@agoric/zoe 0.26.3-upgrade-14-dev-c8f9e7b.0 → 0.26.3-upgrade-16-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
package/exported.js
CHANGED
|
@@ -1,12 +1 @@
|
|
|
1
|
-
//
|
|
2
|
-
|
|
3
|
-
import './src/contractFacet/types.js';
|
|
4
|
-
import './src/zoeService/types.js';
|
|
5
|
-
import './src/contractSupport/types.js';
|
|
6
|
-
import './src/contracts/exported.js';
|
|
7
|
-
import './src/types.js';
|
|
8
|
-
import './tools/types-ambient.js';
|
|
9
|
-
import '@agoric/notifier/exported.js';
|
|
10
|
-
import '@agoric/ertp/exported.js';
|
|
11
|
-
import '@agoric/store/exported.js';
|
|
12
|
-
import '@agoric/swingset-vat/exported.js';
|
|
1
|
+
// Dummy file for .d.ts twin to declare ambients
|
package/package.json
CHANGED
|
@@ -1,29 +1,29 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@agoric/zoe",
|
|
3
|
-
"version": "0.26.3-upgrade-
|
|
3
|
+
"version": "0.26.3-upgrade-16-dev-8879538.0+8879538",
|
|
4
4
|
"description": "Zoe: the Smart Contract Framework for Offer Enforcement",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./src/zoeService/zoe.js",
|
|
7
7
|
"engines": {
|
|
8
|
-
"node": "
|
|
8
|
+
"node": "^18.12 || ^20.9"
|
|
9
9
|
},
|
|
10
10
|
"scripts": {
|
|
11
11
|
"build": "yarn build:bundles",
|
|
12
12
|
"build:bundles": "node scripts/build-bundles.js",
|
|
13
|
-
"prepack": "
|
|
14
|
-
"postpack": "git clean -f '*.d.ts*'
|
|
13
|
+
"prepack": "tsc --build tsconfig.build.json",
|
|
14
|
+
"postpack": "git clean -f '*.d.ts*'",
|
|
15
15
|
"test": "ava --verbose",
|
|
16
16
|
"test:c8": "c8 $C8_OPTIONS ava --config=ava-nesm.config.js",
|
|
17
|
-
"test:unit": "ava 'test/unitTests
|
|
18
|
-
"test:swingset": "ava 'test/swingsetTests
|
|
17
|
+
"test:unit": "ava 'test/unitTests' -T 1m --verbose",
|
|
18
|
+
"test:swingset": "ava 'test/swingsetTests' -T 10m --verbose",
|
|
19
19
|
"test:xs": "yarn test:xs-unit",
|
|
20
20
|
"test:xs-unit": "ava-xs --verbose",
|
|
21
|
-
"test:xs-worker": "SWINGSET_WORKER_TYPE=xs-worker ava -c 2 'test/swingsetTests
|
|
21
|
+
"test:xs-worker": "SWINGSET_WORKER_TYPE=xs-worker ava -c 2 'test/swingsetTests'",
|
|
22
22
|
"build-zcfBundle": "yarn build:bundles",
|
|
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"
|
|
27
27
|
},
|
|
28
28
|
"repository": {
|
|
29
29
|
"type": "git",
|
|
@@ -43,30 +43,37 @@
|
|
|
43
43
|
},
|
|
44
44
|
"homepage": "https://github.com/Agoric/agoric-sdk#readme",
|
|
45
45
|
"dependencies": {
|
|
46
|
-
"@agoric/assert": "0.6.1-upgrade-
|
|
47
|
-
"@agoric/
|
|
48
|
-
"@agoric/
|
|
49
|
-
"@agoric/
|
|
50
|
-
"@agoric/
|
|
51
|
-
"@agoric/
|
|
52
|
-
"@agoric/
|
|
53
|
-
"@agoric/vat
|
|
54
|
-
"@
|
|
55
|
-
"@
|
|
56
|
-
"@
|
|
57
|
-
"@endo/
|
|
58
|
-
"@endo/
|
|
59
|
-
"@endo/
|
|
60
|
-
"@endo/
|
|
61
|
-
"@endo/
|
|
62
|
-
"@endo/
|
|
46
|
+
"@agoric/assert": "0.6.1-upgrade-16-dev-8879538.0+8879538",
|
|
47
|
+
"@agoric/base-zone": "0.1.1-upgrade-16-dev-8879538.0+8879538",
|
|
48
|
+
"@agoric/ertp": "0.16.3-upgrade-16-dev-8879538.0+8879538",
|
|
49
|
+
"@agoric/internal": "0.3.3-upgrade-16-dev-8879538.0+8879538",
|
|
50
|
+
"@agoric/notifier": "0.6.3-upgrade-16-dev-8879538.0+8879538",
|
|
51
|
+
"@agoric/store": "0.9.3-upgrade-16-dev-8879538.0+8879538",
|
|
52
|
+
"@agoric/swingset-liveslots": "0.10.3-upgrade-16-dev-8879538.0+8879538",
|
|
53
|
+
"@agoric/swingset-vat": "0.32.3-upgrade-16-dev-8879538.0+8879538",
|
|
54
|
+
"@agoric/time": "0.3.3-upgrade-16-dev-8879538.0+8879538",
|
|
55
|
+
"@agoric/vat-data": "0.5.3-upgrade-16-dev-8879538.0+8879538",
|
|
56
|
+
"@agoric/zone": "0.2.3-upgrade-16-dev-8879538.0+8879538",
|
|
57
|
+
"@endo/bundle-source": "^3.2.3",
|
|
58
|
+
"@endo/captp": "^4.2.0",
|
|
59
|
+
"@endo/common": "^1.2.2",
|
|
60
|
+
"@endo/eventual-send": "^1.2.2",
|
|
61
|
+
"@endo/exo": "^1.5.0",
|
|
62
|
+
"@endo/far": "^1.1.2",
|
|
63
|
+
"@endo/import-bundle": "^1.1.2",
|
|
64
|
+
"@endo/marshal": "^1.5.0",
|
|
65
|
+
"@endo/nat": "^5.0.7",
|
|
66
|
+
"@endo/patterns": "^1.4.0",
|
|
67
|
+
"@endo/promise-kit": "^1.1.2",
|
|
68
|
+
"yargs-parser": "^21.1.1"
|
|
63
69
|
},
|
|
64
70
|
"devDependencies": {
|
|
65
|
-
"@
|
|
66
|
-
"
|
|
67
|
-
"
|
|
71
|
+
"@agoric/kmarshal": "0.1.1-upgrade-16-dev-8879538.0+8879538",
|
|
72
|
+
"@endo/init": "^1.1.2",
|
|
73
|
+
"ava": "^5.3.0",
|
|
74
|
+
"c8": "^9.1.0",
|
|
68
75
|
"import-meta-resolve": "^2.2.1",
|
|
69
|
-
"tsd": "^0.
|
|
76
|
+
"tsd": "^0.30.7"
|
|
70
77
|
},
|
|
71
78
|
"files": [
|
|
72
79
|
"bundles/",
|
|
@@ -80,51 +87,59 @@
|
|
|
80
87
|
"exclude": [
|
|
81
88
|
"# path/url/import.meta stuff",
|
|
82
89
|
"unitTests/contracts/",
|
|
83
|
-
"test/swingsetTests/privateArgs/
|
|
84
|
-
"test/swingsetTests/brokenContracts/
|
|
85
|
-
"test/swingsetTests/offerArgs/
|
|
86
|
-
"test/swingsetTests/makeKind/
|
|
87
|
-
"test/swingsetTests/zoe/
|
|
88
|
-
"test/swingsetTests/runMint/
|
|
89
|
-
"test/unitTests/
|
|
90
|
-
"test/unitTests/
|
|
91
|
-
"test/unitTests/
|
|
92
|
-
"test/unitTests/
|
|
93
|
-
"test/unitTests/contractSupport/
|
|
94
|
-
"test/unitTests/contractSupport/
|
|
95
|
-
"test/unitTests/contractSupport/
|
|
96
|
-
"test/unitTests/zcf/
|
|
97
|
-
"test/unitTests/zcf/
|
|
90
|
+
"test/swingsetTests/privateArgs/privateArgs.test.js",
|
|
91
|
+
"test/swingsetTests/brokenContracts/crashingContract.test.js",
|
|
92
|
+
"test/swingsetTests/offerArgs/offerArgs.test.js",
|
|
93
|
+
"test/swingsetTests/makeKind/makeKind.test.js",
|
|
94
|
+
"test/swingsetTests/zoe/zoe.test.js",
|
|
95
|
+
"test/swingsetTests/runMint/runMint.test.js",
|
|
96
|
+
"test/unitTests/zoe.test.js",
|
|
97
|
+
"test/unitTests/scriptedOracle.test.js",
|
|
98
|
+
"test/unitTests/makeKind.test.js",
|
|
99
|
+
"test/unitTests/instanceStorage.test.js",
|
|
100
|
+
"test/unitTests/contractSupport/depositTo.test.js",
|
|
101
|
+
"test/unitTests/contractSupport/withdrawFrom.test.js",
|
|
102
|
+
"test/unitTests/contractSupport/offerTo.test.js",
|
|
103
|
+
"test/unitTests/zcf/zcfSeat.test.js",
|
|
104
|
+
"test/unitTests/zcf/zcfSeat-exit.test.js",
|
|
98
105
|
"test/unitTests/zcf/setupZcfTest.js",
|
|
99
|
-
"test/unitTests/zcf/
|
|
106
|
+
"test/unitTests/zcf/feeMintAccess.test.js",
|
|
100
107
|
"# import.meta.url by way of setupZcfTest",
|
|
101
|
-
"test/unitTests/
|
|
102
|
-
"test/unitTests/
|
|
103
|
-
"test/unitTests/
|
|
104
|
-
"test/unitTests/zcf/
|
|
105
|
-
"test/unitTests/zcf/test
|
|
106
|
-
"test/unitTests/zcf/test
|
|
107
|
-
"test/unitTests/zcf/test
|
|
108
|
+
"test/unitTests/zoe.test.js",
|
|
109
|
+
"test/unitTests/zoe-startInstance.test.js",
|
|
110
|
+
"test/unitTests/blockedOffers.test.js",
|
|
111
|
+
"test/unitTests/zcf/reallocate-empty.test.js",
|
|
112
|
+
"test/unitTests/zcf/zoeHelpersWZcf.test.js",
|
|
113
|
+
"test/unitTests/zcf/reallocateForZCFMint.test.js",
|
|
114
|
+
"test/unitTests/zcf/atomicRearrange.test.js",
|
|
115
|
+
"test/unitTests/zcf/zcf.test.js",
|
|
116
|
+
"test/unitTests/zcf/allStagedSeatsUsed.test.js",
|
|
108
117
|
"# ManualTimer.setWakeup: no function",
|
|
109
|
-
"test/unitTests/
|
|
110
|
-
"test/unitTests/
|
|
118
|
+
"test/unitTests/fakePriceAuthority.test.js",
|
|
119
|
+
"test/unitTests/manualTimer.test.js",
|
|
111
120
|
"# hangs",
|
|
112
|
-
"
|
|
113
|
-
"test/unitTests/
|
|
114
|
-
"test/unitTests/
|
|
115
|
-
"test/unitTests/zcf/
|
|
121
|
+
"makeKind.test.js",
|
|
122
|
+
"test/unitTests/scriptedOracle.test.js",
|
|
123
|
+
"test/unitTests/zoe.test.js",
|
|
124
|
+
"test/unitTests/zcf/allStagedSeatsUsed.test.js",
|
|
116
125
|
"# We use SWINGSET_WORKER_TYPE=xs ava to run these...",
|
|
117
126
|
"swingsetTests"
|
|
118
127
|
]
|
|
119
128
|
},
|
|
120
129
|
"ava": {
|
|
121
130
|
"files": [
|
|
122
|
-
"test
|
|
131
|
+
"test/**/*.test.*"
|
|
132
|
+
],
|
|
133
|
+
"require": [
|
|
134
|
+
"@endo/init/debug.js"
|
|
123
135
|
],
|
|
124
136
|
"timeout": "20m"
|
|
125
137
|
},
|
|
126
138
|
"publishConfig": {
|
|
127
139
|
"access": "public"
|
|
128
140
|
},
|
|
129
|
-
"
|
|
141
|
+
"typeCoverage": {
|
|
142
|
+
"atLeast": 84.92
|
|
143
|
+
},
|
|
144
|
+
"gitHead": "8879538cd1d125a08346f02dd5701d0d70c90bb8"
|
|
130
145
|
}
|
package/src/cleanProposal.d.ts
CHANGED
|
@@ -3,7 +3,7 @@ export function assertKeywordName(keyword: any): void;
|
|
|
3
3
|
export function cleanKeywords(uncleanKeywordRecord: {
|
|
4
4
|
[name: string]: any;
|
|
5
5
|
}): string[];
|
|
6
|
-
export function coerceAmountPatternKeywordRecord(allegedAmountKeywordRecord: any, getAssetKindByBrand: any): Record<string, any>;
|
|
7
|
-
export function coerceAmountKeywordRecord(allegedAmountKeywordRecord:
|
|
6
|
+
export function coerceAmountPatternKeywordRecord(allegedAmountKeywordRecord: any, getAssetKindByBrand: any): Record<string | number | symbol, any>;
|
|
7
|
+
export function coerceAmountKeywordRecord(allegedAmountKeywordRecord: unknown, getAssetKindByBrand: any): AmountKeywordRecord;
|
|
8
8
|
export function cleanProposal(proposal: Proposal, getAssetKindByBrand: GetAssetKindByBrand): ProposalRecord;
|
|
9
9
|
//# sourceMappingURL=cleanProposal.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cleanProposal.d.ts","sourceRoot":"","sources":["cleanProposal.js"],"names":[],"mappings":"AAWA,qCAAsC;AAa/B,sDAYN;AAMM
|
|
1
|
+
{"version":3,"file":"cleanProposal.d.ts","sourceRoot":"","sources":["cleanProposal.js"],"names":[],"mappings":"AAWA,qCAAsC;AAa/B,sDAYN;AAMM,oDAHI;IAAC,CAAC,IAAI,EAAE,MAAM,GAAG,GAAG,CAAA;CAAC,GACnB,MAAM,EAAE,CAYpB;AAEM,mJAsBN;AAQM,sEAJI,OAAO,6BAEL,mBAAmB,CAa/B;AA4CM,wCAJI,QAAQ,uBACR,mBAAmB,GACjB,cAAc,CA6B1B"}
|
package/src/cleanProposal.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { assert, q, Fail } from '@agoric/assert';
|
|
2
2
|
import { AmountMath, getAssetKind } from '@agoric/ertp';
|
|
3
|
+
import { objectMap } from '@agoric/internal';
|
|
3
4
|
import { assertRecord } from '@endo/marshal';
|
|
4
5
|
import { assertKey, assertPattern, mustMatch, isKey } from '@agoric/store';
|
|
5
6
|
import { FullProposalShape } from './typeGuards.js';
|
|
6
|
-
import { arrayToObj } from './objArrayConversion.js';
|
|
7
7
|
|
|
8
8
|
import './internal-types.js';
|
|
9
9
|
|
|
@@ -56,12 +56,11 @@ export const coerceAmountPatternKeywordRecord = (
|
|
|
56
56
|
allegedAmountKeywordRecord,
|
|
57
57
|
getAssetKindByBrand,
|
|
58
58
|
) => {
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
const coercedAmounts = amounts.map(amount => {
|
|
59
|
+
cleanKeywords(allegedAmountKeywordRecord);
|
|
60
|
+
// FIXME objectMap should constrain the mapping function by the record's type
|
|
61
|
+
return objectMap(allegedAmountKeywordRecord, amount => {
|
|
62
|
+
// Check that each value can be coerced using the AmountMath
|
|
63
|
+
// indicated by brand. `AmountMath.coerce` throws if coercion fails.
|
|
65
64
|
if (isKey(amount)) {
|
|
66
65
|
const brandAssetKind = getAssetKindByBrand(amount.brand);
|
|
67
66
|
const assetKind = getAssetKind(amount);
|
|
@@ -75,11 +74,14 @@ export const coerceAmountPatternKeywordRecord = (
|
|
|
75
74
|
return amount;
|
|
76
75
|
}
|
|
77
76
|
});
|
|
78
|
-
|
|
79
|
-
// Recreate the amountKeywordRecord with coercedAmounts.
|
|
80
|
-
return harden(arrayToObj(coercedAmounts, keywords));
|
|
81
77
|
};
|
|
82
78
|
|
|
79
|
+
/**
|
|
80
|
+
*
|
|
81
|
+
* @param {unknown} allegedAmountKeywordRecord
|
|
82
|
+
* @param {*} getAssetKindByBrand
|
|
83
|
+
* @returns {AmountKeywordRecord}
|
|
84
|
+
*/
|
|
83
85
|
export const coerceAmountKeywordRecord = (
|
|
84
86
|
allegedAmountKeywordRecord,
|
|
85
87
|
getAssetKindByBrand,
|
|
@@ -89,6 +91,7 @@ export const coerceAmountKeywordRecord = (
|
|
|
89
91
|
getAssetKindByBrand,
|
|
90
92
|
);
|
|
91
93
|
assertKey(result);
|
|
94
|
+
// @ts-expect-error checked cast
|
|
92
95
|
return result;
|
|
93
96
|
};
|
|
94
97
|
|
|
@@ -112,10 +115,10 @@ const assertKeywordNotInBoth = (want, give) => {
|
|
|
112
115
|
const wantKeywordSet = new Set(ownKeys(want));
|
|
113
116
|
const giveKeywords = ownKeys(give);
|
|
114
117
|
|
|
115
|
-
|
|
118
|
+
for (const keyword of giveKeywords) {
|
|
116
119
|
!wantKeywordSet.has(keyword) ||
|
|
117
120
|
Fail`a keyword cannot be in both 'want' and 'give'`;
|
|
118
|
-
}
|
|
121
|
+
}
|
|
119
122
|
};
|
|
120
123
|
|
|
121
124
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"exit.d.ts","sourceRoot":"","sources":["exit.js"],"names":[],"mappings":"AAyBO,
|
|
1
|
+
{"version":3,"file":"exit.d.ts","sourceRoot":"","sources":["exit.js"],"names":[],"mappings":"AAyBO,sGAwGN"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
type TestJigSetter = ({ zcf
|
|
2
|
-
zcf:
|
|
1
|
+
type TestJigSetter = ({ zcf }: {
|
|
2
|
+
zcf: ZCF;
|
|
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":"qBAGa,CAAE,EAAC,GAAG,EAAC,EAAE;IAAC,GAAG,EAAE,GAAG,CAAA;CAAC,KAAM,IAAI;;mBAK5B,CAAC,oBAAoB,EAAE,IAAI,CAAC,gBAAgB,CAAC,EAC1D,qBAA2B,EAAE,cAAc,EAC3C,oBAA0B,EAAE,aAAa,EACzC,WAAiB,CAAC,EAAE,MAAM,KACnB,OAAO,CAAC,qBAAqB,CAAC;qBACxB,CAAC,WAAW,CAAC,EAAE,MAAM,KAAK,IAAI"}
|
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
export function makeOfferHandlerStorage(zcfBaggage: any): {
|
|
2
|
-
storeOfferHandler: (offerHandler:
|
|
2
|
+
storeOfferHandler: (offerHandler: any) => Handle<"Invitation">;
|
|
3
3
|
takeOfferHandler: (invitationHandle: InvitationHandle, details?: Details) => OfferHandler;
|
|
4
4
|
};
|
|
5
|
+
export type PassableOfferHandler = RemotableBrand<any, any> & RemotableObject & OfferHandler<unknown, never>;
|
|
6
|
+
import type { RemotableBrand } from '@endo/eventual-send';
|
|
7
|
+
import type { RemotableObject } from '@endo/pass-style';
|
|
5
8
|
//# sourceMappingURL=offerHandlerStorage.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"offerHandlerStorage.d.ts","sourceRoot":"","sources":["offerHandlerStorage.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"offerHandlerStorage.d.ts","sourceRoot":"","sources":["offerHandlerStorage.js"],"names":[],"mappings":"AAiBO;;yCAgCwB,gBAAgB,YAAY,OAAO,KAAK,YAAY;EAsBlF;;oCA9DgC,qBAAqB;qCACpB,kBAAkB"}
|
|
@@ -6,9 +6,18 @@ import { canBeDurable, provideDurableWeakMapStore } from '@agoric/vat-data';
|
|
|
6
6
|
|
|
7
7
|
import { defineDurableHandle } from '../makeHandle.js';
|
|
8
8
|
|
|
9
|
+
/**
|
|
10
|
+
* @import {RemotableBrand} from '@endo/eventual-send';
|
|
11
|
+
* @import {RemotableObject} from '@endo/pass-style';
|
|
12
|
+
*/
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* @typedef {RemotableBrand & RemotableObject & OfferHandler} PassableOfferHandler
|
|
16
|
+
*/
|
|
17
|
+
|
|
9
18
|
export const makeOfferHandlerStorage = zcfBaggage => {
|
|
10
19
|
const makeInvitationHandle = defineDurableHandle(zcfBaggage, 'Invitation');
|
|
11
|
-
/** @type {WeakMapStore<InvitationHandle,
|
|
20
|
+
/** @type {WeakMapStore<InvitationHandle, PassableOfferHandler>} */
|
|
12
21
|
|
|
13
22
|
// ZCF needs to ephemerally hold on to ephemeral handlers, and durably hold
|
|
14
23
|
// onto handlers that are intended to be durable. We keep two stores and store
|
|
@@ -18,13 +27,12 @@ export const makeOfferHandlerStorage = zcfBaggage => {
|
|
|
18
27
|
const invitationHandleToEphemeralHandler = makeScalarWeakMapStore(
|
|
19
28
|
'invitationHandleToEphemeralHandler',
|
|
20
29
|
);
|
|
21
|
-
/** @type {WeakMapStore<InvitationHandle,
|
|
30
|
+
/** @type {WeakMapStore<InvitationHandle, PassableOfferHandler>} */
|
|
22
31
|
const invitationHandleToDurableHandler = provideDurableWeakMapStore(
|
|
23
32
|
zcfBaggage,
|
|
24
33
|
'invitationHandleToDurableHandler',
|
|
25
34
|
);
|
|
26
35
|
|
|
27
|
-
/** @type {(offerHandler: OfferHandler) => InvitationHandle} */
|
|
28
36
|
const storeOfferHandler = offerHandler => {
|
|
29
37
|
if (typeof offerHandler === 'function') {
|
|
30
38
|
offerHandler = ToFarFunction('offerHandler', offerHandler);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"reallocate.d.ts","sourceRoot":"","sources":["reallocate.js"],"names":[],"mappings":"AAiBO,6CAHI,KAAK,CAAC,YAAY,CAAC,GACjB,CAAC,OAAO,EAAE,mBAAmB,CAAC,EAAE,CA8E5C;8BAtFa,KAAK,CAAC,mBAAmB,CAAC"}
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
import { makeScalarMapStore } from '@agoric/vat-data';
|
|
2
|
+
|
|
3
|
+
import { assertRightsConserved } from './rightsConservation.js';
|
|
4
|
+
import { addToAllocation, subtractFromAllocation } from './allocationMath.js';
|
|
5
|
+
|
|
6
|
+
const { Fail } = assert;
|
|
7
|
+
|
|
8
|
+
/** @typedef {Array<AmountKeywordRecord>} TransactionList */
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* Convert from a list of transfer descriptions ([fromSeat, toSeat, fromAmount,
|
|
12
|
+
* toAmount], with many parts optional) to a list of resulting allocations for
|
|
13
|
+
* each of the seats mentioned.
|
|
14
|
+
*
|
|
15
|
+
* @param {Array<TransferPart>} transfers
|
|
16
|
+
* @returns {[ZCFSeat, AmountKeywordRecord][]}
|
|
17
|
+
*/
|
|
18
|
+
export const makeAllocationMap = transfers => {
|
|
19
|
+
/** @type {MapStore<ZCFSeat, [TransactionList, TransactionList]>} */
|
|
20
|
+
const allocations = makeScalarMapStore();
|
|
21
|
+
|
|
22
|
+
const getAllocations = seat => {
|
|
23
|
+
if (allocations.has(seat)) {
|
|
24
|
+
return allocations.get(seat);
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
/** @type {[TransactionList, TransactionList]} */
|
|
28
|
+
const pair = [[], []];
|
|
29
|
+
allocations.init(seat, pair);
|
|
30
|
+
return pair;
|
|
31
|
+
};
|
|
32
|
+
|
|
33
|
+
const decrementAllocation = (seat, decrement) => {
|
|
34
|
+
const [incr, decr] = getAllocations(seat);
|
|
35
|
+
|
|
36
|
+
const newDecr = [...decr, decrement];
|
|
37
|
+
allocations.set(seat, [incr, newDecr]);
|
|
38
|
+
};
|
|
39
|
+
|
|
40
|
+
const incrementAllocation = (seat, increment) => {
|
|
41
|
+
const [incr, decr] = getAllocations(seat);
|
|
42
|
+
|
|
43
|
+
const newIncr = [...incr, increment];
|
|
44
|
+
allocations.set(seat, [newIncr, decr]);
|
|
45
|
+
};
|
|
46
|
+
|
|
47
|
+
for (const [fromSeat, toSeat, fromAmounts, toAmounts] of transfers) {
|
|
48
|
+
if (fromSeat) {
|
|
49
|
+
if (!fromAmounts) {
|
|
50
|
+
throw Fail`Transfer from ${fromSeat} must say how much`;
|
|
51
|
+
}
|
|
52
|
+
decrementAllocation(fromSeat, fromAmounts);
|
|
53
|
+
if (toSeat) {
|
|
54
|
+
// Conserved transfer between seats
|
|
55
|
+
if (toAmounts) {
|
|
56
|
+
// distinct amounts, so we check conservation.
|
|
57
|
+
assertRightsConserved(
|
|
58
|
+
Object.values(fromAmounts),
|
|
59
|
+
Object.values(toAmounts),
|
|
60
|
+
);
|
|
61
|
+
incrementAllocation(toSeat, toAmounts);
|
|
62
|
+
} else {
|
|
63
|
+
// fromAmounts will be used for toAmounts as well
|
|
64
|
+
incrementAllocation(toSeat, fromAmounts);
|
|
65
|
+
}
|
|
66
|
+
} else {
|
|
67
|
+
// Transfer only from fromSeat
|
|
68
|
+
!toAmounts ||
|
|
69
|
+
Fail`Transfer without toSeat cannot have toAmounts ${toAmounts}`;
|
|
70
|
+
}
|
|
71
|
+
} else {
|
|
72
|
+
toSeat || Fail`Transfer must have at least one of fromSeat or toSeat`;
|
|
73
|
+
// Transfer only to toSeat
|
|
74
|
+
!fromAmounts ||
|
|
75
|
+
Fail`Transfer without fromSeat cannot have fromAmounts ${fromAmounts}`;
|
|
76
|
+
toAmounts || Fail`Transfer to ${toSeat} must say how much`;
|
|
77
|
+
incrementAllocation(toSeat, toAmounts);
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
/** @type {[ZCFSeat,AmountKeywordRecord][]} */
|
|
82
|
+
const resultingAllocations = [];
|
|
83
|
+
for (const [seat, [incrList, decrList]] of allocations.entries()) {
|
|
84
|
+
let newAlloc = seat.getCurrentAllocation();
|
|
85
|
+
for (const incr of incrList) {
|
|
86
|
+
newAlloc = addToAllocation(newAlloc, incr);
|
|
87
|
+
}
|
|
88
|
+
for (const decr of decrList) {
|
|
89
|
+
newAlloc = subtractFromAllocation(newAlloc, decr);
|
|
90
|
+
}
|
|
91
|
+
resultingAllocations.push([seat, newAlloc]);
|
|
92
|
+
}
|
|
93
|
+
return resultingAllocations;
|
|
94
|
+
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rightsConservation.d.ts","sourceRoot":"","sources":["rightsConservation.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"rightsConservation.d.ts","sourceRoot":"","sources":["rightsConservation.js"],"names":[],"mappings":"AAqFA;;;;;;;;;GASG;AACH,uDANW,MAAM,EAAE,cAER,MAAM,EAAE,GAEN,IAAI,CAMhB"}
|