API documentation of Agoric SDK / Exports / @agoric/zoe / src/zoeService/utils
Module: src/zoeService/utils
Table of contents
References
Type Aliases
- AdminFacet
- ContractFacet
- ContractOf
- ContractStartFunction
- GetPublicFacet
- GetTerms
- Instance
- SourceBundle
- StartContractInstance
- StartInstance
- StartParams
- StartResult
- StartedInstanceKit
Variables
References
Installation
Re-exports Installation
InstallationStart
Re-exports InstallationStart
Type Aliases
AdminFacet
Ƭ AdminFacet<SF
>: Object
Type parameters
Name | Type |
---|---|
SF | extends ContractStartFunction |
Type declaration
Name | Type |
---|---|
getVatShutdownPromise | () => Promise <any > |
restartContract | Parameters <SF >[1 ] extends undefined ? () => Promise <VatUpgradeResults > : (newPrivateArgs : Parameters <SF >[1 ]) => Promise <VatUpgradeResults > |
upgradeContract | Parameters <SF >[1 ] extends undefined ? (contractBundleId : string ) => Promise <VatUpgradeResults > : (contractBundleId : string , newPrivateArgs : Parameters <SF >[1 ]) => Promise <VatUpgradeResults > |
Defined in
zoe/src/zoeService/utils.d.ts:39
ContractFacet
Ƭ ContractFacet<T
>: { readonly [P in keyof T]: T[P] extends Callable ? T[P] : never }
Type parameters
Name | Type |
---|---|
T | extends Object = {} |
Defined in
zoe/src/zoeService/utils.d.ts:10
ContractOf
Ƭ ContractOf<S
>: StartParams
<S
> & StartResult
<S
>
Convenience record for contract start function, merging its result with params.
Type parameters
Name |
---|
S |
Defined in
zoe/src/zoeService/utils.d.ts:71
ContractStartFunction
Ƭ ContractStartFunction: (zcf?
: ZCF
, privateArgs?
: {}, baggage?
: Baggage
) => ERef
<{ creatorFacet?
: {} ; publicFacet?
: {} }>
Type declaration
▸ (zcf?
, privateArgs?
, baggage?
): ERef
<{ creatorFacet?
: {} ; publicFacet?
: {} }>
Parameters
Name | Type |
---|---|
zcf? | ZCF |
privateArgs? | Object |
baggage? | Baggage |
Returns
ERef
<{ creatorFacet?
: {} ; publicFacet?
: {} }>
Defined in
zoe/src/zoeService/utils.d.ts:33
GetPublicFacet
Ƭ GetPublicFacet: <SF>(instance
: Instance
<SF
> | PromiseLike
<Instance
<SF
>>) => Promise
<StartResult
<SF
>["publicFacet"
]>
Type declaration
▸ <SF
>(instance
): Promise
<StartResult
<SF
>["publicFacet"
]>
Type parameters
Name |
---|
SF |
Parameters
Name | Type |
---|---|
instance | Instance <SF > | PromiseLike <Instance <SF >> |
Returns
Promise
<StartResult
<SF
>["publicFacet"
]>
Defined in
zoe/src/zoeService/utils.d.ts:124
GetTerms
Ƭ GetTerms: <SF>(instance
: Instance
<SF
>) => Promise
<StartParams
<SF
>["terms"
] extends {} ? StartParams
<SF
>["terms"
] : any
>
Type declaration
▸ <SF
>(instance
): Promise
<StartParams
<SF
>["terms"
] extends {} ? StartParams
<SF
>["terms"
] : any
>
Type parameters
Name |
---|
SF |
Parameters
Name | Type |
---|---|
instance | Instance <SF > |
Returns
Promise
<StartParams
<SF
>["terms"
] extends {} ? StartParams
<SF
>["terms"
] : any
>
Defined in
zoe/src/zoeService/utils.d.ts:128
Instance
Ƭ Instance<SF
>: Handle
<"Instance"
> & { [StartFunction]
: SF
}
Type parameters
Name |
---|
SF |
Defined in
zoe/src/zoeService/utils.d.ts:24
SourceBundle
Ƭ SourceBundle: Record
<string
, any
>
Defined in
zoe/src/zoeService/utils.d.ts:8
StartContractInstance
Ƭ StartContractInstance<C
>: (installation
: Installation
<C
>, issuerKeywordRecord?
: MapStore
, terms?
: object
, privateArgs?
: object
) => Promise
<{ adminFacet
: AdminFacet
<any
> ; creatorFacet
: C
["creatorFacet"
] ; creatorInvitation
: C
["creatorInvitation"
] ; instance
: Instance
; publicFacet
: C
["publicFacet"
] }>
Type parameters
Name |
---|
C |
Type declaration
▸ (installation
, issuerKeywordRecord?
, terms?
, privateArgs?
): Promise
<{ adminFacet
: AdminFacet
<any
> ; creatorFacet
: C
["creatorFacet"
] ; creatorInvitation
: C
["creatorInvitation"
] ; instance
: Instance
; publicFacet
: C
["publicFacet"
] }>
Parameters
Name | Type |
---|---|
installation | Installation <C > |
issuerKeywordRecord? | MapStore |
terms? | object |
privateArgs? | object |
Returns
Promise
<{ adminFacet
: AdminFacet
<any
> ; creatorFacet
: C
["creatorFacet"
] ; creatorInvitation
: C
["creatorInvitation"
] ; instance
: Instance
; publicFacet
: C
["publicFacet"
] }>
Defined in
zoe/src/zoeService/utils.d.ts:73
StartInstance
Ƭ StartInstance: <SF>(installation
: Installation
<SF
> | PromiseLike
<Installation
<SF
>>, issuerKeywordRecord?
: MapStore
, terms?
: Omit
<StartParams
<SF
>["terms"
], "brands"
| "issuers"
>, privateArgs?
: Parameters
<SF
>[1
], label?
: string
) => Promise
<StartedInstanceKit
<SF
>>
Zoe is long-lived. We can use Zoe to create smart contract instances by specifying a particular contract installation to use, as well as the terms
of the contract. The terms.issuers
is a record mapping string names (keywords) to issuers, such as { Asset: simoleanIssuer}
. (Note that the keywords must begin with a capital letter and must be ASCII identifiers.) Parties to the contract will use the keywords to index their proposal and their payments.
The custom terms are the arguments to the contract, such as the number of bids an auction will wait for before closing. Custom terms are up to the discretion of the smart contract. We get back the creator facet, public facet, and creator invitation as defined by the contract.
Type declaration
▸ <SF
>(installation
, issuerKeywordRecord?
, terms?
, privateArgs?
, label?
): Promise
<StartedInstanceKit
<SF
>>
Type parameters
Name |
---|
SF |
Parameters
Name | Type |
---|---|
installation | Installation <SF > | PromiseLike <Installation <SF >> |
issuerKeywordRecord? | MapStore |
terms? | Omit <StartParams <SF >["terms" ], "brands" | "issuers" > |
privateArgs? | Parameters <SF >[1 ] |
label? | string |
Returns
Promise
<StartedInstanceKit
<SF
>>
Defined in
zoe/src/zoeService/utils.d.ts:115
StartParams
Ƭ StartParams<SF
>: SF
extends ContractStartFunction
? Parameters
<SF
>[1
] extends undefined
? { terms
: ReturnType
<Parameters
<SF
>[0
]["getTerms"
]> } : { privateArgs
: Parameters
<SF
>[1
] ; terms
: ReturnType
<Parameters
<SF
>[0
]["getTerms"
]> } : never
Type parameters
Name |
---|
SF |
Defined in
zoe/src/zoeService/utils.d.ts:53
StartResult
Ƭ StartResult<S
>: S
extends (...args
: any
) => Promise
<infer U> ? U
: ReturnType
<S
>
Type parameters
Name |
---|
S |
Defined in
zoe/src/zoeService/utils.d.ts:64
StartedInstanceKit
Ƭ StartedInstanceKit<SF
>: { adminFacet
: AdminFacet
<SF
> ; creatorFacet
: {} ; instance
: Instance
<SF
> ; publicFacet
: {} } & SF
extends ContractStartFunction
? Awaited
<ReturnType
<SF
>> : { creatorFacet
: any
; publicFacet
: any
}
The result of startInstance
Type parameters
Name |
---|
SF |
Defined in
zoe/src/zoeService/utils.d.ts:87
Variables
StartFunction
• Const
StartFunction: unique symbol
Installation of a contract, typed by its start function.