@agoric/zoe 0.26.2 → 0.26.3-calypso-dev-84eb287.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 +628 -314
- package/bundles/bundle-contractFacet.d.ts +3 -3
- package/bundles/bundle-contractFacet.js +1 -1
- package/exported.js +1 -12
- package/package.json +75 -59
- package/src/cleanProposal.d.ts +2 -2
- package/src/cleanProposal.d.ts.map +1 -1
- package/src/cleanProposal.js +15 -12
- package/src/contractFacet/evalContractCode.d.ts.map +1 -1
- package/src/contractFacet/evalContractCode.js +2 -2
- 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/typeGuards.d.ts +8 -0
- package/src/contractFacet/typeGuards.d.ts.map +1 -0
- package/src/contractFacet/typeGuards.js +25 -0
- package/src/contractFacet/types-ambient.d.ts +271 -0
- package/src/contractFacet/types-ambient.js +1 -0
- package/src/contractFacet/vatRoot.d.ts +3 -3
- package/src/contractFacet/vatRoot.d.ts.map +1 -1
- package/src/contractFacet/zcfMint.d.ts +4 -2
- package/src/contractFacet/zcfMint.d.ts.map +1 -1
- package/src/contractFacet/zcfMint.js +7 -7
- package/src/contractFacet/zcfSeat.d.ts +4 -2
- package/src/contractFacet/zcfSeat.d.ts.map +1 -1
- package/src/contractFacet/zcfSeat.js +130 -7
- package/src/contractFacet/zcfZygote.d.ts +1 -2
- package/src/contractFacet/zcfZygote.d.ts.map +1 -1
- package/src/contractFacet/zcfZygote.js +102 -48
- 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 +33 -18
- package/src/contractSupport/priceAuthorityInitial.d.ts +3 -2
- package/src/contractSupport/priceAuthorityInitial.d.ts.map +1 -1
- package/src/contractSupport/priceAuthorityInitial.js +6 -3
- 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 +13 -11
- 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 +33 -119
- 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 +6 -12
- 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 +3 -3
- 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 +3 -2
- 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 +9 -5
- 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 +2 -1
- 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 +6 -2
- package/src/contracts/oracle.d.ts.map +1 -1
- package/src/contracts/oracle.js +10 -3
- 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 +25 -17
- package/src/contracts/priceAggregator.d.ts.map +1 -1
- package/src/contracts/priceAggregator.js +33 -32
- package/src/contracts/priceAggregatorTypes.d.ts +2 -2
- package/src/contracts/priceAggregatorTypes.d.ts.map +1 -1
- package/src/contracts/scaledPriceAuthority.d.ts +3 -4
- 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 +3 -4
- 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 +21 -32
- package/src/internal-types.d.ts.map +1 -1
- package/src/internal-types.js +19 -58
- package/src/issuerRecord.d.ts +1 -1
- package/src/issuerRecord.d.ts.map +1 -1
- package/src/issuerStorage.d.ts +3 -3
- 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 +114 -20
- package/src/typeGuards.d.ts.map +1 -1
- package/src/typeGuards.js +19 -20
- package/src/types-ambient.d.ts +41 -0
- package/src/types-ambient.d.ts.map +1 -0
- package/src/{types.js → types-ambient.js} +7 -15
- 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 +2 -1
- package/src/zoeService/internal-types.d.ts +12 -12
- 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 +82 -37
- package/src/zoeService/{types.d.ts → types-ambient.d.ts} +23 -28
- 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 +57 -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 +14 -8
- package/src/zoeService/zoe.d.ts.map +1 -1
- package/src/zoeService/zoe.js +39 -11
- package/src/zoeService/zoeSeat.d.ts +15 -45
- package/src/zoeService/zoeSeat.d.ts.map +1 -1
- package/src/zoeService/zoeSeat.js +215 -115
- package/src/zoeService/zoeStorageManager.d.ts +13 -47
- package/src/zoeService/zoeStorageManager.d.ts.map +1 -1
- package/src/zoeService/zoeStorageManager.js +13 -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 +16 -3
- package/tools/manualTimer.d.ts +17 -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 +8 -3
- package/tools/setup-zoe.d.ts +10 -6
- 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 -1171
- 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
package/src/internal-types.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
// @jessie-check
|
|
2
|
+
/// <reference types="@agoric/ertp/exported" />
|
|
2
3
|
|
|
3
4
|
/**
|
|
4
5
|
* @typedef {object} SeatData
|
|
@@ -53,13 +54,16 @@
|
|
|
53
54
|
*/
|
|
54
55
|
|
|
55
56
|
/**
|
|
56
|
-
* @typedef
|
|
57
|
+
* @typedef ZoeSeatAdminMethods
|
|
57
58
|
* @property {(allocation: Allocation) => void} replaceAllocation
|
|
58
59
|
* @property {ZoeSeatAdminExit} exit
|
|
59
|
-
* @property {ShutdownWithFailure} fail called with the reason
|
|
60
|
+
* @property {import('@agoric/swingset-vat').ShutdownWithFailure} fail called with the reason
|
|
60
61
|
* for calling fail on this seat, where reason is normally an instanceof Error.
|
|
61
62
|
* @property {() => Subscriber<AmountKeywordRecord>} getExitSubscriber
|
|
62
63
|
*/
|
|
64
|
+
/**
|
|
65
|
+
* @typedef {import('@endo/marshal').RemotableObject & ZoeSeatAdminMethods} ZoeSeatAdmin
|
|
66
|
+
*/
|
|
63
67
|
|
|
64
68
|
/**
|
|
65
69
|
* @callback {(brand: Brand) => AssetKind} GetAssetKind
|
|
@@ -67,7 +71,7 @@
|
|
|
67
71
|
|
|
68
72
|
/**
|
|
69
73
|
* @typedef {object} HandleOfferResult
|
|
70
|
-
* @property {Promise<
|
|
74
|
+
* @property {Promise<import('@endo/marshal').Passable>} offerResultPromise
|
|
71
75
|
* @property {ExitObj} exitObj
|
|
72
76
|
*/
|
|
73
77
|
|
|
@@ -92,7 +96,7 @@
|
|
|
92
96
|
* @property {() => string[]} getOfferFilter
|
|
93
97
|
* @property {() => Installation} getInstallation
|
|
94
98
|
* @property {(completion: Completion) => void} exitAllSeats
|
|
95
|
-
* @property {ShutdownWithFailure} failAllSeats
|
|
99
|
+
* @property {import('@agoric/swingset-vat').ShutdownWithFailure} failAllSeats
|
|
96
100
|
* @property {() => void} stopAcceptingOffers
|
|
97
101
|
* @property {(string: string) => boolean} isBlocked
|
|
98
102
|
* @property {(handleOfferObj: HandleOfferObj, publicFacet: unknown) => void} initDelayedState
|
|
@@ -122,21 +126,22 @@
|
|
|
122
126
|
/**
|
|
123
127
|
* @typedef {object} ZoeInstanceAdmin
|
|
124
128
|
* @property {ZoeInstanceAdminMakeInvitation} makeInvitation
|
|
125
|
-
* @property {(issuerP: ERef<
|
|
129
|
+
* @property {<I extends Issuer>(issuerP: ERef<I>,
|
|
126
130
|
* keyword: Keyword
|
|
127
|
-
* ) => Promise<IssuerRecord>} saveIssuer
|
|
131
|
+
* ) => Promise<I extends Issuer<infer K, infer M> ? IssuerRecord<K, M> : never>} saveIssuer
|
|
128
132
|
* @property {MakeZoeMint} makeZoeMint
|
|
129
133
|
* @property {RegisterFeeMint} registerFeeMint
|
|
130
134
|
* @property {MakeNoEscrowSeat} makeNoEscrowSeat
|
|
131
135
|
* @property {ReplaceAllocations} replaceAllocations
|
|
132
136
|
* @property {(completion: Completion) => void} exitAllSeats
|
|
133
|
-
* @property {ShutdownWithFailure} failAllSeats
|
|
137
|
+
* @property {import('@agoric/swingset-vat').ShutdownWithFailure} failAllSeats
|
|
134
138
|
* @property {(seatHandle: SeatHandle, completion: Completion) => void} exitSeat
|
|
135
139
|
* @property {(seatHandle: SeatHandle, reason: Error) => void} failSeat
|
|
136
140
|
* @property {() => void} stopAcceptingOffers
|
|
137
141
|
* @property {(strings: Array<string>) => void} setOfferFilter
|
|
138
142
|
* @property {() => Array<string>} getOfferFilter
|
|
139
143
|
* @property {(seatHandle: SeatHandle) => Subscriber<AmountKeywordRecord>} getExitSubscriber
|
|
144
|
+
* @property {() => void} repairContractCompletionWatcher
|
|
140
145
|
*/
|
|
141
146
|
|
|
142
147
|
/**
|
|
@@ -159,7 +164,7 @@
|
|
|
159
164
|
* @param {Keyword} keyword
|
|
160
165
|
* @param {AssetKind} [assetKind]
|
|
161
166
|
* @param {AdditionalDisplayInfo} [displayInfo]
|
|
162
|
-
* @param {IssuerOptionsRecord} [options]
|
|
167
|
+
* @param {import('@agoric/ertp').IssuerOptionsRecord} [options]
|
|
163
168
|
* @returns {ZoeMint}
|
|
164
169
|
*/
|
|
165
170
|
|
|
@@ -204,7 +209,7 @@
|
|
|
204
209
|
/**
|
|
205
210
|
* @typedef {object} ExecuteContractResult
|
|
206
211
|
* @property {object} creatorFacet
|
|
207
|
-
* @property {Promise<Invitation>} creatorInvitation
|
|
212
|
+
* @property {Promise<Invitation>} [creatorInvitation]
|
|
208
213
|
* @property {object} publicFacet
|
|
209
214
|
* @property {HandleOfferObj} handleOfferObj
|
|
210
215
|
*/
|
|
@@ -280,19 +285,6 @@
|
|
|
280
285
|
* @property {(zcfSeat: ZCFSeat, newAllocation: Allocation) => void} reallocate
|
|
281
286
|
*/
|
|
282
287
|
|
|
283
|
-
/**
|
|
284
|
-
* @callback CreateSeatManager
|
|
285
|
-
*
|
|
286
|
-
* The SeatManager holds the active zcfSeats and can reallocate and
|
|
287
|
-
* make new zcfSeats.
|
|
288
|
-
*
|
|
289
|
-
* @param {ERef<ZoeInstanceAdmin>} zoeInstanceAdmin
|
|
290
|
-
* @param {GetAssetKindByBrand} getAssetKindByBrand
|
|
291
|
-
* @param {ShutdownWithFailure} shutdownWithFailure
|
|
292
|
-
* @param {import('@agoric/vat-data').Baggage} zcfBaggage
|
|
293
|
-
* @returns {{ seatManager: ZcfSeatManager, zcfMintReallocator: ZcfMintReallocator }}
|
|
294
|
-
*/
|
|
295
|
-
|
|
296
288
|
/**
|
|
297
289
|
* @callback InstanceStateAddIssuer
|
|
298
290
|
*
|
|
@@ -304,44 +296,13 @@
|
|
|
304
296
|
* @returns {void}
|
|
305
297
|
*/
|
|
306
298
|
|
|
307
|
-
/**
|
|
308
|
-
* @callback InstanceStateGetTerms
|
|
309
|
-
* @returns {AnyTerms}
|
|
310
|
-
*/
|
|
311
|
-
|
|
312
|
-
/**
|
|
313
|
-
* @callback InstanceStateGetInstallation
|
|
314
|
-
* @returns {Installation}
|
|
315
|
-
*/
|
|
316
|
-
|
|
317
|
-
/**
|
|
318
|
-
* @callback InstanceRecordGetIssuers
|
|
319
|
-
* @returns {IssuerKeywordRecord}
|
|
320
|
-
*/
|
|
321
|
-
|
|
322
|
-
/**
|
|
323
|
-
* @callback InstanceRecordGetBrands
|
|
324
|
-
* @returns {BrandKeywordRecord}
|
|
325
|
-
*/
|
|
326
|
-
|
|
327
299
|
/**
|
|
328
300
|
* @typedef {object} InstanceState
|
|
329
301
|
* @property {InstanceStateAddIssuer} addIssuer
|
|
330
|
-
* @property {
|
|
331
|
-
* @property {
|
|
332
|
-
* @property {
|
|
333
|
-
* @property {
|
|
334
|
-
* @property {
|
|
302
|
+
* @property {() => InstanceRecord} getInstanceRecord
|
|
303
|
+
* @property {() => AnyTerms} getTerms
|
|
304
|
+
* @property {() => Installation} getInstallation
|
|
305
|
+
* @property {() => IssuerKeywordRecord} getIssuers
|
|
306
|
+
* @property {() => BrandKeywordRecord} getBrands
|
|
335
307
|
* @property {(keyword: Keyword) => void} assertUniqueKeyword
|
|
336
308
|
*/
|
|
337
|
-
|
|
338
|
-
/**
|
|
339
|
-
* @callback GetInstanceRecord
|
|
340
|
-
* @returns {InstanceRecord}
|
|
341
|
-
*/
|
|
342
|
-
|
|
343
|
-
/**
|
|
344
|
-
* @callback IssuerStorageGetIssuerRecords
|
|
345
|
-
* @param {Issuer[]} issuers
|
|
346
|
-
* @returns {IssuerRecords}
|
|
347
|
-
*/
|
package/src/issuerRecord.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
export function makeIssuerRecord<K extends AssetKind>(brand: Brand<K>, issuer: Issuer<K>, displayInfo: DisplayInfo<K>): IssuerRecord<K>;
|
|
2
|
-
export function assertFullIssuerRecord(issuerRecord: IssuerRecord): asserts issuerRecord is Required<IssuerRecord
|
|
2
|
+
export function assertFullIssuerRecord(issuerRecord: IssuerRecord): asserts issuerRecord is Required<IssuerRecord>;
|
|
3
3
|
//# sourceMappingURL=issuerRecord.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"issuerRecord.d.ts","sourceRoot":"","sources":["issuerRecord.js"],"names":[],"mappings":"AAaO,
|
|
1
|
+
{"version":3,"file":"issuerRecord.d.ts","sourceRoot":"","sources":["issuerRecord.js"],"names":[],"mappings":"AAaO,iCANkB,CAAC,SAAZ,SAAU,SACb,KAAK,CAAC,CAAC,CAAC,UACR,MAAM,CAAC,CAAC,CAAC,eACT,WAAW,CAAC,CAAC,CAAC,GACZ,YAAY,CAAC,CAAC,CAAC,CAQxB;AAMG,qDAHI,YAAY,GACV,QAAQ,YAAY,IAAI,QAAQ,CAAC,YAAY,CAAC,CAM1D"}
|
package/src/issuerStorage.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export function provideIssuerStorage(zcfBaggage:
|
|
1
|
+
export function provideIssuerStorage(zcfBaggage: import("@agoric/vat-data").Baggage): {
|
|
2
2
|
storeIssuerKeywordRecord: (uncleanIssuerKeywordRecord: IssuerKeywordRecord) => Promise<{
|
|
3
3
|
issuers: IssuerKeywordRecord;
|
|
4
4
|
brands: BrandKeywordRecord;
|
|
@@ -7,8 +7,8 @@ export function provideIssuerStorage(zcfBaggage: MapStore<string, unknown>): {
|
|
|
7
7
|
storeIssuerRecord: (issuerRecord: IssuerRecord) => IssuerRecord;
|
|
8
8
|
getAssetKindByBrand: GetAssetKindByBrand;
|
|
9
9
|
getBrandForIssuer: <K extends AssetKind>(issuer: Issuer<K>) => Brand<K>;
|
|
10
|
-
getIssuerForBrand: <
|
|
11
|
-
getIssuerRecords:
|
|
10
|
+
getIssuerForBrand: <K extends AssetKind>(brand: Brand<K>) => Issuer<K>;
|
|
11
|
+
getIssuerRecords: (issuers: Issuer[]) => IssuerRecords;
|
|
12
12
|
instantiate: (issuerRecords?: any[]) => void;
|
|
13
13
|
};
|
|
14
14
|
//# sourceMappingURL=issuerStorage.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"issuerStorage.d.ts","sourceRoot":"","sources":["issuerStorage.js"],"names":[],"mappings":"AAgBO;
|
|
1
|
+
{"version":3,"file":"issuerStorage.d.ts","sourceRoot":"","sources":["issuerStorage.js"],"names":[],"mappings":"AAgBO,iDAFI,OAAO,kBAAkB,EAAE,OAAO;2DAwHhC,mBAAmB,KACjB,OAAO,CAAC;QAAE,OAAO,EAAE,mBAAmB,CAAC;QACnD,MAA4B,EAAE,kBAAkB,CAAA;KAAE,CAAC;2BAnDzC,IAAI,CAAC,MAAM,CAAC,KACV,OAAO,CAAC,YAAY,CAAC;sCAzBvB,YAAY,KACV,YAAY;;wBAyFA,CAAC,SAAZ,SAAU,UACb,MAAM,CAAC,CAAC,CAAC,KACP,KAAK,CAAC,CAAC,CAAC;wBASI,CAAC,SAAZ,SAAU,SACb,KAAK,CAAC,CAAC,CAAC,KACN,MAAM,CAAC,CAAC,CAAC;gCASX,MAAM,EAAE,KACN,aAAa;;EAyB3B"}
|
package/src/issuerStorage.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
+
import { deeplyFulfilledObject, objectMap } from '@agoric/internal';
|
|
1
2
|
import { provideDurableWeakMapStore } from '@agoric/vat-data';
|
|
2
3
|
import { E } from '@endo/eventual-send';
|
|
3
4
|
|
|
4
|
-
import { arrayToObj } from './objArrayConversion.js';
|
|
5
5
|
import { cleanKeywords } from './cleanProposal.js';
|
|
6
6
|
import { makeIssuerRecord } from './issuerRecord.js';
|
|
7
7
|
|
|
@@ -124,11 +124,6 @@ export const provideIssuerStorage = zcfBaggage => {
|
|
|
124
124
|
return getByBrand(brand);
|
|
125
125
|
};
|
|
126
126
|
|
|
127
|
-
const storeIssuers = issuers => {
|
|
128
|
-
assertInstantiated();
|
|
129
|
-
return Promise.all(issuers.map(storeIssuer));
|
|
130
|
-
};
|
|
131
|
-
|
|
132
127
|
/** @type {GetAssetKindByBrand} */
|
|
133
128
|
const getAssetKindByBrand = brand => {
|
|
134
129
|
assertInstantiated();
|
|
@@ -143,28 +138,14 @@ export const provideIssuerStorage = zcfBaggage => {
|
|
|
143
138
|
*/
|
|
144
139
|
const storeIssuerKeywordRecord = async uncleanIssuerKeywordRecord => {
|
|
145
140
|
assertInstantiated();
|
|
146
|
-
|
|
147
|
-
const
|
|
148
|
-
|
|
149
|
-
);
|
|
150
|
-
// The issuers may not have been seen before, so we must wait for the
|
|
151
|
-
// issuer records to be available synchronously
|
|
152
|
-
const issuerRecords = await storeIssuers(issuerPs);
|
|
153
|
-
// AWAIT ///
|
|
154
|
-
|
|
155
|
-
const issuers = arrayToObj(
|
|
156
|
-
issuerRecords.map(record => record.issuer),
|
|
157
|
-
keywords,
|
|
141
|
+
cleanKeywords(uncleanIssuerKeywordRecord);
|
|
142
|
+
const issuerRecordPs = objectMap(uncleanIssuerKeywordRecord, issuerP =>
|
|
143
|
+
storeIssuer(issuerP),
|
|
158
144
|
);
|
|
159
|
-
const
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
);
|
|
163
|
-
|
|
164
|
-
return harden({
|
|
165
|
-
issuers,
|
|
166
|
-
brands,
|
|
167
|
-
});
|
|
145
|
+
const issuerRecords = await deeplyFulfilledObject(issuerRecordPs);
|
|
146
|
+
const issuers = objectMap(issuerRecords, ({ issuer }) => issuer);
|
|
147
|
+
const brands = objectMap(issuerRecords, ({ brand }) => brand);
|
|
148
|
+
return harden({ issuers, brands });
|
|
168
149
|
};
|
|
169
150
|
|
|
170
151
|
/**
|
|
@@ -189,7 +170,10 @@ export const provideIssuerStorage = zcfBaggage => {
|
|
|
189
170
|
return brandToIssuerRecord.get(brand).issuer;
|
|
190
171
|
};
|
|
191
172
|
|
|
192
|
-
/**
|
|
173
|
+
/**
|
|
174
|
+
* @param {Issuer[]} issuers
|
|
175
|
+
* @returns {IssuerRecords}
|
|
176
|
+
*/
|
|
193
177
|
const getIssuerRecords = issuers => {
|
|
194
178
|
assertInstantiated();
|
|
195
179
|
return issuers.map(issuerToIssuerRecord.get);
|
package/src/makeHandle.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export function defineDurableHandle<H extends string>(baggage:
|
|
1
|
+
export function defineDurableHandle<H extends string>(baggage: Baggage, handleType: H): H extends "Instance" ? () => Instance : () => Handle<H>;
|
|
2
2
|
export function makeHandle<H extends string>(handleType: H): H extends "Instance" ? Instance : Handle<H>;
|
|
3
|
-
|
|
3
|
+
import type { Baggage } from '@agoric/vat-data';
|
|
4
4
|
//# sourceMappingURL=makeHandle.d.ts.map
|
package/src/makeHandle.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"makeHandle.d.ts","sourceRoot":"","sources":["makeHandle.js"],"names":[],"mappings":"AAkBO,
|
|
1
|
+
{"version":3,"file":"makeHandle.d.ts","sourceRoot":"","sources":["makeHandle.js"],"names":[],"mappings":"AAkBO,oCALe,CAAC,SAAV,MAAQ,WACV,OAAO,cACP,CAAC,GACC,CAAC,SAAS,UAAU,GAAG,MAAM,QAAQ,GAAG,MAAM,MAAM,CAAC,CAAC,CAAC,CAanE;AAUM,2BAJe,CAAC,SAAV,MAAQ,cACV,CAAC,GACC,CAAC,SAAS,UAAU,GAAG,QAAQ,GAAG,MAAM,CAAC,CAAC,CAAC,CAOvD;6BAlC0B,kBAAkB"}
|
package/src/makeHandle.js
CHANGED
package/src/typeGuards.d.ts
CHANGED
|
@@ -18,53 +18,147 @@ export namespace TermsShape {
|
|
|
18
18
|
export namespace InstanceRecordShape {
|
|
19
19
|
export { InstallationShape as installation };
|
|
20
20
|
export { InstanceHandleShape as instance };
|
|
21
|
-
export
|
|
21
|
+
export let terms: import("@endo/patterns").Matcher;
|
|
22
22
|
}
|
|
23
|
-
export const HandleI: import("@endo/patterns").InterfaceGuard
|
|
23
|
+
export const HandleI: import("@endo/patterns").InterfaceGuard<{}>;
|
|
24
24
|
export function makeHandleShape(name: any): import("@endo/patterns").Matcher;
|
|
25
25
|
export const TimerShape: import("@endo/patterns").Matcher;
|
|
26
26
|
export namespace FullProposalShape {
|
|
27
27
|
export { AmountPatternKeywordRecordShape as want };
|
|
28
28
|
export { AmountKeywordRecordShape as give };
|
|
29
|
-
export
|
|
29
|
+
export let exit: import("@endo/patterns").Matcher;
|
|
30
30
|
}
|
|
31
31
|
/** @see {Proposal} type */
|
|
32
32
|
export const ProposalShape: import("@endo/patterns").Matcher;
|
|
33
|
+
export const EmptyProposalShape: import("@endo/patterns").Matcher;
|
|
33
34
|
export function isOnDemandExitRule(exit: any): boolean;
|
|
34
35
|
export function isWaivedExitRule(exit: ExitRule): exit is WaivedExitRule;
|
|
35
36
|
export function isAfterDeadlineExitRule(exit: ExitRule): exit is AfterDeadlineExitRule;
|
|
36
37
|
export const InvitationElementShape: import("@endo/patterns").Matcher;
|
|
37
|
-
export const OfferHandlerI: import("@endo/patterns").InterfaceGuard
|
|
38
|
+
export const OfferHandlerI: import("@endo/patterns").InterfaceGuard<{
|
|
39
|
+
handle: import("@endo/patterns").MethodGuard;
|
|
40
|
+
}>;
|
|
38
41
|
export const SeatHandleAllocationsShape: import("@endo/patterns").Matcher;
|
|
39
42
|
export const ZoeMintShape: import("@endo/patterns").Matcher;
|
|
40
|
-
export const ZoeMintI: import("@endo/patterns").InterfaceGuard
|
|
41
|
-
|
|
43
|
+
export const ZoeMintI: import("@endo/patterns").InterfaceGuard<{
|
|
44
|
+
getIssuerRecord: import("@endo/patterns").MethodGuard;
|
|
45
|
+
mintAndEscrow: import("@endo/patterns").MethodGuard;
|
|
46
|
+
withdrawAndBurn: import("@endo/patterns").MethodGuard;
|
|
47
|
+
}>;
|
|
42
48
|
export const FeeMintAccessShape: import("@endo/patterns").Matcher;
|
|
43
|
-
export const ExitObjectI: import("@endo/patterns").InterfaceGuard
|
|
49
|
+
export const ExitObjectI: import("@endo/patterns").InterfaceGuard<{
|
|
50
|
+
exit: import("@endo/patterns").MethodGuard;
|
|
51
|
+
}>;
|
|
44
52
|
export const ExitObjectShape: import("@endo/patterns").Matcher;
|
|
45
53
|
export const InstanceAdminShape: import("@endo/patterns").Matcher;
|
|
46
|
-
export const InstanceAdminI: import("@endo/patterns").InterfaceGuard
|
|
54
|
+
export const InstanceAdminI: import("@endo/patterns").InterfaceGuard<{
|
|
55
|
+
makeInvitation: import("@endo/patterns").MethodGuard;
|
|
56
|
+
saveIssuer: import("@endo/patterns").MethodGuard;
|
|
57
|
+
makeNoEscrowSeat: import("@endo/patterns").MethodGuard;
|
|
58
|
+
exitAllSeats: import("@endo/patterns").MethodGuard;
|
|
59
|
+
failAllSeats: import("@endo/patterns").MethodGuard;
|
|
60
|
+
exitSeat: import("@endo/patterns").MethodGuard;
|
|
61
|
+
failSeat: import("@endo/patterns").MethodGuard;
|
|
62
|
+
makeZoeMint: import("@endo/patterns").MethodGuard;
|
|
63
|
+
registerFeeMint: import("@endo/patterns").MethodGuard;
|
|
64
|
+
replaceAllocations: import("@endo/patterns").MethodGuard;
|
|
65
|
+
stopAcceptingOffers: import("@endo/patterns").MethodGuard;
|
|
66
|
+
setOfferFilter: import("@endo/patterns").MethodGuard;
|
|
67
|
+
getOfferFilter: import("@endo/patterns").MethodGuard;
|
|
68
|
+
getExitSubscriber: import("@endo/patterns").MethodGuard;
|
|
69
|
+
isBlocked: import("@endo/patterns").MethodGuard;
|
|
70
|
+
repairContractCompletionWatcher: import("@endo/patterns").MethodGuard;
|
|
71
|
+
}>;
|
|
47
72
|
export namespace InstanceStorageManagerIKit {
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
73
|
+
let instanceStorageManager: import("@endo/patterns").InterfaceGuard<{
|
|
74
|
+
getTerms: import("@endo/patterns").MethodGuard;
|
|
75
|
+
getIssuers: import("@endo/patterns").MethodGuard;
|
|
76
|
+
getBrands: import("@endo/patterns").MethodGuard;
|
|
77
|
+
getInstallation: import("@endo/patterns").MethodGuard;
|
|
78
|
+
getInvitationIssuer: import("@endo/patterns").MethodGuard;
|
|
79
|
+
saveIssuer: import("@endo/patterns").MethodGuard;
|
|
80
|
+
makeZoeMint: import("@endo/patterns").MethodGuard;
|
|
81
|
+
registerFeeMint: import("@endo/patterns").MethodGuard;
|
|
82
|
+
getInstanceRecord: import("@endo/patterns").MethodGuard;
|
|
83
|
+
getIssuerRecords: import("@endo/patterns").MethodGuard;
|
|
84
|
+
getWithdrawFacet: import("@endo/patterns").MethodGuard;
|
|
85
|
+
initInstanceAdmin: import("@endo/patterns").MethodGuard;
|
|
86
|
+
deleteInstanceAdmin: import("@endo/patterns").MethodGuard;
|
|
87
|
+
makeInvitation: import("@endo/patterns").MethodGuard;
|
|
88
|
+
getRoot: import("@endo/patterns").MethodGuard;
|
|
89
|
+
getAdminNode: import("@endo/patterns").MethodGuard;
|
|
90
|
+
}>;
|
|
91
|
+
let withdrawFacet: import("@endo/patterns").InterfaceGuard<{
|
|
92
|
+
withdrawPayments: import("@endo/patterns").MethodGuard;
|
|
93
|
+
}>;
|
|
94
|
+
let helpers: import("@endo/patterns").InterfaceGuard<{
|
|
95
|
+
wrapIssuerKitWithZoeMint: import("@endo/patterns").MethodGuard;
|
|
96
|
+
}>;
|
|
51
97
|
}
|
|
52
98
|
export const BundleCapShape: import("@endo/patterns").Matcher;
|
|
53
99
|
export const BundleShape: import("@endo/patterns").Matcher;
|
|
54
100
|
export const UnwrappedInstallationShape: import("@endo/patterns").Matcher;
|
|
55
101
|
export namespace ZoeStorageManagerIKit {
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
102
|
+
let zoeServiceDataAccess: import("@endo/patterns").InterfaceGuard<{
|
|
103
|
+
getTerms: import("@endo/patterns").MethodGuard;
|
|
104
|
+
getIssuers: import("@endo/patterns").MethodGuard;
|
|
105
|
+
getBrands: import("@endo/patterns").MethodGuard;
|
|
106
|
+
getInstallation: import("@endo/patterns").MethodGuard;
|
|
107
|
+
getInvitationIssuer: import("@endo/patterns").MethodGuard;
|
|
108
|
+
getBundleIDFromInstallation: import("@endo/patterns").MethodGuard;
|
|
109
|
+
installBundle: import("@endo/patterns").MethodGuard;
|
|
110
|
+
installBundleID: import("@endo/patterns").MethodGuard;
|
|
111
|
+
getPublicFacet: import("@endo/patterns").MethodGuard;
|
|
112
|
+
getOfferFilter: import("@endo/patterns").MethodGuard;
|
|
113
|
+
getProposalShapeForInvitation: import("@endo/patterns").MethodGuard;
|
|
114
|
+
}>;
|
|
115
|
+
let makeOfferAccess: import("@endo/patterns").InterfaceGuard<{
|
|
116
|
+
getAssetKindByBrand: import("@endo/patterns").MethodGuard;
|
|
117
|
+
getInstanceAdmin: import("@endo/patterns").MethodGuard;
|
|
118
|
+
getProposalShapeForInvitation: import("@endo/patterns").MethodGuard;
|
|
119
|
+
getInvitationIssuer: import("@endo/patterns").MethodGuard;
|
|
120
|
+
depositPayments: import("@endo/patterns").MethodGuard;
|
|
121
|
+
}>;
|
|
122
|
+
let startInstanceAccess: import("@endo/patterns").InterfaceGuard<{
|
|
123
|
+
makeZoeInstanceStorageManager: import("@endo/patterns").MethodGuard;
|
|
124
|
+
unwrapInstallation: import("@endo/patterns").MethodGuard;
|
|
125
|
+
}>;
|
|
126
|
+
let invitationIssuerAccess: import("@endo/patterns").InterfaceGuard<{
|
|
127
|
+
getInvitationIssuer: import("@endo/patterns").MethodGuard;
|
|
128
|
+
}>;
|
|
60
129
|
}
|
|
61
|
-
export const ZoeServiceI: import("@endo/patterns").InterfaceGuard
|
|
62
|
-
|
|
130
|
+
export const ZoeServiceI: import("@endo/patterns").InterfaceGuard<{
|
|
131
|
+
install: import("@endo/patterns").MethodGuard;
|
|
132
|
+
installBundleID: import("@endo/patterns").MethodGuard;
|
|
133
|
+
startInstance: import("@endo/patterns").MethodGuard;
|
|
134
|
+
offer: import("@endo/patterns").MethodGuard;
|
|
135
|
+
getOfferFilter: import("@endo/patterns").MethodGuard;
|
|
136
|
+
getInvitationIssuer: import("@endo/patterns").MethodGuard;
|
|
137
|
+
getFeeIssuer: import("@endo/patterns").MethodGuard;
|
|
138
|
+
getBrands: import("@endo/patterns").MethodGuard;
|
|
139
|
+
getIssuers: import("@endo/patterns").MethodGuard;
|
|
140
|
+
getPublicFacet: import("@endo/patterns").MethodGuard;
|
|
141
|
+
getTerms: import("@endo/patterns").MethodGuard;
|
|
142
|
+
getInstallationForInstance: import("@endo/patterns").MethodGuard;
|
|
143
|
+
getBundleIDFromInstallation: import("@endo/patterns").MethodGuard;
|
|
144
|
+
getInstallation: import("@endo/patterns").MethodGuard;
|
|
145
|
+
getInstance: import("@endo/patterns").MethodGuard;
|
|
146
|
+
getConfiguration: import("@endo/patterns").MethodGuard;
|
|
147
|
+
getInvitationDetails: import("@endo/patterns").MethodGuard;
|
|
148
|
+
getProposalShapeForInvitation: import("@endo/patterns").MethodGuard;
|
|
149
|
+
}>;
|
|
150
|
+
export const AdminFacetI: import("@endo/patterns").InterfaceGuard<{
|
|
151
|
+
getVatShutdownPromise: import("@endo/patterns").MethodGuard;
|
|
152
|
+
restartContract: import("@endo/patterns").MethodGuard;
|
|
153
|
+
upgradeContract: import("@endo/patterns").MethodGuard;
|
|
154
|
+
}>;
|
|
63
155
|
export const SeatDataShape: import("@endo/patterns").Matcher;
|
|
64
|
-
export const HandleOfferI: import("@endo/patterns").InterfaceGuard
|
|
156
|
+
export const HandleOfferI: import("@endo/patterns").InterfaceGuard<{
|
|
157
|
+
handleOffer: import("@endo/patterns").MethodGuard;
|
|
158
|
+
}>;
|
|
65
159
|
export namespace PriceQuoteShape {
|
|
66
160
|
export { AmountShape as quoteAmount };
|
|
67
|
-
export
|
|
161
|
+
export let quotePayment: globalThis.Pattern;
|
|
68
162
|
}
|
|
69
|
-
import { AmountShape } from
|
|
163
|
+
import { AmountShape } from '@agoric/ertp';
|
|
70
164
|
//# sourceMappingURL=typeGuards.d.ts.map
|
package/src/typeGuards.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"typeGuards.d.ts","sourceRoot":"","sources":["typeGuards.js"],"names":[],"mappings":"AAgBA,4DAAuC;AAEvC,qEAAqE;AACrE,+DAAyD;AACzD,mEAAiE;AACjE,iEAA6D;AAC7D,yDAA6C;AAE7C,wEAA8E;AAC9E,+EAGE;AACF,0EAGE;AACF,wEAA8E;AAC9E,yEAGE;AACF,uEAA4E;AAE5E,iEAOE;;;;;;;;;;AAaF,
|
|
1
|
+
{"version":3,"file":"typeGuards.d.ts","sourceRoot":"","sources":["typeGuards.js"],"names":[],"mappings":"AAgBA,4DAAuC;AAEvC,qEAAqE;AACrE,+DAAyD;AACzD,mEAAiE;AACjE,iEAA6D;AAC7D,yDAA6C;AAE7C,wEAA8E;AAC9E,+EAGE;AACF,0EAGE;AACF,wEAA8E;AAC9E,yEAGE;AACF,uEAA4E;AAE5E,iEAOE;;;;;;;;;;AAaF,kEAAiD;AAE1C,6EAA4D;AACnE,0DAAmD;;;;;;AA0BnD,2BAA2B;AAC3B,6DAAsE;AAEtE,kEAIG;AAEI,uDAGN;AAMM,uCAHI,QAAQ,GACN,IAAI,IAAI,cAAc,CAKlC;AAMM,8CAHI,QAAQ,GACN,IAAI,IAAI,qBAAqB,CAKzC;AAED,sEAKG;AAEH;;GAEG;AAEH,0EAKE;AAEF,4DAAmD;AACnD;;;;GAIG;AAEH,kEAA+D;AAE/D;;GAEG;AAEH,+DAAsD;AACtD,kEAA+D;AAC/D;;;;;;;;;;;;;;;;;GAkCG;;;;;;;;;;;;;;;;;;;;;;;;;;;AAiDH,8DAAuD;AACvD,2DAGE;AAEF,0EAUE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA8DF;;;;;;;;;;;;;;;;;;;GA6CG;AAEH;;;;GAIG;AAEH,6DASE;AAEF;;GAKG;;;;;4BAtXI,cAAc"}
|
package/src/typeGuards.js
CHANGED
|
@@ -90,6 +90,12 @@ export const FullProposalShape = harden({
|
|
|
90
90
|
/** @see {Proposal} type */
|
|
91
91
|
export const ProposalShape = M.splitRecord({}, FullProposalShape, {});
|
|
92
92
|
|
|
93
|
+
export const EmptyProposalShape = M.splitRecord({
|
|
94
|
+
give: {},
|
|
95
|
+
want: {},
|
|
96
|
+
exit: { onDemand: null },
|
|
97
|
+
});
|
|
98
|
+
|
|
93
99
|
export const isOnDemandExitRule = exit => {
|
|
94
100
|
const [exitKey] = Object.keys(exit);
|
|
95
101
|
return exitKey === 'onDemand';
|
|
@@ -121,7 +127,7 @@ export const InvitationElementShape = M.splitRecord({
|
|
|
121
127
|
});
|
|
122
128
|
|
|
123
129
|
export const OfferHandlerI = M.interface('OfferHandler', {
|
|
124
|
-
handle: M.call(SeatShape).optional(M.any()).returns(M.
|
|
130
|
+
handle: M.call(SeatShape).optional(M.any()).returns(M.any()),
|
|
125
131
|
});
|
|
126
132
|
|
|
127
133
|
export const SeatHandleAllocationsShape = M.arrayOf(
|
|
@@ -138,17 +144,6 @@ export const ZoeMintI = M.interface('ZoeMint', {
|
|
|
138
144
|
withdrawAndBurn: M.call(AmountShape).returns(),
|
|
139
145
|
});
|
|
140
146
|
|
|
141
|
-
export const ZcfMintI = M.interface('ZcfMint', {
|
|
142
|
-
getIssuerRecord: M.call().returns(IssuerRecordShape),
|
|
143
|
-
mintGains: M.call(AmountKeywordRecordShape)
|
|
144
|
-
.optional(M.remotable('zcfSeat'))
|
|
145
|
-
.returns(M.remotable('zcfSeat')),
|
|
146
|
-
burnLosses: M.call(
|
|
147
|
-
AmountKeywordRecordShape,
|
|
148
|
-
M.remotable('zcfSeat'),
|
|
149
|
-
).returns(),
|
|
150
|
-
});
|
|
151
|
-
|
|
152
147
|
export const FeeMintAccessShape = M.remotable('FeeMintAccess');
|
|
153
148
|
|
|
154
149
|
export const ExitObjectI = M.interface('Exit Object', {
|
|
@@ -190,6 +185,7 @@ export const InstanceAdminI = M.interface('InstanceAdmin', {
|
|
|
190
185
|
getOfferFilter: M.call().returns(M.arrayOf(M.string())),
|
|
191
186
|
getExitSubscriber: M.call(SeatShape).returns(SubscriberShape),
|
|
192
187
|
isBlocked: M.call(M.string()).returns(M.boolean()),
|
|
188
|
+
repairContractCompletionWatcher: M.call().returns(),
|
|
193
189
|
});
|
|
194
190
|
|
|
195
191
|
export const InstanceStorageManagerIKit = harden({
|
|
@@ -218,7 +214,7 @@ export const InstanceStorageManagerIKit = harden({
|
|
|
218
214
|
InstanceHandleShape,
|
|
219
215
|
M.remotable('instanceAdmin'),
|
|
220
216
|
).returns(M.promise()),
|
|
221
|
-
deleteInstanceAdmin: M.call(
|
|
217
|
+
deleteInstanceAdmin: M.call(InstanceAdminShape).returns(),
|
|
222
218
|
makeInvitation: M.call(InvitationHandleShape, M.string())
|
|
223
219
|
.optional(M.record(), M.pattern())
|
|
224
220
|
.returns(PaymentShape),
|
|
@@ -270,10 +266,12 @@ export const ZoeStorageManagerIKit = harden({
|
|
|
270
266
|
getBundleIDFromInstallation: M.call(InstallationShape).returns(
|
|
271
267
|
M.eref(M.string()),
|
|
272
268
|
),
|
|
273
|
-
installBundle: M.call(M.or(InstanceHandleShape, BundleShape))
|
|
274
|
-
M.
|
|
275
|
-
|
|
276
|
-
installBundleID: M.call(M.string())
|
|
269
|
+
installBundle: M.call(M.or(InstanceHandleShape, BundleShape))
|
|
270
|
+
.optional(M.string())
|
|
271
|
+
.returns(M.promise()),
|
|
272
|
+
installBundleID: M.call(M.string())
|
|
273
|
+
.optional(M.string())
|
|
274
|
+
.returns(M.promise()),
|
|
277
275
|
|
|
278
276
|
getPublicFacet: M.call(InstanceHandleShape).returns(
|
|
279
277
|
M.eref(M.remotable('PublicFacet')),
|
|
@@ -304,6 +302,7 @@ export const ZoeStorageManagerIKit = harden({
|
|
|
304
302
|
IssuerPKeywordRecordShape,
|
|
305
303
|
M.or(InstanceHandleShape, BundleShape),
|
|
306
304
|
M.or(BundleCapShape, BundleShape),
|
|
305
|
+
M.string(),
|
|
307
306
|
).returns(M.promise()),
|
|
308
307
|
unwrapInstallation: M.callWhen(M.eref(InstallationShape)).returns(
|
|
309
308
|
UnwrappedInstallationShape,
|
|
@@ -315,10 +314,10 @@ export const ZoeStorageManagerIKit = harden({
|
|
|
315
314
|
});
|
|
316
315
|
|
|
317
316
|
export const ZoeServiceI = M.interface('ZoeService', {
|
|
318
|
-
install: M.call(M.any()).returns(M.promise()),
|
|
319
|
-
installBundleID: M.call(M.string()).returns(M.promise()),
|
|
317
|
+
install: M.call(M.any()).optional(M.string()).returns(M.promise()),
|
|
318
|
+
installBundleID: M.call(M.string()).optional(M.string()).returns(M.promise()),
|
|
320
319
|
startInstance: M.call(M.eref(InstallationShape))
|
|
321
|
-
.optional(IssuerPKeywordRecordShape, M.
|
|
320
|
+
.optional(IssuerPKeywordRecordShape, M.record(), M.record(), M.string())
|
|
322
321
|
.returns(M.promise()),
|
|
323
322
|
offer: M.call(M.eref(InvitationShape))
|
|
324
323
|
.optional(ProposalShape, PaymentPKeywordRecordShape, M.any())
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Alias for RemotableObject
|
|
3
|
+
*/
|
|
4
|
+
type Handle<H extends string> = import("@endo/marshal").RemotableObject<H>;
|
|
5
|
+
type Keyword = string;
|
|
6
|
+
/**
|
|
7
|
+
* - an opaque handle for an invitation
|
|
8
|
+
*/
|
|
9
|
+
type InvitationHandle = Handle<"Invitation">;
|
|
10
|
+
type IssuerKeywordRecord = Record<Keyword, Issuer<any>>;
|
|
11
|
+
type IssuerPKeywordRecord = Record<Keyword, import("@endo/far").ERef<Issuer<any>>>;
|
|
12
|
+
type BrandKeywordRecord = Record<Keyword, Brand<any>>;
|
|
13
|
+
type StandardTerms = {
|
|
14
|
+
/**
|
|
15
|
+
* - record with
|
|
16
|
+
* keywords keys, issuer values
|
|
17
|
+
*/
|
|
18
|
+
issuers: IssuerKeywordRecord;
|
|
19
|
+
/**
|
|
20
|
+
* - record with keywords
|
|
21
|
+
* keys, brand values
|
|
22
|
+
*/
|
|
23
|
+
brands: BrandKeywordRecord;
|
|
24
|
+
};
|
|
25
|
+
type AnyTerms = StandardTerms & Record<string, any>;
|
|
26
|
+
type InstanceRecord = {
|
|
27
|
+
installation: import("./zoeService/utils.js").Installation<any>;
|
|
28
|
+
instance: import("./zoeService/utils.js").Instance<any>;
|
|
29
|
+
/**
|
|
30
|
+
* - contract parameters
|
|
31
|
+
*/
|
|
32
|
+
terms: AnyTerms;
|
|
33
|
+
};
|
|
34
|
+
type IssuerRecord<K extends AssetKind = globalThis.AssetKind, M extends import("@endo/patterns").Key = import("@endo/patterns").Key> = {
|
|
35
|
+
brand: Brand<K>;
|
|
36
|
+
issuer: Issuer<K, M>;
|
|
37
|
+
assetKind: K;
|
|
38
|
+
displayInfo?: globalThis.DisplayInfo<K> | undefined;
|
|
39
|
+
};
|
|
40
|
+
type Allocation = Record<Keyword, import("@agoric/ertp/src/types.js").AnyAmount>;
|
|
41
|
+
//# sourceMappingURL=types-ambient.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types-ambient.d.ts","sourceRoot":"","sources":["types-ambient.js"],"names":[],"mappings":";;;YAGsB,CAAC,SAAV,MAAQ,IACR,OAAO,eAAe,EAAE,eAAe,CAAC,CAAC,CAAC;eAI1C,MAAM;;;;wBACN,MAAM,CAAC,YAAY,CAAC;2BACpB,MAAM,CAAC,OAAO,EAAE,MAAM,CAAC,GAAG,CAAC,CAAC;4BAC5B,MAAM,CAAC,OAAO,EAAE,OAAO,WAAW,EAAE,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC;0BACtD,MAAM,CAAC,OAAO,EAAE,KAAK,CAAC,GAAG,CAAC,CAAC;;;;;;aAK1B,mBAAmB;;;;;YAEnB,kBAAkB;;gBAGnB,aAAa,GAAG,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC;;kBAGlC,OAAO,uBAAuB,EAAE,YAAY,CAAC,GAAG,CAAC;cACjD,OAAO,uBAAuB,EAAE,QAAQ,CAAC,GAAG,CAAC;;;;WAC7C,QAAQ;;kBAII,CAAC,SAAb,SAAU,yBACqB,CAAC,SAAjC,OAAQ,gBAAgB,EAAE,GAAI;WAE7B,KAAK,CAAC,CAAC,CAAC;YACR,MAAM,CAAC,CAAC,EAAE,CAAC,CAAC;eACZ,CAAC;;;kBAKF,MAAM,CAAC,OAAO,EAAE,OAAO,2BAA2B,EAAE,SAAS,CAAC"}
|
|
@@ -1,20 +1,15 @@
|
|
|
1
1
|
// @jessie-check
|
|
2
2
|
|
|
3
|
-
/// <reference types="ses"/>
|
|
4
|
-
|
|
5
3
|
/**
|
|
6
4
|
* @template {string} H - the name of the handle
|
|
7
|
-
* @typedef {
|
|
8
|
-
* identified by the H string. This uses an intersection type
|
|
9
|
-
* ('MyHandle' & {}) to tag the handle's type even though the actual
|
|
10
|
-
* value is just an empty object.
|
|
5
|
+
* @typedef {import('@endo/marshal').RemotableObject<H>} Handle Alias for RemotableObject
|
|
11
6
|
*/
|
|
12
7
|
|
|
13
8
|
/**
|
|
14
9
|
* @typedef {string} Keyword
|
|
15
10
|
* @typedef {Handle<'Invitation'>} InvitationHandle - an opaque handle for an invitation
|
|
16
11
|
* @typedef {Record<Keyword, Issuer<any>>} IssuerKeywordRecord
|
|
17
|
-
* @typedef {Record<Keyword, ERef<Issuer<any>>>} IssuerPKeywordRecord
|
|
12
|
+
* @typedef {Record<Keyword, import('@endo/far').ERef<Issuer<any>>>} IssuerPKeywordRecord
|
|
18
13
|
* @typedef {Record<Keyword, Brand<any>>} BrandKeywordRecord
|
|
19
14
|
*/
|
|
20
15
|
|
|
@@ -28,24 +23,21 @@
|
|
|
28
23
|
* @typedef {StandardTerms & Record<string, any>} AnyTerms
|
|
29
24
|
*
|
|
30
25
|
* @typedef {object} InstanceRecord
|
|
31
|
-
* @property {Installation} installation
|
|
32
|
-
* @property {import(
|
|
26
|
+
* @property {import('./zoeService/utils.js').Installation<any>} installation
|
|
27
|
+
* @property {import('./zoeService/utils.js').Instance<any>} instance
|
|
33
28
|
* @property {AnyTerms} terms - contract parameters
|
|
34
29
|
*/
|
|
35
30
|
|
|
36
31
|
/**
|
|
37
32
|
* @template {AssetKind} [K=AssetKind]
|
|
33
|
+
* @template {import('@endo/patterns').Key} [M=import('@endo/patterns').Key] member kind, for Amounts that have member values
|
|
38
34
|
* @typedef {object} IssuerRecord
|
|
39
35
|
* @property {Brand<K>} brand
|
|
40
|
-
* @property {Issuer<K>} issuer
|
|
36
|
+
* @property {Issuer<K, M>} issuer
|
|
41
37
|
* @property {K} assetKind
|
|
42
38
|
* @property {DisplayInfo<K>} [displayInfo]
|
|
43
|
-
*
|
|
44
|
-
* @typedef {AmountKeywordRecord} Allocation
|
|
45
39
|
*/
|
|
46
40
|
|
|
47
41
|
/**
|
|
48
|
-
* @
|
|
49
|
-
* @template {object} [A=never] Offer args
|
|
50
|
-
* @typedef {Payment<'set'>} Invitation
|
|
42
|
+
* @typedef {Record<Keyword, import('@agoric/ertp/src/types.js').AnyAmount>} Allocation
|
|
51
43
|
*/
|