interface UserSeat<OR> {
    getExitSubscriber: (() => Subscriber<Completion>);
    getFinalAllocation: (() => Promise<Allocation>);
    getOfferResult: (() => Promise<OR>);
    getPayout: ((keyword) => 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.

Type declaration

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

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

Type declaration

    • (): Promise<Allocation>
    • Returns Promise<Allocation>

getOfferResult: (() => Promise<OR>)

Type declaration

    • (): Promise<OR>
    • Returns Promise<OR>

getPayout: ((keyword) => Promise<Payment<any>>)

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

Type declaration

    • (keyword): Promise<Payment<any>>
    • Parameters

      • keyword: string

      Returns Promise<Payment<any>>

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.

Type declaration

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

Type declaration

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

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

Type declaration

    • (): Promise<boolean>
    • Returns Promise<boolean>

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.

Type declaration

    • (): Promise<0 | 1>
    • Returns Promise<0 | 1>

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.

Type declaration

    • (): void
    • Returns void