@agoric/orchestration 0.1.1-dev-dcf2772.0 → 0.1.1-dev-e37a322.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 +16 -16
- package/src/examples/send-anywhere.contract.d.ts +4 -4
- package/src/examples/send-anywhere.contract.d.ts.map +1 -1
- package/src/examples/send-anywhere.contract.js +1 -1
- package/src/exos/chain-hub.d.ts +7 -3
- package/src/exos/chain-hub.d.ts.map +1 -1
- package/src/exos/chain-hub.js +36 -18
- package/src/exos/local-orchestration-account.js +1 -1
- package/src/exos/orchestrator.d.ts +2 -2
- package/src/exos/orchestrator.js +3 -3
- package/src/orchestration-api.d.ts +1 -1
- package/src/orchestration-api.d.ts.map +1 -1
- package/src/orchestration-api.ts +1 -0
- package/src/proposals/start-send-anywhere.d.ts +4 -4
- package/src/proposals/start-send-anywhere.d.ts.map +1 -1
- package/src/proposals/start-send-anywhere.js +1 -1
- package/src/utils/chain-hub-helper.d.ts +2 -2
- package/src/utils/chain-hub-helper.d.ts.map +1 -1
- package/src/utils/chain-hub-helper.js +6 -3
- package/src/utils/start-helper.d.ts +2 -2
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@agoric/orchestration",
|
|
3
|
-
"version": "0.1.1-dev-
|
|
3
|
+
"version": "0.1.1-dev-e37a322.0+e37a322",
|
|
4
4
|
"description": "Chain abstraction for Agoric's orchestration clients",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "index.js",
|
|
@@ -33,19 +33,19 @@
|
|
|
33
33
|
},
|
|
34
34
|
"homepage": "https://github.com/Agoric/agoric-sdk#readme",
|
|
35
35
|
"dependencies": {
|
|
36
|
-
"@agoric/async-flow": "0.1.1-dev-
|
|
37
|
-
"@agoric/cosmic-proto": "0.4.1-dev-
|
|
38
|
-
"@agoric/ertp": "0.16.3-dev-
|
|
39
|
-
"@agoric/internal": "0.3.3-dev-
|
|
40
|
-
"@agoric/network": "0.1.1-dev-
|
|
41
|
-
"@agoric/notifier": "0.6.3-dev-
|
|
42
|
-
"@agoric/store": "0.9.3-dev-
|
|
43
|
-
"@agoric/time": "0.3.3-dev-
|
|
44
|
-
"@agoric/vat-data": "0.5.3-dev-
|
|
45
|
-
"@agoric/vats": "0.15.2-dev-
|
|
46
|
-
"@agoric/vow": "0.1.1-dev-
|
|
47
|
-
"@agoric/zoe": "0.26.3-dev-
|
|
48
|
-
"@agoric/zone": "0.2.3-dev-
|
|
36
|
+
"@agoric/async-flow": "0.1.1-dev-e37a322.0+e37a322",
|
|
37
|
+
"@agoric/cosmic-proto": "0.4.1-dev-e37a322.0+e37a322",
|
|
38
|
+
"@agoric/ertp": "0.16.3-dev-e37a322.0+e37a322",
|
|
39
|
+
"@agoric/internal": "0.3.3-dev-e37a322.0+e37a322",
|
|
40
|
+
"@agoric/network": "0.1.1-dev-e37a322.0+e37a322",
|
|
41
|
+
"@agoric/notifier": "0.6.3-dev-e37a322.0+e37a322",
|
|
42
|
+
"@agoric/store": "0.9.3-dev-e37a322.0+e37a322",
|
|
43
|
+
"@agoric/time": "0.3.3-dev-e37a322.0+e37a322",
|
|
44
|
+
"@agoric/vat-data": "0.5.3-dev-e37a322.0+e37a322",
|
|
45
|
+
"@agoric/vats": "0.15.2-dev-e37a322.0+e37a322",
|
|
46
|
+
"@agoric/vow": "0.1.1-dev-e37a322.0+e37a322",
|
|
47
|
+
"@agoric/zoe": "0.26.3-dev-e37a322.0+e37a322",
|
|
48
|
+
"@agoric/zone": "0.2.3-dev-e37a322.0+e37a322",
|
|
49
49
|
"@endo/base64": "^1.0.9",
|
|
50
50
|
"@endo/errors": "^1.2.8",
|
|
51
51
|
"@endo/far": "^1.1.9",
|
|
@@ -54,7 +54,7 @@
|
|
|
54
54
|
"@noble/hashes": "^1.5.0"
|
|
55
55
|
},
|
|
56
56
|
"devDependencies": {
|
|
57
|
-
"@agoric/swingset-liveslots": "0.10.3-dev-
|
|
57
|
+
"@agoric/swingset-liveslots": "0.10.3-dev-e37a322.0+e37a322",
|
|
58
58
|
"@chain-registry/client": "^1.47.4",
|
|
59
59
|
"@cosmjs/amino": "^0.32.3",
|
|
60
60
|
"@cosmjs/proto-signing": "^0.32.3",
|
|
@@ -95,5 +95,5 @@
|
|
|
95
95
|
"typeCoverage": {
|
|
96
96
|
"atLeast": 97.23
|
|
97
97
|
},
|
|
98
|
-
"gitHead": "
|
|
98
|
+
"gitHead": "e37a3220b45d5b749a1114af1330960752f990f4"
|
|
99
99
|
}
|
|
@@ -8,9 +8,9 @@ export const SingleNatAmountRecord: import("@endo/patterns").Matcher;
|
|
|
8
8
|
export function contract(zcf: ZCF, privateArgs: OrchestrationPowers & {
|
|
9
9
|
marshaller: Marshaller;
|
|
10
10
|
chainInfo?: Record<string, CosmosChainInfo>;
|
|
11
|
-
assetInfo?:
|
|
11
|
+
assetInfo?: [Denom, DenomDetail & {
|
|
12
12
|
brandKey?: string;
|
|
13
|
-
}
|
|
13
|
+
}][];
|
|
14
14
|
}, zone: Zone, { chainHub, orchestrateAll, vowTools, zoeTools }: OrchestrationTools): Promise<{
|
|
15
15
|
publicFacet: import("@endo/exo").Guarded<{
|
|
16
16
|
makeSendInvitation(): Promise<Invitation<Vow<void>, {
|
|
@@ -35,9 +35,9 @@ export const start: (zcf: ZCF<Record<string, unknown>>, privateArgs: Orchestrati
|
|
|
35
35
|
denom: string;
|
|
36
36
|
}>>;
|
|
37
37
|
}>>;
|
|
38
|
-
assetInfo?:
|
|
38
|
+
assetInfo?: [Denom, DenomDetail & {
|
|
39
39
|
brandKey?: string;
|
|
40
|
-
}
|
|
40
|
+
}][];
|
|
41
41
|
}, baggage: import("@agoric/vat-data").Baggage) => Promise<{
|
|
42
42
|
publicFacet: import("@endo/exo").Guarded<{
|
|
43
43
|
makeSendInvitation(): Promise<Invitation<Vow<void>, {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"send-anywhere.contract.d.ts","sourceRoot":"","sources":["send-anywhere.contract.js"],"names":[],"mappings":"AAUA;;;;;GAKG;AAEH,qEAKE;AAeK,8BATI,GAAG,eACH,mBAAmB,GAAG;IAC5B,UAAU,EAAE,UAAU,CAAC;IACvB,SAAS,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,eAAe,CAAC,CAAC;IAC5C,SAAS,CAAC,EAAE,
|
|
1
|
+
{"version":3,"file":"send-anywhere.contract.d.ts","sourceRoot":"","sources":["send-anywhere.contract.js"],"names":[],"mappings":"AAUA;;;;;GAKG;AAEH,qEAKE;AAeK,8BATI,GAAG,eACH,mBAAmB,GAAG;IAC5B,UAAU,EAAE,UAAU,CAAC;IACvB,SAAS,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,eAAe,CAAC,CAAC;IAC5C,SAAS,CAAC,EAAE,CAAC,KAAK,EAAE,WAAW,GAAG;QAAE,QAAQ,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC,EAAE,CAAC;CAC5D,QACO,IAAI,oDACJ,kBAAkB;;;;;;;;;;;GA6D5B;AAGD;gBArEiB,UAAU;;;;;;;;;;;gBAEV,CAAC,KAAK,EAAE,WAAW,GAAG;QAAE,QAAQ,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC,EAAE;;;;;;;;;;;;;;;;;;;;;GAmEd;yCAtFS,0BAA0B;qCAC9B,uBAAuB;2BAAvB,uBAAuB;iCAAvB,uBAAuB;0BAFtD,cAAc;wCACqB,0BAA0B;yBAF9D,aAAa"}
|
|
@@ -30,7 +30,7 @@ harden(SingleNatAmountRecord);
|
|
|
30
30
|
* @param {OrchestrationPowers & {
|
|
31
31
|
* marshaller: Marshaller;
|
|
32
32
|
* chainInfo?: Record<string, CosmosChainInfo>;
|
|
33
|
-
* assetInfo?:
|
|
33
|
+
* assetInfo?: [Denom, DenomDetail & { brandKey?: string }][];
|
|
34
34
|
* }} privateArgs
|
|
35
35
|
* @param {Zone} zone
|
|
36
36
|
* @param {OrchestrationTools} tools
|
package/src/exos/chain-hub.d.ts
CHANGED
|
@@ -84,9 +84,10 @@ export function makeChainHub(zone: Zone, agoricNames: Remote<NameHub>, vowTools:
|
|
|
84
84
|
* Retrieve holding, issuing chain names etc. for a denom.
|
|
85
85
|
*
|
|
86
86
|
* @param {Denom} denom
|
|
87
|
+
* @param {string} srcChainName - the chainName the denom is held on
|
|
87
88
|
* @returns {DenomDetail | undefined}
|
|
88
89
|
*/
|
|
89
|
-
getAsset(denom: Denom): DenomDetail | undefined;
|
|
90
|
+
getAsset(denom: Denom, srcChainName: string): DenomDetail | undefined;
|
|
90
91
|
/**
|
|
91
92
|
* Retrieve denom (string) for a Brand.
|
|
92
93
|
*
|
|
@@ -104,16 +105,19 @@ export function makeChainHub(zone: Zone, agoricNames: Remote<NameHub>, vowTools:
|
|
|
104
105
|
* Determine the transfer route for a destination and amount given the
|
|
105
106
|
* current holding chain.
|
|
106
107
|
*
|
|
108
|
+
* Does not account for routes with more than 1 intermediary hop - that is,
|
|
109
|
+
* it can't unwrap denoms that were incorrectly routed.
|
|
110
|
+
*
|
|
107
111
|
* XXX consider accepting AmountArg #10449
|
|
108
112
|
*
|
|
109
113
|
* @param {ChainAddress} destination
|
|
110
114
|
* @param {DenomAmount} denomAmount
|
|
111
|
-
* @param {string}
|
|
115
|
+
* @param {string} srcChainName
|
|
112
116
|
* @param {Pick<ForwardInfo['forward'], 'retries' | 'timeout'>} [forwardOpts]
|
|
113
117
|
* @returns {TransferRoute} single hop, multi hop
|
|
114
118
|
* @throws {Error} if unable to determine route
|
|
115
119
|
*/
|
|
116
|
-
makeTransferRoute(destination: ChainAddress, denomAmount: DenomAmount,
|
|
120
|
+
makeTransferRoute(destination: ChainAddress, denomAmount: DenomAmount, srcChainName: string, forwardOpts?: Pick<ForwardInfo["forward"], "retries" | "timeout">): TransferRoute;
|
|
117
121
|
}>;
|
|
118
122
|
export function registerAssets(chainHub: ChainHub, name: string, assets: CosmosAssetInfo[]): void;
|
|
119
123
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"chain-hub.d.ts","sourceRoot":"","sources":["chain-hub.js"],"names":[],"mappings":"AAkBA;;;;;;;;GAQG;AAEH,gEAAgE;AAChE,2BAAkD,KAAK,CAAE;sBAsB/C,CAAC,OAAO,OAAO,EAAE,MAAM,OAAO,OAAO,CAAC;;;;;;AAYhD,oCAAoC;AACpC,gCAAuC;AACvC,8CAA8C;AAC9C,gDAAuD;AACvD,0CAA0C;AAC1C,uCAA8C;AAqBvC,wCAHI,MAAM,YACN,MAAM,UAUhB;AAoCM,wDALI,MAAM,kBACN,MAAM,YACN,iBAAiB,GACf,CAAC,MAAM,EAAE,iBAAiB,CAAC,CAavC;AAwCD,0CAA0C;AAC1C,iCADW,aAAa,aAAa,CAAC,CAUpC;
|
|
1
|
+
{"version":3,"file":"chain-hub.d.ts","sourceRoot":"","sources":["chain-hub.js"],"names":[],"mappings":"AAkBA;;;;;;;;GAQG;AAEH,gEAAgE;AAChE,2BAAkD,KAAK,CAAE;sBAsB/C,CAAC,OAAO,OAAO,EAAE,MAAM,OAAO,OAAO,CAAC;;;;;;AAYhD,oCAAoC;AACpC,gCAAuC;AACvC,8CAA8C;AAC9C,gDAAuD;AACvD,0CAA0C;AAC1C,uCAA8C;AAqBvC,wCAHI,MAAM,YACN,MAAM,UAUhB;AAoCM,wDALI,MAAM,kBACN,MAAM,YACN,iBAAiB,GACf,CAAC,MAAM,EAAE,iBAAiB,CAAC,CAavC;AAwCD,0CAA0C;AAC1C,iCADW,aAAa,aAAa,CAAC,CAUpC;AAsCK,mCAJI,IAAI,eACJ,OAAO,OAAO,CAAC,YACf,QAAQ;IA2Hf;;;;;;;;;;;OAWG;wBAFQ,MAAM,aACN,eAAe;IAQ1B;;;;OAIG;iBAHmB,CAAC,SAAV,MAAQ,aACV,CAAC,GACC,IAAI,eAAe,CAAC,CAAC,CAAC,CAAC;IAYpC;;;;OAIG;uCAHQ,MAAM,uBACN,MAAM,kBACN,iBAAiB;IAW5B;;;;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kB;iCAC3E,kBAAkB;+BAAlB,kBAAkB"}
|
package/src/exos/chain-hub.js
CHANGED
|
@@ -205,7 +205,9 @@ const ChainHubI = M.interface('ChainHub', {
|
|
|
205
205
|
getConnectionInfo: M.call(ChainIdArgShape, ChainIdArgShape).returns(VowShape),
|
|
206
206
|
getChainsAndConnection: M.call(M.string(), M.string()).returns(VowShape),
|
|
207
207
|
registerAsset: M.call(M.string(), DenomDetailShape).returns(),
|
|
208
|
-
getAsset: M.call(M.string()
|
|
208
|
+
getAsset: M.call(M.string(), M.string()).returns(
|
|
209
|
+
M.or(DenomDetailShape, M.undefined()),
|
|
210
|
+
),
|
|
209
211
|
getDenom: M.call(BrandShape).returns(M.or(M.string(), M.undefined())),
|
|
210
212
|
makeChainAddress: M.call(M.string()).returns(ChainAddressShape),
|
|
211
213
|
makeTransferRoute: M.call(ChainAddressShape, DenomAmountShape, M.string())
|
|
@@ -256,6 +258,12 @@ export const makeChainHub = (zone, agoricNames, vowTools) => {
|
|
|
256
258
|
valueShape: M.string(),
|
|
257
259
|
});
|
|
258
260
|
|
|
261
|
+
/**
|
|
262
|
+
* @param {Denom} denom - from perspective of the src/holding chain
|
|
263
|
+
* @param {DenomDetail['chainName']} srcChainName
|
|
264
|
+
*/
|
|
265
|
+
const makeDenomKey = (denom, srcChainName) => `${srcChainName}:${denom}`;
|
|
266
|
+
|
|
259
267
|
const lookupChainInfo = vowTools.retryable(
|
|
260
268
|
zone,
|
|
261
269
|
'lookupChainInfo',
|
|
@@ -440,8 +448,14 @@ export const makeChainHub = (zone, agoricNames, vowTools) => {
|
|
|
440
448
|
Fail`must register chain ${q(chainName)} first`;
|
|
441
449
|
chainInfos.has(baseName) ||
|
|
442
450
|
Fail`must register chain ${q(baseName)} first`;
|
|
443
|
-
|
|
451
|
+
|
|
452
|
+
const denomKey = makeDenomKey(denom, detail.chainName);
|
|
453
|
+
denomDetails.has(denomKey) &&
|
|
454
|
+
Fail`already registered ${q(denom)} on ${q(chainName)}`;
|
|
455
|
+
denomDetails.init(denomKey, detail);
|
|
444
456
|
if (detail.brand) {
|
|
457
|
+
chainName === 'agoric' ||
|
|
458
|
+
Fail`brands only registerable for agoric-held assets`;
|
|
445
459
|
brandDenoms.init(detail.brand, denom);
|
|
446
460
|
}
|
|
447
461
|
},
|
|
@@ -449,11 +463,13 @@ export const makeChainHub = (zone, agoricNames, vowTools) => {
|
|
|
449
463
|
* Retrieve holding, issuing chain names etc. for a denom.
|
|
450
464
|
*
|
|
451
465
|
* @param {Denom} denom
|
|
466
|
+
* @param {string} srcChainName - the chainName the denom is held on
|
|
452
467
|
* @returns {DenomDetail | undefined}
|
|
453
468
|
*/
|
|
454
|
-
getAsset(denom) {
|
|
455
|
-
|
|
456
|
-
|
|
469
|
+
getAsset(denom, srcChainName) {
|
|
470
|
+
const denomKey = makeDenomKey(denom, srcChainName);
|
|
471
|
+
if (denomDetails.has(denomKey)) {
|
|
472
|
+
return denomDetails.get(denomKey);
|
|
457
473
|
}
|
|
458
474
|
return undefined;
|
|
459
475
|
},
|
|
@@ -491,26 +507,31 @@ export const makeChainHub = (zone, agoricNames, vowTools) => {
|
|
|
491
507
|
* Determine the transfer route for a destination and amount given the
|
|
492
508
|
* current holding chain.
|
|
493
509
|
*
|
|
510
|
+
* Does not account for routes with more than 1 intermediary hop - that is,
|
|
511
|
+
* it can't unwrap denoms that were incorrectly routed.
|
|
512
|
+
*
|
|
494
513
|
* XXX consider accepting AmountArg #10449
|
|
495
514
|
*
|
|
496
515
|
* @param {ChainAddress} destination
|
|
497
516
|
* @param {DenomAmount} denomAmount
|
|
498
|
-
* @param {string}
|
|
517
|
+
* @param {string} srcChainName
|
|
499
518
|
* @param {Pick<ForwardInfo['forward'], 'retries' | 'timeout'>} [forwardOpts]
|
|
500
519
|
* @returns {TransferRoute} single hop, multi hop
|
|
501
520
|
* @throws {Error} if unable to determine route
|
|
502
521
|
*/
|
|
503
|
-
makeTransferRoute(destination, denomAmount,
|
|
504
|
-
chainInfos.has(
|
|
505
|
-
Fail`chain info not found for holding chain: ${q(
|
|
522
|
+
makeTransferRoute(destination, denomAmount, srcChainName, forwardOpts) {
|
|
523
|
+
chainInfos.has(srcChainName) ||
|
|
524
|
+
Fail`chain info not found for holding chain: ${q(srcChainName)}`;
|
|
506
525
|
|
|
507
|
-
const denomDetail = chainHub.getAsset(denomAmount.denom);
|
|
526
|
+
const denomDetail = chainHub.getAsset(denomAmount.denom, srcChainName);
|
|
508
527
|
denomDetail ||
|
|
509
|
-
Fail`no denom detail for: ${q(denomAmount.denom)}. ensure it is registered in chainHub.`;
|
|
528
|
+
Fail`no denom detail for: ${q(denomAmount.denom)} on ${q(srcChainName)}. ensure it is registered in chainHub.`;
|
|
510
529
|
|
|
511
530
|
const { baseName, chainName } = /** @type {DenomDetail} */ (denomDetail);
|
|
512
|
-
|
|
513
|
-
|
|
531
|
+
|
|
532
|
+
// currently unreachable since assets are registered with holdingChainName
|
|
533
|
+
chainName === srcChainName ||
|
|
534
|
+
Fail`cannot transfer asset ${q(denomAmount.denom)}. held on ${q(chainName)} not ${q(srcChainName)}.`;
|
|
514
535
|
|
|
515
536
|
// currently unreachable since we can't register an asset before a chain
|
|
516
537
|
chainInfos.has(baseName) ||
|
|
@@ -518,13 +539,10 @@ export const makeChainHub = (zone, agoricNames, vowTools) => {
|
|
|
518
539
|
|
|
519
540
|
const { chainId: baseChainId, pfmEnabled } = chainInfos.get(baseName);
|
|
520
541
|
|
|
521
|
-
const holdingChainId = chainInfos.get(
|
|
542
|
+
const holdingChainId = chainInfos.get(srcChainName).chainId;
|
|
522
543
|
|
|
523
544
|
// asset is transferring to or from the issuing chain, return direct route
|
|
524
|
-
if (
|
|
525
|
-
baseChainId === destination.chainId ||
|
|
526
|
-
baseName === holdingChainName
|
|
527
|
-
) {
|
|
545
|
+
if (baseChainId === destination.chainId || baseName === srcChainName) {
|
|
528
546
|
// TODO use getConnectionInfo once its sync
|
|
529
547
|
const connKey = connectionKey(holdingChainId, destination.chainId);
|
|
530
548
|
connectionInfos.has(connKey) ||
|
|
@@ -511,7 +511,7 @@ export const prepareLocalOrchestrationAccountKit = (
|
|
|
511
511
|
return asVow(() => {
|
|
512
512
|
const [brand, denom] =
|
|
513
513
|
typeof denomArg === 'string'
|
|
514
|
-
? [chainHub.getAsset(denomArg)?.brand, denomArg]
|
|
514
|
+
? [chainHub.getAsset(denomArg, 'agoric')?.brand, denomArg]
|
|
515
515
|
: [denomArg, chainHub.getDenom(denomArg)];
|
|
516
516
|
|
|
517
517
|
if (!denom) {
|
|
@@ -11,7 +11,7 @@ export function prepareOrchestrator(zone: Zone, powers: {
|
|
|
11
11
|
vowTools: VowTools;
|
|
12
12
|
}): () => import("@endo/exo").Guarded<{
|
|
13
13
|
getChain(chainName: string): Vow<HostInterface<Chain<any>>>;
|
|
14
|
-
getDenomInfo(denom: string): HostInterface<import("../orchestration-api.js").DenomInfo<"agoric" | "celestia" | "dydx" | "juno" | "neutron" | "noble" | "stride" | "umee" | "cosmoshub" | "omniflixhub" | "osmosis" | "secretnetwork" | "stargaze", "agoric" | "celestia" | "dydx" | "juno" | "neutron" | "noble" | "stride" | "umee" | "cosmoshub" | "omniflixhub" | "osmosis" | "secretnetwork" | "stargaze">>;
|
|
14
|
+
getDenomInfo(denom: string, srcChainName: "agoric" | "celestia" | "dydx" | "juno" | "neutron" | "noble" | "stride" | "umee" | "cosmoshub" | "omniflixhub" | "osmosis" | "secretnetwork" | "stargaze"): HostInterface<import("../orchestration-api.js").DenomInfo<"agoric" | "celestia" | "dydx" | "juno" | "neutron" | "noble" | "stride" | "umee" | "cosmoshub" | "omniflixhub" | "osmosis" | "secretnetwork" | "stargaze", "agoric" | "celestia" | "dydx" | "juno" | "neutron" | "noble" | "stride" | "umee" | "cosmoshub" | "omniflixhub" | "osmosis" | "secretnetwork" | "stargaze">>;
|
|
15
15
|
/** @type {HostOf<Orchestrator['asAmount']>} */
|
|
16
16
|
asAmount: HostOf<Orchestrator["asAmount"]>;
|
|
17
17
|
}>;
|
|
@@ -114,7 +114,7 @@ declare function prepareOrchestratorKit(zone: Zone, { chainHub, makeLocalChainFa
|
|
|
114
114
|
};
|
|
115
115
|
orchestrator: {
|
|
116
116
|
getChain(chainName: string): Vow<HostInterface<Chain<any>>>;
|
|
117
|
-
getDenomInfo(denom: string): HostInterface<import("../orchestration-api.js").DenomInfo<"agoric" | "celestia" | "dydx" | "juno" | "neutron" | "noble" | "stride" | "umee" | "cosmoshub" | "omniflixhub" | "osmosis" | "secretnetwork" | "stargaze", "agoric" | "celestia" | "dydx" | "juno" | "neutron" | "noble" | "stride" | "umee" | "cosmoshub" | "omniflixhub" | "osmosis" | "secretnetwork" | "stargaze">>;
|
|
117
|
+
getDenomInfo(denom: string, srcChainName: "agoric" | "celestia" | "dydx" | "juno" | "neutron" | "noble" | "stride" | "umee" | "cosmoshub" | "omniflixhub" | "osmosis" | "secretnetwork" | "stargaze"): HostInterface<import("../orchestration-api.js").DenomInfo<"agoric" | "celestia" | "dydx" | "juno" | "neutron" | "noble" | "stride" | "umee" | "cosmoshub" | "omniflixhub" | "osmosis" | "secretnetwork" | "stargaze", "agoric" | "celestia" | "dydx" | "juno" | "neutron" | "noble" | "stride" | "umee" | "cosmoshub" | "omniflixhub" | "osmosis" | "secretnetwork" | "stargaze">>;
|
|
118
118
|
/** @type {HostOf<Orchestrator['asAmount']>} */
|
|
119
119
|
asAmount: HostOf<Orchestrator["asAmount"]>;
|
|
120
120
|
};
|
package/src/exos/orchestrator.js
CHANGED
|
@@ -34,7 +34,7 @@ const trace = makeTracer('Orchestrator');
|
|
|
34
34
|
/** @see {Orchestrator} */
|
|
35
35
|
export const OrchestratorI = M.interface('Orchestrator', {
|
|
36
36
|
getChain: M.call(M.string()).returns(Vow$(ChainInfoShape)),
|
|
37
|
-
getDenomInfo: M.call(DenomShape).returns(DenomInfoShape),
|
|
37
|
+
getDenomInfo: M.call(DenomShape, M.string()).returns(DenomInfoShape),
|
|
38
38
|
asAmount: M.call(DenomAmountShape).returns(AmountShape),
|
|
39
39
|
});
|
|
40
40
|
|
|
@@ -138,8 +138,8 @@ const prepareOrchestratorKit = (
|
|
|
138
138
|
});
|
|
139
139
|
},
|
|
140
140
|
/** @type {HostOf<Orchestrator['getDenomInfo']>} */
|
|
141
|
-
getDenomInfo(denom) {
|
|
142
|
-
const denomDetail = chainHub.getAsset(denom);
|
|
141
|
+
getDenomInfo(denom, holdingChainName) {
|
|
142
|
+
const denomDetail = chainHub.getAsset(denom, holdingChainName);
|
|
143
143
|
if (!denomDetail) throw Fail`No denom detail for ${q(denom)}`;
|
|
144
144
|
const { chainName, baseName, baseDenom, brand } = denomDetail;
|
|
145
145
|
chainByName.has(chainName) ||
|
|
@@ -98,7 +98,7 @@ export interface Orchestrator {
|
|
|
98
98
|
* issues the corresponding asset.
|
|
99
99
|
* @param denom
|
|
100
100
|
*/
|
|
101
|
-
getDenomInfo: <HoldingChain extends keyof KnownChains, IssuingChain extends keyof KnownChains>(denom: Denom) => DenomInfo<HoldingChain, IssuingChain>;
|
|
101
|
+
getDenomInfo: <HoldingChain extends keyof KnownChains, IssuingChain extends keyof KnownChains>(denom: Denom, srcChainName: HoldingChain) => DenomInfo<HoldingChain, IssuingChain>;
|
|
102
102
|
/**
|
|
103
103
|
* Convert an amount described in native data to a local, structured Amount.
|
|
104
104
|
* @param amount - the described amount
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"orchestration-api.d.ts","sourceRoot":"","sources":["orchestration-api.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,SAAS,EAAE,MAAM,2BAA2B,CAAC;AAE1E,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAC9C,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,gCAAgC,CAAC;AAClE,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,2CAA2C,CAAC;AACrF,OAAO,KAAK,EAAE,QAAQ,EAAE,MAA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;IACpB,IAAI,CAAC,EAAE,WAAW,CAAC;IACnB,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAED,aAAa;AACb,MAAM,WAAW,WAAW;IAC1B,SAAS,EAAE,MAAM,CAAC;IAClB,WAAW,EAAE,YAAY,CAAC;CAC3B;AACD,aAAa;AACb,MAAM,WAAW,SAAS;IACxB,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,MAAM,CAAC;CACnB;AACD,aAAa;AACb,MAAM,WAAW,eAAe;IAC9B,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,KAAK,CAAC;IAChB,QAAQ,EAAE,MAAM,CAAC;CAClB"}
|
package/src/orchestration-api.ts
CHANGED
|
@@ -13,9 +13,9 @@ export function startSendAnywhere({ consume: { agoricNames, board, chainStorage,
|
|
|
13
13
|
denom: string;
|
|
14
14
|
}>>;
|
|
15
15
|
}>>;
|
|
16
|
-
assetInfo?:
|
|
16
|
+
assetInfo?: [Denom, DenomDetail & {
|
|
17
17
|
brandKey?: string;
|
|
18
|
-
}
|
|
18
|
+
}][];
|
|
19
19
|
}, baggage: import("@agoric/vat-data").Baggage) => Promise<{
|
|
20
20
|
publicFacet: import("@endo/exo").Guarded<{
|
|
21
21
|
makeSendInvitation(): Promise<Invitation<import("@agoric/vow").Vow<void>, {
|
|
@@ -42,9 +42,9 @@ export function startSendAnywhere({ consume: { agoricNames, board, chainStorage,
|
|
|
42
42
|
}, { options: { chainInfo, assetInfo } }: {
|
|
43
43
|
options: {
|
|
44
44
|
chainInfo: Record<string, CosmosChainInfo>;
|
|
45
|
-
assetInfo:
|
|
45
|
+
assetInfo: [Denom, DenomDetail & {
|
|
46
46
|
brandKey?: string;
|
|
47
|
-
}
|
|
47
|
+
}][];
|
|
48
48
|
};
|
|
49
49
|
}): Promise<void>;
|
|
50
50
|
export function getManifest({ restoreRef }: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"start-send-anywhere.d.ts","sourceRoot":"","sources":["start-send-anywhere.js"],"names":[],"mappings":"AAkCO,wSAdI,eAAe,GAAG;IACxB,YAAY,EAAE;QACZ,OAAO,EAAE;YACP,YAAY,EAAE;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"start-send-anywhere.d.ts","sourceRoot":"","sources":["start-send-anywhere.js"],"names":[],"mappings":"AAkCO,wSAdI,eAAe,GAAG;IACxB,YAAY,EAAE;QACZ,OAAO,EAAE;YACP,YAAY,EAAE;;;;;;;;;;;;;4BA2BK,CAAC;;;;;;;;;;;;;;;;;;;;;;eA3Be,CAAC;SACrC,CAAC;KACH,CAAC;CACH,yCACO;IACN,OAAO,EAAE;QACP,SAAS,EAAE,MAAM,CAAC,MAAM,EAAE,eAAe,CAAC,CAAC;QAC3C,SAAS,EAAE,CAAC,KAAK,EAAE,WAAW,GAAG;YAAE,QAAQ,CAAC,EAAE,MAAM,CAAA;SAAE,CAAC,EAAE,CAAC;KAC3D,CAAC;CACH,iBAqDH;AAGM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA8BN;2BA5GqD,uBAAuB;iCAAvB,uBAAuB;kCAD9C,qCAAqC;qCACd,uBAAuB"}
|
|
@@ -28,7 +28,7 @@ const trace = makeTracer('StartSA', true);
|
|
|
28
28
|
* @param {{
|
|
29
29
|
* options: {
|
|
30
30
|
* chainInfo: Record<string, CosmosChainInfo>;
|
|
31
|
-
* assetInfo:
|
|
31
|
+
* assetInfo: [Denom, DenomDetail & { brandKey?: string }][];
|
|
32
32
|
* };
|
|
33
33
|
* }} config
|
|
34
34
|
*/
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
export function registerChainsAndAssets(chainHub: ChainHub, brands: Record<string, Brand<"nat">>, chainInfo: Record<string, CosmosChainInfo> | undefined, assetInfo:
|
|
1
|
+
export function registerChainsAndAssets(chainHub: ChainHub, brands: Record<string, Brand<"nat">>, chainInfo: Record<string, CosmosChainInfo> | undefined, assetInfo: [Denom, DenomDetail & {
|
|
2
2
|
brandKey?: string;
|
|
3
|
-
}
|
|
3
|
+
}][] | undefined): void;
|
|
4
4
|
import type { ChainHub } from '../types.js';
|
|
5
5
|
import type { CosmosChainInfo } from '../types.js';
|
|
6
6
|
import type { Denom } from '../types.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"chain-hub-helper.d.ts","sourceRoot":"","sources":["chain-hub-helper.js"],"names":[],"mappings":"AAgBO,kDALI,QAAQ,UACR,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC,KAAK,CAAC,CAAC,aAC5B,MAAM,CAAC,MAAM,EAAE,eAAe,CAAC,GAAG,SAAS,aAC3C,
|
|
1
|
+
{"version":3,"file":"chain-hub-helper.d.ts","sourceRoot":"","sources":["chain-hub-helper.js"],"names":[],"mappings":"AAgBO,kDALI,QAAQ,UACR,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC,KAAK,CAAC,CAAC,aAC5B,MAAM,CAAC,MAAM,EAAE,eAAe,CAAC,GAAG,SAAS,aAC3C,CAAC,KAAK,EAAE,WAAW,GAAG;IAAE,QAAQ,CAAC,EAAE,MAAM,CAAA;CAAE,CAAC,EAAE,GAAG,SAAS,QA6CpE;8BA1D+D,aAAa;qCAAb,aAAa;2BAAb,aAAa;iCAAb,aAAa"}
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
* @param {ChainHub} chainHub
|
|
13
13
|
* @param {Record<string, Brand<'nat'>>} brands
|
|
14
14
|
* @param {Record<string, CosmosChainInfo> | undefined} chainInfo
|
|
15
|
-
* @param {
|
|
15
|
+
* @param {[Denom, DenomDetail & { brandKey?: string }][] | undefined} assetInfo
|
|
16
16
|
*/
|
|
17
17
|
export const registerChainsAndAssets = (
|
|
18
18
|
chainHub,
|
|
@@ -43,11 +43,14 @@ export const registerChainsAndAssets = (
|
|
|
43
43
|
}
|
|
44
44
|
console.log('chainHub: registered connections', [...registeredPairs].sort());
|
|
45
45
|
|
|
46
|
-
console.log(
|
|
46
|
+
console.log(
|
|
47
|
+
'chainHub: registering assets',
|
|
48
|
+
assetInfo?.map(([denom, { chainName }]) => `${chainName}: ${denom}`),
|
|
49
|
+
);
|
|
47
50
|
if (!assetInfo) {
|
|
48
51
|
return;
|
|
49
52
|
}
|
|
50
|
-
for (const [denom, info] of
|
|
53
|
+
for (const [denom, info] of assetInfo) {
|
|
51
54
|
const { brandKey, ...rest } = info;
|
|
52
55
|
const infoWithBrand = brandKey
|
|
53
56
|
? { ...rest, brand: brands[brandKey] }
|
|
@@ -17,10 +17,10 @@ export function provideOrchestration(zcf: ZCF, baggage: Baggage, remotePowers: O
|
|
|
17
17
|
}): import("@agoric/vow").Vow<import("../cosmos-api.js").IBCConnectionInfo>;
|
|
18
18
|
getChainsAndConnection<C1 extends string, C2 extends string>(primaryName: C1, counterName: C2): import("@agoric/vow").Vow<[ActualChainInfo<C1>, ActualChainInfo<C2>, import("../cosmos-api.js").IBCConnectionInfo]>;
|
|
19
19
|
registerAsset(denom: import("../orchestration-api.js").Denom, detail: DenomDetail): void;
|
|
20
|
-
getAsset(denom: import("../orchestration-api.js").Denom): DenomDetail | undefined;
|
|
20
|
+
getAsset(denom: import("../orchestration-api.js").Denom, srcChainName: string): DenomDetail | undefined;
|
|
21
21
|
getDenom(brand: Brand): import("../orchestration-api.js").Denom | undefined;
|
|
22
22
|
makeChainAddress(address: string): import("../orchestration-api.js").ChainAddress;
|
|
23
|
-
makeTransferRoute(destination: import("../orchestration-api.js").ChainAddress, denomAmount: import("../orchestration-api.js").DenomAmount,
|
|
23
|
+
makeTransferRoute(destination: import("../orchestration-api.js").ChainAddress, denomAmount: import("../orchestration-api.js").DenomAmount, srcChainName: string, forwardOpts?: Pick<import("../cosmos-api.js").ForwardInfo["forward"], "retries" | "timeout">): import("../cosmos-api.js").TransferRoute;
|
|
24
24
|
}>;
|
|
25
25
|
vowTools: import("@agoric/vow").VowTools;
|
|
26
26
|
asyncFlowTools: {
|