interface UserSeat<OR> {
    getExitSubscriber: (() => Subscriber<Completion>);
    getFinalAllocation: (() => Promise<Allocation>);
    getOfferResult: (() => Promise<OR>);
    getPayout: ((keyword: string) => Promise<Payment<any>>);
    getPayouts: (() => Promise<PaymentPKeywordRecord>);
    getProposal: (() => Promise<ProposalRecord>);
    hasExited: (() => Promise<boolean>);
    numWantsSatisfied: (() => Promise<0 | 1>);
    tryExit: undefined | (() => void);
}

Type Parameters

  • OR extends object = unknown

Properties

getExitSubscriber: (() => Subscriber<Completion>)

returns a subscriber that will be notified when the seat has exited or failed.

getFinalAllocation: (() => Promise<Allocation>)

return a promise for the final allocation. The promise will resolve after the seat has exited.

getOfferResult: (() => Promise<OR>)
getPayout: ((keyword: string) => Promise<Payment<any>>)

returns a promise for the Payment corresponding to the indicated keyword. The promise will resolve after the seat has exited.

getPayouts: (() => Promise<PaymentPKeywordRecord>)

returns a promise for a KeywordPaymentRecord containing all the payouts from this seat. The promise will resolve after the seat has exited.

getProposal: (() => Promise<ProposalRecord>)
hasExited: (() => Promise<boolean>)

Returns true if the seat has exited, false if it is still active.

numWantsSatisfied: (() => Promise<0 | 1>)

returns 1 if the proposal's want clause was satisfied by the final allocation, otherwise 0. This is numeric to support a planned enhancement called "multiples" which will allow the return value to be any non-negative number. The promise will resolve after the seat has exited.

tryExit: undefined | (() => void)

Note: Only works if the seat's proposal has an OnDemand exit clause. Zoe's offer-safety guarantee applies no matter how a seat's interaction with a contract ends. Under normal circumstances, the participant might be able to call tryExit(), or the contract might do something explicitly. On exiting, the seat holder gets its current allocation and the seat can no longer interact with the contract.