@agoric/zoe 0.26.3-upgrade-14-dev-c8f9e7b.0 → 0.26.3-upgrade-16-fi-dev-8879538.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +7 -7
- package/bundles/bundle-contractFacet-js-meta.json +622 -313
- package/bundles/bundle-contractFacet.d.ts +3 -3
- package/bundles/bundle-contractFacet.js +1 -1
- package/exported.js +1 -12
- package/package.json +75 -60
- package/src/cleanProposal.d.ts +2 -2
- package/src/cleanProposal.d.ts.map +1 -1
- package/src/cleanProposal.js +15 -12
- package/src/contractFacet/exit.d.ts.map +1 -1
- package/src/contractFacet/exit.js +1 -0
- package/src/contractFacet/internal-types.d.ts +2 -2
- package/src/contractFacet/internal-types.d.ts.map +1 -1
- package/src/contractFacet/internal-types.js +1 -1
- package/src/contractFacet/offerHandlerStorage.d.ts +4 -1
- package/src/contractFacet/offerHandlerStorage.d.ts.map +1 -1
- package/src/contractFacet/offerHandlerStorage.js +11 -3
- package/src/contractFacet/reallocate.d.ts +3 -0
- package/src/contractFacet/reallocate.d.ts.map +1 -0
- package/src/contractFacet/reallocate.js +94 -0
- package/src/contractFacet/rightsConservation.d.ts.map +1 -1
- package/src/contractFacet/rightsConservation.js +3 -0
- package/src/contractFacet/types-ambient.d.ts +259 -0
- package/src/contractFacet/types-ambient.js +1 -0
- package/src/contractFacet/vatRoot.d.ts +4 -4
- package/src/contractFacet/vatRoot.d.ts.map +1 -1
- package/src/contractFacet/zcfMint.d.ts +5 -3
- package/src/contractFacet/zcfMint.d.ts.map +1 -1
- package/src/contractFacet/zcfMint.js +4 -4
- package/src/contractFacet/zcfSeat.d.ts +4 -2
- package/src/contractFacet/zcfSeat.d.ts.map +1 -1
- package/src/contractFacet/zcfSeat.js +125 -5
- package/src/contractFacet/zcfZygote.d.ts +1 -2
- package/src/contractFacet/zcfZygote.d.ts.map +1 -1
- package/src/contractFacet/zcfZygote.js +95 -42
- package/src/contractSupport/atomicTransfer.d.ts +0 -6
- package/src/contractSupport/atomicTransfer.d.ts.map +1 -1
- package/src/contractSupport/atomicTransfer.js +5 -90
- package/src/contractSupport/bondingCurves.js +2 -2
- package/src/contractSupport/durability.d.ts +3 -3
- package/src/contractSupport/durability.d.ts.map +1 -1
- package/src/contractSupport/durability.js +5 -5
- package/src/contractSupport/index.d.ts +1 -0
- package/src/contractSupport/index.js +1 -0
- package/src/contractSupport/prepare-ownable.d.ts +11 -0
- package/src/contractSupport/prepare-ownable.d.ts.map +1 -0
- package/src/contractSupport/prepare-ownable.js +100 -0
- package/src/contractSupport/priceAuthority.d.ts +23 -15
- package/src/contractSupport/priceAuthority.d.ts.map +1 -1
- package/src/contractSupport/priceAuthority.js +32 -17
- package/src/contractSupport/priceAuthorityInitial.d.ts +3 -2
- package/src/contractSupport/priceAuthorityInitial.d.ts.map +1 -1
- package/src/contractSupport/priceAuthorityInitial.js +5 -2
- package/src/contractSupport/priceAuthorityQuoteMint.d.ts +2 -1
- package/src/contractSupport/priceAuthorityQuoteMint.d.ts.map +1 -1
- package/src/contractSupport/priceAuthorityQuoteMint.js +23 -27
- package/src/contractSupport/priceAuthorityTransform.d.ts +14 -12
- package/src/contractSupport/priceAuthorityTransform.d.ts.map +1 -1
- package/src/contractSupport/priceAuthorityTransform.js +10 -8
- package/src/contractSupport/priceQuote.d.ts +7 -5
- package/src/contractSupport/priceQuote.d.ts.map +1 -1
- package/src/contractSupport/priceQuote.js +5 -1
- package/src/contractSupport/ratio.d.ts +2 -2
- package/src/contractSupport/ratio.d.ts.map +1 -1
- package/src/contractSupport/ratio.js +19 -15
- package/src/contractSupport/recorder.d.ts +31 -117
- package/src/contractSupport/recorder.d.ts.map +1 -1
- package/src/contractSupport/recorder.js +21 -10
- package/src/contractSupport/safeMath.d.ts +7 -7
- package/src/contractSupport/safeMath.d.ts.map +1 -1
- package/src/contractSupport/statistics.d.ts +1 -1
- package/src/contractSupport/statistics.d.ts.map +1 -1
- package/src/contractSupport/topics.d.ts +1 -1
- package/src/contractSupport/topics.d.ts.map +1 -1
- package/src/contractSupport/{types.d.ts → types-ambient.d.ts} +4 -4
- package/src/contractSupport/types-ambient.d.ts.map +1 -0
- package/src/contractSupport/{types.js → types-ambient.js} +1 -1
- package/src/contractSupport/zoeHelpers.d.ts +1 -1
- package/src/contractSupport/zoeHelpers.d.ts.map +1 -1
- package/src/contractSupport/zoeHelpers.js +5 -11
- package/src/contracts/auction/firstPriceLogic.d.ts.map +1 -1
- package/src/contracts/auction/firstPriceLogic.js +5 -8
- package/src/contracts/auction/index.d.ts +10 -10
- package/src/contracts/auction/index.d.ts.map +1 -1
- package/src/contracts/auction/index.js +2 -1
- package/src/contracts/auction/secondPriceLogic.d.ts.map +1 -1
- package/src/contracts/auction/secondPriceLogic.js +1 -4
- package/src/contracts/automaticRefund.d.ts +1 -1
- package/src/contracts/automaticRefund.d.ts.map +1 -1
- package/src/contracts/autoswap.d.ts.map +1 -1
- package/src/contracts/autoswap.js +8 -9
- package/src/contracts/barterExchange.d.ts +1 -1
- package/src/contracts/barterExchange.d.ts.map +1 -1
- package/src/contracts/barterExchange.js +2 -3
- package/src/contracts/callSpread/calculateShares.d.ts +1 -8
- package/src/contracts/callSpread/calculateShares.d.ts.map +1 -1
- package/src/contracts/callSpread/calculateShares.js +1 -1
- package/src/contracts/callSpread/fundedCallSpread.d.ts +4 -0
- package/src/contracts/callSpread/fundedCallSpread.d.ts.map +1 -1
- package/src/contracts/callSpread/fundedCallSpread.js +6 -4
- package/src/contracts/callSpread/payoffHandler.d.ts.map +1 -1
- package/src/contracts/callSpread/payoffHandler.js +2 -1
- package/src/contracts/callSpread/percent.d.ts +2 -4
- package/src/contracts/callSpread/percent.d.ts.map +1 -1
- package/src/contracts/callSpread/position.d.ts +2 -2
- package/src/contracts/callSpread/pricedCallSpread.d.ts +6 -5
- package/src/contracts/callSpread/pricedCallSpread.d.ts.map +1 -1
- package/src/contracts/callSpread/pricedCallSpread.js +8 -4
- package/src/contracts/callSpread/{types.d.ts → types-ambient.d.ts} +3 -3
- package/src/contracts/callSpread/types-ambient.d.ts.map +1 -0
- package/src/contracts/coveredCall-durable.d.ts +2 -4
- package/src/contracts/coveredCall-durable.d.ts.map +1 -1
- package/src/contracts/exported.js +3 -3
- package/src/contracts/loan/borrow.d.ts.map +1 -1
- package/src/contracts/loan/borrow.js +7 -4
- package/src/contracts/loan/close.d.ts.map +1 -1
- package/src/contracts/loan/close.js +3 -7
- package/src/contracts/loan/index.d.ts +5 -1
- package/src/contracts/loan/index.d.ts.map +1 -1
- package/src/contracts/loan/index.js +4 -0
- package/src/contracts/loan/liquidate.d.ts +1 -12
- package/src/contracts/loan/liquidate.d.ts.map +1 -1
- package/src/contracts/loan/liquidate.js +4 -2
- package/src/contracts/loan/scheduleLiquidation.d.ts.map +1 -1
- package/src/contracts/loan/scheduleLiquidation.js +1 -0
- package/src/contracts/loan/{types.d.ts → types-ambient.d.ts} +16 -17
- package/src/contracts/loan/types-ambient.d.ts.map +1 -0
- package/src/contracts/loan/{types.js → types-ambient.js} +11 -18
- package/src/contracts/loan/updateDebt.js +1 -1
- package/src/contracts/mintAndSellNFT.d.ts.map +1 -1
- package/src/contracts/mintPayments.d.ts +14 -6
- package/src/contracts/mintPayments.d.ts.map +1 -1
- package/src/contracts/mintPayments.js +1 -1
- package/src/contracts/oracle.d.ts +25 -3
- package/src/contracts/oracle.d.ts.map +1 -1
- package/src/contracts/oracle.js +7 -0
- package/src/contracts/otcDesk.d.ts +3 -3
- package/src/contracts/otcDesk.d.ts.map +1 -1
- package/src/contracts/otcDesk.js +1 -1
- package/src/contracts/priceAggregator.d.ts +112 -18
- package/src/contracts/priceAggregator.d.ts.map +1 -1
- package/src/contracts/priceAggregator.js +16 -18
- package/src/contracts/priceAggregatorTypes.d.ts +2 -2
- package/src/contracts/priceAggregatorTypes.d.ts.map +1 -1
- package/src/contracts/scaledPriceAuthority.d.ts +4 -5
- package/src/contracts/scaledPriceAuthority.d.ts.map +1 -1
- package/src/contracts/scaledPriceAuthority.js +6 -0
- package/src/contracts/sellItems.d.ts +2 -2
- package/src/contracts/sellItems.d.ts.map +1 -1
- package/src/contracts/sellItems.js +2 -3
- package/src/contracts/simpleExchange.d.ts +3 -3
- package/src/contracts/{types.d.ts → types-ambient.d.ts} +1 -1
- package/src/contracts/types-ambient.d.ts.map +1 -0
- package/src/handleWarning.d.ts.map +1 -1
- package/src/instanceRecordStorage.d.ts +1 -1
- package/src/instanceRecordStorage.d.ts.map +1 -1
- package/src/internal-types.d.ts +20 -32
- package/src/internal-types.d.ts.map +1 -1
- package/src/internal-types.js +18 -58
- package/src/issuerRecord.d.ts +2 -2
- package/src/issuerRecord.d.ts.map +1 -1
- package/src/issuerStorage.d.ts +4 -4
- package/src/issuerStorage.d.ts.map +1 -1
- package/src/issuerStorage.js +12 -28
- package/src/makeHandle.d.ts +2 -2
- package/src/makeHandle.d.ts.map +1 -1
- package/src/makeHandle.js +1 -1
- package/src/typeGuards.d.ts +119 -20
- package/src/typeGuards.d.ts.map +1 -1
- package/src/typeGuards.js +18 -9
- package/src/types-ambient.d.ts +41 -0
- package/src/types-ambient.d.ts.map +1 -0
- package/src/{types.js → types-ambient.js} +6 -14
- package/src/zoeService/escrowStorage.d.ts +1 -1
- package/src/zoeService/escrowStorage.d.ts.map +1 -1
- package/src/zoeService/escrowStorage.js +20 -27
- package/src/zoeService/feeMint.d.ts +9 -16
- package/src/zoeService/feeMint.d.ts.map +1 -1
- package/src/zoeService/feeMint.js +21 -15
- package/src/zoeService/installationStorage.d.ts +5 -20
- package/src/zoeService/installationStorage.d.ts.map +1 -1
- package/src/zoeService/installationStorage.js +11 -7
- package/src/zoeService/instanceAdminStorage.d.ts +22 -42
- package/src/zoeService/instanceAdminStorage.d.ts.map +1 -1
- package/src/zoeService/instanceAdminStorage.js +1 -0
- package/src/zoeService/internal-types.d.ts +16 -16
- package/src/zoeService/internal-types.d.ts.map +1 -1
- package/src/zoeService/internal-types.js +6 -6
- package/src/zoeService/invitationQueries.d.ts.map +1 -1
- package/src/zoeService/invitationQueries.js +7 -5
- package/src/zoeService/makeInvitation.d.ts +3 -3
- package/src/zoeService/makeInvitation.d.ts.map +1 -1
- package/src/zoeService/makeInvitation.js +25 -21
- package/src/zoeService/offer/burnInvitation.d.ts.map +1 -1
- package/src/zoeService/offer/offer.d.ts.map +1 -1
- package/src/zoeService/offer/offer.js +2 -5
- package/src/zoeService/originalZoeSeat.d.ts +34 -0
- package/src/zoeService/originalZoeSeat.d.ts.map +1 -0
- package/src/zoeService/originalZoeSeat.js +353 -0
- package/src/zoeService/startInstance.d.ts +3 -3
- package/src/zoeService/startInstance.d.ts.map +1 -1
- package/src/zoeService/startInstance.js +17 -11
- package/src/zoeService/{types.d.ts → types-ambient.d.ts} +26 -31
- package/src/zoeService/types-ambient.d.ts.map +1 -0
- package/src/zoeService/{types.js → types-ambient.js} +19 -32
- package/src/zoeService/utils.d.ts +54 -58
- package/src/zoeService/utils.test-d.d.ts +2 -0
- package/src/zoeService/utils.test-d.d.ts.map +1 -0
- package/src/zoeService/utils.test-d.ts +33 -0
- package/src/zoeService/zoe.d.ts +9 -13
- package/src/zoeService/zoe.d.ts.map +1 -1
- package/src/zoeService/zoe.js +7 -7
- package/src/zoeService/zoeSeat.d.ts +15 -45
- package/src/zoeService/zoeSeat.d.ts.map +1 -1
- package/src/zoeService/zoeSeat.js +214 -114
- package/src/zoeService/zoeStorageManager.d.ts +9 -43
- package/src/zoeService/zoeStorageManager.d.ts.map +1 -1
- package/src/zoeService/zoeStorageManager.js +8 -6
- package/tools/fakePriceAuthority.d.ts +9 -8
- package/tools/fakePriceAuthority.d.ts.map +1 -1
- package/tools/fakePriceAuthority.js +21 -17
- package/tools/fakeVatAdmin.d.ts +10 -10
- package/tools/manualPriceAuthority.d.ts +11 -6
- package/tools/manualPriceAuthority.d.ts.map +1 -1
- package/tools/manualPriceAuthority.js +15 -2
- package/tools/manualTimer.d.ts +21 -40
- package/tools/manualTimer.d.ts.map +1 -1
- package/tools/manualTimer.js +30 -16
- package/tools/prepare-test-env.js +1 -1
- package/tools/scriptedOracle.d.ts +3 -3
- package/tools/scriptedOracle.d.ts.map +1 -1
- package/tools/scriptedOracle.js +1 -1
- package/tools/scriptedPriceAuthority.d.ts +4 -0
- package/tools/scriptedPriceAuthority.d.ts.map +1 -1
- package/tools/scriptedPriceAuthority.js +6 -1
- package/tools/setup-zoe.d.ts +8 -9
- package/tools/setup-zoe.d.ts.map +1 -1
- package/tools/setup-zoe.js +16 -1
- package/tools/test-utils.d.ts +20 -0
- package/tools/test-utils.d.ts.map +1 -0
- package/tools/test-utils.js +26 -0
- package/tools/types.d.ts +21 -21
- package/tools/types.d.ts.map +1 -1
- package/tools/types.js +10 -10
- package/CHANGELOG.md +0 -1203
- package/src/contractFacet/types.d.ts +0 -191
- package/src/contractFacet/types.d.ts.map +0 -1
- package/src/contractFacet/types.js +0 -256
- package/src/contractSupport/types.d.ts.map +0 -1
- package/src/contracts/callSpread/types.d.ts.map +0 -1
- package/src/contracts/loan/types.d.ts.map +0 -1
- package/src/contracts/types.d.ts.map +0 -1
- package/src/objArrayConversion.d.ts +0 -5
- package/src/objArrayConversion.d.ts.map +0 -1
- package/src/objArrayConversion.js +0 -35
- package/src/types.d.ts +0 -45
- package/src/types.d.ts.map +0 -1
- package/src/zoeService/types.d.ts.map +0 -1
- package/tools/internal-types.d.ts +0 -12
- package/tools/internal-types.d.ts.map +0 -1
- package/tools/internal-types.js +0 -14
- package/tools/priceAuthorityRegistry.d.ts +0 -20
- package/tools/priceAuthorityRegistry.d.ts.map +0 -1
- package/tools/priceAuthorityRegistry.js +0 -209
- package/tools/types-ambient.d.ts +0 -142
- package/tools/types-ambient.d.ts.map +0 -1
- package/tools/types-ambient.js +0 -160
- /package/src/contracts/callSpread/{types.js → types-ambient.js} +0 -0
- /package/src/contracts/{types.js → types-ambient.js} +0 -0
|
@@ -1,191 +0,0 @@
|
|
|
1
|
-
type IssuerOptionsRecord = import('@agoric/ertp').IssuerOptionsRecord;
|
|
2
|
-
/**
|
|
3
|
-
* Any passable non-thenable. Often an explanatory string.
|
|
4
|
-
*/
|
|
5
|
-
type Completion = any;
|
|
6
|
-
type ZCFMakeEmptySeatKit = (exit?: ExitRule | undefined) => ZcfSeatKit;
|
|
7
|
-
/**
|
|
8
|
-
* Zoe Contract Facet
|
|
9
|
-
*
|
|
10
|
-
* The Zoe interface specific to a contract instance. The Zoe Contract
|
|
11
|
-
* Facet is an API object used by running contract instances to access
|
|
12
|
-
* the Zoe state for that instance. The Zoe Contract Facet is accessed
|
|
13
|
-
* synchronously from within the contract, and usually is referred to
|
|
14
|
-
* in code as zcf.
|
|
15
|
-
*/
|
|
16
|
-
type ZCF<CT extends unknown = Record<string, unknown>> = {
|
|
17
|
-
/**
|
|
18
|
-
* - reallocate amounts among seats.
|
|
19
|
-
* Deprecated: Use atomicRearrange instead.
|
|
20
|
-
*/
|
|
21
|
-
reallocate: Reallocate;
|
|
22
|
-
/**
|
|
23
|
-
* - check
|
|
24
|
-
* whether a keyword is valid and unique and could be added in
|
|
25
|
-
* `saveIssuer`
|
|
26
|
-
*/
|
|
27
|
-
assertUniqueKeyword: (keyword: Keyword) => void;
|
|
28
|
-
/**
|
|
29
|
-
* - save an issuer to ZCF and Zoe
|
|
30
|
-
* and get the AmountMath and brand synchronously accessible after
|
|
31
|
-
* saving
|
|
32
|
-
*/
|
|
33
|
-
saveIssuer: SaveIssuer;
|
|
34
|
-
makeInvitation: MakeInvitation;
|
|
35
|
-
shutdown: (completion: Completion) => void;
|
|
36
|
-
shutdownWithFailure: ShutdownWithFailure;
|
|
37
|
-
getZoeService: () => ERef<ZoeService>;
|
|
38
|
-
getInvitationIssuer: () => Issuer<'set'>;
|
|
39
|
-
getTerms: () => StandardTerms & CT;
|
|
40
|
-
getBrandForIssuer: <K extends AssetKind>(issuer: Issuer<K>) => Brand<K>;
|
|
41
|
-
getIssuerForBrand: <K_1 extends AssetKind>(brand: Brand<K_1>) => Issuer<K_1>;
|
|
42
|
-
getAssetKind: GetAssetKindByBrand;
|
|
43
|
-
makeZCFMint: <K_2 extends AssetKind = "nat">(keyword: Keyword, assetKind?: K_2 | undefined, displayInfo?: AdditionalDisplayInfo, options?: IssuerOptionsRecord) => Promise<ZCFMint<K_2>>;
|
|
44
|
-
registerFeeMint: ZCFRegisterFeeMint;
|
|
45
|
-
makeEmptySeatKit: ZCFMakeEmptySeatKit;
|
|
46
|
-
setTestJig: SetTestJig;
|
|
47
|
-
stopAcceptingOffers: () => Promise<void>;
|
|
48
|
-
setOfferFilter: (strings: Array<string>) => Promise<void>;
|
|
49
|
-
getOfferFilter: () => Promise<Array<string>>;
|
|
50
|
-
getInstance: () => Instance;
|
|
51
|
-
};
|
|
52
|
-
/**
|
|
53
|
-
* The contract can reallocate over seats, which commits the staged
|
|
54
|
-
* allocation for each seat. On commit, the staged allocation becomes
|
|
55
|
-
* the current allocation and the staged allocation is deleted.
|
|
56
|
-
*
|
|
57
|
-
* The reallocation will only succeed if the reallocation 1) conserves
|
|
58
|
-
* rights (the amounts specified have the same total value as the
|
|
59
|
-
* current total amount), and 2) is 'offer-safe' for all parties
|
|
60
|
-
* involved. All seats that have staged allocations must be included
|
|
61
|
-
* as arguments to `reallocate`, or an error is thrown. Additionally,
|
|
62
|
-
* an error is thrown if any seats included in `reallocate` do not
|
|
63
|
-
* have a staged allocation.
|
|
64
|
-
*
|
|
65
|
-
* The reallocation is partial, meaning that it applies only to the
|
|
66
|
-
* seats passed in as arguments. By induction, if rights conservation
|
|
67
|
-
* and offer safety hold before, they will hold after a safe
|
|
68
|
-
* reallocation, even though we only re-validate for the seats whose
|
|
69
|
-
* allocations will change. Since rights are conserved for the change,
|
|
70
|
-
* overall rights will be unchanged, and a reallocation can only
|
|
71
|
-
* effect offer safety for seats whose allocations change.
|
|
72
|
-
*/
|
|
73
|
-
type Reallocate = (seat1: ZCFSeat, seat2: ZCFSeat, ...seatRest: Array<ZCFSeat>) => void;
|
|
74
|
-
/**
|
|
75
|
-
* Informs Zoe about an issuer and returns a promise for acknowledging
|
|
76
|
-
* when the issuer is added and ready.
|
|
77
|
-
*/
|
|
78
|
-
type SaveIssuer = (issuerP: ERef<Issuer>, keyword: Keyword) => Promise<IssuerRecord<any>>;
|
|
79
|
-
/**
|
|
80
|
-
* Make a credible Zoe invitation for a particular smart contract
|
|
81
|
-
* indicated by the `instance` in the details of the invitation. Zoe
|
|
82
|
-
* also puts the `installation` and a unique `handle` in the details
|
|
83
|
-
* of the invitation. The contract must provide a `description` for
|
|
84
|
-
* the invitation and should include whatever information is necessary
|
|
85
|
-
* for a potential buyer of the invitation to know what they are
|
|
86
|
-
* getting in the `customDetails`. `customDetails` will be
|
|
87
|
-
* placed in the details of the invitation.
|
|
88
|
-
*/
|
|
89
|
-
type MakeInvitation = <Result>(offerHandler: OfferHandler<Result>, description: string, customDetails?: object, proposalShape?: Pattern) => Promise<Invitation<Awaited<Result>, never>>;
|
|
90
|
-
type ZCFRegisterFeeMint = (keyword: Keyword, allegedFeeMintAccess: FeeMintAccess) => Promise<ZCFMint<'nat'>>;
|
|
91
|
-
/**
|
|
92
|
-
* Provide a jig object for testing purposes only.
|
|
93
|
-
*
|
|
94
|
-
* The contract code provides a callback whose return result will
|
|
95
|
-
* be made available to the test that started this contract. The
|
|
96
|
-
* supplied callback will only be called in a testing context,
|
|
97
|
-
* never in production; i.e., it is only called if `testJigSetter`
|
|
98
|
-
* was supplied.
|
|
99
|
-
*
|
|
100
|
-
* If no, `testFn` is supplied, then an empty jig will be used.
|
|
101
|
-
* An additional `zcf` property set to the current ContractFacet
|
|
102
|
-
* will be appended to the returned jig object (overriding any
|
|
103
|
-
* provided by the `testFn`).
|
|
104
|
-
*/
|
|
105
|
-
type SetTestJig = (testFn: () => Record<string, unknown>) => void;
|
|
106
|
-
type ZCFMint<K extends AssetKind = AssetKind> = {
|
|
107
|
-
getIssuerRecord: () => IssuerRecord<K>;
|
|
108
|
-
/**
|
|
109
|
-
* All the amounts in gains must be of this ZCFMint's brand.
|
|
110
|
-
* The gains' keywords are in the namespace of that seat.
|
|
111
|
-
* Add the gains to that seat's allocation.
|
|
112
|
-
* The resulting state must be offer safe. (Currently, increasing assets can
|
|
113
|
-
* never violate offer safety anyway.)
|
|
114
|
-
*
|
|
115
|
-
* Mint that amount of assets into the pooled purse.
|
|
116
|
-
* If a seat is provided, it is returned. Otherwise a new seat is
|
|
117
|
-
* returned.
|
|
118
|
-
*/
|
|
119
|
-
mintGains: (gains: AmountKeywordRecord, zcfSeat?: ZCFSeat) => ZCFSeat;
|
|
120
|
-
/**
|
|
121
|
-
* All the amounts in losses must be of this ZCFMint's brand.
|
|
122
|
-
* The losses' keywords are in the namespace of that seat.
|
|
123
|
-
* Subtract losses from that seat's allocation.
|
|
124
|
-
* The resulting state must be offer safe.
|
|
125
|
-
*
|
|
126
|
-
* Burn that amount of assets from the pooled purse.
|
|
127
|
-
*/
|
|
128
|
-
burnLosses: (losses: AmountKeywordRecord, zcfSeat: ZCFSeat) => void;
|
|
129
|
-
};
|
|
130
|
-
/**
|
|
131
|
-
* fail called with the reason for this failure, where reason is
|
|
132
|
-
* normally an instanceof Error.
|
|
133
|
-
*/
|
|
134
|
-
type ZCFSeatFail = (reason: unknown) => Error;
|
|
135
|
-
/**
|
|
136
|
-
* The brand is used for filling in an empty amount if the `keyword`
|
|
137
|
-
* is not present in the allocation
|
|
138
|
-
*/
|
|
139
|
-
type ZCFGetAmountAllocated = (keyword: Keyword, brand?: Brand<AssetKind> | undefined) => Amount<any>;
|
|
140
|
-
type ZCFSeat = {
|
|
141
|
-
exit: (completion?: Completion) => void;
|
|
142
|
-
fail: ZCFSeatFail;
|
|
143
|
-
getSubscriber: () => Promise<Subscriber<Allocation>>;
|
|
144
|
-
hasExited: () => boolean;
|
|
145
|
-
getProposal: () => ProposalRecord;
|
|
146
|
-
getAmountAllocated: ZCFGetAmountAllocated;
|
|
147
|
-
getCurrentAllocation: () => Allocation;
|
|
148
|
-
/**
|
|
149
|
-
* Deprecated: Use atomicRearrange instead
|
|
150
|
-
*/
|
|
151
|
-
getStagedAllocation: () => Allocation;
|
|
152
|
-
/**
|
|
153
|
-
* Deprecated: Use atomicRearrange instead
|
|
154
|
-
*/
|
|
155
|
-
hasStagedAllocation: () => boolean;
|
|
156
|
-
isOfferSafe: (newAllocation: Allocation) => boolean;
|
|
157
|
-
/**
|
|
158
|
-
* Deprecated: Use atomicRearrange instead
|
|
159
|
-
*/
|
|
160
|
-
incrementBy: (amountKeywordRecord: AmountKeywordRecord) => AmountKeywordRecord;
|
|
161
|
-
/**
|
|
162
|
-
* Deprecated: Use atomicRearrange instead
|
|
163
|
-
*/
|
|
164
|
-
decrementBy: (amountKeywordRecord: AmountKeywordRecord) => AmountKeywordRecord;
|
|
165
|
-
/**
|
|
166
|
-
* Deprecated: Use atomicRearrange instead
|
|
167
|
-
*/
|
|
168
|
-
clear: () => void;
|
|
169
|
-
};
|
|
170
|
-
type ZcfSeatKit = {
|
|
171
|
-
zcfSeat: ZCFSeat;
|
|
172
|
-
userSeat: ERef<UserSeat>;
|
|
173
|
-
};
|
|
174
|
-
type HandleOffer<OR extends unknown> = (seat: ZCFSeat, offerArgs?: object) => OR;
|
|
175
|
-
type OfferHandler<OR extends unknown = unknown> = HandleOffer<OR> | {
|
|
176
|
-
handle: HandleOffer<OR>;
|
|
177
|
-
};
|
|
178
|
-
/**
|
|
179
|
-
* API for a contract start function.
|
|
180
|
-
*
|
|
181
|
-
* CAVEAT: assumes synchronous
|
|
182
|
-
*/
|
|
183
|
-
type ContractStartFn<PF extends unknown = any, CF extends unknown = any, CT extends unknown = any, PA extends unknown = any> = (zcf: ZCF<CT>, privateArgs: PA) => ContractStartFnResult<PF, CF>;
|
|
184
|
-
type ContractStartFnResult<PF, CF> = {
|
|
185
|
-
publicFacet: PF;
|
|
186
|
-
creatorFacet: CF;
|
|
187
|
-
creatorInvitation?: Promise<Invitation<unknown, never>> | undefined;
|
|
188
|
-
};
|
|
189
|
-
type ContractOf<S> = import('../zoeService/utils').ContractOf<S>;
|
|
190
|
-
type AdminFacet = import('../zoeService/utils').AdminFacet;
|
|
191
|
-
//# sourceMappingURL=types.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["types.js"],"names":[],"mappings":"2BAIc,OAAO,cAAc,EAAE,mBAAmB;;;;kBAI3C,GAAG;4DAOH,UAAU;;;;;;;;;;;;;;;gBAaT,UAAU;;;;;;mCAEA,OAAO,KAAK,IAAI;;;;;;gBAG1B,UAAU;oBAGV,cAAc;2BACD,UAAU,KAAK,IAAI;yBAChC,mBAAmB;mBACnB,MAAM,KAAK,UAAU,CAAC;yBACtB,MAAM,OAAO,KAAK,CAAC;cACnB,MAAM,aAAa,GAAG,EAAE;;;kBAGxB,mBAAmB;0DAEnB,OAAO,6CAEF,qBAAqB,YACzB,mBAAmB;qBAEpB,kBAAkB;sBAClB,mBAAmB;gBACnB,UAAU;yBACV,MAAM,QAAQ,IAAI,CAAC;8BACT,MAAM,MAAM,CAAC,KAAK,QAAQ,IAAI,CAAC;oBACzC,MAAM,QAAQ,MAAM,MAAM,CAAC,CAAC;iBAC5B,MAAM,QAAQ;;;;;;;;;;;;;;;;;;;;;;;0BAIP,OAAO,SAAS,OAAO,eAC3C,MAAQ,OAAO,CAAC,KAAK,IAAI;;;;;4BA6Bf,KAAK,MAAM,CAAC,WACZ,OAAO,KACL,QAAQ,iBAAe,CAAC;;;;;;;;;;;gFAMnB,MAAM,kBACH,MAAM,kBACN,OAAO;oCAgBjB,OAAO,wBACP,aAAa,KAEX,QAAQ,QAAQ,KAAK,CAAC,CAAC;;;;;;;;;;;;;;;2BAkBzB,MAAM,OAAO,MAAM,EAAE,OAAO,CAAC,KAC3B,IAAI;;qBAMH,MAAM,aAAa,CAAC,CAAC;;;;;;;;;;;;uBACb,mBAAmB,YAAY,OAAO,KAAK,OAAO;;;;;;;;;yBAWjD,mBAAmB,WAClB,OAAO,KACZ,IAAI;;;;;;4BAcZ,OAAO,KACL,KAAK;;;;;uCAOP,OAAO,2CAEL,OAAO,GAAG,CAAC;;wBAKI,UAAU,KAAK,IAAI;UACjC,WAAW;mBACX,MAAM,QAAQ,WAAW,UAAU,CAAC,CAAC;eACrC,MAAM,OAAO;iBACb,MAAM,cAAc;wBACpB,qBAAqB;0BACrB,MAAM,UAAU;;;;yBAChB,MAAM,UAAU;;;;yBAEhB,MAAM,OAAO;iCAEG,UAAU,KAAK,OAAO;;;;uCAChB,mBAAmB,KAAK,mBAAmB;;;;uCAE3C,mBAAmB,KAAK,mBAAmB;;;;WAEjE,MAAM,IAAI;;kBAKX;IAAE,OAAO,EAAE,OAAO,CAAC;IAAC,QAAQ,EAAE,KAAK,QAAQ,CAAC,CAAA;CAAC;8CAKtC,OAAO,cAAc,MAAM,KAAK,EAAE;kDAKzC,YAAY,EAAE,CAAC,GAAG;IAAE,MAAM,EAAE,YAAY,EAAE,CAAC,CAAA;CAAE;;;;;;qIAe/C,IAAI,EAAE,CAAC,eACP,EAAE,KACA,sBAAsB,EAAE,EAAE,EAAE,CAAC;;iBAO5B,EAAE;kBACF,EAAE;;;qBAMH,OAAO,qBAAqB,EAAE,UAAU,CAAC,CAAC,CAAC;kBAI3C,OAAO,qBAAqB,EAAE,UAAU"}
|
|
@@ -1,256 +0,0 @@
|
|
|
1
|
-
// @jessie-check
|
|
2
|
-
|
|
3
|
-
/// <reference types="ses"/>
|
|
4
|
-
|
|
5
|
-
/** @typedef {import('@agoric/ertp').IssuerOptionsRecord} IssuerOptionsRecord */
|
|
6
|
-
|
|
7
|
-
// XXX can be tighter than 'any'
|
|
8
|
-
/**
|
|
9
|
-
* @typedef {any} Completion
|
|
10
|
-
* Any passable non-thenable. Often an explanatory string.
|
|
11
|
-
*/
|
|
12
|
-
|
|
13
|
-
/**
|
|
14
|
-
* @callback ZCFMakeEmptySeatKit
|
|
15
|
-
* @param {ExitRule} [exit]
|
|
16
|
-
* @returns {ZcfSeatKit}
|
|
17
|
-
*/
|
|
18
|
-
|
|
19
|
-
/**
|
|
20
|
-
* @template {object} [CT=Record<string, unknown>] Contract's custom terms
|
|
21
|
-
* @typedef {object} ZCF Zoe Contract Facet
|
|
22
|
-
*
|
|
23
|
-
* The Zoe interface specific to a contract instance. The Zoe Contract
|
|
24
|
-
* Facet is an API object used by running contract instances to access
|
|
25
|
-
* the Zoe state for that instance. The Zoe Contract Facet is accessed
|
|
26
|
-
* synchronously from within the contract, and usually is referred to
|
|
27
|
-
* in code as zcf.
|
|
28
|
-
*
|
|
29
|
-
* @property {Reallocate} reallocate - reallocate amounts among seats.
|
|
30
|
-
* Deprecated: Use atomicRearrange instead.
|
|
31
|
-
* @property {(keyword: Keyword) => void} assertUniqueKeyword - check
|
|
32
|
-
* whether a keyword is valid and unique and could be added in
|
|
33
|
-
* `saveIssuer`
|
|
34
|
-
* @property {SaveIssuer} saveIssuer - save an issuer to ZCF and Zoe
|
|
35
|
-
* and get the AmountMath and brand synchronously accessible after
|
|
36
|
-
* saving
|
|
37
|
-
* @property {MakeInvitation} makeInvitation
|
|
38
|
-
* @property {(completion: Completion) => void} shutdown
|
|
39
|
-
* @property {ShutdownWithFailure} shutdownWithFailure
|
|
40
|
-
* @property {() => ERef<ZoeService>} getZoeService
|
|
41
|
-
* @property {() => Issuer<'set'>} getInvitationIssuer
|
|
42
|
-
* @property {() => StandardTerms & CT} getTerms
|
|
43
|
-
* @property {<K extends AssetKind>(issuer: Issuer<K>) => Brand<K>} getBrandForIssuer
|
|
44
|
-
* @property {<K extends AssetKind>(brand: Brand<K>) => Issuer<K>} getIssuerForBrand
|
|
45
|
-
* @property {GetAssetKindByBrand} getAssetKind
|
|
46
|
-
* @property {<K extends AssetKind = 'nat'>(
|
|
47
|
-
* keyword: Keyword,
|
|
48
|
-
* assetKind?: K,
|
|
49
|
-
* displayInfo?: AdditionalDisplayInfo,
|
|
50
|
-
* options?: IssuerOptionsRecord
|
|
51
|
-
* ) => Promise<ZCFMint<K>>} makeZCFMint
|
|
52
|
-
* @property {ZCFRegisterFeeMint} registerFeeMint
|
|
53
|
-
* @property {ZCFMakeEmptySeatKit} makeEmptySeatKit
|
|
54
|
-
* @property {SetTestJig} setTestJig
|
|
55
|
-
* @property {() => Promise<void>} stopAcceptingOffers
|
|
56
|
-
* @property {(strings: Array<string>) => Promise<void>} setOfferFilter
|
|
57
|
-
* @property {() => Promise<Array<string>>} getOfferFilter
|
|
58
|
-
* @property {() => Instance} getInstance
|
|
59
|
-
*/
|
|
60
|
-
|
|
61
|
-
/**
|
|
62
|
-
* @typedef {(seat1: ZCFSeat, seat2: ZCFSeat, ...seatRest:
|
|
63
|
-
* Array<ZCFSeat>) => void} Reallocate
|
|
64
|
-
*
|
|
65
|
-
* The contract can reallocate over seats, which commits the staged
|
|
66
|
-
* allocation for each seat. On commit, the staged allocation becomes
|
|
67
|
-
* the current allocation and the staged allocation is deleted.
|
|
68
|
-
*
|
|
69
|
-
* The reallocation will only succeed if the reallocation 1) conserves
|
|
70
|
-
* rights (the amounts specified have the same total value as the
|
|
71
|
-
* current total amount), and 2) is 'offer-safe' for all parties
|
|
72
|
-
* involved. All seats that have staged allocations must be included
|
|
73
|
-
* as arguments to `reallocate`, or an error is thrown. Additionally,
|
|
74
|
-
* an error is thrown if any seats included in `reallocate` do not
|
|
75
|
-
* have a staged allocation.
|
|
76
|
-
*
|
|
77
|
-
* The reallocation is partial, meaning that it applies only to the
|
|
78
|
-
* seats passed in as arguments. By induction, if rights conservation
|
|
79
|
-
* and offer safety hold before, they will hold after a safe
|
|
80
|
-
* reallocation, even though we only re-validate for the seats whose
|
|
81
|
-
* allocations will change. Since rights are conserved for the change,
|
|
82
|
-
* overall rights will be unchanged, and a reallocation can only
|
|
83
|
-
* effect offer safety for seats whose allocations change.
|
|
84
|
-
*/
|
|
85
|
-
|
|
86
|
-
/**
|
|
87
|
-
* @callback SaveIssuer
|
|
88
|
-
*
|
|
89
|
-
* Informs Zoe about an issuer and returns a promise for acknowledging
|
|
90
|
-
* when the issuer is added and ready.
|
|
91
|
-
*
|
|
92
|
-
* @param {ERef<Issuer>} issuerP Promise for issuer
|
|
93
|
-
* @param {Keyword} keyword Keyword for added issuer
|
|
94
|
-
* @returns {Promise<IssuerRecord<*>>} Issuer is added and ready
|
|
95
|
-
*/
|
|
96
|
-
|
|
97
|
-
/**
|
|
98
|
-
* @typedef {<Result>(
|
|
99
|
-
* offerHandler: OfferHandler<Result>,
|
|
100
|
-
* description: string,
|
|
101
|
-
* customDetails?: object,
|
|
102
|
-
* proposalShape?: Pattern,
|
|
103
|
-
* ) => Promise<Invitation<Awaited<Result>>>
|
|
104
|
-
* } MakeInvitation
|
|
105
|
-
*
|
|
106
|
-
* Make a credible Zoe invitation for a particular smart contract
|
|
107
|
-
* indicated by the `instance` in the details of the invitation. Zoe
|
|
108
|
-
* also puts the `installation` and a unique `handle` in the details
|
|
109
|
-
* of the invitation. The contract must provide a `description` for
|
|
110
|
-
* the invitation and should include whatever information is necessary
|
|
111
|
-
* for a potential buyer of the invitation to know what they are
|
|
112
|
-
* getting in the `customDetails`. `customDetails` will be
|
|
113
|
-
* placed in the details of the invitation.
|
|
114
|
-
*/
|
|
115
|
-
|
|
116
|
-
/**
|
|
117
|
-
* @callback ZCFRegisterFeeMint
|
|
118
|
-
* @param {Keyword} keyword
|
|
119
|
-
* @param {FeeMintAccess} allegedFeeMintAccess - an object that
|
|
120
|
-
* purports to be the object that grants access to the fee mint
|
|
121
|
-
* @returns {Promise<ZCFMint<'nat'>>}
|
|
122
|
-
*/
|
|
123
|
-
|
|
124
|
-
/**
|
|
125
|
-
* Provide a jig object for testing purposes only.
|
|
126
|
-
*
|
|
127
|
-
* The contract code provides a callback whose return result will
|
|
128
|
-
* be made available to the test that started this contract. The
|
|
129
|
-
* supplied callback will only be called in a testing context,
|
|
130
|
-
* never in production; i.e., it is only called if `testJigSetter`
|
|
131
|
-
* was supplied.
|
|
132
|
-
*
|
|
133
|
-
* If no, `testFn` is supplied, then an empty jig will be used.
|
|
134
|
-
* An additional `zcf` property set to the current ContractFacet
|
|
135
|
-
* will be appended to the returned jig object (overriding any
|
|
136
|
-
* provided by the `testFn`).
|
|
137
|
-
*
|
|
138
|
-
* @callback SetTestJig
|
|
139
|
-
* @param {() => Record<string, unknown>} testFn
|
|
140
|
-
* @returns {void}
|
|
141
|
-
*/
|
|
142
|
-
|
|
143
|
-
/**
|
|
144
|
-
* @template {AssetKind} [K=AssetKind]
|
|
145
|
-
* @typedef {object} ZCFMint
|
|
146
|
-
* @property {() => IssuerRecord<K>} getIssuerRecord
|
|
147
|
-
* @property {(gains: AmountKeywordRecord, zcfSeat?: ZCFSeat) => ZCFSeat} mintGains
|
|
148
|
-
* All the amounts in gains must be of this ZCFMint's brand.
|
|
149
|
-
* The gains' keywords are in the namespace of that seat.
|
|
150
|
-
* Add the gains to that seat's allocation.
|
|
151
|
-
* The resulting state must be offer safe. (Currently, increasing assets can
|
|
152
|
-
* never violate offer safety anyway.)
|
|
153
|
-
*
|
|
154
|
-
* Mint that amount of assets into the pooled purse.
|
|
155
|
-
* If a seat is provided, it is returned. Otherwise a new seat is
|
|
156
|
-
* returned.
|
|
157
|
-
*
|
|
158
|
-
* @property {(losses: AmountKeywordRecord,
|
|
159
|
-
* zcfSeat: ZCFSeat,
|
|
160
|
-
* ) => void} burnLosses
|
|
161
|
-
* All the amounts in losses must be of this ZCFMint's brand.
|
|
162
|
-
* The losses' keywords are in the namespace of that seat.
|
|
163
|
-
* Subtract losses from that seat's allocation.
|
|
164
|
-
* The resulting state must be offer safe.
|
|
165
|
-
*
|
|
166
|
-
* Burn that amount of assets from the pooled purse.
|
|
167
|
-
*/
|
|
168
|
-
|
|
169
|
-
/**
|
|
170
|
-
* @callback ZCFSeatFail
|
|
171
|
-
*
|
|
172
|
-
* fail called with the reason for this failure, where reason is
|
|
173
|
-
* normally an instanceof Error.
|
|
174
|
-
* @param {unknown} reason
|
|
175
|
-
* @returns {Error}
|
|
176
|
-
*/
|
|
177
|
-
|
|
178
|
-
/**
|
|
179
|
-
* @callback ZCFGetAmountAllocated
|
|
180
|
-
* The brand is used for filling in an empty amount if the `keyword`
|
|
181
|
-
* is not present in the allocation
|
|
182
|
-
* @param {Keyword} keyword
|
|
183
|
-
* @param {Brand} [brand]
|
|
184
|
-
* @returns {Amount<any>}
|
|
185
|
-
*/
|
|
186
|
-
|
|
187
|
-
/**
|
|
188
|
-
* @typedef {object} ZCFSeat
|
|
189
|
-
* @property {(completion?: Completion) => void} exit
|
|
190
|
-
* @property {ZCFSeatFail} fail
|
|
191
|
-
* @property {() => Promise<Subscriber<Allocation>>} getSubscriber
|
|
192
|
-
* @property {() => boolean} hasExited
|
|
193
|
-
* @property {() => ProposalRecord} getProposal
|
|
194
|
-
* @property {ZCFGetAmountAllocated} getAmountAllocated
|
|
195
|
-
* @property {() => Allocation} getCurrentAllocation
|
|
196
|
-
* @property {() => Allocation} getStagedAllocation
|
|
197
|
-
* Deprecated: Use atomicRearrange instead
|
|
198
|
-
* @property {() => boolean} hasStagedAllocation
|
|
199
|
-
* Deprecated: Use atomicRearrange instead
|
|
200
|
-
* @property {(newAllocation: Allocation) => boolean} isOfferSafe
|
|
201
|
-
* @property {(amountKeywordRecord: AmountKeywordRecord) => AmountKeywordRecord} incrementBy
|
|
202
|
-
* Deprecated: Use atomicRearrange instead
|
|
203
|
-
* @property {(amountKeywordRecord: AmountKeywordRecord) => AmountKeywordRecord} decrementBy
|
|
204
|
-
* Deprecated: Use atomicRearrange instead
|
|
205
|
-
* @property {() => void} clear
|
|
206
|
-
* Deprecated: Use atomicRearrange instead
|
|
207
|
-
*/
|
|
208
|
-
|
|
209
|
-
/**
|
|
210
|
-
* @typedef {{ zcfSeat: ZCFSeat, userSeat: ERef<UserSeat>}} ZcfSeatKit
|
|
211
|
-
*/
|
|
212
|
-
|
|
213
|
-
/**
|
|
214
|
-
* @template {object} OR Offer results
|
|
215
|
-
* @typedef {(seat: ZCFSeat, offerArgs?: object) => OR} HandleOffer
|
|
216
|
-
*/
|
|
217
|
-
|
|
218
|
-
/**
|
|
219
|
-
* @template {object} [OR=unknown] Offer results
|
|
220
|
-
* @typedef {HandleOffer<OR> | { handle: HandleOffer<OR> }} OfferHandler
|
|
221
|
-
*/
|
|
222
|
-
|
|
223
|
-
/**
|
|
224
|
-
* API for a contract start function.
|
|
225
|
-
*
|
|
226
|
-
* CAVEAT: assumes synchronous
|
|
227
|
-
*
|
|
228
|
-
* @deprecated define function signature directly
|
|
229
|
-
*
|
|
230
|
-
* @template {object} [PF=any] Public facet
|
|
231
|
-
* @template {object} [CF=any] Creator facet
|
|
232
|
-
* @template {object} [CT=any] Custom terms
|
|
233
|
-
* @template {object} [PA=any] Private args
|
|
234
|
-
* @callback ContractStartFn
|
|
235
|
-
* @param {ZCF<CT>} zcf
|
|
236
|
-
* @param {PA} privateArgs
|
|
237
|
-
* @returns {ContractStartFnResult<PF, CF>}
|
|
238
|
-
*/
|
|
239
|
-
|
|
240
|
-
/**
|
|
241
|
-
* @template PF Public facet
|
|
242
|
-
* @template CF Creator facet
|
|
243
|
-
* @typedef {object} ContractStartFnResult
|
|
244
|
-
* @property {PF} publicFacet
|
|
245
|
-
* @property {CF} creatorFacet
|
|
246
|
-
* @property {Promise<Invitation>} [creatorInvitation]
|
|
247
|
-
*/
|
|
248
|
-
|
|
249
|
-
/**
|
|
250
|
-
* @template S
|
|
251
|
-
* @typedef {import('../zoeService/utils').ContractOf<S>} ContractOf
|
|
252
|
-
*/
|
|
253
|
-
|
|
254
|
-
/**
|
|
255
|
-
* @typedef {import('../zoeService/utils').AdminFacet} AdminFacet
|
|
256
|
-
*/
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["types.js"],"names":[],"mappings":";UAMc,OAAO;;;;;WACP,mBAAmB;;;;;;;;YAEnB,mBAAmB;;;;;;;;;;;;;;;kBAqBtB,GAAG,YACH,OAAO,aACP,OAAO,KACL,MAAM;;;;;;;;;;uBAcR,GAAG,YACH,OAAO,aACP,OAAO,KACL,MAAM;;;;4BAIN,OAAO,OAAO,EAAC,OAAO,CAAC;;;;;;qEAYvB,oBAAoB;;;;;;;mCAWtB,mBAAmB,GAAG,qBAAqB,GAAG,mBAAmB,GAAG,SAAS,kBAC7E,oBAAoB;;eAKjB,OAAO,KAAK,CAAC;iBACb,OAAO,KAAK,CAAC;;4BAKhB,OAAO,KAAK,CAAC,SACb,KAAK,KACH,OAAO,KAAK,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["types.js"],"names":[],"mappings":"oBACa,MAAM,GAAG,OAAO;2CAKlB,YAAY,KACV,QAAQ,UAAU,CAAC;;qBAKlB,MAAM,IAAI;0BACT,oBAAoB;;;;;;;;eAQrB,KAAK;gBACL,KAAK;;;;;;;;;;;;;yCAcR,KAAK,SACL,OAAO,KAAK,CAAC,gBACb,OAAO,KAAK,CAAC,gBACb,OAAO,KAAK,CAAC,KACX,qBAAqB;8BAKvB,KAAK,KACH,KAAK;4BAKP,KAAK,KACH,KAAK"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["types.js"],"names":[],"mappings":";;;;;;;sBACa,SAAS,OAAO,wBAAwB,EAAE,eAAe,CAAC;;;;;;;wBAU1D,QAAQ;;;;;;SAUP,KAAK;sBAGL,gBAAgB;;;;;oBAEhB,cAAc;oBAKd,cAAc;;;;;kBAEd,KAAK;oBAIL,OAAO,wBAAwB,EAAE,YAAY;eAE7C,KAAK;qBACL,KAAK;;;;;;gBAKL,OAAO;;;;;4BAMR,SAAS,GAAG,kBAAkB;;;;;;oBAQ7B,OAAO;;;;aAKP,MAAM,OAAO,KAAK,CAAC;;;;;2BAInB,cAAc,UAAU,CAAC;;;;;;;oBASzB,OAAO;;;;;2BAKP,cAAc,UAAU,CAAC;;;;;8BAO1B,oBAAoB,GAAG,wBAAwB;uCAM/C,oBAAoB,GAAG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BACR,qBAAqB;uBACrB,QAAQ;0BACR,oBAAoB;;;6BAGP,mBAAmB,KAAK,QAAQ,eAAe,CAAC;eAC7D,MAAM,MAAM;;;oBAKZ,MAAM,MAAM;oBACZ,MAAM,QAAQ,UAAU,CAAC;;;;;;;wBAKzB,MAAM,QAAQ,UAAU,CAAC;;;;;;0BAEzB,MAAM,QAAQ,UAAU,CAAC;;;;;;2BAGzB,MAAM,QAAQ,UAAU,CAAC;;;;;gCAGzB,MAAM,QAAQ,UAAU,CAAC;;;;;mCAEzB,MAAM,QAAQ,UAAU,CAAC;wBAEzB,MAAM,MAAM;;;;;wBACZ,MAAM,MAAM;;;;;8BAED,MAAM,YAAY,KAAK,KAAK,MAAM;;;;;gCAGjC,MAAM,WAAW,KAAK,KAAK,MAAM;;;;;uBAG7C,MAAM,OAAO,MAAM,EAAE,MAAM,CAAC"}
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
export function arrayToObj<T, U extends PropertyName>(array: T[], keys: U[]): Record<U, T>;
|
|
2
|
-
export function assertSubset(whole: string[], part: string[]): void;
|
|
3
|
-
export type Primitive = bigint | boolean | null | number | string | symbol | undefined;
|
|
4
|
-
export type PropertyName = string | number | symbol;
|
|
5
|
-
//# sourceMappingURL=objArrayConversion.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"objArrayConversion.d.ts","sourceRoot":"","sources":["objArrayConversion.js"],"names":[],"mappings":"AAaO,2FAON;AAQM,oCAHI,MAAM,EAAE,QACR,MAAM,EAAE,QAQlB;wBA/BY,MAAM,GAAC,OAAO,GAAC,IAAI,GAAC,MAAM,GAAC,MAAM,GAAC,MAAM,GAAC,SAAS;2BAClD,MAAM,GAAC,MAAM,GAAC,MAAM"}
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
import { assert, Fail, q } from '@agoric/assert';
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* @typedef {bigint|boolean|null|number|string|symbol|undefined} Primitive
|
|
5
|
-
* @typedef {string|number|symbol} PropertyName
|
|
6
|
-
*/
|
|
7
|
-
|
|
8
|
-
/**
|
|
9
|
-
* @template T
|
|
10
|
-
* @template {PropertyName} U
|
|
11
|
-
* @param {T[]} array
|
|
12
|
-
* @param {U[]} keys
|
|
13
|
-
*/
|
|
14
|
-
export const arrayToObj = (array, keys) => {
|
|
15
|
-
array.length === keys.length || Fail`array and keys must be of equal length`;
|
|
16
|
-
const obj =
|
|
17
|
-
/** @type {Record<U, T>} */
|
|
18
|
-
({});
|
|
19
|
-
keys.forEach((key, i) => (obj[key] = array[i]));
|
|
20
|
-
return harden(obj);
|
|
21
|
-
};
|
|
22
|
-
|
|
23
|
-
/**
|
|
24
|
-
* Assert all values from `part` appear in `whole`.
|
|
25
|
-
*
|
|
26
|
-
* @param {string[]} whole
|
|
27
|
-
* @param {string[]} part
|
|
28
|
-
*/
|
|
29
|
-
export const assertSubset = (whole, part) => {
|
|
30
|
-
part.forEach(key => {
|
|
31
|
-
assert.typeof(key, 'string');
|
|
32
|
-
whole.includes(key) ||
|
|
33
|
-
Fail`key ${q(key)} was not one of the expected keys ${q(whole)}`;
|
|
34
|
-
});
|
|
35
|
-
};
|
package/src/types.d.ts
DELETED
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* A type constructor for an opaque type
|
|
3
|
-
* identified by the H string. This uses an intersection type
|
|
4
|
-
* ('MyHandle' & {}) to tag the handle's type even though the actual
|
|
5
|
-
* value is just an empty object.
|
|
6
|
-
*/
|
|
7
|
-
type Handle<H extends string> = H & typeof import("@endo/marshal").Remotable;
|
|
8
|
-
type Keyword = string;
|
|
9
|
-
/**
|
|
10
|
-
* - an opaque handle for an invitation
|
|
11
|
-
*/
|
|
12
|
-
type InvitationHandle = Handle<'Invitation'>;
|
|
13
|
-
type IssuerKeywordRecord = Record<Keyword, Issuer<any>>;
|
|
14
|
-
type IssuerPKeywordRecord = Record<Keyword, ERef<Issuer<any>>>;
|
|
15
|
-
type BrandKeywordRecord = Record<Keyword, Brand<any>>;
|
|
16
|
-
type StandardTerms = {
|
|
17
|
-
/**
|
|
18
|
-
* - record with
|
|
19
|
-
* keywords keys, issuer values
|
|
20
|
-
*/
|
|
21
|
-
issuers: IssuerKeywordRecord;
|
|
22
|
-
/**
|
|
23
|
-
* - record with keywords
|
|
24
|
-
* keys, brand values
|
|
25
|
-
*/
|
|
26
|
-
brands: BrandKeywordRecord;
|
|
27
|
-
};
|
|
28
|
-
type AnyTerms = StandardTerms & Record<string, any>;
|
|
29
|
-
type InstanceRecord = {
|
|
30
|
-
installation: Installation;
|
|
31
|
-
instance: import("./zoeService/utils.js").Instance<any>;
|
|
32
|
-
/**
|
|
33
|
-
* - contract parameters
|
|
34
|
-
*/
|
|
35
|
-
terms: AnyTerms;
|
|
36
|
-
};
|
|
37
|
-
type IssuerRecord<K extends AssetKind = AssetKind> = {
|
|
38
|
-
brand: Brand<K>;
|
|
39
|
-
issuer: Issuer<K>;
|
|
40
|
-
assetKind: K;
|
|
41
|
-
displayInfo?: DisplayInfo<K> | undefined;
|
|
42
|
-
};
|
|
43
|
-
type Allocation<K extends AssetKind = AssetKind> = AmountKeywordRecord;
|
|
44
|
-
type Invitation<R extends unknown = unknown, A extends unknown = never> = Payment<'set'>;
|
|
45
|
-
//# sourceMappingURL=types.d.ts.map
|
package/src/types.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["types.js"],"names":[],"mappings":";;;;;;gCAMa,CAAC,2CAAoC;eAOrC,MAAM;;;;wBACN,OAAO,YAAY,CAAC;2BACpB,OAAO,OAAO,EAAE,OAAO,GAAG,CAAC,CAAC;4BAC5B,OAAO,OAAO,EAAE,KAAK,OAAO,GAAG,CAAC,CAAC,CAAC;0BAClC,OAAO,OAAO,EAAE,MAAM,GAAG,CAAC,CAAC;;;;;;aAK1B,mBAAmB;;;;;YAEnB,kBAAkB;;gBAGnB,aAAa,GAAG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W;eAI1C;IAAC,SAAS,EAAE,OAAO,sBAAsB,EAAE,SAAS,CAAA;CAAE,GAAG;IAAC,MAAM,MAAM,CAAA;CAAC,GAAG;IAAC,EAAE,EAAE,QAAQ,CAAA;CAAC;;;;oBAIxF,OAAO,MAAM,EAAE,GAAG,CAAC;6BAKnB,OAAO,OAAO,EAAC,KAAK,QAAQ,GAAG,CAAC,CAAC,CAAC;4BAClC,OAAO,OAAO,EAAC,QAAQ,GAAG,CAAC,CAAC;;kBAK3B,YAAY;cACZ,OAAO,SAAS,EAAE,QAAQ,CAAC,GAAG,CAAC;YAC/B,gBAAgB;iBAChB,MAAM;;;8BAMP,OAAO,SAAS,EAAE,YAAY,CAAC,EAAE,CAAC;sDAKlC,OAAO,SAAS,EAAE,iBAAiB,CAAC,CAAC,CAAC;;UAKrC,MAAM;eACN,SAAS;iBACT,WAAW;;;uBAKX,QAAQ;;qBAIT,OAAO,eAAe,CAAC"}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
type ManualTimerAdmin = {
|
|
2
|
-
/**
|
|
3
|
-
* Advance the timer by one tick.
|
|
4
|
-
* DEPRECATED: use `await tickN(1)` instead. `tick` function errors might be
|
|
5
|
-
* thrown synchronously, even though success is signaled by returning anything
|
|
6
|
-
* other than a rejected promise.
|
|
7
|
-
*/
|
|
8
|
-
tick: (msg?: string) => void | Promise<void>;
|
|
9
|
-
tickN: (nTimes: number, msg?: string) => Promise<void>;
|
|
10
|
-
};
|
|
11
|
-
type ManualTimer = import('@agoric/time/src/types').TimerService & ManualTimerAdmin;
|
|
12
|
-
//# sourceMappingURL=internal-types.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"internal-types.d.ts","sourceRoot":"","sources":["internal-types.js"],"names":[],"mappings":";;;;;;;iBAIqB,MAAM,KAAK,IAAI,GAAG,QAAQ,IAAI,CAAC;oBAI7B,MAAM,QAAQ,MAAM,KAAK,QAAQ,IAAI,CAAC;;mBAIhD,OAAO,wBAAwB,EAAE,YAAY,GAAG,gBAAgB"}
|
package/tools/internal-types.js
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
// @jessie-check
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* @typedef {object} ManualTimerAdmin
|
|
5
|
-
* @property {(msg?: string) => void | Promise<void>} tick Advance the timer by one tick.
|
|
6
|
-
* DEPRECATED: use `await tickN(1)` instead. `tick` function errors might be
|
|
7
|
-
* thrown synchronously, even though success is signaled by returning anything
|
|
8
|
-
* other than a rejected promise.
|
|
9
|
-
* @property {(nTimes: number, msg?: string) => Promise<void>} tickN
|
|
10
|
-
*/
|
|
11
|
-
|
|
12
|
-
/**
|
|
13
|
-
* @typedef {import('@agoric/time/src/types').TimerService & ManualTimerAdmin} ManualTimer
|
|
14
|
-
*/
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
export function providePriceAuthorityRegistry(baggage: MapStore<string, unknown>): PriceAuthorityRegistry;
|
|
2
|
-
export type Deleter = {
|
|
3
|
-
delete: () => void;
|
|
4
|
-
};
|
|
5
|
-
export type PriceAuthorityRegistryAdmin = {
|
|
6
|
-
/**
|
|
7
|
-
* Add a unique price authority for a given pair
|
|
8
|
-
*/
|
|
9
|
-
registerPriceAuthority: (pa: ERef<PriceAuthority>, brandIn: Brand, brandOut: Brand, force?: boolean) => Promise<Deleter>;
|
|
10
|
-
};
|
|
11
|
-
/**
|
|
12
|
-
* A price authority that is a facade
|
|
13
|
-
* for other backing price authorities registered for a given asset and price
|
|
14
|
-
* brand
|
|
15
|
-
*/
|
|
16
|
-
export type PriceAuthorityRegistry = {
|
|
17
|
-
priceAuthority: PriceAuthority;
|
|
18
|
-
adminFacet: PriceAuthorityRegistryAdmin;
|
|
19
|
-
};
|
|
20
|
-
//# sourceMappingURL=priceAuthorityRegistry.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"priceAuthorityRegistry.d.ts","sourceRoot":"","sources":["priceAuthorityRegistry.js"],"names":[],"mappings":"AA0CO,mFAFM,sBAAsB,CAwKlC;;YAhMa,MAAM,IAAI;;;;;;iCAKL,KAAK,cAAc,CAAC,WACf,KAAK,YACJ,KAAK,UACP,OAAO,KAAK,QAAQ,OAAO,CAAC;;;;;;;;oBAQrC,cAAc;gBACd,2BAA2B"}
|