@agoric/fast-usdc 0.1.1-dev-d4385f0.0 → 0.1.1-dev-8657c4c.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-d4385f0.0+d4385f0",
3
+ "version": "0.1.1-dev-8657c4c.0+8657c4c",
4
4
  "description": "CLI and library for Fast USDC product",
5
5
  "type": "module",
6
6
  "files": [
@@ -21,9 +21,9 @@
21
21
  "lint:eslint": "eslint ."
22
22
  },
23
23
  "devDependencies": {
24
- "@agoric/swingset-liveslots": "0.10.3-dev-d4385f0.0+d4385f0",
25
- "@agoric/vats": "0.15.2-dev-d4385f0.0+d4385f0",
26
- "@agoric/zone": "0.2.3-dev-d4385f0.0+d4385f0",
24
+ "@agoric/swingset-liveslots": "0.10.3-dev-8657c4c.0+8657c4c",
25
+ "@agoric/vats": "0.15.2-dev-8657c4c.0+8657c4c",
26
+ "@agoric/zone": "0.2.3-dev-8657c4c.0+8657c4c",
27
27
  "@fast-check/ava": "^2.0.1",
28
28
  "ava": "^5.3.0",
29
29
  "c8": "^10.1.2",
@@ -31,15 +31,15 @@
31
31
  "ts-blank-space": "^0.4.1"
32
32
  },
33
33
  "dependencies": {
34
- "@agoric/client-utils": "0.1.1-dev-d4385f0.0+d4385f0",
35
- "@agoric/ertp": "0.16.3-dev-d4385f0.0+d4385f0",
36
- "@agoric/internal": "0.3.3-dev-d4385f0.0+d4385f0",
37
- "@agoric/notifier": "0.6.3-dev-d4385f0.0+d4385f0",
38
- "@agoric/orchestration": "0.1.1-dev-d4385f0.0+d4385f0",
39
- "@agoric/store": "0.9.3-dev-d4385f0.0+d4385f0",
40
- "@agoric/vat-data": "0.5.3-dev-d4385f0.0+d4385f0",
41
- "@agoric/vow": "0.1.1-dev-d4385f0.0+d4385f0",
42
- "@agoric/zoe": "0.26.3-dev-d4385f0.0+d4385f0",
34
+ "@agoric/client-utils": "0.1.1-dev-8657c4c.0+8657c4c",
35
+ "@agoric/ertp": "0.16.3-dev-8657c4c.0+8657c4c",
36
+ "@agoric/internal": "0.3.3-dev-8657c4c.0+8657c4c",
37
+ "@agoric/notifier": "0.6.3-dev-8657c4c.0+8657c4c",
38
+ "@agoric/orchestration": "0.1.1-dev-8657c4c.0+8657c4c",
39
+ "@agoric/store": "0.9.3-dev-8657c4c.0+8657c4c",
40
+ "@agoric/vat-data": "0.5.3-dev-8657c4c.0+8657c4c",
41
+ "@agoric/vow": "0.1.1-dev-8657c4c.0+8657c4c",
42
+ "@agoric/zoe": "0.26.3-dev-8657c4c.0+8657c4c",
43
43
  "@cosmjs/proto-signing": "^0.32.4",
44
44
  "@cosmjs/stargate": "^0.32.4",
45
45
  "@endo/base64": "^1.0.9",
@@ -78,5 +78,5 @@
78
78
  "publishConfig": {
79
79
  "access": "public"
80
80
  },
81
- "gitHead": "d4385f04ae2735e8d2863e2be9bf341f8566b36c"
81
+ "gitHead": "8657c4cfc5dcb48602f730574afe5efb6f8ffb24"
82
82
  }
@@ -6,7 +6,10 @@ import {
6
6
  } from '@agoric/internal';
7
7
  import { observeIteration, subscribeEach } from '@agoric/notifier';
8
8
  import {
9
+ CosmosChainInfoShape,
10
+ DenomDetailShape,
9
11
  OrchestrationPowersShape,
12
+ registerChainsAndAssets,
10
13
  withOrchestration,
11
14
  } from '@agoric/orchestration';
12
15
  import { provideSingleton } from '@agoric/zoe/src/contractSupport/durability.js';
@@ -27,9 +30,8 @@ import * as flows from './fast-usdc.flows.js';
27
30
  const trace = makeTracer('FastUsdc');
28
31
 
