@agoric/fast-usdc 0.1.1-dev-0e4c5b5.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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@agoric/fast-usdc",
3
- "version": "0.1.1-dev-0e4c5b5.0+0e4c5b5",
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-0e4c5b5.0+0e4c5b5",
26
- "@agoric/vats": "0.15.2-dev-0e4c5b5.0+0e4c5b5",
27
- "@agoric/zone": "0.2.3-dev-0e4c5b5.0+0e4c5b5",
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-0e4c5b5.0+0e4c5b5",
36
- "@agoric/cosmic-proto": "0.4.1-dev-0e4c5b5.0+0e4c5b5",
37
- "@agoric/ertp": "0.16.3-dev-0e4c5b5.0+0e4c5b5",
38
- "@agoric/internal": "0.3.3-dev-0e4c5b5.0+0e4c5b5",
39
- "@agoric/notifier": "0.6.3-dev-0e4c5b5.0+0e4c5b5",
40
- "@agoric/orchestration": "0.1.1-dev-0e4c5b5.0+0e4c5b5",
41
- "@agoric/store": "0.9.3-dev-0e4c5b5.0+0e4c5b5",
42
- "@agoric/vat-data": "0.5.3-dev-0e4c5b5.0+0e4c5b5",
43
- "@agoric/vow": "0.1.1-dev-0e4c5b5.0+0e4c5b5",
44
- "@agoric/zoe": "0.26.3-dev-0e4c5b5.0+0e4c5b5",
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": "0e4c5b57754bf73c40833e517d1b720f2f06219f"
84
+ "gitHead": "78063fcb842125cdcd840898065c8e39fd926be3"
85
85
  }
@@ -1,6 +1,7 @@
1
1
  /* eslint-env node */
2
2
  /**
3
3
  * @import {Command} from 'commander';
4
+ * @import {Amount, Brand} from '@agoric/ertp';
4
5
  * @import {OfferSpec} from '@agoric/smart-wallet/src/offers.js';
5
6
  * @import {ExecuteOfferAction} from '@agoric/smart-wallet/src/smartWallet.js';
6
7
  * @import {USDCProposalShapes} from '../pool-share-math.js';
@@ -16,13 +16,14 @@ import { makeFeeTools } from '../utils/fees.js';
16
16
 
17
17
  /**
18
18
  * @import {HostInterface} from '@agoric/async-flow';
19
+ * @import {Amount, Brand} from '@agoric/ertp';
19
20
  * @import {TypedPattern} from '@agoric/internal'
20
21
  * @import {NatAmount} from '@agoric/ertp';
21
22
  * @import {ChainAddress, ChainHub, Denom, OrchestrationAccount} from '@agoric/orchestration';
22
23
  * @import {ZoeTools} from '@agoric/orchestration/src/utils/zoe-tools.js';
23
24
  * @import {VowTools} from '@agoric/vow';
24
25
  * @import {Zone} from '@agoric/zone';
25
- * @import {CctpTxEvidence, AddressHook, EvmHash, FeeConfig, LogFn, NobleAddress, EvidenceWithRisk} from '../types.js';
26
+ * @import {AddressHook, EvmHash, FeeConfig, LogFn, NobleAddress, EvidenceWithRisk} from '../types.js';
26
27
  * @import {StatusManager} from './status-manager.js';
27
28
  * @import {LiquidityPoolKit} from './liquidity-pool.js';
28
29
  */
