@agoric/fast-usdc 0.1.1-dev-b5d1abe.0 → 0.1.1-dev-78063fc.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/package.json +15 -15
- package/src/exos/advancer.js +17 -15
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@agoric/fast-usdc",
|
|
3
|
-
"version": "0.1.1-dev-
|
|
3
|
+
"version": "0.1.1-dev-78063fc.0+78063fc",
|
|
4
4
|
"description": "CLI and library for Fast USDC product",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"files": [
|
|
@@ -22,9 +22,9 @@
|
|
|
22
22
|
"lint:eslint": "eslint ."
|
|
23
23
|
},
|
|
24
24
|
"devDependencies": {
|
|
25
|
-
"@agoric/swingset-liveslots": "0.10.3-dev-
|
|
26
|
-
"@agoric/vats": "0.15.2-dev-
|
|
27
|
-
"@agoric/zone": "0.2.3-dev-
|
|
25
|
+
"@agoric/swingset-liveslots": "0.10.3-dev-78063fc.0+78063fc",
|
|
26
|
+
"@agoric/vats": "0.15.2-dev-78063fc.0+78063fc",
|
|
27
|
+
"@agoric/zone": "0.2.3-dev-78063fc.0+78063fc",
|
|
28
28
|
"@fast-check/ava": "^2.0.1",
|
|
29
29
|
"ava": "^5.3.0",
|
|
30
30
|
"c8": "^10.1.2",
|
|
@@ -32,16 +32,16 @@
|
|
|
32
32
|
"ts-blank-space": "^0.4.4"
|
|
33
33
|
},
|
|
34
34
|
"dependencies": {
|
|
35
|
-
"@agoric/client-utils": "0.1.1-dev-
|
|
36
|
-
"@agoric/cosmic-proto": "0.4.1-dev-
|
|
37
|
-
"@agoric/ertp": "0.16.3-dev-
|
|
38
|
-
"@agoric/internal": "0.3.3-dev-
|
|
39
|
-
"@agoric/notifier": "0.6.3-dev-
|
|
40
|
-
"@agoric/orchestration": "0.1.1-dev-
|
|
41
|
-
"@agoric/store": "0.9.3-dev-
|
|
42
|
-
"@agoric/vat-data": "0.5.3-dev-
|
|
43
|
-
"@agoric/vow": "0.1.1-dev-
|
|
44
|
-
"@agoric/zoe": "0.26.3-dev-
|
|
35
|
+
"@agoric/client-utils": "0.1.1-dev-78063fc.0+78063fc",
|
|
36
|
+
"@agoric/cosmic-proto": "0.4.1-dev-78063fc.0+78063fc",
|
|
37
|
+
"@agoric/ertp": "0.16.3-dev-78063fc.0+78063fc",
|
|
38
|
+
"@agoric/internal": "0.3.3-dev-78063fc.0+78063fc",
|
|
39
|
+
"@agoric/notifier": "0.6.3-dev-78063fc.0+78063fc",
|
|
40
|
+
"@agoric/orchestration": "0.1.1-dev-78063fc.0+78063fc",
|
|
41
|
+
"@agoric/store": "0.9.3-dev-78063fc.0+78063fc",
|
|
42
|
+
"@agoric/vat-data": "0.5.3-dev-78063fc.0+78063fc",
|
|
43
|
+
"@agoric/vow": "0.1.1-dev-78063fc.0+78063fc",
|
|
44
|
+
"@agoric/zoe": "0.26.3-dev-78063fc.0+78063fc",
|
|
45
45
|
"@cosmjs/proto-signing": "^0.32.4",
|
|
46
46
|
"@cosmjs/stargate": "^0.32.4",
|
|
47
47
|
"@endo/base64": "^1.0.9",
|
|
@@ -81,5 +81,5 @@
|
|
|
81
81
|
"publishConfig": {
|
|
82
82
|
"access": "public"
|
|
83
83
|
},
|
|
84
|
-
"gitHead": "
|
|
84
|
+
"gitHead": "78063fcb842125cdcd840898065c8e39fd926be3"
|
|
85
85
|
}
|
package/src/exos/advancer.js
CHANGED
|
@@ -23,7 +23,7 @@ import { makeFeeTools } from '../utils/fees.js';
|
|
|
23
23
|
* @import {ZoeTools} from '@agoric/orchestration/src/utils/zoe-tools.js';
|
|
24
24
|
* @import {VowTools} from '@agoric/vow';
|
|
25
25
|
* @import {Zone} from '@agoric/zone';
|
|
26
|
-
* @import {
|
|
26
|
+
* @import {AddressHook, EvmHash, FeeConfig, LogFn, NobleAddress, EvidenceWithRisk} from '../types.js';
|
|
27
27
|
* @import {StatusManager} from './status-manager.js';
|
|
28
28
|
* @import {LiquidityPoolKit} from './liquidity-pool.js';
|
|
29
29
|
*/
|
|
@@ -213,14 +213,20 @@ export const prepareAdvancerKit = (
|
|
|
213
213
|
* @param {AdvancerVowCtx & { tmpSeat: ZCFSeat }} ctx
|
|
214
214
|
*/
|
|
215
215
|
onFulfilled(result, ctx) {
|
|
216
|
-
const { poolAccount, intermediateRecipient } =
|
|
216
|
+
const { poolAccount, intermediateRecipient, settlementAddress } =
|
|
217
|
+
this.state;
|
|
217
218
|
const { destination, advanceAmount, tmpSeat: _, ...detail } = ctx;
|
|
218
|
-
const
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
219
|
+
const amount = harden({
|
|
220
|
+
denom: usdc.denom,
|
|
221
|
+
value: advanceAmount.value,
|
|
222
|
+
});
|
|
223
|
+
const transferOrSendV =
|
|
224
|
+
destination.chainId === settlementAddress.chainId
|
|
225
|
+
? E(poolAccount).send(destination, amount)
|
|
226
|
+
: E(poolAccount).transfer(destination, amount, {
|
|
227
|
+
forwardOpts: { intermediateRecipient },
|
|
228
|
+
});
|
|
229
|
+
return watch(transferOrSendV, this.facets.transferHandler, {
|
|
224
230
|
destination,
|
|
225
231
|
advanceAmount,
|
|
226
232
|
...detail,
|
|
@@ -253,17 +259,13 @@ export const prepareAdvancerKit = (
|
|
|
253
259
|
},
|
|
254
260
|
transferHandler: {
|
|
255
261
|
/**
|
|
256
|
-
* @param {
|
|
262
|
+
* @param {undefined} result
|
|
257
263
|
* @param {AdvancerVowCtx} ctx
|
|
258
264
|
*/
|
|
259
265
|
onFulfilled(result, ctx) {
|
|
260
266
|
const { notifyFacet } = this.state;
|
|
261
267
|
const { advanceAmount, destination, ...detail } = ctx;
|
|
262
|
-
log('Advance
|
|
263
|
-
advanceAmount,
|
|
264
|
-
destination,
|
|
265
|
-
result,
|
|
266
|
-
});
|
|
268
|
+
log('Advance succeeded', { advanceAmount, destination });
|
|
267
269
|
// During development, due to a bug, this call threw.
|
|
268
270
|
// The failure was silent (no diagnostics) due to:
|
|
269
271
|
// - #10576 Vows do not report unhandled rejections
|
|
@@ -278,7 +280,7 @@ export const prepareAdvancerKit = (
|
|
|
278
280
|
*/
|
|
279
281
|
onRejected(error, ctx) {
|
|
280
282
|
const { notifyFacet } = this.state;
|
|
281
|
-
log('Advance
|
|
283
|
+
log('Advance failed', error);
|
|
282
284
|
const { advanceAmount: _, ...restCtx } = ctx;
|
|
283
285
|
notifyFacet.notifyAdvancingResult(restCtx, false);
|
|
284
286
|
},
|