29
32
  /**
30
- * @import {Denom} from '@agoric/orchestration';
31
33
  * @import {HostInterface} from '@agoric/async-flow';
32
- * @import {OrchestrationAccount} from '@agoric/orchestration';
34
+ * @import {CosmosChainInfo, Denom, DenomDetail, OrchestrationAccount} from '@agoric/orchestration';
33
35
  * @import {OrchestrationPowers, OrchestrationTools} from '@agoric/orchestration/src/utils/start-helper.js';
34
36
  * @import {Vow} from '@agoric/vow';
35
37
  * @import {Zone} from '@agoric/zone';
@@ -53,6 +55,8 @@ export const meta = {
53
55
  ...OrchestrationPowersShape,
54
56
  feeConfig: FeeConfigShape,
55
57
  marshaller: M.remotable(),
58
+ chainInfo: M.recordOf(M.string(), CosmosChainInfoShape),
59
+ assetInfo: M.recordOf(M.string(), DenomDetailShape),
56
60
  },
57
61
  };
58
62
  harden(meta);
@@ -62,6 +66,8 @@ harden(meta);
62
66
  * @param {OrchestrationPowers & {
63
67
  * marshaller: Marshaller;
64
68
  * feeConfig: FeeConfig;
69
+ * chainInfo: Record<string, CosmosChainInfo>;
70
+ * assetInfo: Record<Denom, DenomDetail & { brandKey?: string}>;
65
71
  * }} privateArgs
66
72
  * @param {Zone} zone
67
73
  * @param {OrchestrationTools} tools
@@ -82,7 +88,7 @@ export const contract = async (zcf, privateArgs, zone, tools) => {
82
88
 
83
89
  const { USDC } = terms.brands;
84
90
  const { withdrawToSeat } = tools.zoeTools;
85
- const { chainHub, orchestrateAll, vowTools } = tools;
91
+ const { baggage, chainHub, orchestrateAll, vowTools } = tools;
86
92
  const makeSettler = prepareSettler(zone, {
87
93
  statusManager,
88
94
  USDC,
@@ -212,6 +218,18 @@ export const contract = async (zcf, privateArgs, zone, tools) => {
212
218
  makeLiquidityPoolKit(shareMint, privateArgs.storageNode),
213
219
  );
214
220
 
221
+ /** Chain, connection, and asset info can only be registered once */
222
+ const firstIncarnationKey = 'firstIncarnationKey';
223
+ if (!baggage.has(firstIncarnationKey)) {
224
+ baggage.init(firstIncarnationKey, true);
225
+ registerChainsAndAssets(
226
+ chainHub,
227
+ terms.brands,
228
+ privateArgs.chainInfo,
229
+ privateArgs.assetInfo,
230
+ );
231
+ }
232
+
215
233
  const feedKit = zone.makeOnce('Feed Kit', () => makeFeedKit());
216
234
 
217
235
  const poolAccountV = zone.makeOnce('PoolAccount', () => makeLocalAccount());
@@ -1,4 +1,5 @@
1
1
  import { deeplyFulfilledObject, makeTracer, objectMap } from '@agoric/internal';
2
+ import { CosmosChainInfoShape, DenomDetailShape } from '@agoric/orchestration';
2
3
  import { Fail } from '@endo/errors';
3
4
  import { E } from '@endo/far';
4
5
  import { makeMarshal } from '@endo/marshal';
@@ -13,6 +14,7 @@ import { fromExternalConfig } from './utils/config-marshal.js';
13
14
  /**
14
15
  * @import {DepositFacet} from '@agoric/ertp/src/types.js'
15
16
  * @import {TypedPattern} from '@agoric/internal'
17
+ * @import {CosmosChainInfo, Denom, DenomDetail} from '@agoric/orchestration';
16
18
  * @import {Instance, StartParams} from '@agoric/zoe/src/zoeService/utils'
17
19
  * @import {Board} from '@agoric/vats'
18
20
  * @import {ManifestBundleRef} from '@agoric/deploy-script-support/src/externalTypes.js'
@@ -33,6 +35,8 @@ const contractName = 'fastUsdc';
33
35
  * oracles: Record<string, string>;
34
36
  * feeConfig: FeeConfig;
35
37
  * feedPolicy: FeedPolicy & Passable;
38
+ * chainInfo: Record<string, CosmosChainInfo & Passable>;
39
+ * assetInfo: Record<Denom, DenomDetail & {brandKey?: string}>;
36
40
  * }} FastUSDCConfig
37
41
  */
38
42
  /** @type {TypedPattern<FastUSDCConfig>} */
@@ -41,6 +45,8 @@ export const FastUSDCConfigShape = M.splitRecord({
41
45
  oracles: M.recordOf(M.string(), M.string()),
42
46
  feeConfig: FeeConfigShape,
43
47
  feedPolicy: FeedPolicyShape,
48
+ chainInfo: M.recordOf(M.string(), CosmosChainInfoShape),
49
+ assetInfo: M.recordOf(M.string(), DenomDetailShape),
44
50
  });
45
51
 
46
52
  /**
@@ -149,11 +155,12 @@ export const startFastUSDC = async (
149
155
  USDC: await E(USDCissuer).getBrand(),
150
156
  });
151
157
 
152
- const { terms, oracles, feeConfig, feedPolicy } = fromExternalConfig(
153
- config?.options, // just in case config is missing somehow
154
- brands,
155
- FastUSDCConfigShape,
156
- );
158
+ const { terms, oracles, feeConfig, feedPolicy, chainInfo, assetInfo } =
159
+ fromExternalConfig(
160
+ config?.options, // just in case config is missing somehow
161
+ brands,
162
+ FastUSDCConfigShape,
163
+ );
157
164
  trace('using terms', terms);
158
165
  trace('using fee config', feeConfig);
159
166
 
@@ -187,6 +194,8 @@ export const startFastUSDC = async (
187
194
  storageNode,
188
195
  timerService,
189
196
  marshaller,
197
+ chainInfo,
198
+ assetInfo,
190
199
  }),
191
200
  );
192
201