UNPKG

@agoric/zoe

Version:

Zoe: the Smart Contract Framework for Offer Enforcement

97 lines 4.27 kB
/** * Create a purse for a new issuer */ type CreatePurse = (issuer: Issuer, brand: Brand) => ERef<void>; /** * Create a purse for a new, local issuer. Used only for ZCFMint issuers. * * Note: in the case of the feeMint, it may have been registered * before with `feeMintAccess`. In that case, we do not create a new * purse, but reuse the existing purse. */ type ProvideLocalPurse = (issuer: Issuer, brand: Brand) => Purse; /** * Deposits payments or promises for payments according to the * `give` property of the proposal. Using the proposal, creates an * initial allocation including the amount deposited for `give` * keywords and an empty amount for `want` keywords. */ type DepositPayments = (proposal: ProposalRecord, payments: PaymentPKeywordRecord) => Promise<Allocation>; type InitInstanceAdmin = (instance: Instance, InstanceAdmin: InstanceAdmin) => void; type GetInstanceAdmin = (instance: Instance) => InstanceAdmin; type DeleteInstanceAdmin = (instance: Instance) => void; /** * Assert the installation is known, and return the bundle/bundlecap and * installation */ type UnwrapInstallation = (installationP: ERef<Installation>) => ERef<{ bundle?: SourceBundle; bundleCap?: BundleCap; bundleID?: BundleID; installation: Installation; }>; type GetIssuerRecords = () => IssuerRecords; type ZoeInstanceStorageManager = { getTerms: () => AnyTerms; getIssuers: () => IssuerKeywordRecord; getBrands: () => BrandKeywordRecord; saveIssuer: ZCF["saveIssuer"]; makeZoeMint: MakeZoeMint; registerFeeMint: RegisterFeeMint; getInstanceRecord: () => InstanceRecord; getIssuerRecords: GetIssuerRecords; initInstanceAdmin: InitInstanceAdmin; deleteInstanceAdmin: DeleteInstanceAdmin; makeInvitation: ZoeInstanceAdminMakeInvitation; getInvitationIssuer: () => Issuer; /** * of CreateVatResults */ getRoot: () => object; /** * of CreateVatResults */ getAdminNode: () => import("@agoric/swingset-vat").VatAdminFacet; }; /** * Create a storage manager for a particular contract instance. The * ZoeInstanceStorageManager encapsulates access to the * issuerStorage and escrowStorage from Zoe, and stores the * instance-specific terms */ type MakeZoeInstanceStorageManager = (installation: Installation, customTerms: object, uncleanIssuerKeywordRecord: IssuerKeywordRecord, instance: Instance, contractBundleCap: BundleCap, instanceLabel: string) => Promise<ZoeInstanceStorageManager>; type GetBundleCapForID = (id: BundleID) => Promise<BundleCap>; type ZoeStorageManager = { makeZoeInstanceStorageManager: MakeZoeInstanceStorageManager; getAssetKindByBrand: GetAssetKindByBrand; depositPayments: DepositPayments; invitationIssuer: Issuer<"set">; installBundle: InstallBundle; installBundleID: InstallBundleID; getBundleIDFromInstallation: GetBundleIDFromInstallation; getPublicFacet: import("./utils.js").GetPublicFacet; getBrands: GetBrands; getIssuers: GetIssuers; getTerms: import("./utils.js").GetTerms; getOfferFilter: (instance: import("./utils.js").Instance<any>) => string[]; setOfferFilter: (instance: Instance, strings: string[]) => any; getInstallationForInstance: (instance: import("./utils.js").Instance<any>) => Promise<Installation>; getInstanceAdmin: GetInstanceAdmin; unwrapInstallation: UnwrapInstallation; getProposalShapeForInvitation: (invitationHandle: InvitationHandle) => import("@endo/patterns").Pattern | undefined; }; /** * Use VatAdminSvc to create a new vat, but only with the code of the * ZCF bundle */ type CreateZCFVat = (contractBundleCap: BundleCap, contractLabel: string) => Promise<import("@agoric/swingset-vat").CreateVatResults>; type GetFeeIssuerKit = (feeMintAccess: FeeMintAccess) => IssuerKit<"nat">; import type { FeeMintAccess } from './types.js'; import type { GetBrands } from './types.js'; import type { GetBundleIDFromInstallation } from './types.js'; import type { GetIssuers } from './types.js'; import type { InstallBundle } from './types.js'; import type { InstallBundleID } from './types.js'; import type { SourceBundle } from './types.js'; import type { InstanceRecord } from './utils.js'; //# sourceMappingURL=internal-types.d.ts.map