Skip to content

API documentation of Agoric SDK / Exports / @agoric/zoe / src/contractFacet/types-ambient

Module: src/contractFacet/types-ambient

Table of contents

Type Aliases

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

NameType
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

NameType
PFextends unknown = any
CFextends unknown = any
CTextends unknown = any
PAextends unknown = any

Type declaration

▸ (zcf, privateArgs, baggage): ContractStartFnResult<PF, CF>

Parameters
NameType
zcfZCF<CT>
privateArgsPA
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

NameType
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

NameType
ORextends unknown
OAOA

Type declaration

▸ (seat, offerArgs?): OR

Parameters
NameType
seatZCFSeat
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

NameType
Runknown
Aundefined

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

NameType
ORextends unknown = unknown
OAnever

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
NameType
seat1ZCFSeat
seat2ZCFSeat
...seatRestZCFSeat[]
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
NameType
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

NameType
CTextends unknown = Record<string, unknown>

Type declaration

NameTypeDescription
assertUniqueKeyword(keyword: Keyword) => void-
atomicRearrange(transfers: TransferPart[]) => void-
getAssetKindGetAssetKindByBrand-
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>-
makeEmptySeatKitZCFMakeEmptySeatKit-
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>>-
reallocateReallocate- reallocate amounts among seats. Deprecated Use atomicRearrange instead.
registerFeeMintZCFRegisterFeeMint-
saveIssuer(issuerP: ERef<Issuer>, keyword: Keyword) => Promise<IssuerRecord<any>>-
setOfferFilter(strings: string[]) => Promise<void>-
setTestJigSetTestJig-
shutdown(completion: Completion) => void-
shutdownWithFailureShutdownWithFailure-
stopAcceptingOffers() => Promise<void>-

Defined in

zoe/src/contractFacet/types-ambient.d.ts:18


ZCFMakeEmptySeatKit

Ƭ ZCFMakeEmptySeatKit: (exit?: ExitRule) => ZcfSeatKit

Type declaration

▸ (exit?): ZcfSeatKit

Parameters
NameType
exit?ExitRule
Returns

ZcfSeatKit

Defined in

zoe/src/contractFacet/types-ambient.d.ts:7


ZCFMint

Ƭ ZCFMint<K>: Object

Type parameters

NameType
Kextends AssetKind = AssetKind

Type declaration

NameTypeDescription
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
NameType
keywordKeyword
allegedFeeMintAccessFeeMintAccess
Returns

Promise<ZCFMint<"nat">>

Defined in

zoe/src/contractFacet/types-ambient.d.ts:117


ZCFSeat

Ƭ ZCFSeat: Object

Type declaration

NameTypeDescription
clear() => void-
decrementBy(amountKeywordRecord: AmountKeywordRecord) => AmountKeywordRecord-
exit(completion?: Completion) => void-
failZCFSeatFail-
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
NameType
reasonunknown
Returns

Error

Defined in

zoe/src/contractFacet/types-ambient.d.ts:164


ZcfSeatKit

Ƭ ZcfSeatKit: Object

Type declaration

NameType
userSeatERef<UserSeat>
zcfSeatZCFSeat

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

Defined in

zoe/src/contractFacet/types-ambient.d.ts:247