@agoric/smart-wallet 0.5.4-dev-2b7c650.0 → 0.5.4-mainnet1B-dev-2d6b13f.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 +191 -0
- package/package.json +24 -27
- package/src/invitations.d.ts +1 -1
- package/src/invitations.d.ts.map +1 -1
- package/src/invitations.js +2 -2
- package/src/offers.d.ts +2 -2
- package/src/offers.d.ts.map +1 -1
- package/src/offers.js +6 -4
- package/src/payments.d.ts +2 -2
- package/src/payments.d.ts.map +1 -1
- package/src/payments.js +3 -3
- package/src/proposals/upgrade-walletFactory-proposal.d.ts +1 -1
- package/src/proposals/upgrade-walletFactory-proposal.d.ts.map +1 -1
- package/src/proposals/upgrade-walletFactory-proposal.js +17 -42
- package/src/smartWallet.d.ts +3 -2
- package/src/smartWallet.d.ts.map +1 -1
- package/src/smartWallet.js +15 -8
- package/src/typeGuards.d.ts +1 -1
- package/src/types.d.ts +5 -14
- package/src/walletFactory.d.ts +4 -4
- package/src/walletFactory.d.ts.map +1 -1
- package/src/walletFactory.js +1 -1
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,191 @@
|
|
|
1
|
+
# Change Log
|
|
2
|
+
|
|
3
|
+
All notable changes to this project will be documented in this file.
|
|
4
|
+
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
|
+
|
|
6
|
+
### [0.5.4-u11wf.0](https://github.com/Agoric/agoric/compare/@agoric/smart-wallet@0.5.4-u11.0...@agoric/smart-wallet@0.5.4-u11wf.0) (2023-09-23)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Features
|
|
10
|
+
|
|
11
|
+
* **smart-wallet:** trading in non-vbank asset ([dc99ca0](https://github.com/Agoric/agoric/commit/dc99ca0b58af3a66778071993f0d73d099605069))
|
|
12
|
+
* **smart-wallet:** upgrade walletFactory for non-vbank assets ([073b450](https://github.com/Agoric/agoric/commit/073b450b0790d1837d59e80c0109f0923b5f0cd2))
|
|
13
|
+
* **smart-wallet:** withdraw payments before getting invitation ([82ed64e](https://github.com/Agoric/agoric/commit/82ed64ec20ce7884d6cdf6caac63fab85d02af40)), closes [#7098](https://github.com/Agoric/agoric/issues/7098)
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
### [0.5.4-u11.0](https://github.com/Agoric/agoric/compare/@agoric/smart-wallet@0.5.3...@agoric/smart-wallet@0.5.4-u11.0) (2023-08-24)
|
|
18
|
+
|
|
19
|
+
**Note:** Version bump only for package @agoric/smart-wallet
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
### [0.5.3](https://github.com/Agoric/agoric/compare/@agoric/smart-wallet@0.5.2...@agoric/smart-wallet@0.5.3) (2023-06-09)
|
|
26
|
+
|
|
27
|
+
**Note:** Version bump only for package @agoric/smart-wallet
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
### [0.5.2](https://github.com/Agoric/agoric/compare/@agoric/smart-wallet@0.5.1...@agoric/smart-wallet@0.5.2) (2023-06-02)
|
|
34
|
+
|
|
35
|
+
**Note:** Version bump only for package @agoric/smart-wallet
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
### [0.5.1](https://github.com/Agoric/agoric/compare/@agoric/smart-wallet@0.5.0...@agoric/smart-wallet@0.5.1) (2023-05-24)
|
|
42
|
+
|
|
43
|
+
**Note:** Version bump only for package @agoric/smart-wallet
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
|
|
47
|
+
|
|
48
|
+
|
|
49
|
+
## [0.5.0](https://github.com/Agoric/agoric/compare/@agoric/smart-wallet@0.4.2...@agoric/smart-wallet@0.5.0) (2023-05-19)
|
|
50
|
+
|
|
51
|
+
|
|
52
|
+
### ⚠ BREAKING CHANGES
|
|
53
|
+
|
|
54
|
+
* emit smallcaps-format data in all marshallers
|
|
55
|
+
* move PublicTopic to Zoe contractSupport
|
|
56
|
+
* **wallet:** reject executeOffer on failure
|
|
57
|
+
* storage paths by getPublicTopics
|
|
58
|
+
* rename 'fit' to 'mustMatch'
|
|
59
|
+
|
|
60
|
+
### Features
|
|
61
|
+
|
|
62
|
+
* emit smallcaps-format data in all marshallers ([1753df8](https://github.com/Agoric/agoric/commit/1753df83465785b5ee71b250770c9b012d750ffc)), closes [#6822](https://github.com/Agoric/agoric/issues/6822)
|
|
63
|
+
* **board-utils:** BoardRemote like Remotables ([3aa44de](https://github.com/Agoric/agoric/commit/3aa44debbdc955892611ba870478fb088395cf10))
|
|
64
|
+
* **smartWallet:** fail early on offerId re-use ([08307e0](https://github.com/Agoric/agoric/commit/08307e01a6c9a3d53144df55f52e03f8f9df2a78))
|
|
65
|
+
* Add incarnation number to the transcript store records ([5d64be7](https://github.com/Agoric/agoric/commit/5d64be7aa1fd222822b145240f541f5eabb01c43)), closes [#7482](https://github.com/Agoric/agoric/issues/7482)
|
|
66
|
+
* **contractSupport:** provideAll takes thunks ([f35034b](https://github.com/Agoric/agoric/commit/f35034b13b99dbfb8d472816644e09f9b4f2be3a))
|
|
67
|
+
* **contractSupport:** providePublicTopic ([5bdb71e](https://github.com/Agoric/agoric/commit/5bdb71e1af9ecde163322612de3e648fd75d7a47))
|
|
68
|
+
* **smart-wallet:** exit offer ([7323023](https://github.com/Agoric/agoric/commit/7323023308aa40c145e60093b7fc52580534cd2d))
|
|
69
|
+
* **smart-wallet:** preserve existing `myAddressNameAdmin` ([8f283af](https://github.com/Agoric/agoric/commit/8f283aff0fc7b6146e9b6393c158cd9ca15f31f9))
|
|
70
|
+
* **smart-wallet:** publish pending offers before completion ([c913b36](https://github.com/Agoric/agoric/commit/c913b36950be1d2ae1b16d16bfcfc8df32305e0c))
|
|
71
|
+
* **smart-wallet:** publish possibly exitable offers ([de0170a](https://github.com/Agoric/agoric/commit/de0170add5bd4c82cbef23431bffaa95f7007880))
|
|
72
|
+
* **topics:** makePublicTopic ([c8b464c](https://github.com/Agoric/agoric/commit/c8b464c26c53535097e4df573e126c81e00e5aa6))
|
|
73
|
+
* **vats:** Scoped bridge managers ([11f6429](https://github.com/Agoric/agoric/commit/11f64298d8529cca249d2933894236dc534dfe3e))
|
|
74
|
+
* **wallet:** executeOffer throw errors ([224dbca](https://github.com/Agoric/agoric/commit/224dbca918343608d53f691a448171c8a48d283e))
|
|
75
|
+
* **wallet:** record bridge errors to vstorage ([f8581e9](https://github.com/Agoric/agoric/commit/f8581e95311f7cb4105f6d81f0ac7b6a9121b68f))
|
|
76
|
+
* **wallet:** reject executeOffer on failure ([308caab](https://github.com/Agoric/agoric/commit/308caab24c1680c2c7910eff8128f9089dedf26d))
|
|
77
|
+
* **walletFactory:** more durability ([7e6c98d](https://github.com/Agoric/agoric/commit/7e6c98d4a448eb94de98c865bc8280534bd5069f))
|
|
78
|
+
* **walletFactory:** upgradable ([ca30e05](https://github.com/Agoric/agoric/commit/ca30e05988fae00f437b5708dbabe061742797f1))
|
|
79
|
+
* agoricContract invitation getter ([ca6166f](https://github.com/Agoric/agoric/commit/ca6166f94a934811f698631f9ce1dd2a32ad422c))
|
|
80
|
+
* allow string for offer id, leave uniqueness to client ([7856e56](https://github.com/Agoric/agoric/commit/7856e5635ba04671da17334080dad061a8f9fc15))
|
|
81
|
+
* boot-oracles ([ce8f8de](https://github.com/Agoric/agoric/commit/ce8f8de65ad4c14b4e8d699cd721683cfa1cc495))
|
|
82
|
+
* durable smart wallet ([6977f73](https://github.com/Agoric/agoric/commit/6977f73f820a9345ef49f4f18095a5c88af06729))
|
|
83
|
+
* fixed heap for getPublicTopics ([1886c3a](https://github.com/Agoric/agoric/commit/1886c3af2319b9540faa318cf6179d4d01eec084))
|
|
84
|
+
* storage paths by getPublicTopics ([40a8624](https://github.com/Agoric/agoric/commit/40a8624240f241a686c28bd7d7c7ef1ef780f984))
|
|
85
|
+
* support TopicsRecord ([8618461](https://github.com/Agoric/agoric/commit/8618461781fe11f28e6b891a4d31ebfd9dda5e0d))
|
|
86
|
+
* track publicSubscribers ([30cae51](https://github.com/Agoric/agoric/commit/30cae513a624a74f2df05b668f4eaa02d6d13656))
|
|
87
|
+
* vaults list command ([894c92f](https://github.com/Agoric/agoric/commit/894c92f9ee6331aba43aaeebd6c007dd03d53996))
|
|
88
|
+
|
|
89
|
+
|
|
90
|
+
### Bug Fixes
|
|
91
|
+
|
|
92
|
+
* handle {} wallet update records ([c7dbccb](https://github.com/Agoric/agoric/commit/c7dbccbad2d2007af398c31c94f68793fe4e8504))
|
|
93
|
+
* **cli:** dont blow up from old wallet updates ([ac5a28e](https://github.com/Agoric/agoric/commit/ac5a28e9e47916b0d3ba7978d90067a757470be3))
|
|
94
|
+
* **walletFactory:** handle restartContract ([f8b7200](https://github.com/Agoric/agoric/commit/f8b720014c2987301a67d073348b80fc1d30d756))
|
|
95
|
+
* Improve the smart wallet revival handshake ([69ec2e7](https://github.com/Agoric/agoric/commit/69ec2e76f06cf87454d087adfa2ef6c2adcea8a0))
|
|
96
|
+
* **vats:** Extract revivable wallet addresses from the correct chain storage path ([2454d3f](https://github.com/Agoric/agoric/commit/2454d3f48eefb2bdea5a0d03a250d8a5a74b0ba3))
|
|
97
|
+
* add missing facet interface ([d16bc2e](https://github.com/Agoric/agoric/commit/d16bc2e121810c8c432519028e4382146b066956))
|
|
98
|
+
* bootstrap handles BundleIDs, not full bundles ([de8b0f5](https://github.com/Agoric/agoric/commit/de8b0f5d35e0938fa00d795d11cfad3acadd9428)), closes [#6826](https://github.com/Agoric/agoric/issues/6826) [#4374](https://github.com/Agoric/agoric/issues/4374)
|
|
99
|
+
* number/string inconsistency with offer lookup ([59abbdb](https://github.com/Agoric/agoric/commit/59abbdb0a6498333ec48e971347076f7739c9b84))
|
|
100
|
+
* Preserve smart wallets through bulldozer upgrade ([160bf6c](https://github.com/Agoric/agoric/commit/160bf6cad0bbdfe6a245f6b7a8e260d244c44f21)), closes [#7537](https://github.com/Agoric/agoric/issues/7537)
|
|
101
|
+
* use `subscribeEach` to get reconnect benefits ([fb24132](https://github.com/Agoric/agoric/commit/fb24132f9b4e117e56bae2803994e57c188344f3))
|
|
102
|
+
* **wallet:** pipeTopicToStorage with Recorder kit ([31b79b7](https://github.com/Agoric/agoric/commit/31b79b71eda59b62d3bacd7ca648b53b9385afc0))
|
|
103
|
+
* **wallet:** recording handleBridgeAction errors ([8e64158](https://github.com/Agoric/agoric/commit/8e6415872dafc1cd5def9c038d673842464b316b))
|
|
104
|
+
* multiple deposits of unknown brand ([6ef6062](https://github.com/Agoric/agoric/commit/6ef6062a4b69b0d44b18dc576021bbbaf372b3b2))
|
|
105
|
+
* purse making (use vbank) ([9175882](https://github.com/Agoric/agoric/commit/91758824848ea24f5cd4cae5eaadf88169b80e39))
|
|
106
|
+
* race in watchPurse to update balance ([51869c1](https://github.com/Agoric/agoric/commit/51869c1ffce90350cbaed84b5f92fa05c3473f3e))
|
|
107
|
+
* rename from FarClass to ExoClass, etc ([#6323](https://github.com/Agoric/agoric/issues/6323)) ([da96c7c](https://github.com/Agoric/agoric/commit/da96c7c3c902a5e266baeedf23df02481f2e9c9d))
|
|
108
|
+
* **smart-wallet:** create purses for new assets lazily ([e241ba0](https://github.com/Agoric/agoric/commit/e241ba03a7d9f441436b3d987f9327060d7dd8ce))
|
|
109
|
+
|
|
110
|
+
|
|
111
|
+
### Miscellaneous Chores
|
|
112
|
+
|
|
113
|
+
* rename 'fit' to 'mustMatch' ([9fa3232](https://github.com/Agoric/agoric/commit/9fa32324f84bfb85de9e99e0c9ad277b8017b50e)), closes [#6844](https://github.com/Agoric/agoric/issues/6844)
|
|
114
|
+
|
|
115
|
+
|
|
116
|
+
### Code Refactoring
|
|
117
|
+
|
|
118
|
+
* move PublicTopic to Zoe contractSupport ([c51ea3d](https://github.com/Agoric/agoric/commit/c51ea3de22f50e05fcc1aaabd2108e785d51eb2e))
|
|
119
|
+
|
|
120
|
+
|
|
121
|
+
|
|
122
|
+
### [0.4.4](https://github.com/Agoric/agoric/compare/@agoric/smart-wallet@0.4.3...@agoric/smart-wallet@0.4.4) (2023-02-17)
|
|
123
|
+
|
|
124
|
+
**Note:** Version bump only for package @agoric/smart-wallet
|
|
125
|
+
|
|
126
|
+
|
|
127
|
+
|
|
128
|
+
|
|
129
|
+
|
|
130
|
+
### [0.4.3](https://github.com/Agoric/agoric/compare/@agoric/smart-wallet@0.4.2...@agoric/smart-wallet@0.4.3) (2022-12-14)
|
|
131
|
+
|
|
132
|
+
**Note:** Version bump only for package @agoric/smart-wallet
|
|
133
|
+
|
|
134
|
+
|
|
135
|
+
|
|
136
|
+
|
|
137
|
+
|
|
138
|
+
### [0.4.2](https://github.com/Agoric/agoric/compare/@agoric/smart-wallet@0.4.1...@agoric/smart-wallet@0.4.2) (2022-10-18)
|
|
139
|
+
|
|
140
|
+
**Note:** Version bump only for package @agoric/smart-wallet
|
|
141
|
+
|
|
142
|
+
|
|
143
|
+
|
|
144
|
+
|
|
145
|
+
|
|
146
|
+
### [0.4.1](https://github.com/Agoric/agoric/compare/@agoric/smart-wallet@0.4.0...@agoric/smart-wallet@0.4.1) (2022-10-08)
|
|
147
|
+
|
|
148
|
+
**Note:** Version bump only for package @agoric/smart-wallet
|
|
149
|
+
|
|
150
|
+
|
|
151
|
+
|
|
152
|
+
|
|
153
|
+
|
|
154
|
+
## [0.4.0](https://github.com/Agoric/agoric/compare/@agoric/smart-wallet@0.3.0...@agoric/smart-wallet@0.4.0) (2022-10-05)
|
|
155
|
+
|
|
156
|
+
|
|
157
|
+
### Features
|
|
158
|
+
|
|
159
|
+
* **cli:** use new wallet.current node ([71effe7](https://github.com/Agoric/agoric/commit/71effe758c28181b8709ae4ccf025fcec7bb8a38))
|
|
160
|
+
* track consumed invitation amounts ([e9e3c35](https://github.com/Agoric/agoric/commit/e9e3c35cebdc85e80fb2eaa117ff0be00d26c9bb))
|
|
161
|
+
* **cli:** show status of invitations ([8506e6d](https://github.com/Agoric/agoric/commit/8506e6d87ef331e781c9d2e2251fdcf48e784e04))
|
|
162
|
+
|
|
163
|
+
|
|
164
|
+
### Bug Fixes
|
|
165
|
+
|
|
166
|
+
* **vats:** handle duplicate provision requests ([#6307](https://github.com/Agoric/agoric/issues/6307)) ([05d405d](https://github.com/Agoric/agoric/commit/05d405d5409e1f80612bb002234f5a9c3910a7df))
|
|
167
|
+
* **wallet-ui:** detect unprovisioned wallet ([1747d57](https://github.com/Agoric/agoric/commit/1747d5781f4ee594eca1ded76af4944c405e7000))
|
|
168
|
+
|
|
169
|
+
|
|
170
|
+
|
|
171
|
+
## 0.3.0 (2022-09-20)
|
|
172
|
+
|
|
173
|
+
|
|
174
|
+
### Features
|
|
175
|
+
|
|
176
|
+
* **wallet:** more diagnostics for invitation match ([98630ee](https://github.com/Agoric/agoric/commit/98630ee96a202cf3907e37b5d4d549bb37b1263d))
|
|
177
|
+
* **wallet-ui:** start displaying balances ([0f36da9](https://github.com/Agoric/agoric/commit/0f36da99daef86f24670d606ae5fd1adb32b419b))
|
|
178
|
+
* ensure voting via PSMCharter works with a unit test ([#6167](https://github.com/Agoric/agoric/issues/6167)) ([ff9471b](https://github.com/Agoric/agoric/commit/ff9471bf3a90ffab050e8b659d64d4cbd7c2d764))
|
|
179
|
+
* **smart-wallet:** include lastOfferId in error ([932cb7d](https://github.com/Agoric/agoric/commit/932cb7d90b8e281f0922d0b38287230aabd6f535))
|
|
180
|
+
* **smartWallet:** defer deposits until purse available ([#6172](https://github.com/Agoric/agoric/issues/6172)) ([1a1cc41](https://github.com/Agoric/agoric/commit/1a1cc41d421760563892212e1ca3df237a7a6661))
|
|
181
|
+
* **smartWallet:** virtual objects ([659ad58](https://github.com/Agoric/agoric/commit/659ad58349f972881a540d78ec5d856872dacc7d))
|
|
182
|
+
* distribute PSM Charter Invitatitons ([#6166](https://github.com/Agoric/agoric/issues/6166)) ([50cd3e2](https://github.com/Agoric/agoric/commit/50cd3e240fb33079948fa03b32bda86276879b4a))
|
|
183
|
+
* new Smart Wallet ([708972f](https://github.com/Agoric/agoric/commit/708972f1f531c9ea5e346f833c6d253efe80f837))
|
|
184
|
+
|
|
185
|
+
|
|
186
|
+
### Bug Fixes
|
|
187
|
+
|
|
188
|
+
* **smart-wallet:** invitation brand is remote ([6613136](https://github.com/Agoric/agoric/commit/66131366f563ebfefbeabeecffda43211a093d1e))
|
|
189
|
+
* **smart-wallet:** not yet durable-able ([db66c2c](https://github.com/Agoric/agoric/commit/db66c2c13de92f2a0783bcaf174223691ab0a339))
|
|
190
|
+
* Fix test failures in packages other than "vats" ([364815b](https://github.com/Agoric/agoric/commit/364815b88429e3443734681b5b0771b7d824ebe8))
|
|
191
|
+
* two corrections we found by demoing on 6084 ([#6155](https://github.com/Agoric/agoric/issues/6155)) ([88b1067](https://github.com/Agoric/agoric/commit/88b10676b9617e662fed38df61ab3210df07c602))
|
package/package.json
CHANGED
|
@@ -1,44 +1,44 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@agoric/smart-wallet",
|
|
3
|
-
"version": "0.5.4-dev-
|
|
3
|
+
"version": "0.5.4-mainnet1B-dev-2d6b13f.0+2d6b13f",
|
|
4
4
|
"description": "Wallet contract",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"scripts": {
|
|
7
7
|
"build": "yarn build:bundles",
|
|
8
8
|
"build:bundles": "node ./scripts/build-bundles.js",
|
|
9
|
-
"prepack": "tsc --build
|
|
9
|
+
"prepack": "tsc --build jsconfig.build.json",
|
|
10
10
|
"postpack": "git clean -f '*.d.ts*'",
|
|
11
11
|
"test": "ava",
|
|
12
12
|
"test:xs": "exit 0",
|
|
13
13
|
"lint": "run-s --continue-on-error lint:*",
|
|
14
14
|
"lint-fix": "yarn lint:eslint --fix",
|
|
15
|
-
"lint:types": "tsc",
|
|
15
|
+
"lint:types": "tsc -p jsconfig.json",
|
|
16
16
|
"lint:eslint": "eslint ."
|
|
17
17
|
},
|
|
18
18
|
"devDependencies": {
|
|
19
|
-
"@agoric/cosmic-proto": "0.3.1-dev-
|
|
20
|
-
"@
|
|
21
|
-
"@endo/
|
|
22
|
-
"@endo/
|
|
23
|
-
"
|
|
24
|
-
"ava": "^5.3.0",
|
|
19
|
+
"@agoric/cosmic-proto": "0.3.1-mainnet1B-dev-2d6b13f.0+2d6b13f",
|
|
20
|
+
"@endo/bundle-source": "2.5.2-upstream-rollup",
|
|
21
|
+
"@endo/captp": "3.1.1",
|
|
22
|
+
"@endo/init": "0.5.56",
|
|
23
|
+
"ava": "^5.2.0",
|
|
25
24
|
"import-meta-resolve": "^2.2.1"
|
|
26
25
|
},
|
|
27
26
|
"dependencies": {
|
|
28
|
-
"@agoric/assert": "0.6.1-dev-
|
|
29
|
-
"@agoric/casting": "0.4.3-dev-
|
|
30
|
-
"@agoric/ertp": "0.16.3-dev-
|
|
31
|
-
"@agoric/internal": "0.3.3-dev-
|
|
32
|
-
"@agoric/notifier": "0.6.3-dev-
|
|
33
|
-
"@agoric/store": "0.9.3-dev-
|
|
34
|
-
"@agoric/vat
|
|
35
|
-
"@agoric/
|
|
36
|
-
"@agoric/
|
|
37
|
-
"@
|
|
38
|
-
"@endo/
|
|
39
|
-
"@endo/
|
|
40
|
-
"@endo/
|
|
41
|
-
"@endo/
|
|
27
|
+
"@agoric/assert": "0.6.1-mainnet1B-dev-2d6b13f.0+2d6b13f",
|
|
28
|
+
"@agoric/casting": "0.4.3-mainnet1B-dev-2d6b13f.0+2d6b13f",
|
|
29
|
+
"@agoric/ertp": "0.16.3-mainnet1B-dev-2d6b13f.0+2d6b13f",
|
|
30
|
+
"@agoric/internal": "0.3.3-mainnet1B-dev-2d6b13f.0+2d6b13f",
|
|
31
|
+
"@agoric/notifier": "0.6.3-mainnet1B-dev-2d6b13f.0+2d6b13f",
|
|
32
|
+
"@agoric/store": "0.9.3-mainnet1B-dev-2d6b13f.0+2d6b13f",
|
|
33
|
+
"@agoric/swingset-vat": "0.32.3-mainnet1B-dev-2d6b13f.0+2d6b13f",
|
|
34
|
+
"@agoric/vat-data": "0.5.3-mainnet1B-dev-2d6b13f.0+2d6b13f",
|
|
35
|
+
"@agoric/vats": "0.15.2-mainnet1B-dev-2d6b13f.0+2d6b13f",
|
|
36
|
+
"@agoric/zoe": "0.26.3-mainnet1B-dev-2d6b13f.0+2d6b13f",
|
|
37
|
+
"@endo/eventual-send": "0.17.2",
|
|
38
|
+
"@endo/far": "0.2.18",
|
|
39
|
+
"@endo/marshal": "0.8.5",
|
|
40
|
+
"@endo/nat": "4.1.27",
|
|
41
|
+
"@endo/promise-kit": "0.2.56"
|
|
42
42
|
},
|
|
43
43
|
"files": [
|
|
44
44
|
"src/"
|
|
@@ -58,13 +58,10 @@
|
|
|
58
58
|
"files": [
|
|
59
59
|
"test/**/test-*.js"
|
|
60
60
|
],
|
|
61
|
-
"require": [
|
|
62
|
-
"@endo/init/debug.js"
|
|
63
|
-
],
|
|
64
61
|
"timeout": "2m"
|
|
65
62
|
},
|
|
66
63
|
"publishConfig": {
|
|
67
64
|
"access": "public"
|
|
68
65
|
},
|
|
69
|
-
"gitHead": "
|
|
66
|
+
"gitHead": "2d6b13f85e7f81644f12be02c2ca9344bd056d2f"
|
|
70
67
|
}
|
package/src/invitations.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export function makeInvitationsHelper(zoe: ERef<ZoeService>, agoricNames: ERef<
|
|
1
|
+
export function makeInvitationsHelper(zoe: ERef<ZoeService>, agoricNames: ERef<NameHub>, invitationBrand: Brand<'set'>, invitationsPurse: Purse<'set'>, getInvitationContinuation: (fromOfferId: string) => import('./types').RemoteInvitationMakers): (spec: InvitationSpec) => ERef<Invitation>;
|
|
2
2
|
/**
|
|
3
3
|
* Specify how to produce an invitation. See each type in the union for details.
|
|
4
4
|
*/
|
package/src/invitations.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"invitations.d.ts","sourceRoot":"","sources":["invitations.js"],"names":[],"mappings":"AAkEO,2CANI,KAAK,UAAU,CAAC,eAChB,KAAK,OAAO,
|
|
1
|
+
{"version":3,"file":"invitations.d.ts","sourceRoot":"","sources":["invitations.js"],"names":[],"mappings":"AAkEO,2CANI,KAAK,UAAU,CAAC,eAChB,KAAK,OAAO,CAAC,mBACb,MAAM,KAAK,CAAC,oBACZ,MAAM,KAAK,CAAC,2CACE,MAAM,KAAK,OAAO,SAAS,EAAE,sBAAsB,UAsFxD,cAAc,KAAK,KAAK,UAAU,CAAC,CAgBtD;;;;6BAvJY,4BAA4B,GAAG,sBAAsB,GAAG,mBAAmB,GAAG,wBAAwB;;;;;;;2CAKtG;IACZ,MAAQ,EAAE,gBAAgB,CAAC;IAC3B,YAAc,EAAE,MAAM,EAAE,CAAC;IACzB,QAAU,EAAE,MAAM,CAAC,UAAU,EAAE,MAAM,EAAE,UAAU,CAAC,EAAE,GAAG,EAAE,CAAC,CAAC,CAAC;CACzD;;;;qCAMS;IACZ,MAAQ,EAAE,UAAU,CAAC;IACrB,QAAU,EAAE,QAAQ,CAAC;IACrB,qBAAuB,EAAE,MAAM,CAAC;IAChC,cAAgB,CAAC,EAAE,GAAG,EAAE,CAAC;CACtB;;;;;kCAGS;IACZ,MAAQ,EAAE,OAAO,CAAC;IAClB,QAAU,EAAE,QAAQ,CAAC;IACrB,WAAa,EAAE,MAAM,CAAC;CACnB;;;;uCAIS;IACZ,MAAQ,EAAE,YAAY,CAAC;IACvB,aAAe,EAAE,OAAO,aAAa,EAAE,OAAO,CAAC;IAC/C,mBAAqB,EAAE,MAAM,CAAC;IAC9B,cAAgB,CAAC,EAAE,GAAG,EAAE,CAAC;CACtB;oCAKS,KAAK,iBAAiB,EAAE,aAAa,GAAG,UAAU,CAAC"}
|
package/src/invitations.js
CHANGED
|
@@ -59,10 +59,10 @@ const MAX_PIPE_LENGTH = 2;
|
|
|
59
59
|
|
|
60
60
|
/**
|
|
61
61
|
* @param {ERef<ZoeService>} zoe
|
|
62
|
-
* @param {ERef<
|
|
62
|
+
* @param {ERef<NameHub>} agoricNames
|
|
63
63
|
* @param {Brand<'set'>} invitationBrand
|
|
64
64
|
* @param {Purse<'set'>} invitationsPurse
|
|
65
|
-
* @param {(fromOfferId: string) => import('./types').
|
|
65
|
+
* @param {(fromOfferId: string) => import('./types').RemoteInvitationMakers} getInvitationContinuation
|
|
66
66
|
*/
|
|
67
67
|
export const makeInvitationsHelper = (
|
|
68
68
|
zoe,
|
package/src/offers.d.ts
CHANGED
|
@@ -20,10 +20,10 @@ export function makeOfferExecutor({ zoe, depositFacet, invitationIssuer, powers,
|
|
|
20
20
|
powers: {
|
|
21
21
|
logger: Pick<Console, 'info' | 'error'>;
|
|
22
22
|
invitationFromSpec: (spec: import('./invitations').InvitationSpec) => ERef<Invitation>;
|
|
23
|
-
purseForBrand: (brand: Brand) => Promise<
|
|
23
|
+
purseForBrand: (brand: Brand) => Promise<import('./types').RemotePurse>;
|
|
24
24
|
};
|
|
25
25
|
onStatusChange: (status: OfferStatus) => void;
|
|
26
|
-
onNewContinuingOffer: (offerId: string, invitationAmount: Amount<'set'>, invitationMakers: import('./types').
|
|
26
|
+
onNewContinuingOffer: (offerId: string, invitationAmount: Amount<'set'>, invitationMakers: import('./types').RemoteInvitationMakers, publicSubscribers: import('./types').PublicSubscribers | import('@agoric/zoe/src/contractSupport').TopicsRecord) => Promise<void>;
|
|
27
27
|
}): {
|
|
28
28
|
/**
|
|
29
29
|
* Take an offer description provided in capData, augment it with payments and call zoe.offer()
|
package/src/offers.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"offers.d.ts","sourceRoot":"","sources":["offers.js"],"names":[],"mappings":"AAIA;;GAEG;AAEH;;;;;;;GAOG;AAEH,kEAAkE;AAClE,+CAAgD;AAwBzC;SAVI,KAAK,UAAU,CAAC;;mCACW,QAAQ,MAAM,CAAC;;sBAC1C,KAAK,OAAO,KAAK,CAAC,CAAC;;gBAEnB,KAAK,OAAO,EAAE,MAAM,GAAE,OAAO,CAAC;mCACvB,OAAO,eAAe,EAAE,cAAc,KAAK,KAAK,UAAU,CAAC;+BAC1D,KAAK,KAAK,QAAQ,
|
|
1
|
+
{"version":3,"file":"offers.d.ts","sourceRoot":"","sources":["offers.js"],"names":[],"mappings":"AAIA;;GAEG;AAEH;;;;;;;GAOG;AAEH,kEAAkE;AAClE,+CAAgD;AAwBzC;SAVI,KAAK,UAAU,CAAC;;mCACW,QAAQ,MAAM,CAAC;;sBAC1C,KAAK,OAAO,KAAK,CAAC,CAAC;;gBAEnB,KAAK,OAAO,EAAE,MAAM,GAAE,OAAO,CAAC;mCACvB,OAAO,eAAe,EAAE,cAAc,KAAK,KAAK,UAAU,CAAC;+BAC1D,KAAK,KAAK,QAAQ,OAAO,SAAS,EAAE,WAAW,CAAC;;6BAC/C,WAAW,KAAK,IAAI;oCACnB,MAAM,oBAAoB,OAAO,KAAK,CAAC,oBAAoB,OAAO,SAAS,EAAE,sBAAsB,qBAAqB,OAAO,SAAS,EAAE,iBAAiB,GAAG,OAAO,iCAAiC,EAAE,YAAY,KAAM,QAAQ,IAAI,CAAC;;IAaxP;;;;;;;OAOG;4BAJQ,SAAS,2BACC,QAAQ,KAAK,IAAI,GACzB,QAAQ,IAAI,CAAC;EA0I7B;sBA/LY,MAAM,GAAG,MAAM;wBAIf;IACZ,EAAM,EAAE,OAAO,CAAC;IAChB,cAAkB,EAAE,OAAO,eAAe,EAAE,cAAc,CAAC;IAC3D,QAAY,EAAE,QAAQ,CAAC;IACvB,SAAa,CAAC,EAAE,OAAO,CAAA;CACpB;0BAOS,OAAO,aAAa,EAAE,SAAS,GAAG;IAC9C,KAAO,CAAC,EAAE,MAAM,CAAC;IACjB,iBAAmB,CAAC,EAAE,MAAM,CAAA;IAC5B,MAAQ,CAAC,EAAE,OAAO,GAAG,yBAAyB,CAAC;IAC/C,OAAS,CAAC,EAAE,mBAAmB,CAAC;CAC7B"}
|
package/src/offers.js
CHANGED
|
@@ -36,9 +36,9 @@ export const UNPUBLISHED_RESULT = 'UNPUBLISHED';
|
|
|
36
36
|
* @param {object} opts.powers
|
|
37
37
|
* @param {Pick<Console, 'info'| 'error'>} opts.powers.logger
|
|
38
38
|
* @param {(spec: import('./invitations').InvitationSpec) => ERef<Invitation>} opts.powers.invitationFromSpec
|
|
39
|
-
* @param {(brand: Brand) => Promise<
|
|
39
|
+
* @param {(brand: Brand) => Promise<import('./types').RemotePurse>} opts.powers.purseForBrand
|
|
40
40
|
* @param {(status: OfferStatus) => void} opts.onStatusChange
|
|
41
|
-
* @param {(offerId: string, invitationAmount: Amount<'set'>, invitationMakers: import('./types').
|
|
41
|
+
* @param {(offerId: string, invitationAmount: Amount<'set'>, invitationMakers: import('./types').RemoteInvitationMakers, publicSubscribers: import('./types').PublicSubscribers | import('@agoric/zoe/src/contractSupport').TopicsRecord ) => Promise<void>} opts.onNewContinuingOffer
|
|
42
42
|
*/
|
|
43
43
|
export const makeOfferExecutor = ({
|
|
44
44
|
zoe,
|
|
@@ -86,13 +86,15 @@ export const makeOfferExecutor = ({
|
|
|
86
86
|
deeplyFulfilledObject(paymentsManager.withdrawGive(proposal.give)));
|
|
87
87
|
|
|
88
88
|
const invitation = invitationFromSpec(invitationSpec);
|
|
89
|
-
const invitationAmount =
|
|
90
|
-
|
|
89
|
+
const invitationAmount = await E(invitationIssuer).getAmountOf(
|
|
90
|
+
invitation,
|
|
91
|
+
);
|
|
91
92
|
|
|
92
93
|
// 2. Begin executing offer
|
|
93
94
|
// No explicit signal to user that we reached here but if anything above
|
|
94
95
|
// failed they'd get an 'error' status update.
|
|
95
96
|
|
|
97
|
+
// eslint-disable-next-line @jessie.js/no-nested-await -- unconditional
|
|
96
98
|
seatRef = await E(zoe).offer(
|
|
97
99
|
invitation,
|
|
98
100
|
proposal,
|
package/src/payments.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export function makePaymentsHelper(purseForBrand: (brand: Brand) => Promise<
|
|
1
|
+
export function makePaymentsHelper(purseForBrand: (brand: Brand) => Promise<import('./types').RemotePurse>, depositFacet: {
|
|
2
2
|
receive: (payment: any) => Promise<Amount>;
|
|
3
3
|
}): {
|
|
4
4
|
/**
|
|
@@ -10,7 +10,7 @@ export function makePaymentsHelper(purseForBrand: (brand: Brand) => Promise<Purs
|
|
|
10
10
|
* Try reclaiming any of our payments that we successfully withdrew, but
|
|
11
11
|
* were left unclaimed.
|
|
12
12
|
*/
|
|
13
|
-
tryReclaimingWithdrawnPayments(): Promise<undefined> | Promise<PromiseSettledResult<Amount<
|
|
13
|
+
tryReclaimingWithdrawnPayments(): Promise<undefined> | Promise<PromiseSettledResult<Amount<unknown> | undefined>[]>;
|
|
14
14
|
/**
|
|
15
15
|
* @param {PaymentPKeywordRecord} payouts
|
|
16
16
|
* @returns {Promise<AmountKeywordRecord>} amounts for deferred deposits will be empty
|
package/src/payments.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"payments.d.ts","sourceRoot":"","sources":["payments.js"],"names":[],"mappings":"AAUO,0DAHY,KAAK,KAAK,QAAQ,
|
|
1
|
+
{"version":3,"file":"payments.d.ts","sourceRoot":"","sources":["payments.js"],"names":[],"mappings":"AAUO,0DAHY,KAAK,KAAK,QAAQ,OAAO,SAAS,EAAE,WAAW,CAAC;+BAC7B,QAAQ,MAAM,CAAC;;IAcjD;;;OAGG;uBAFQ,mBAAmB,GACjB,qBAAqB;IAkBlC;;;OAGG;;IA8BH;;;OAGG;4BAFQ,qBAAqB,GACnB,QAAQ,mBAAmB,CAAC;EAU5C"}
|
package/src/payments.js
CHANGED
|
@@ -5,7 +5,7 @@ import { E } from '@endo/far';
|
|
|
5
5
|
/**
|
|
6
6
|
* Used in an offer execution to manage payments state safely.
|
|
7
7
|
*
|
|
8
|
-
* @param {(brand: Brand) => Promise<
|
|
8
|
+
* @param {(brand: Brand) => Promise<import('./types').RemotePurse>} purseForBrand
|
|
9
9
|
* @param {{ receive: (payment: *) => Promise<Amount> }} depositFacet
|
|
10
10
|
*/
|
|
11
11
|
export const makePaymentsHelper = (purseForBrand, depositFacet) => {
|
|
@@ -15,7 +15,7 @@ export const makePaymentsHelper = (purseForBrand, depositFacet) => {
|
|
|
15
15
|
/**
|
|
16
16
|
* Tracks from whence our payment came.
|
|
17
17
|
*
|
|
18
|
-
* @type {Map<Payment,
|
|
18
|
+
* @type {Map<Payment, import('./types').RemotePurse>}
|
|
19
19
|
*/
|
|
20
20
|
const paymentToPurse = new Map();
|
|
21
21
|
|
|
@@ -28,7 +28,7 @@ export const makePaymentsHelper = (purseForBrand, depositFacet) => {
|
|
|
28
28
|
!keywordPaymentPromises ||
|
|
29
29
|
Fail`withdrawPayments can be called once per helper`;
|
|
30
30
|
keywordPaymentPromises = objectMap(give, amount => {
|
|
31
|
-
/** @type {Promise<
|
|
31
|
+
/** @type {Promise<import('./types').RemotePurse<any>>} */
|
|
32
32
|
const purseP = purseForBrand(amount.brand);
|
|
33
33
|
return Promise.all([purseP, E(purseP).withdraw(amount)]).then(
|
|
34
34
|
([purse, payment]) => {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export function upgradeWalletFactory({ consume: { contractKits
|
|
1
|
+
export function upgradeWalletFactory({ consume: { contractKits: kitsP, instancePrivateArgs: argsP }, instance: { consume: { walletFactory: wfInstanceP }, }, }: BootstrapPowers, config: {
|
|
2
2
|
options: {
|
|
3
3
|
walletFactoryRef: VatSourceRef & {
|
|
4
4
|
bundleID: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"upgrade-walletFactory-proposal.d.ts","sourceRoot":"","sources":["upgrade-walletFactory-proposal.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"upgrade-walletFactory-proposal.d.ts","sourceRoot":"","sources":["upgrade-walletFactory-proposal.js"],"names":[],"mappings":"AAoBO,gKALK,eAAe;;0BAGI,YAAY,GAAG;YAAE,QAAQ,EAAE,MAAM,CAAA;SAAE;;kBA6BjE;AAMM,mGAFK,eAAe,iBAwB1B;AAsBM;;;;;;;EAKN"}
|
|
@@ -8,7 +8,6 @@ console.warn('upgrade-walletFactory-proposal.js module evaluating');
|
|
|
8
8
|
const { Fail } = assert;
|
|
9
9
|
|
|
10
10
|
// vstorage paths under published.*
|
|
11
|
-
const WALLET_STORAGE_PATH_SEGMENT = 'wallet';
|
|
12
11
|
const BOARD_AUX = 'boardAux';
|
|
13
12
|
|
|
14
13
|
const marshalData = makeMarshal(_val => Fail`data only`);
|
|
@@ -21,14 +20,9 @@ const marshalData = makeMarshal(_val => Fail`data only`);
|
|
|
21
20
|
*/
|
|
22
21
|
export const upgradeWalletFactory = async (
|
|
23
22
|
{
|
|
24
|
-
consume: {
|
|
25
|
-
contractKits,
|
|
26
|
-
governedContractKits,
|
|
27
|
-
chainStorage,
|
|
28
|
-
walletBridgeManager: walletBridgeManagerP,
|
|
29
|
-
},
|
|
23
|
+
consume: { contractKits: kitsP, instancePrivateArgs: argsP },
|
|
30
24
|
instance: {
|
|
31
|
-
consume: { walletFactory: wfInstanceP
|
|
25
|
+
consume: { walletFactory: wfInstanceP },
|
|
32
26
|
},
|
|
33
27
|
},
|
|
34
28
|
config,
|
|
@@ -36,36 +30,20 @@ export const upgradeWalletFactory = async (
|
|
|
36
30
|
console.log('upgradeWalletFactory: config', config);
|
|
37
31
|
const { walletFactoryRef } = config.options;
|
|
38
32
|
|
|
39
|
-
|
|
40
|
-
const
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
// @ts-expect-error chainStorage is only falsy in testing
|
|
46
|
-
storageNode: E(chainStorage).makeChildNode(WALLET_STORAGE_PATH_SEGMENT),
|
|
47
|
-
});
|
|
48
|
-
// console.log('upgradeWalletFactory: awaiting contract kits');
|
|
49
|
-
const { wfKit, ppKit } = await allValues({
|
|
50
|
-
wfKit: E(contractKits).get(wfInstance),
|
|
51
|
-
ppKit: E(governedContractKits).get(ppInstance),
|
|
33
|
+
console.log('upgradeWalletFactory: awaiting instance');
|
|
34
|
+
const wfInstance = await wfInstanceP;
|
|
35
|
+
console.log('upgradeWalletFactory: awaiting contract kits');
|
|
36
|
+
const { contractKits, instancePrivateArgs } = await allValues({
|
|
37
|
+
contractKits: kitsP,
|
|
38
|
+
instancePrivateArgs: argsP,
|
|
52
39
|
});
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
console.log(
|
|
62
|
-
'upgradeWalletFactory: upgrading with newPrivateArgs',
|
|
63
|
-
newPrivateArgs,
|
|
64
|
-
);
|
|
65
|
-
await E(wfKit.adminFacet).upgradeContract(
|
|
66
|
-
walletFactoryRef.bundleID,
|
|
67
|
-
newPrivateArgs,
|
|
68
|
-
);
|
|
40
|
+
const { adminFacet } = contractKits.get(wfInstance);
|
|
41
|
+
/** @type {Parameters<typeof import('../walletFactory').prepare>[1]} */
|
|
42
|
+
// @ts-expect-error cast
|
|
43
|
+
const unsettledArgs = instancePrivateArgs.get(wfInstance);
|
|
44
|
+
const privateArgs = await allValues(unsettledArgs);
|
|
45
|
+
console.log('upgradeWalletFactory: upgrading with privateArgs', privateArgs);
|
|
46
|
+
await E(adminFacet).upgradeContract(walletFactoryRef.bundleID, privateArgs);
|
|
69
47
|
console.log('upgradeWalletFactory: done');
|
|
70
48
|
};
|
|
71
49
|
harden(upgradeWalletFactory);
|
|
@@ -90,7 +68,7 @@ export const publishAgoricBrandsDisplayInfo = async ({
|
|
|
90
68
|
await E(node).setValue(JSON.stringify(aux));
|
|
91
69
|
};
|
|
92
70
|
|
|
93
|
-
/** @type {ERef<
|
|
71
|
+
/** @type {ERef<NameHub>} */
|
|
94
72
|
const brandHub = E(agoricNames).lookup('brand');
|
|
95
73
|
const brands = await E(brandHub).values();
|
|
96
74
|
// tolerate failure; in particular, for the timer brand
|
|
@@ -104,10 +82,7 @@ const manifest = {
|
|
|
104
82
|
// include rationale for closely-held, high authority capabilities
|
|
105
83
|
consume: {
|
|
106
84
|
contractKits: `to upgrade walletFactory using its adminFacet`,
|
|
107
|
-
|
|
108
|
-
'to get walletReviver from provisionPool.creatorFacet',
|
|
109
|
-
chainStorage: 'to allow walletFactory to (continue) write to vstorage',
|
|
110
|
-
walletBridgeManager: 'to handle bridged cosmos SpendAction messages',
|
|
85
|
+
instancePrivateArgs: `to get privateArgs for walletFactory`,
|
|
111
86
|
},
|
|
112
87
|
// widely-shared, low authority instance handles need no rationale
|
|
113
88
|
instance: {
|
package/src/smartWallet.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export const BRAND_TO_PURSES_KEY: "brandToPurses";
|
|
2
|
-
export function prepareSmartWallet(baggage: MapStore<string,
|
|
2
|
+
export function prepareSmartWallet(baggage: MapStore<string, unknown>, shared: SharedParams): (uniqueWithoutChildNodes: Omit<UniqueParams, "currentStorageNode" | "walletStorageNode"> & {
|
|
3
3
|
walletStorageNode: ERef<StorageNode>;
|
|
4
4
|
}) => Promise<{
|
|
5
5
|
/**
|
|
@@ -126,6 +126,7 @@ export type BrandDescriptor = {
|
|
|
126
126
|
issuer: Issuer;
|
|
127
127
|
petname: import('./types').Petname;
|
|
128
128
|
};
|
|
129
|
+
export type RemotePurse = import('./types').RemotePurse;
|
|
129
130
|
export type UniqueParams = {
|
|
130
131
|
address: string;
|
|
131
132
|
bank: ERef<import('@agoric/vats/src/vat-bank').Bank>;
|
|
@@ -155,7 +156,7 @@ export type ImmutableState = Readonly<UniqueParams & {
|
|
|
155
156
|
offerToInvitationMakers: MapStore<string, import('./types').InvitationMakers>;
|
|
156
157
|
offerToPublicSubscriberPaths: MapStore<string, Record<string, string>>;
|
|
157
158
|
offerToUsedInvitation: MapStore<string, Amount>;
|
|
158
|
-
purseBalances: MapStore<
|
|
159
|
+
purseBalances: MapStore<RemotePurse, Amount>;
|
|
159
160
|
updateRecorderKit: import('@agoric/zoe/src/contractSupport/recorder.js').RecorderKit<UpdateRecord>;
|
|
160
161
|
currentRecorderKit: import('@agoric/zoe/src/contractSupport/recorder.js').RecorderKit<CurrentWalletRecord>;
|
|
161
162
|
liveOffers: MapStore<import('./offers.js').OfferId, import('./offers.js').OfferStatus>;
|
package/src/smartWallet.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"smartWallet.d.ts","sourceRoot":"","sources":["smartWallet.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"smartWallet.d.ts","sourceRoot":"","sources":["smartWallet.js"],"names":[],"mappings":"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"}
|
package/src/smartWallet.js
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
// backported types are out of sync
|
|
2
|
+
// @ts-nocheck
|
|
1
3
|
import {
|
|
2
4
|
AmountShape,
|
|
3
5
|
BrandShape,
|
|
@@ -111,6 +113,9 @@ const trace = makeTracer('SmrtWlt');
|
|
|
111
113
|
* For use by clients to describe brands to users. Includes `displayInfo` to save a remote call.
|
|
112
114
|
*/
|
|
113
115
|
|
|
116
|
+
// imports
|
|
117
|
+
/** @typedef {import('./types').RemotePurse} RemotePurse */
|
|
118
|
+
|
|
114
119
|
/**
|
|
115
120
|
* @typedef {{
|
|
116
121
|
* address: string,
|
|
@@ -142,7 +147,7 @@ const trace = makeTracer('SmrtWlt');
|
|
|
142
147
|
* offerToInvitationMakers: MapStore<string, import('./types').InvitationMakers>,
|
|
143
148
|
* offerToPublicSubscriberPaths: MapStore<string, Record<string, string>>,
|
|
144
149
|
* offerToUsedInvitation: MapStore<string, Amount>,
|
|
145
|
-
* purseBalances: MapStore<
|
|
150
|
+
* purseBalances: MapStore<RemotePurse, Amount>,
|
|
146
151
|
* updateRecorderKit: import('@agoric/zoe/src/contractSupport/recorder.js').RecorderKit<UpdateRecord>,
|
|
147
152
|
* currentRecorderKit: import('@agoric/zoe/src/contractSupport/recorder.js').RecorderKit<CurrentWalletRecord>,
|
|
148
153
|
* liveOffers: MapStore<import('./offers.js').OfferId, import('./offers.js').OfferStatus>,
|
|
@@ -160,7 +165,7 @@ const trace = makeTracer('SmrtWlt');
|
|
|
160
165
|
* TODO: consider moving to nameHub.js?
|
|
161
166
|
*
|
|
162
167
|
* @param {unknown} target - passable Key
|
|
163
|
-
* @param {ERef<
|
|
168
|
+
* @param {ERef<NameHub>} nameHub
|
|
164
169
|
*/
|
|
165
170
|
const namesOf = async (target, nameHub) => {
|
|
166
171
|
const entries = await E(nameHub).entries();
|
|
@@ -371,7 +376,7 @@ export const prepareSmartWallet = (baggage, shared) => {
|
|
|
371
376
|
!used || Fail`cannot re-use offer id ${id}`;
|
|
372
377
|
},
|
|
373
378
|
/**
|
|
374
|
-
* @param {
|
|
379
|
+
* @param {RemotePurse} purse
|
|
375
380
|
* @param {Amount<any>} balance
|
|
376
381
|
*/
|
|
377
382
|
updateBalance(purse, balance) {
|
|
@@ -410,7 +415,7 @@ export const prepareSmartWallet = (baggage, shared) => {
|
|
|
410
415
|
});
|
|
411
416
|
},
|
|
412
417
|
|
|
413
|
-
/** @type {(purse: ERef<
|
|
418
|
+
/** @type {(purse: ERef<RemotePurse>) => Promise<void>} */
|
|
414
419
|
async watchPurse(purseRef) {
|
|
415
420
|
const { address } = this.state;
|
|
416
421
|
|
|
@@ -447,7 +452,7 @@ export const prepareSmartWallet = (baggage, shared) => {
|
|
|
447
452
|
* to facilitate a transition to decentralized introductions.
|
|
448
453
|
*
|
|
449
454
|
* @param {Brand} brand
|
|
450
|
-
* @param {ERef<
|
|
455
|
+
* @param {ERef<NameHub>} known - namehub with brand, issuer branches
|
|
451
456
|
* @returns {Promise<Purse | undefined>} undefined if brand is not known
|
|
452
457
|
*/
|
|
453
458
|
async getPurseIfKnownBrand(brand, known) {
|
|
@@ -579,14 +584,15 @@ export const prepareSmartWallet = (baggage, shared) => {
|
|
|
579
584
|
),
|
|
580
585
|
/**
|
|
581
586
|
* @param {Brand} brand
|
|
582
|
-
* @returns {Promise<
|
|
587
|
+
* @returns {Promise<RemotePurse>}
|
|
583
588
|
*/
|
|
584
589
|
purseForBrand: async brand => {
|
|
585
590
|
const { helper } = facets;
|
|
586
591
|
if (registry.has(brand)) {
|
|
587
|
-
// @ts-expect-error
|
|
592
|
+
// @ts-expect-error RemotePurse cast
|
|
588
593
|
return E(bank).getPurse(brand);
|
|
589
594
|
} else if (invitationBrand === brand) {
|
|
595
|
+
// @ts-expect-error RemotePurse cast
|
|
590
596
|
return invitationPurse;
|
|
591
597
|
}
|
|
592
598
|
|
|
@@ -621,7 +627,7 @@ export const prepareSmartWallet = (baggage, shared) => {
|
|
|
621
627
|
}
|
|
622
628
|
}
|
|
623
629
|
},
|
|
624
|
-
/** @type {(offerId: string, invitationAmount: Amount<'set'>, invitationMakers: import('./types').
|
|
630
|
+
/** @type {(offerId: string, invitationAmount: Amount<'set'>, invitationMakers: import('./types').RemoteInvitationMakers, publicSubscribers?: import('./types').PublicSubscribers | import('@agoric/zoe/src/contractSupport').TopicsRecord) => Promise<void>} */
|
|
625
631
|
onNewContinuingOffer: async (
|
|
626
632
|
offerId,
|
|
627
633
|
invitationAmount,
|
|
@@ -746,6 +752,7 @@ export const prepareSmartWallet = (baggage, shared) => {
|
|
|
746
752
|
const { invitationPurse } = state;
|
|
747
753
|
const { helper } = facets;
|
|
748
754
|
|
|
755
|
+
// @ts-expect-error RemotePurse cast
|
|
749
756
|
void helper.watchPurse(invitationPurse);
|
|
750
757
|
},
|
|
751
758
|
},
|
package/src/typeGuards.d.ts
CHANGED
package/src/types.d.ts
CHANGED
|
@@ -5,11 +5,9 @@
|
|
|
5
5
|
* Downside is it can't reference any ambient types, which most of agoric-sdk type are presently.
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
|
-
import
|
|
8
|
+
import { ERef, FarRef } from '@endo/far';
|
|
9
9
|
import type { CapData } from '@endo/marshal';
|
|
10
10
|
import type { MsgWalletSpendAction } from '@agoric/cosmic-proto/swingset/msgs';
|
|
11
|
-
import type { AgoricNamesRemotes } from '@agoric/vats/tools/board-utils.js';
|
|
12
|
-
import type { OfferSpec } from './offers.js';
|
|
13
11
|
|
|
14
12
|
declare const CapDataShape: unique symbol;
|
|
15
13
|
|
|
@@ -21,9 +19,10 @@ declare const CapDataShape: unique symbol;
|
|
|
21
19
|
*/
|
|
22
20
|
export type Petname = string | string[];
|
|
23
21
|
|
|
24
|
-
export type
|
|
25
|
-
|
|
26
|
-
|
|
22
|
+
export type RemotePurse<T = unknown> = FarRef<Purse<T>>;
|
|
23
|
+
|
|
24
|
+
export type RemoteInvitationMakers = FarRef<
|
|
25
|
+
Record<string, (...args: any[]) => Promise<Invitation>>
|
|
27
26
|
>;
|
|
28
27
|
|
|
29
28
|
export type PublicSubscribers = Record<string, ERef<StoredFacet>>;
|
|
@@ -75,11 +74,3 @@ export type WalletSpendActionMsg = {
|
|
|
75
74
|
* the sending of the message (as is the case for WALLET_SPEND_ACTION).
|
|
76
75
|
*/
|
|
77
76
|
export type WalletBridgeMsg = WalletActionMsg | WalletSpendActionMsg;
|
|
78
|
-
|
|
79
|
-
/**
|
|
80
|
-
* Used for clientSupport helpers
|
|
81
|
-
*/
|
|
82
|
-
export type OfferMaker = (
|
|
83
|
-
agoricNames: AgoricNamesRemotes,
|
|
84
|
-
...rest: any[]
|
|
85
|
-
) => OfferSpec;
|
package/src/walletFactory.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export namespace customTermsShape {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
2
|
+
const agoricNames: any;
|
|
3
|
+
const board: any;
|
|
4
|
+
const assetPublisher: any;
|
|
5
5
|
}
|
|
6
6
|
export const privateArgsShape: import("@endo/patterns").Matcher;
|
|
7
7
|
export function publishDepositFacet(address: string, wallet: import('./smartWallet.js').SmartWallet, namesByAddressAdmin: ERef<import('@agoric/vats').NameAdmin>): Promise<unknown>;
|
|
@@ -26,7 +26,7 @@ export function prepare(zcf: ZCF<SmartWalletContractTerms>, privateArgs: {
|
|
|
26
26
|
storageNode: ERef<StorageNode>;
|
|
27
27
|
walletBridgeManager?: ERef<import("@agoric/vats").ScopedBridgeManager> | undefined;
|
|
28
28
|
walletReviver?: ERef<WalletReviver> | undefined;
|
|
29
|
-
}, baggage: MapStore<string,
|
|
29
|
+
}, baggage: MapStore<string, unknown>): Promise<{
|
|
30
30
|
creatorFacet: {
|
|
31
31
|
/**
|
|
32
32
|
* @param {string} address
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"walletFactory.d.ts","sourceRoot":"","sources":["walletFactory.js"],"names":[],"mappings":";;;;;AAwBA,gEAKE;AAUK,6CAJI,MAAM,UACN,OAAO,kBAAkB,EAAE,WAAW,uBACtC,KAAK,OAAO,cAAc,EAAE,SAAS,CAAC,oBAehD;AAWM,kDAFI,cAAc;IAwCrB,2BAA2B;iBAAf,KAAK;IAEjB,2BAA2B;iBAAf,KAAK;eApCP,KAAK;qBACC,WAAW;gBAChB,MAAM;iBACL,OAAO,SAAS,EAAE,OAAO;;;eAH3B,KAAK;qBACC,WAAW;gBAChB,MAAM;iBACL,OAAO,SAAS,EAAE,OAAO;;EAsCxC;AAmCM,6BARI,IAAI,wBAAwB,CAAC;iBAEtB,KAAK,WAAW,CAAC;;;;;
|
|
1
|
+
{"version":3,"file":"walletFactory.d.ts","sourceRoot":"","sources":["walletFactory.js"],"names":[],"mappings":";;;;;AAwBA,gEAKE;AAUK,6CAJI,MAAM,UACN,OAAO,kBAAkB,EAAE,WAAW,uBACtC,KAAK,OAAO,cAAc,EAAE,SAAS,CAAC,oBAehD;AAWM,kDAFI,cAAc;IAwCrB,2BAA2B;iBAAf,KAAK;IAEjB,2BAA2B;iBAAf,KAAK;eApCP,KAAK;qBACC,WAAW;gBAChB,MAAM;iBACL,OAAO,SAAS,EAAE,OAAO;;;eAH3B,KAAK;qBACC,WAAW;gBAChB,MAAM;iBACL,OAAO,SAAS,EAAE,OAAO;;EAsCxC;AAmCM,6BARI,IAAI,wBAAwB,CAAC;iBAEtB,KAAK,WAAW,CAAC;;;;;QAgH7B;;;;;;;WAOG;oCANQ,MAAM,QACN,KAAK,OAAO,2BAA2B,EAAE,IAAI,CAAC,uBAC9C,KAAK,OAAO,eAAe,EAAE,SAAS,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;QAHlD;;;;;;;WAOG;oCANQ,MAAM,QACN,KAAK,OAAO,2BAA2B,EAAE,IAAI,CAAC,uBAC9C,KAAK,OAAO,eAAe,EAAE,SAAS,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;GAqDvD;uCAlMY;IACZ,WAAe,EAAE,KAAK,OAAO,CAAC,CAAC;IAC/B,KAAS,EAAE,KAAK,OAAO,cAAc,EAAE,KAAK,CAAC,CAAC;IAC9C,cAAkB,EAAE,cAAc,CAAC;CAChC;sBAES,OAAO,cAAc,EAAE,OAAO;6BAE9B;IACZ,oBAAwB,EAAE,MAAM,KAChC,kBAAwB,OAAO,2BAA2B,EAAE,eAAe,CAAC,CAAC,CAAA;CAC1E;uBAES,OAAO;;4BAES,MAAM,KAAK,QAAQ,OAAO,eAAe,EAAE,WAAW,CAAC;yBAC1D,MAAM,KAAK,QAAQ;;oBAuL/B,cAAc"}
|
package/src/walletFactory.js
CHANGED
|
@@ -142,7 +142,6 @@ export const makeAssetRegistry = assetPublisher => {
|
|
|
142
142
|
* @param {import('@agoric/vat-data').Baggage} baggage
|
|
143
143
|
*/
|
|
144
144
|
export const prepare = async (zcf, privateArgs, baggage) => {
|
|
145
|
-
const upgrading = baggage.has('walletsByAddress');
|
|
146
145
|
const { agoricNames, board, assetPublisher } = zcf.getTerms();
|
|
147
146
|
|
|
148
147
|
const zoe = zcf.getZoeService();
|
|
@@ -293,6 +292,7 @@ export const prepare = async (zcf, privateArgs, baggage) => {
|
|
|
293
292
|
if (walletBridgeManager) {
|
|
294
293
|
// NB: may not be in service when creatorFacet is used, or ever
|
|
295
294
|
// It can't be awaited because that fails vat restart
|
|
295
|
+
const upgrading = baggage.has('walletsByAddress');
|
|
296
296
|
if (upgrading) {
|
|
297
297
|
void E(walletBridgeManager).setHandler(handleWalletAction);
|
|
298
298
|
} else {
|