@agoric/zoe 0.26.3-dev-ecf2d8e.0 → 0.26.3-other-dev-70beeb7.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/CHANGELOG.md +1179 -0
- package/README.md +7 -7
- package/bundles/bundle-contractFacet-js-meta.json +319 -543
- package/bundles/bundle-contractFacet.d.ts +3 -3
- package/bundles/bundle-contractFacet.js +1 -1
- package/exported.js +1 -1
- package/package.json +23 -30
- package/src/cleanProposal.js +2 -2
- 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/types.d.ts +191 -0
- package/src/contractFacet/types.d.ts.map +1 -0
- package/src/contractFacet/types.js +256 -0
- package/src/contractFacet/vatRoot.d.ts +1 -1
- package/src/contractFacet/vatRoot.d.ts.map +1 -1
- package/src/contractFacet/zcfMint.d.ts +1 -1
- package/src/contractFacet/zcfMint.d.ts.map +1 -1
- package/src/contractFacet/zcfMint.js +1 -2
- package/src/contractFacet/zcfSeat.d.ts.map +1 -1
- package/src/contractFacet/zcfSeat.js +3 -105
- package/src/contractFacet/zcfZygote.d.ts +1 -1
- package/src/contractFacet/zcfZygote.d.ts.map +1 -1
- package/src/contractFacet/zcfZygote.js +33 -78
- package/src/contractSupport/atomicTransfer.d.ts +6 -0
- package/src/contractSupport/atomicTransfer.d.ts.map +1 -1
- package/src/contractSupport/atomicTransfer.js +90 -5
- package/src/contractSupport/bondingCurves.js +2 -2
- package/src/contractSupport/durability.d.ts +2 -2
- package/src/contractSupport/durability.d.ts.map +1 -1
- package/src/contractSupport/durability.js +3 -3
- package/src/contractSupport/priceAuthority.d.ts +1 -16
- package/src/contractSupport/priceAuthority.d.ts.map +1 -1
- package/src/contractSupport/priceAuthority.js +1 -3
- package/src/contractSupport/priceAuthorityInitial.d.ts.map +1 -1
- package/src/contractSupport/priceAuthorityInitial.js +0 -1
- package/src/contractSupport/priceAuthorityQuoteMint.d.ts +1 -1
- package/src/contractSupport/priceAuthorityQuoteMint.d.ts.map +1 -1
- package/src/contractSupport/priceAuthorityTransform.d.ts.map +1 -1
- package/src/contractSupport/priceAuthorityTransform.js +3 -2
- package/src/contractSupport/recorder.d.ts +4 -4
- package/src/contractSupport/recorder.d.ts.map +1 -1
- package/src/contractSupport/safeMath.d.ts +7 -7
- package/src/contractSupport/safeMath.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/zoeHelpers.d.ts +1 -1
- package/src/contractSupport/zoeHelpers.d.ts.map +1 -1
- package/src/contractSupport/zoeHelpers.js +11 -5
- package/src/contracts/atomicSwap.d.ts +1 -1
- package/src/contracts/auction/firstPriceLogic.d.ts.map +1 -1
- package/src/contracts/auction/firstPriceLogic.js +7 -5
- package/src/contracts/auction/index.d.ts +23 -1
- package/src/contracts/auction/index.d.ts.map +1 -1
- package/src/contracts/auction/index.js +0 -1
- package/src/contracts/auction/secondPriceLogic.d.ts.map +1 -1
- package/src/contracts/auction/secondPriceLogic.js +3 -1
- package/src/contracts/automaticRefund.d.ts +3 -3
- package/src/contracts/autoswap.d.ts.map +1 -1
- package/src/contracts/autoswap.js +7 -4
- package/src/contracts/barterExchange.d.ts +2 -2
- package/src/contracts/barterExchange.d.ts.map +1 -1
- package/src/contracts/barterExchange.js +3 -2
- package/src/contracts/callSpread/calculateShares.d.ts +7 -0
- package/src/contracts/callSpread/calculateShares.d.ts.map +1 -1
- package/src/contracts/callSpread/fundedCallSpread.d.ts +1 -1
- package/src/contracts/callSpread/fundedCallSpread.d.ts.map +1 -1
- package/src/contracts/callSpread/fundedCallSpread.js +3 -1
- package/src/contracts/callSpread/payoffHandler.d.ts.map +1 -1
- package/src/contracts/callSpread/payoffHandler.js +0 -1
- package/src/contracts/callSpread/percent.d.ts +2 -0
- package/src/contracts/callSpread/percent.d.ts.map +1 -1
- package/src/contracts/callSpread/pricedCallSpread.d.ts +4 -4
- package/src/contracts/callSpread/pricedCallSpread.d.ts.map +1 -1
- package/src/contracts/callSpread/pricedCallSpread.js +3 -2
- package/src/contracts/coveredCall-durable.d.ts +3 -3
- package/src/contracts/coveredCall.d.ts +1 -1
- package/src/contracts/loan/borrow.d.ts.map +1 -1
- package/src/contracts/loan/borrow.js +3 -1
- package/src/contracts/loan/close.d.ts.map +1 -1
- package/src/contracts/loan/close.js +6 -2
- package/src/contracts/loan/index.d.ts +1 -1
- package/src/contracts/loan/liquidate.d.ts +12 -1
- package/src/contracts/loan/liquidate.d.ts.map +1 -1
- package/src/contracts/loan/liquidate.js +1 -3
- package/src/contracts/loan/scheduleLiquidation.d.ts.map +1 -1
- package/src/contracts/loan/scheduleLiquidation.js +0 -1
- package/src/contracts/loan/types.d.ts +1 -0
- package/src/contracts/loan/types.d.ts.map +1 -1
- package/src/contracts/loan/types.js +7 -0
- package/src/contracts/mintPayments.d.ts +6 -14
- package/src/contracts/mintPayments.d.ts.map +1 -1
- package/src/contracts/mintPayments.js +1 -1
- package/src/contracts/oracle.d.ts +2 -2
- package/src/contracts/oracle.d.ts.map +1 -1
- package/src/contracts/oracle.js +0 -3
- package/src/contracts/priceAggregator.d.ts +12 -2
- package/src/contracts/priceAggregator.d.ts.map +1 -1
- package/src/contracts/priceAggregator.js +2 -3
- package/src/contracts/scaledPriceAuthority.d.ts +1 -1
- package/src/contracts/scaledPriceAuthority.d.ts.map +1 -1
- package/src/contracts/scaledPriceAuthority.js +0 -2
- package/src/contracts/sellItems.d.ts +1 -1
- package/src/contracts/sellItems.d.ts.map +1 -1
- package/src/contracts/sellItems.js +3 -2
- package/src/contracts/simpleExchange.d.ts +2 -2
- package/src/instanceRecordStorage.d.ts +1 -1
- package/src/instanceRecordStorage.d.ts.map +1 -1
- package/src/internal-types.d.ts +3 -3
- package/src/internal-types.d.ts.map +1 -1
- package/src/internal-types.js +1 -1
- package/src/issuerStorage.d.ts +1 -1
- package/src/makeHandle.d.ts +1 -1
- package/src/makeHandle.d.ts.map +1 -1
- package/src/typeGuards.d.ts +20 -118
- package/src/typeGuards.d.ts.map +1 -1
- package/src/typeGuards.js +1 -7
- package/src/zoeService/escrowStorage.d.ts +1 -1
- package/src/zoeService/feeMint.d.ts +5 -5
- package/src/zoeService/feeMint.d.ts.map +1 -1
- package/src/zoeService/installationStorage.d.ts +1 -1
- package/src/zoeService/instanceAdminStorage.d.ts +2 -2
- package/src/zoeService/instanceAdminStorage.d.ts.map +1 -1
- package/src/zoeService/instanceAdminStorage.js +0 -1
- package/src/zoeService/internal-types.d.ts +2 -2
- package/src/zoeService/internal-types.d.ts.map +1 -1
- package/src/zoeService/internal-types.js +1 -1
- package/src/zoeService/makeInvitation.d.ts +1 -1
- package/src/zoeService/makeInvitation.d.ts.map +1 -1
- package/src/zoeService/offer/offer.d.ts.map +1 -1
- package/src/zoeService/offer/offer.js +3 -2
- package/src/zoeService/startInstance.d.ts +1 -1
- package/src/zoeService/startInstance.d.ts.map +1 -1
- package/src/zoeService/startInstance.js +23 -20
- package/src/zoeService/types.d.ts +1 -1
- package/src/zoeService/types.d.ts.map +1 -1
- package/src/zoeService/utils.d.ts +2 -2
- package/src/zoeService/zoe.d.ts +1 -11
- package/src/zoeService/zoe.d.ts.map +1 -1
- package/src/zoeService/zoe.js +1 -24
- package/src/zoeService/zoeSeat.d.ts +1 -1
- package/src/zoeService/zoeSeat.d.ts.map +1 -1
- package/src/zoeService/zoeSeat.js +0 -1
- package/src/zoeService/zoeStorageManager.d.ts +1 -1
- package/src/zoeService/zoeStorageManager.d.ts.map +1 -1
- package/src/zoeService/zoeStorageManager.js +2 -7
- package/tools/fakePriceAuthority.d.ts.map +1 -1
- package/tools/fakePriceAuthority.js +2 -0
- package/tools/manualPriceAuthority.d.ts.map +1 -1
- package/tools/manualPriceAuthority.js +0 -1
- package/tools/manualTimer.js +1 -1
- package/tools/prepare-test-env.js +1 -1
- package/tools/priceAuthorityRegistry.d.ts +1 -1
- package/tools/priceAuthorityRegistry.d.ts.map +1 -1
- package/tools/scriptedOracle.d.ts +2 -2
- package/tools/scriptedPriceAuthority.d.ts.map +1 -1
- package/tools/scriptedPriceAuthority.js +0 -1
- package/tools/setup-zoe.d.ts +0 -5
- package/tools/setup-zoe.d.ts.map +1 -1
- package/src/contractFacet/reallocate.d.ts +0 -3
- package/src/contractFacet/reallocate.d.ts.map +0 -1
- package/src/contractFacet/reallocate.js +0 -94
- package/src/contractFacet/types-ambient.d.ts +0 -247
- package/src/contractFacet/types-ambient.js +0 -1
package/exported.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@agoric/zoe",
|
|
3
|
-
"version": "0.26.3-dev-
|
|
3
|
+
"version": "0.26.3-other-dev-70beeb7.0+70beeb7",
|
|
4
4
|
"description": "Zoe: the Smart Contract Framework for Offer Enforcement",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./src/zoeService/zoe.js",
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
"scripts": {
|
|
11
11
|
"build": "yarn build:bundles",
|
|
12
12
|
"build:bundles": "node scripts/build-bundles.js",
|
|
13
|
-
"prepack": "echo \"export {}; \" | cat - tools/types-ambient.js > tools/types.js && tsc --build
|
|
13
|
+
"prepack": "echo \"export {}; \" | cat - tools/types-ambient.js > tools/types.js && tsc --build jsconfig.build.json",
|
|
14
14
|
"postpack": "git clean -f '*.d.ts*' tools/types.js",
|
|
15
15
|
"test": "ava --verbose",
|
|
16
16
|
"test:c8": "c8 $C8_OPTIONS ava --config=ava-nesm.config.js",
|
|
@@ -23,7 +23,7 @@
|
|
|
23
23
|
"lint-fix": "yarn lint:eslint --fix",
|
|
24
24
|
"lint": "run-s --continue-on-error lint:*",
|
|
25
25
|
"lint:eslint": "eslint .",
|
|
26
|
-
"lint:types": "tsc"
|
|
26
|
+
"lint:types": "tsc -p jsconfig.json"
|
|
27
27
|
},
|
|
28
28
|
"repository": {
|
|
29
29
|
"type": "git",
|
|
@@ -43,29 +43,27 @@
|
|
|
43
43
|
},
|
|
44
44
|
"homepage": "https://github.com/Agoric/agoric-sdk#readme",
|
|
45
45
|
"dependencies": {
|
|
46
|
-
"@agoric/assert": "0.6.1-dev-
|
|
47
|
-
"@agoric/ertp": "0.16.3-dev-
|
|
48
|
-
"@agoric/internal": "0.3.3-dev-
|
|
49
|
-
"@agoric/notifier": "0.6.3-dev-
|
|
50
|
-
"@agoric/store": "0.9.3-dev-
|
|
51
|
-
"@agoric/swingset-
|
|
52
|
-
"@agoric/
|
|
53
|
-
"@agoric/
|
|
54
|
-
"@
|
|
55
|
-
"@endo/
|
|
56
|
-
"@endo/
|
|
57
|
-
"@endo/
|
|
58
|
-
"@endo/
|
|
59
|
-
"@endo/
|
|
60
|
-
"@endo/
|
|
61
|
-
"@endo/
|
|
62
|
-
"@endo/
|
|
63
|
-
"@endo/promise-kit": "^0.2.59",
|
|
64
|
-
"yargs-parser": "^21.1.1"
|
|
46
|
+
"@agoric/assert": "0.6.1-other-dev-70beeb7.0+70beeb7",
|
|
47
|
+
"@agoric/ertp": "0.16.3-other-dev-70beeb7.0+70beeb7",
|
|
48
|
+
"@agoric/internal": "0.3.3-other-dev-70beeb7.0+70beeb7",
|
|
49
|
+
"@agoric/notifier": "0.6.3-other-dev-70beeb7.0+70beeb7",
|
|
50
|
+
"@agoric/store": "0.9.3-other-dev-70beeb7.0+70beeb7",
|
|
51
|
+
"@agoric/swingset-vat": "0.32.3-other-dev-70beeb7.0+70beeb7",
|
|
52
|
+
"@agoric/time": "0.3.3-other-dev-70beeb7.0+70beeb7",
|
|
53
|
+
"@agoric/vat-data": "0.5.3-other-dev-70beeb7.0+70beeb7",
|
|
54
|
+
"@endo/bundle-source": "2.5.2-upstream-rollup",
|
|
55
|
+
"@endo/captp": "3.1.1",
|
|
56
|
+
"@endo/eventual-send": "0.17.2",
|
|
57
|
+
"@endo/far": "0.2.18",
|
|
58
|
+
"@endo/import-bundle": "0.3.4",
|
|
59
|
+
"@endo/marshal": "0.8.5",
|
|
60
|
+
"@endo/nat": "4.1.27",
|
|
61
|
+
"@endo/patterns": "0.2.2",
|
|
62
|
+
"@endo/promise-kit": "0.2.56"
|
|
65
63
|
},
|
|
66
64
|
"devDependencies": {
|
|
67
|
-
"@endo/init": "
|
|
68
|
-
"ava": "^5.
|
|
65
|
+
"@endo/init": "0.5.56",
|
|
66
|
+
"ava": "^5.2.0",
|
|
69
67
|
"c8": "^7.13.0",
|
|
70
68
|
"import-meta-resolve": "^2.2.1",
|
|
71
69
|
"tsd": "^0.28.1"
|
|
@@ -101,12 +99,10 @@
|
|
|
101
99
|
"test/unitTests/zcf/test-feeMintAccess.js",
|
|
102
100
|
"# import.meta.url by way of setupZcfTest",
|
|
103
101
|
"test/unitTests/test-zoe.js",
|
|
104
|
-
"test/unitTests/test-zoe-startInstance.js",
|
|
105
102
|
"test/unitTests/test-blockedOffers.js",
|
|
106
103
|
"test/unitTests/zcf/test-reallocate-empty.js",
|
|
107
104
|
"test/unitTests/zcf/test-zoeHelpersWZcf.js",
|
|
108
105
|
"test/unitTests/zcf/test-reallocateForZCFMint.js",
|
|
109
|
-
"test/unitTests/zcf/test-atomicRearrange.js",
|
|
110
106
|
"test/unitTests/zcf/test-zcf.js",
|
|
111
107
|
"test/unitTests/zcf/test-allStagedSeatsUsed.js",
|
|
112
108
|
"# ManualTimer.setWakeup: no function",
|
|
@@ -125,13 +121,10 @@
|
|
|
125
121
|
"files": [
|
|
126
122
|
"test/**/test-*.js"
|
|
127
123
|
],
|
|
128
|
-
"require": [
|
|
129
|
-
"@endo/init/debug.js"
|
|
130
|
-
],
|
|
131
124
|
"timeout": "20m"
|
|
132
125
|
},
|
|
133
126
|
"publishConfig": {
|
|
134
127
|
"access": "public"
|
|
135
128
|
},
|
|
136
|
-
"gitHead": "
|
|
129
|
+
"gitHead": "70beeb7e476f24cfad30fa8cd5918f04746e8839"
|
|
137
130
|
}
|
package/src/cleanProposal.js
CHANGED
|
@@ -112,10 +112,10 @@ const assertKeywordNotInBoth = (want, give) => {
|
|
|
112
112
|
const wantKeywordSet = new Set(ownKeys(want));
|
|
113
113
|
const giveKeywords = ownKeys(give);
|
|
114
114
|
|
|
115
|
-
|
|
115
|
+
giveKeywords.forEach(keyword => {
|
|
116
116
|
!wantKeywordSet.has(keyword) ||
|
|
117
117
|
Fail`a keyword cannot be in both 'want' and 'give'`;
|
|
118
|
-
}
|
|
118
|
+
});
|
|
119
119
|
};
|
|
120
120
|
|
|
121
121
|
/**
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
type TestJigSetter = ({ zcf }: {
|
|
2
|
-
zcf:
|
|
1
|
+
type TestJigSetter = ({ zcf: ZCF }: {
|
|
2
|
+
zcf: any;
|
|
3
3
|
}) => void;
|
|
4
4
|
type ZCFZygote = {
|
|
5
5
|
startContract: (instanceAdminFromZoe: ERef<ZoeInstanceAdmin>, instanceRecordFromZoe: InstanceRecord, issuerStorageFromZoe: IssuerRecords, privateArgs?: object) => Promise<ExecuteContractResult>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"internal-types.d.ts","sourceRoot":"","sources":["internal-types.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"internal-types.d.ts","sourceRoot":"","sources":["internal-types.js"],"names":[],"mappings":";;MAG+B,IAAI;;0CAKE,KAAK,gBAAgB,CAAC,yBAC7B,cAAc,qDAEvB,MAAM,KACnB,QAAQ,qBAAqB,CAAC;oCACT,MAAM,KAAK,IAAI"}
|
|
@@ -0,0 +1,191 @@
|
|
|
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
|
|
@@ -0,0 +1 @@
|
|
|
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"}
|
|
@@ -0,0 +1,256 @@
|
|
|
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
|
+
*/
|
|
@@ -10,5 +10,5 @@ export function buildRootObject(powers: import("@agoric/swingset-vat").Terminati
|
|
|
10
10
|
zoeService: ZoeService;
|
|
11
11
|
invitationIssuer: Issuer<'set'>;
|
|
12
12
|
privateArgs?: any;
|
|
13
|
-
}, baggage: MapStore<string,
|
|
13
|
+
}, baggage: MapStore<string, unknown>): Promise<import("@endo/eventual-send").RemotableBrand<{}, {}>>;
|
|
14
14
|
//# sourceMappingURL=vatRoot.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"vatRoot.d.ts","sourceRoot":"","sources":["vatRoot.js"],"names":[],"mappings":"AAkBA;;;;GAIG;AACH;mBAJwC,aAAa;;uBACtB,SAAS;gBAAc,UAAU;sBAAoB,OAAO,KAAK,CAAC;kBAAgB,GAAG;
|
|
1
|
+
{"version":3,"file":"vatRoot.d.ts","sourceRoot":"","sources":["vatRoot.js"],"names":[],"mappings":"AAkBA;;;;GAIG;AACH;mBAJwC,aAAa;;uBACtB,SAAS;gBAAc,UAAU;sBAAoB,OAAO,KAAK,CAAC;kBAAgB,GAAG;sGAgEnH"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export function sumAmountKeywordRecord<K extends AssetKind>(amr: AmountKeywordRecord, issuerRecord: IssuerRecord<K>): Amount<K>;
|
|
2
|
-
export function prepareZcMint(zcfBaggage: MapStore<string,
|
|
2
|
+
export function prepareZcMint(zcfBaggage: MapStore<string, unknown>, recordIssuer: (keyword: string, issuerRecord: IssuerRecord) => void, getAssetKindByBrand: GetAssetKindByBrand, makeEmptySeatKit: (exit?: undefined) => {
|
|
3
3
|
zcfSeat: any;
|
|
4
4
|
userSeat: Promise<UserSeat>;
|
|
5
5
|
}, reallocator: ZcfMintReallocator): <K extends AssetKind>(keyword: string, zoeMintP: ERef<ZoeMint<K>>) => Promise<ZCFMint<K>>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"zcfMint.d.ts","sourceRoot":"","sources":["zcfMint.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"zcfMint.d.ts","sourceRoot":"","sources":["zcfMint.js"],"names":[],"mappings":"AAqBO,iEAJI,mBAAmB,4CAc7B;AASM,6FALgB,MAAM,gBAAgB,YAAY,KAAG,IAAI,uBACrD,mBAAmB,4BACX,SAAS,KAAK;IAAE,OAAO,EAAE,GAAG,CAAC;IAAC,QAAQ,EAAE,QAAQ,QAAQ,CAAC,CAAA;CAAE,eACnE,kBAAkB,kCAkHhB,MAAM,qDAalB"}
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
/* eslint @typescript-eslint/no-floating-promises: "warn" */
|
|
2
1
|
import { AmountMath } from '@agoric/ertp';
|
|
3
2
|
import { prepareExoClass } from '@agoric/vat-data';
|
|
4
3
|
import { E } from '@endo/eventual-send';
|
|
@@ -10,7 +9,7 @@ import { addToAllocation, subtractFromAllocation } from './allocationMath.js';
|
|
|
10
9
|
import '../internal-types.js';
|
|
11
10
|
import { ZcfMintI } from '../typeGuards.js';
|
|
12
11
|
import './internal-types.js';
|
|
13
|
-
import './types
|
|
12
|
+
import './types.js';
|
|
14
13
|
|
|
15
14
|
const { Fail } = assert;
|
|
16
15
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"zcfSeat.d.ts","sourceRoot":"","sources":["zcfSeat.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"zcfSeat.d.ts","sourceRoot":"","sources":["zcfSeat.js"],"names":[],"mappings":"AAwBA,gCAAgC;AAChC,gCADW,iBAAiB,CAsX1B"}
|