@@ -212,14 +213,20 @@ export const prepareAdvancerKit = (
212
213
  * @param {AdvancerVowCtx & { tmpSeat: ZCFSeat }} ctx
213
214
  */
214
215
  onFulfilled(result, ctx) {
215
- const { poolAccount, intermediateRecipient } = this.state;
216
+ const { poolAccount, intermediateRecipient, settlementAddress } =
217
+ this.state;
216
218
  const { destination, advanceAmount, tmpSeat: _, ...detail } = ctx;
217
- const transferV = E(poolAccount).transfer(
218
- destination,
219
- { denom: usdc.denom, value: advanceAmount.value },
220
- { forwardOpts: { intermediateRecipient } },
221
- );
222
- return watch(transferV, this.facets.transferHandler, {
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, {
223
230
  destination,
224
231
  advanceAmount,
225
232
  ...detail,
@@ -252,17 +259,13 @@ export const prepareAdvancerKit = (
252
259
  },
253
260
  transferHandler: {
254
261
  /**
255
- * @param {unknown} result TODO confirm this is not a bigint (sequence)
262
+ * @param {undefined} result
256
263
  * @param {AdvancerVowCtx} ctx
257
264
  */
258
265
  onFulfilled(result, ctx) {
259
266
  const { notifyFacet } = this.state;
260
267
  const { advanceAmount, destination, ...detail } = ctx;
261
- log('Advance transfer fulfilled', {
262
- advanceAmount,
263
- destination,
264
- result,
265
- });
268
+ log('Advance succeeded', { advanceAmount, destination });
266
269
  // During development, due to a bug, this call threw.
267
270
  // The failure was silent (no diagnostics) due to:
268
271
  // - #10576 Vows do not report unhandled rejections
@@ -277,7 +280,7 @@ export const prepareAdvancerKit = (
277
280
  */
278
281
  onRejected(error, ctx) {
279
282
  const { notifyFacet } = this.state;
280
- log('Advance transfer rejected', error);
283
+ log('Advance failed', error);
281
284
  const { advanceAmount: _, ...restCtx } = ctx;
282
285
  notifyFacet.notifyAdvancingResult(restCtx, false);
283
286
  },
@@ -20,6 +20,7 @@ import {
20
20
  } from '../type-guards.js';
21
21
 
22
22
  /**
23
+ * @import {Amount, Brand, Payment} from '@agoric/ertp';
23
24
  * @import {Zone} from '@agoric/zone';
24
25
  * @import {Remote} from '@agoric/internal'
25
26
  * @import {StorageNode} from '@agoric/internal/src/lib-chainStorage.js'
@@ -16,6 +16,7 @@ import {
16
16
 
17
17
  /**
18
18
  * @import {FungibleTokenPacketData} from '@agoric/cosmic-proto/ibc/applications/transfer/v2/packet.js';
19
+ * @import {Amount, Brand, NatValue, Payment} from '@agoric/ertp';
19
20
  * @import {Denom, OrchestrationAccount, ChainHub, ChainAddress} from '@agoric/orchestration';
20
21
  * @import {WithdrawToSeat} from '@agoric/orchestration/src/utils/zoe-tools'
21
22
  * @import {IBCChannelID, VTransferIBCEvent} from '@agoric/vats';
@@ -5,6 +5,7 @@ import { fromExternalConfig } from './utils/config-marshal.js';
5
5
  import { FeedPolicyShape } from './type-guards.js';
6
6
 
7
7
  /**
8
+ * @import {Issuer} from '@agoric/ertp';
8
9
  * @import {Passable} from '@endo/pass-style'
9
10
  * @import {BootstrapManifest} from '@agoric/vats/src/core/lib-boot.js'
10
11
  * @import {LegibleCapData} from './utils/config-marshal.js'
@@ -16,7 +16,7 @@ import {
16
16
  import { fromExternalConfig } from './utils/config-marshal.js';
17
17
 
18
18
  /**
19
- * @import {DepositFacet} from '@agoric/ertp/src/types.js'
19
+ * @import {Amount, Brand, DepositFacet, Issuer, Payment} from '@agoric/ertp';
20
20
  * @import {TypedPattern} from '@agoric/internal'
21
21
  * @import {Instance, StartParams} from '@agoric/zoe/src/zoeService/utils'
22
22
  * @import {Board} from '@agoric/vats'
@@ -10,6 +10,7 @@ import { Fail, q } from '@endo/errors';
10
10
  const { getValue, add, isEmpty, isEqual, isGTE, subtract } = AmountMath;
11
11
 
12
12
  /**
13
+ * @import {Amount, Brand, DepositFacet, NatValue, Payment} from '@agoric/ertp';
13
14
  * @import {PoolStats} from './types';
14
15
  * @import {RepayAmountKWR} from './exos/liquidity-pool';
15
16
  */
@@ -3,6 +3,7 @@ import { M } from '@endo/patterns';
3
3
  import { PendingTxStatus } from './constants.js';
4
4
 
5
5
  /**
6
+ * @import {Amount, Brand, NatValue, Payment} from '@agoric/ertp';
6
7
  * @import {TypedPattern} from '@agoric/internal';
7
8
  * @import {FastUsdcTerms} from './fast-usdc.contract.js';
8
9
  * @import {USDCProposalShapes} from './pool-share-math.js';