API documentation of Agoric SDK / Exports / @agoric/zoe / src/contractFacet/types-ambient
Module: src/contractFacet/types-ambient
Table of contents
Type Aliases
- AdminFacet
- Completion
- ContractMeta
- ContractOf
- ContractStartFn
- ContractStartFnResult
- CopyRecord
- HandleOffer
- Invitation
- IssuerOptionsRecord
- OfferHandler
- Reallocate
- SetTestJig
- TransferPart
- ZCF
- ZCFMakeEmptySeatKit
- ZCFMint
- ZCFRegisterFeeMint
- ZCFSeat
- ZCFSeatFail
- ZcfSeatKit
Variables
Type Aliases
AdminFacet
Ƭ AdminFacet: src/zoeService/utils
Defined in
zoe/src/contractFacet/types-ambient.d.ts:245
Completion
Ƭ Completion: any
Any passable non-thenable. Often an explanatory string.
Defined in
zoe/src/contractFacet/types-ambient.d.ts:6
ContractMeta
Ƭ ContractMeta: Object
Type declaration
Name | Type |
---|---|
customTermsShape? | CopyRecord <any > |
privateArgsShape? | CopyRecord <any > |
upgradability? | "none" | "canBeUpgraded" | "canUpgrade" |
Defined in
zoe/src/contractFacet/types-ambient.d.ts:219
ContractOf
Ƭ ContractOf<S
>: src/zoeService/utils
Type parameters
Name |
---|
S |
Defined in
zoe/src/contractFacet/types-ambient.d.ts:244
ContractStartFn
Ƭ ContractStartFn<PF
, CF
, CT
, PA
>: (zcf
: ZCF
<CT
>, privateArgs
: PA
, baggage
: @agoric/vat-data
) => ContractStartFnResult
<PF
, CF
>
API for a contract start function.
CAVEAT: assumes synchronous
Type parameters
Name | Type |
---|---|
PF | extends unknown = any |
CF | extends unknown = any |
CT | extends unknown = any |
PA | extends unknown = any |
Type declaration
▸ (zcf
, privateArgs
, baggage
): ContractStartFnResult
<PF
, CF
>
Parameters
Name | Type |
---|---|
zcf | ZCF <CT > |
privateArgs | PA |
baggage | @agoric/vat-data |
Returns
ContractStartFnResult
<PF
, CF
>
Defined in
zoe/src/contractFacet/types-ambient.d.ts:229
ContractStartFnResult
Ƭ ContractStartFnResult<PF
, CF
>: Object
Type parameters
Name |
---|
PF |
CF |
Type declaration
Name | Type |
---|---|
creatorFacet? | CF |
creatorInvitation? | Promise <Invitation <R , A >> |
publicFacet? | PF |
Defined in
zoe/src/contractFacet/types-ambient.d.ts:239
CopyRecord
Ƭ CopyRecord<T
>: CopyRecord
Type parameters
Name |
---|
T |
Defined in
zoe/src/contractFacet/types-ambient.d.ts:1
HandleOffer
Ƭ HandleOffer<OR
, OA
>: (seat
: ZCFSeat
, offerArgs?
: OA
) => OR
Type parameters
Name | Type |
---|---|
OR | extends unknown |
OA | OA |
Type declaration
▸ (seat
, offerArgs?
): OR
Parameters
Name | Type |
---|---|
seat | ZCFSeat |
offerArgs? | OA |
Returns
OR
Defined in
zoe/src/contractFacet/types-ambient.d.ts:210
Invitation
Ƭ Invitation<R
, A
>: Payment
<"set"
> & { [OfferArgs]?
: A
; [OfferReturn]?
: R
}
Type parameters
Name | Type |
---|---|
R | unknown |
A | undefined |
Defined in
zoe/src/contractFacet/types-ambient.d.ts:249
IssuerOptionsRecord
Ƭ IssuerOptionsRecord: @agoric/ertp
Defined in
zoe/src/contractFacet/types-ambient.d.ts:2
OfferHandler
Ƭ OfferHandler<OR
, OA
>: HandleOffer
<OR
, OA
> | { handle
: HandleOffer
<OR
, OA
> }
Type parameters
Name | Type |
---|---|
OR | extends unknown = unknown |
OA | never |
Defined in
zoe/src/contractFacet/types-ambient.d.ts:214
Reallocate
Ƭ Reallocate: (seat1
: ZCFSeat
, seat2
: ZCFSeat
, ...seatRest
: ZCFSeat
[]) => void
The contract can reallocate over seats, which commits the staged allocation for each seat. On commit, the staged allocation becomes the current allocation and the staged allocation is deleted.
The reallocation will only succeed if the reallocation 1) conserves rights (the amounts specified have the same total value as the current total amount), and 2) is 'offer-safe' for all parties involved. All seats that have staged allocations must be included as arguments to reallocate
, or an error is thrown. Additionally, an error is thrown if any seats included in reallocate
do not have a staged allocation.
The reallocation is partial, meaning that it applies only to the seats passed in as arguments. By induction, if rights conservation and offer safety hold before, they will hold after a safe reallocation, even though we only re-validate for the seats whose allocations will change. Since rights are conserved for the change, overall rights will be unchanged, and a reallocation can only effect offer safety for seats whose allocations change.
Type declaration
▸ (seat1
, seat2
, ...seatRest
): void
Parameters
Name | Type |
---|---|
seat1 | ZCFSeat |
seat2 | ZCFSeat |
...seatRest | ZCFSeat [] |
Returns
void
Defined in
zoe/src/contractFacet/types-ambient.d.ts:105
SetTestJig
Ƭ SetTestJig: (testFn
: () => Record
<string
, unknown
>) => void
Provide a jig object for testing purposes only.
The contract code provides a callback whose return result will be made available to the test that started this contract. The supplied callback will only be called in a testing context, never in production; i.e., it is only called if testJigSetter
was supplied.
If no, testFn
is supplied, then an empty jig will be used. An additional zcf
property set to the current ContractFacet will be appended to the returned jig object (overriding any provided by the testFn
).
Type declaration
▸ (testFn
): void
Parameters
Name | Type |
---|---|
testFn | () => Record <string , unknown > |
Returns
void
Defined in
zoe/src/contractFacet/types-ambient.d.ts:135
TransferPart
Ƭ TransferPart: [fromSeat?: ZCFSeat, toSeat?: ZCFSeat, fromAmounts?: AmountKeywordRecord, toAmounts?: AmountKeywordRecord]
Defined in
zoe/src/contractFacet/types-ambient.d.ts:110
ZCF
Ƭ ZCF<CT
>: Object
Zoe Contract Facet
The Zoe interface specific to a contract instance. The Zoe Contract Facet is an API object used by running contract instances to access the Zoe state for that instance. The Zoe Contract Facet is accessed synchronously from within the contract, and usually is referred to in code as zcf.
Type parameters
Name | Type |
---|---|
CT | extends unknown = Record <string , unknown > |
Type declaration
Name | Type | Description |
---|---|---|
assertUniqueKeyword | (keyword : Keyword ) => void | - |
atomicRearrange | (transfers : TransferPart []) => void | - |
getAssetKind | GetAssetKindByBrand | - |
getBrandForIssuer | <K>(issuer : Issuer <K >) => Brand <K > | - |
getInstance | () => Instance | - |
getInvitationIssuer | () => Issuer <"set" > | - |
getIssuerForBrand | <K_1>(brand : Brand <K_1 >) => Issuer <K_1 > | - |
getOfferFilter | () => Promise <string []> | - |
getTerms | () => StandardTerms & CT | - |
getZoeService | () => ERef <ZoeService > | - |
makeEmptySeatKit | ZCFMakeEmptySeatKit | - |
makeInvitation | <R, A>(offerHandler : OfferHandler <ERef <R >, A >, description : string , customDetails? : object , proposalShape? : Pattern ) => Promise <Invitation <R , A >> | - |
makeZCFMint | <K_2>(keyword : Keyword , assetKind? : K_2 , displayInfo? : AdditionalDisplayInfo , options? : IssuerOptionsRecord ) => Promise <ZCFMint <K_2 >> | - |
reallocate | Reallocate | - reallocate amounts among seats. Deprecated Use atomicRearrange instead. |
registerFeeMint | ZCFRegisterFeeMint | - |
saveIssuer | (issuerP : ERef <Issuer >, keyword : Keyword ) => Promise <IssuerRecord <any >> | - |
setOfferFilter | (strings : string []) => Promise <void > | - |
setTestJig | SetTestJig | - |
shutdown | (completion : Completion ) => void | - |
shutdownWithFailure | ShutdownWithFailure | - |
stopAcceptingOffers | () => Promise <void > | - |
Defined in
zoe/src/contractFacet/types-ambient.d.ts:18
ZCFMakeEmptySeatKit
Ƭ ZCFMakeEmptySeatKit: (exit?
: ExitRule
) => ZcfSeatKit
Type declaration
▸ (exit?
): ZcfSeatKit
Parameters
Name | Type |
---|---|
exit? | ExitRule |
Returns
Defined in
zoe/src/contractFacet/types-ambient.d.ts:7
ZCFMint
Ƭ ZCFMint<K
>: Object
Type parameters
Name | Type |
---|---|
K | extends AssetKind = AssetKind |
Type declaration
Name | Type | Description |
---|---|---|
burnLosses | (losses : AmountKeywordRecord , zcfSeat : ZCFSeat ) => void | - |
getIssuerRecord | () => IssuerRecord <K > | - |
mintGains | (gains : AmountKeywordRecord , zcfSeat? : ZCFSeat ) => ZCFSeat | - |
Defined in
zoe/src/contractFacet/types-ambient.d.ts:136
ZCFRegisterFeeMint
Ƭ ZCFRegisterFeeMint: (keyword
: Keyword
, allegedFeeMintAccess
: FeeMintAccess
) => Promise
<ZCFMint
<"nat"
>>
Type declaration
▸ (keyword
, allegedFeeMintAccess
): Promise
<ZCFMint
<"nat"
>>
Parameters
Name | Type |
---|---|
keyword | Keyword |
allegedFeeMintAccess | FeeMintAccess |
Returns
Promise
<ZCFMint
<"nat"
>>
Defined in
zoe/src/contractFacet/types-ambient.d.ts:117
ZCFSeat
Ƭ ZCFSeat: Object
Type declaration
Name | Type | Description |
---|---|---|
clear | () => void | - |
decrementBy | (amountKeywordRecord : AmountKeywordRecord ) => AmountKeywordRecord | - |
exit | (completion? : Completion ) => void | - |
fail | ZCFSeatFail | - |
getAmountAllocated | <B>(keyword : Keyword , brand? : B ) => B extends Brand <infer K> ? Amount <K > : Amount | - |
getCurrentAllocation | () => Allocation | - |
getProposal | () => ProposalRecord | - |
getStagedAllocation | () => Allocation | - |
getSubscriber | () => Promise <Subscriber <Allocation >> | - |
hasExited | () => boolean | - |
hasStagedAllocation | () => boolean | - |
incrementBy | (amountKeywordRecord : AmountKeywordRecord ) => AmountKeywordRecord | - |
isOfferSafe | (newAllocation : Allocation ) => boolean | - |
Defined in
zoe/src/contractFacet/types-ambient.d.ts:165
ZCFSeatFail
Ƭ ZCFSeatFail: (reason
: unknown
) => Error
fail called with the reason for this failure, where reason is normally an instanceof Error.
Type declaration
▸ (reason
): Error
Parameters
Name | Type |
---|---|
reason | unknown |
Returns
Error
Defined in
zoe/src/contractFacet/types-ambient.d.ts:164
ZcfSeatKit
Ƭ ZcfSeatKit: Object
Type declaration
Name | Type |
---|---|
userSeat | ERef <UserSeat > |
zcfSeat | ZCFSeat |
Defined in
zoe/src/contractFacet/types-ambient.d.ts:206
Variables
OfferArgs
• Const
OfferArgs: unique symbol
Defined in
zoe/src/contractFacet/types-ambient.d.ts:248
OfferReturn
• Const
OfferReturn: unique symbol