@agoric/orchestration 0.1.1-dev-33a5708.0 → 0.1.1-dev-db6d589.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.
Files changed (36) hide show
  1. package/package.json +17 -16
  2. package/src/cosmos-api.d.ts +11 -1
  3. package/src/cosmos-api.d.ts.map +1 -1
  4. package/src/cosmos-api.ts +15 -0
  5. package/src/examples/send-anywhere.contract.d.ts +3 -3
  6. package/src/examples/send-anywhere.contract.d.ts.map +1 -1
  7. package/src/examples/send-anywhere.contract.js +40 -13
  8. package/src/examples/send-anywhere.flows.d.ts +559 -2
  9. package/src/examples/send-anywhere.flows.d.ts.map +1 -1
  10. package/src/examples/send-anywhere.flows.js +105 -28
  11. package/src/examples/stake-ica.contract.d.ts +1 -0
  12. package/src/examples/stake-ica.contract.d.ts.map +1 -1
  13. package/src/exos/README.md +1 -0
  14. package/src/exos/chain-hub-admin.d.ts +2 -2
  15. package/src/exos/chain-hub-admin.d.ts.map +1 -1
  16. package/src/exos/chain-hub-admin.js +5 -7
  17. package/src/exos/chain-hub.d.ts +19 -8
  18. package/src/exos/chain-hub.d.ts.map +1 -1
  19. package/src/exos/chain-hub.js +75 -17
  20. package/src/exos/cosmos-orchestration-account.d.ts +2 -0
  21. package/src/exos/cosmos-orchestration-account.d.ts.map +1 -1
  22. package/src/exos/cosmos-orchestration-account.js +67 -2
  23. package/src/exos/orchestrator.d.ts +1 -1
  24. package/src/exos/remote-chain-facade.d.ts +1 -1
  25. package/src/orchestration-api.d.ts +4 -4
  26. package/src/orchestration-api.d.ts.map +1 -1
  27. package/src/orchestration-api.ts +6 -3
  28. package/src/proposals/start-send-anywhere.js +4 -0
  29. package/src/utils/address.d.ts +4 -1
  30. package/src/utils/address.d.ts.map +1 -1
  31. package/src/utils/address.js +32 -2
  32. package/src/utils/chain-info.d.ts +4 -0
  33. package/src/utils/chain-info.d.ts.map +1 -0
  34. package/src/utils/chain-info.js +11 -0
  35. package/src/utils/start-helper.d.ts +2 -1
  36. package/src/utils/start-helper.d.ts.map +1 -1
@@ -1,14 +1,16 @@
1
1
  import { NonNullish } from '@agoric/internal';
2
- import { makeError, q } from '@endo/errors';
2
+ import { Fail, makeError, q } from '@endo/errors';
3
3
  import { M, mustMatch } from '@endo/patterns';
4
4
 
5
5
  /**
6
6
  * @import {GuestInterface, GuestOf} from '@agoric/async-flow';
7
7
  * @import {Invitation, ZCF, ZCFSeat} from '@agoric/zoe';
8
+ * @import {Brand} from '@agoric/ertp';
8
9
  * @import {Vow} from '@agoric/vow';
9
10
  * @import {LocalOrchestrationAccountKit} from '../exos/local-orchestration-account.js';
10
11
  * @import {ZoeTools} from '../utils/zoe-tools.js';
11
- * @import {Orchestrator, OrchestrationFlow, LocalAccountMethods, ChainHub} from '../types.js';
12
+ * @import {Orchestrator, OrchestrationFlow, LocalAccountMethods, ChainHub, ChainInfo} from '../types.js';
13
+ * @import {AccountIdArg} from '../orchestration-api.ts';
12
14
  */
13
15
 
14
16
  const { entries } = Object;
@@ -16,14 +18,40 @@ const { entries } = Object;
16
18
  // in guest file (the orchestration functions)
17
19
  // the second argument is all the endowments provided
18
20
 
21
+ /**
22
+ * @satisfies {OrchestrationFlow}
23
+ * @param {Orchestrator} orch
24
+ */
25
+ export const makeNobleAccount = async orch => {
26
+ const nobleChain = await orch.getChain('noble');
27
+ return nobleChain.makeAccount();
28
+ };
29
+ harden(makeNobleAccount);
30
+
31
+ const denomForBrand = async (orch, brand) => {
32
+ const agoric = await orch.getChain('agoric');
33
+ const assets = await agoric.getVBankAssetInfo();
34
+ const { denom } = NonNullish(
35
+ assets.find(a => a.brand === brand),
36
+ `${brand} not registered in ChainHub`,
37
+ );
38
+ return denom;
39
+ };
40
+
19
41
  /**
20
42
  * @satisfies {OrchestrationFlow}
21
43
  * @param {Orchestrator} orch
22
44
  * @param {object} ctx
23
45
  * @param {GuestInterface<ChainHub>} ctx.chainHub
24
46
  * @param {Promise<GuestInterface<LocalOrchestrationAccountKit['holder']>>} ctx.sharedLocalAccountP
47
+ * @param {Promise<
48
+ * GuestInterface<
49
+ * import('../exos/cosmos-orchestration-account.js').CosmosOrchestrationAccountKit['holder']
50
+ * >
51
+ * >} ctx.nobleAccountP
25
52
  * @param {GuestInterface<ZoeTools>} ctx.zoeTools
26
53
  * @param {GuestOf<(msg: string) => Vow<void>>} ctx.log
54
+ * @param {Brand} ctx.USDC
27
55
  * @param {ZCFSeat} seat
28
56
  * @param {{ chainName: string; destAddr: string }} offerArgs
29
57
  */
@@ -33,6 +61,8 @@ export const sendIt = async (
33
61
  chainHub,
34
62
  sharedLocalAccountP,
35
63
  log,
64
+ nobleAccountP,
65
+ USDC,
36
66
  zoeTools: { localTransfer, withdrawToSeat },
37
67
  },
38
68
  seat,
@@ -44,42 +74,89 @@ export const sendIt = async (
44
74
  const { give } = seat.getProposal();
45
75
  const [[_kw, amt]] = entries(give);
46
76
  void log(`sending {${amt.value}} from ${chainName} to ${destAddr}`);
47
- const denom = NonNullish(
48
- chainHub.getDenom(amt.brand),
49
- `${amt.brand} not registered in ChainHub`,
50
- );
51
- void log(`got denom ${denom} for ${amt.brand}`);
52
- const chain = await orch.getChain(chainName);
53
- const info = await chain.getChainInfo();
54
- const { chainId } = info;
55
- assert(typeof chainId === 'string', 'bad chainId');
56
- void log(`got info for chain: ${chainName} ${chainId}`);
77
+ const denom = await denomForBrand(orch, amt.brand);
78
+
79
+ /** @type {ChainInfo} */
80
+ const info = await chainHub.getChainInfo(chainName);
57
81
 
58
82
  /**
59
83
  * @type {any} XXX methods returning vows
60
84
  * https://github.com/Agoric/agoric-sdk/issues/9822
61
85
  */
62
86
  const sharedLocalAccount = await sharedLocalAccountP;
63
- await localTransfer(seat, sharedLocalAccount, give);
64
-
65
- void log(`completed transfer to localAccount`);
66
-
67
- try {
68
- await sharedLocalAccount.transfer(
69
- {
70
- value: destAddr,
71
- encoding: 'bech32',
72
- chainId,
73
- },
74
- { denom, value: amt.value },
75
- );
76
- void log(`completed transfer to ${destAddr}`);
77
- } catch (e) {
87
+
88
+ /**
89
+ * Helper function to recover if IBC Transfer fails
90
+ *
91
+ * @param {Error} e
92
+ */
93
+ const recoverFailedTransfer = async e => {
78
94
  await withdrawToSeat(sharedLocalAccount, seat, give);
79
95
  const errorMsg = `IBC Transfer failed ${q(e)}`;
80
96
  void log(`ERROR: ${errorMsg}`);
81
- seat.exit(errorMsg);
97
+ seat.fail(errorMsg);
82
98
  throw makeError(errorMsg);
99
+ };
100
+
101
+ if (info.namespace === 'cosmos') {
102
+ const { chainId } = info;
103
+ assert(typeof chainId === 'string', 'bad chainId');
104
+
105
+ const [_a, _o, connection] = await chainHub.getChainsAndConnection(
106
+ 'agoric',
107
+ chainName,
108
+ );
109
+
110
+ connection.counterparty || Fail`No IBC connection to ${chainName}`;
111
+
112
+ void log(`got info for chain: ${chainName} ${chainId}`);
113
+
114
+ await localTransfer(seat, sharedLocalAccount, give);
115
+ void log(`completed transfer to localAccount`);
116
+
117
+ try {
118
+ await sharedLocalAccount.transfer(
119
+ {
120
+ value: destAddr,
121
+ encoding: 'bech32',
122
+ chainId,
123
+ },
124
+ { denom, value: amt.value },
125
+ );
126
+ void log(`completed transfer to ${destAddr}`);
127
+ } catch (e) {
128
+ return recoverFailedTransfer(e);
129
+ }
130
+ } else if (amt.brand === USDC && 'cctpDestinationDomain' in info) {
131
+ const nobleAccount = await nobleAccountP;
132
+ const nobleAddr = nobleAccount.getAddress();
133
+ const denomAmt = { denom, value: amt.value };
134
+ try {
135
+ await sharedLocalAccount.transfer(nobleAddr, denomAmt);
136
+ } catch (e) {
137
+ return recoverFailedTransfer(e);
138
+ }
139
+ void log('assets are now on noble');
140
+ const destAccountId = /** @type {const} */ (
141
+ `${info.namespace}:${info.reference}:${destAddr}`
142
+ );
143
+ try {
144
+ await nobleAccount.depositForBurn(destAccountId, denomAmt);
145
+ } catch (e) {
146
+ try {
147
+ // transfer back to agoric contract account if depositForBurn is not accepted by noble chain
148
+ const lcaAddress = await sharedLocalAccount.getAddress();
149
+ await nobleAccount.transfer(lcaAddress, denomAmt);
150
+ } catch (err) {
151
+ const errorMsg = `IBC Transfer from Noble back to LocalAccount failed: ${q(err)}`;
152
+ void log(`🚨 contract upgrade required to recover funds: ${errorMsg}`);
153
+ seat.fail(errorMsg);
154
+ throw makeError(errorMsg);
155
+ }
156
+ return recoverFailedTransfer(e);
157
+ }
158
+ } else {
159
+ Fail`There is currently support only for IBC and USDC transfers`;
83
160
  }
84
161
 
85
162
  seat.exit();
@@ -111,6 +111,7 @@ export function start(zcf: ZCF<StakeIcaTerms>, privateArgs: {
111
111
  typeUrl: string;
112
112
  value: string;
113
113
  }[], opts?: Partial<Omit<import("@agoric/cosmic-proto/cosmos/tx/v1beta1/tx.js").TxBody, "messages">> | undefined): import("@agoric/vow").Vow<string>;
114
+ depositForBurn(mintRecipient: `${string}:${string}:${string}`, amount: import("../orchestration-api.js").AmountArg, caller?: `${string}:${string}:${string}` | undefined): import("@agoric/vow").Vow<void>;
114
115
  }>>;
115
116
  makeAccountInvitationMaker(): Promise<Invitation<ResolvedContinuingOfferResult, undefined>>;
116
117
  }>;
@@ -1 +1 @@
1
- {"version":3,"file":"stake-ica.contract.d.ts","sourceRoot":"","sources":["stake-ica.contract.js"],"names":[],"mappings":"AAgBA;;;;;;;;GAQG;AAEH,yCAAyC;AACzC,mBADW,aAAa,OAAO,KAAK,CAAC,CAelC;AAEH;;;;;;cAAsD;AAuB/C,2BAVI,IAAI,aAAa,CAAC,eAClB;IACN,WAAW,EAAE,OAAO,OAAO,CAAC,CAAC;IAC7B,uBAAuB,EAAE,uBAAuB,CAAC;IACjD,WAAW,EAAE,WAAW,CAAC;IACzB,UAAU,EAAE,UAAU,CAAC;IACvB,KAAK,EAAE,YAAY,CAAC;CACrB,WACO,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAyGjB;4BA1HY;IACR,OAAO,EAAE,MAAM,CAAC;IAChB,gBAAgB,EAAE,eAAe,CAAC;IAClC,sBAAsB,EAAE,eAAe,CAAC;IACxC,UAAU,EAAE,OAAO,CAAC;CACrB;yBAwHU,OAAO,KAAK;kCAzJ+B,aAAa;yBAAb,aAAa;6BAC3B,cAAc;4BAFhC,kBAAkB;6CAKwB,aAAa;kCAFjD,cAAc;6BAJnB,kBAAkB;mDAKI,uBAAuB;gCAHd,aAAa;qCAC3B,cAAc"}
1
+ {"version":3,"file":"stake-ica.contract.d.ts","sourceRoot":"","sources":["stake-ica.contract.js"],"names":[],"mappings":"AAgBA;;;;;;;;GAQG;AAEH,yCAAyC;AACzC,mBADW,aAAa,OAAO,KAAK,CAAC,CAelC;AAEH;;;;;;cAAsD;AAuB/C,2BAVI,IAAI,aAAa,CAAC,eAClB;IACN,WAAW,EAAE,OAAO,OAAO,CAAC,CAAC;IAC7B,uBAAuB,EAAE,uBAAuB,CAAC;IACjD,WAAW,EAAE,WAAW,CAAC;IACzB,UAAU,EAAE,UAAU,CAAC;IACvB,KAAK,EAAE,YAAY,CAAC;CACrB,WACO,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAyGjB;4BA1HY;IACR,OAAO,EAAE,MAAM,CAAC;IAChB,gBAAgB,EAAE,eAAe,CAAC;IAClC,sBAAsB,EAAE,eAAe,CAAC;IACxC,UAAU,EAAE,OAAO,CAAC;CACrB;yBAwHU,OAAO,KAAK;kCAzJ+B,aAAa;yBAAb,aAAa;6BAC3B,cAAc;4BAFhC,kBAAkB;6CAKwB,aAAa;kCAFjD,cAAc;6BAJnB,kBAAkB;mDAKI,uBAAuB;gCAHd,aAAa;qCAC3B,cAAc"}
@@ -114,6 +114,7 @@ classDiagram
114
114
  asContinuingOffer()
115
115
  deactivate()
116
116
  delegate()
117
+ depositForBurn()
117
118
  executeEncodedTx()
118
119
  getAddress()
119
120
  getBalance()
@@ -1,6 +1,6 @@
1
1
  export function prepareChainHubAdmin(zone: Zone, chainHub: ChainHub): import("@endo/exo").Guarded<{
2
2
  /**
3
- * Register information for a chain
3
+ * Register information for a Cosmos chain
4
4
  *
5
5
  * @param {string} chainName - must not exist in chainHub
6
6
  * @param {ChainInfo} chainInfo
@@ -19,7 +19,7 @@ export function prepareChainHubAdmin(zone: Zone, chainHub: ChainHub): import("@e
19
19
  }>;
20
20
  export type ChainHubAdmin = ReturnType<(zone: Zone, chainHub: ChainHub) => import("@endo/exo").Guarded<{
21
21
  /**
22
- * Register information for a chain
22
+ * Register information for a Cosmos chain
23
23
  *
24
24
  * @param {string} chainName - must not exist in chainHub
25
25
  * @param {ChainInfo} chainInfo
@@ -1 +1 @@
1
- {"version":3,"file":"chain-hub-admin.d.ts","sourceRoot":"","sources":["chain-hub-admin.js"],"names":[],"mappings":"AA+BO,2CAHI,IAAI,YACJ,QAAQ;IAeb;;;;;;OAMG;6BAHQ,MAAM,aACN,SAAS,sBACT,iBAAiB;IAiB5B;;;;;;;OAOG;yBAHQ,KAAK,UAEL,WAAW;GAU3B;4BAEa,UAAU,QAxDb,IAAI,YACJ,QAAQ;IAeb;;;;;;OAMG;6BAHQ,MAAM,aACN,SAAS,sBACT,iBAAiB;IAiB5B;;;;;;;OAOG;yBAHQ,KAAK,UAEL,WAAW;GAYkB;0BA7EvB,cAAc;8BAEG,gBAAgB;+BADe,uBAAuB;uCAAvB,uBAAuB;2BAAvB,uBAAuB;iCACtD,gBAAgB"}
1
+ {"version":3,"file":"chain-hub-admin.d.ts","sourceRoot":"","sources":["chain-hub-admin.js"],"names":[],"mappings":"AA+BO,2CAHI,IAAI,YACJ,QAAQ;IAab;;;;;;OAMG;6BAHQ,MAAM,aACN,SAAS,sBACT,iBAAiB;IAiB5B;;;;;;;OAOG;yBAHQ,KAAK,UAEL,WAAW;GAU3B;4BAEa,UAAU,QAtDb,IAAI,YACJ,QAAQ;IAab;;;;;;OAMG;6BAHQ,MAAM,aACN,SAAS,sBACT,iBAAiB;IAiB5B;;;;;;;OAOG;yBAHQ,KAAK,UAEL,WAAW;GAYkB;0BA3EvB,cAAc;8BAEG,gBAAgB;+BADe,uBAAuB;uCAAvB,uBAAuB;2BAAvB,uBAAuB;iCACtD,gBAAgB"}
@@ -1,4 +1,4 @@
1
- /* we expect promises to resolved promptly, */
1
+ /* we expect promises to resolve promptly, */
2
2
  /* eslint-disable no-restricted-syntax */
3
3
  import { heapVowE } from '@agoric/vow/vat.js';
4
4
  import { M } from '@endo/patterns';
@@ -34,16 +34,14 @@ export const prepareChainHubAdmin = (zone, chainHub) => {
34
34
  const makeCreatorFacet = zone.exo(
35
35
  'ChainHub Admin',
36
36
  M.interface('ChainHub Admin', {
37
- registerChain: M.callWhen(
38
- M.string(),
39
- ChainInfoShape,
40
- ConnectionInfoShape,
41
- ).returns(M.undefined()),
37
+ registerChain: M.callWhen(M.string(), ChainInfoShape)
38
+ .optional(ConnectionInfoShape)
39
+ .returns(M.undefined()),
42
40
  registerAsset: M.call(M.string(), DenomDetailShape).returns(M.promise()),
43
41
  }),
44
42
  {
45
43
  /**
46
- * Register information for a chain
44
+ * Register information for a Cosmos chain
47
45
  *
48
46
  * @param {string} chainName - must not exist in chainHub
49
47
  * @param {ChainInfo} chainInfo
@@ -4,7 +4,7 @@
4
4
  * @import {Zone} from '@agoric/zone';
5
5
  * @import {CosmosAssetInfo, CosmosChainInfo, ForwardInfo, IBCConnectionInfo, IBCMsgTransferOptions, TransferRoute, GoDuration, Bech32Address} from '../cosmos-api.js';
6
6
  * @import {KnownChains} from '../chain-info.js';
7
- * @import {AccountId, CosmosChainAddress, ChainInfo, ScopedChainId, Denom, DenomAmount, AccountIdArg} from '../orchestration-api.js';
7
+ * @import {AccountId, CosmosChainAddress, ChainInfo, CaipChainId, Denom, DenomAmount, AccountIdArg} from '../orchestration-api.js';
8
8
  * @import {Remote, TypedPattern} from '@agoric/internal';
9
9
  * @import {Pattern} from '@endo/patterns';
10
10
  */
@@ -23,8 +23,8 @@ export const CONNECTIONS_KEY: "chainConnection";
23
23
  /** @deprecated use HubName.ChainAssets */
24
24
  export const ASSETS_KEY: "chainAssets";
25
25
  export function encodeChainId(chainId: string): string;
26
- export function connectionKey(chainId1: string, chainId2: string): string;
27
- export function normalizeConnectionInfo(primaryChainId: string, counterChainId: string, directed: IBCConnectionInfo): [string, IBCConnectionInfo];
26
+ export function connectionKey(chainId1: string, chainId2: string): IbcConnectionKey;
27
+ export function normalizeConnectionInfo(primaryChainId: string, counterChainId: string, directed: IBCConnectionInfo): [IbcConnectionKey, IBCConnectionInfo];
28
28
  /** @type {TypedPattern<TransferRoute>} */
29
29
  export const TransferRouteShape: TypedPattern<TransferRoute>;
30
30
  export function makeChainHub(zone: Zone, agoricNames: Remote<NameHub>, vowTools: VowTools, { chainInfoValueShape }?: {
@@ -58,6 +58,13 @@ export function makeChainHub(zone: Zone, agoricNames: Remote<NameHub>, vowTools:
58
58
  */
59
59
  getChainInfo<K extends string>(chainName: K): Vow<ActualChainInfo<K>>;
60
60
  /**
61
+ * @param {CaipChainId} chainId
62
+ * @returns {ChainInfo}
63
+ */
64
+ getChainInfoByChainId(chainId: CaipChainId): ChainInfo;
65
+ /**
66
+ * Register information for a Cosmos chain
67
+ *
61
68
  * @param {string} primaryChainId
62
69
  * @param {string} counterpartyChainId
63
70
  * @param {IBCConnectionInfo} connectionInfo from primary to counterparty
@@ -66,8 +73,9 @@ export function makeChainHub(zone: Zone, agoricNames: Remote<NameHub>, vowTools:
66
73
  /**
67
74
  * Update connection info by completely replacing existing entry
68
75
  *
69
- * @param {string} primaryChainId - ID of primary chain
70
- * @param {string} counterpartyChainId - ID of counterparty chain
76
+ * @param {string} primaryChainId - Cosmos chainId of primary chain
77
+ * @param {string} counterpartyChainId - Cosmos chainId of counterparty
78
+ * chain
71
79
  * @param {IBCConnectionInfo} connectionInfo - New connection info
72
80
  * @throws {Error} If connection not registered
73
81
  */
@@ -126,11 +134,12 @@ export function makeChainHub(zone: Zone, agoricNames: Remote<NameHub>, vowTools:
126
134
  */
127
135
  getDenom(brand: Brand): Denom | undefined;
128
136
  /**
129
- * @param {string} partialId CAIP-10 account ID or a Cosmos bech32 address
137
+ * @param {AccountId | Bech32Address | string} partialId CAIP-10 account ID
138
+ * or a Cosmos bech32 address
130
139
  * @returns {AccountId}
131
140
  * @throws {Error} if chain info not found for bech32Prefix
132
141
  */
133
- resolveAccountId(partialId: string): AccountId;
142
+ resolveAccountId(partialId: AccountId | Bech32Address | string): AccountId;
134
143
  /**
135
144
  * @param {string} partialId CAIP-10 account ID or a Cosmos bech32 address
136
145
  * @returns {CosmosChainAddress}
@@ -178,6 +187,7 @@ export type DenomDetail = {
178
187
  */
179
188
  brand?: globalThis.Brand<"nat"> | undefined;
180
189
  };
190
+ export type IbcConnectionKey = `${string}${"_"}${string}`;
181
191
  export type ChainHub = ReturnType<typeof makeChainHub>;
182
192
  import type { IBCConnectionInfo } from '../cosmos-api.js';
183
193
  import type { TransferRoute } from '../cosmos-api.js';
@@ -189,11 +199,12 @@ import type { VowTools } from '@agoric/vow';
189
199
  import type { Pattern } from '@endo/patterns';
190
200
  import type { ChainInfo } from '../orchestration-api.js';
191
201
  import type { Vow } from '@agoric/vow';
202
+ import type { CaipChainId } from '../orchestration-api.js';
192
203
  import type { Denom } from '../orchestration-api.js';
193
204
  import type { AccountId } from '../orchestration-api.js';
205
+ import type { Bech32Address } from '../cosmos-api.js';
194
206
  import type { CosmosChainAddress } from '../orchestration-api.js';
195
207
  import type { AccountIdArg } from '../orchestration-api.js';
196
- import type { Bech32Address } from '../cosmos-api.js';
197
208
  import type { DenomAmount } from '../orchestration-api.js';
198
209
  import type { IBCMsgTransferOptions } from '../cosmos-api.js';
199
210
  import type { CosmosAssetInfo } from '../cosmos-api.js';
@@ -1 +1 @@
1
- {"version":3,"file":"chain-hub.d.ts","sourceRoot":"","sources":["chain-hub.js"],"names":[],"mappings":"AAoBA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AG,SAAS;IASpC;;;;;OAKG;oBAFQ,KAAK,GACH,KAAK,GAAG,SAAS;IAS9B;;;;;OAKG;gCAJQ,SAAS,GAAG,aAAa,GAAG,MAAM,GAEhC,SAAS;IAetB;;;;OAIG;gCAHQ,MAAM,GACJ,kBAAkB;IAwB/B;;;;;;;;;;;;;;;OAeG;mCANQ,YAAY,GAAG,aAAa,eAC5B,WAAW,gBACX,MAAM,gBACN,qBAAqB,CAAC,aAAa,CAAC,GAClC,aAAa;GAgH7B;AAUM,yCAJI,QAAQ,QACR,MAAM,UACN,eAAe,EAAE,QAe3B;;;;4BAh0BqB,CAAC,SAAV,MAAQ,IACR,CAAC,SAAS,MAAM,WAAW,GACjC,SAAS,GAAG,IAAI,CAAC,WAAW,CAAC,CAAC,CAAC,EAAE,aAAa,CAAC,GAC/C,SAAS;;;;;cAMF,MAAM;;;;eACN,KAAK;;;;eACL,MAAM;;;;;;+BA8BN,GAAG,MAAM,GAAG,GAAkB,GAAG,MAAM,EAAE;uBAiwBzC,UAAU,CAAC,OAAO,YAAY,CAAC;uCAvzBuG,kBAAkB;mCAAlB,kBAAkB;kCAG/H,kBAAkB;0BAJlC,cAAc;6BAFX,cAAc;4BAMD,kBAAkB;8BALzB,aAAa;6BAMnB,gBAAgB;+BAFgE,yBAAyB;yBAJnG,aAAa;iCAI6D,yBAAyB;2BAAzB,yBAAyB;+BAAzB,yBAAyB;mCAFiB,kBAAkB;wCAE5D,yBAAyB;kCAAzB,yBAAyB;iCAAzB,yBAAyB;2CAFiB,kBAAkB;qCAAlB,kBAAkB;iCACxI,kBAAkB"}
@@ -1,10 +1,12 @@
1
+ import { BrandShape } from '@agoric/ertp/src/typeGuards.js';
1
2
  import { Fail, makeError, q } from '@endo/errors';
2
3
  import { E } from '@endo/far';
3
4
  import { M } from '@endo/patterns';
4
- import { BrandShape } from '@agoric/ertp/src/typeGuards.js';
5
5
 
6
6
  import { VowShape } from '@agoric/vow';
7
7
  import {
8
+ AccountArgShape,
9
+ ChainInfoShape,
8
10
  CoinShape,
9
11
  CosmosChainAddressShape,
10
12
  DenomAmountShape,
@@ -13,10 +15,9 @@ import {
13
15
  ForwardOptsShape,
14
16
  IBCChannelIDShape,
15
17
  IBCConnectionInfoShape,
16
- AccountArgShape,
17
- ChainInfoShape,
18
18
  } from '../typeGuards.js';
19
19
  import { getBech32Prefix } from '../utils/address.js';
20
+ import { chainInfoCaipId } from '../utils/chain-info.js';
20
21
 
21
22
  /**
22
23
  * @import {NameHub} from '@agoric/vats';
@@ -24,7 +25,7 @@ import { getBech32Prefix } from '../utils/address.js';
24
25
  * @import {Zone} from '@agoric/zone';
25
26
  * @import {CosmosAssetInfo, CosmosChainInfo, ForwardInfo, IBCConnectionInfo, IBCMsgTransferOptions, TransferRoute, GoDuration, Bech32Address} from '../cosmos-api.js';
26
27
  * @import {KnownChains} from '../chain-info.js';
27
- * @import {AccountId, CosmosChainAddress, ChainInfo, ScopedChainId, Denom, DenomAmount, AccountIdArg} from '../orchestration-api.js';
28
+ * @import {AccountId, CosmosChainAddress, ChainInfo, CaipChainId, Denom, DenomAmount, AccountIdArg} from '../orchestration-api.js';
28
29
  * @import {Remote, TypedPattern} from '@agoric/internal';
29
30
  * @import {Pattern} from '@endo/patterns';
30
31
  */
@@ -76,6 +77,8 @@ export const ASSETS_KEY = HubName.ChainAssets;
76
77
  */
77
78
  const CHAIN_ID_SEPARATOR = '_';
78
79
 
80
+ /** @typedef {`${string}${CHAIN_ID_SEPARATOR}${string}`} IbcConnectionKey */
81
+
79
82
  /**
80
83
  * Vstorage keys can be only alphanumerics, dash, or underscore, which are all
81
84
  * valid characters in chain IDs. So, double each occurence of
@@ -98,12 +101,15 @@ export const encodeChainId = chainId =>
98
101
  *
99
102
  * @param {string} chainId1
100
103
  * @param {string} chainId2
104
+ * @returns {IbcConnectionKey}
101
105
  */
102
106
  export const connectionKey = (chainId1, chainId2) => {
103
107
  const chainId1Sanitized = encodeChainId(chainId1);
104
108
  const chainId2Sanitized = encodeChainId(chainId2);
105
109
 
106
- return [chainId1Sanitized, chainId2Sanitized].sort().join(CHAIN_ID_SEPARATOR);
110
+ return /** @type {IbcConnectionKey} */ (
111
+ [chainId1Sanitized, chainId2Sanitized].sort().join(CHAIN_ID_SEPARATOR)
112
+ );
107
113
  };
108
114
 
109
115
  /**
@@ -138,7 +144,7 @@ const reverseConnInfo = connInfo => {
138
144
  * @param {string} primaryChainId
139
145
  * @param {string} counterChainId
140
146
  * @param {IBCConnectionInfo} directed
141
- * @returns {[string, IBCConnectionInfo]}
147
+ * @returns {[IbcConnectionKey, IBCConnectionInfo]}
142
148
  */
143
149
  export const normalizeConnectionInfo = (
144
150
  primaryChainId,
@@ -207,6 +213,7 @@ const ChainHubI = M.interface('ChainHub', {
207
213
  registerChain: M.call(M.string(), ChainInfoShape).returns(),
208
214
  updateChain: M.call(M.string(), ChainInfoShape).returns(),
209
215
  getChainInfo: M.call(M.string()).returns(VowShape),
216
+ getChainInfoByChainId: M.call(M.string()).returns(ChainInfoShape),
210
217
  registerConnection: M.call(
211
218
  M.string(),
212
219
  M.string(),
@@ -254,12 +261,21 @@ export const makeChainHub = (
254
261
  vowTools,
255
262
  { chainInfoValueShape = /** @type {Pattern} */ (ChainInfoShape) } = {},
256
263
  ) => {
257
- /** @type {MapStore<string, ChainInfo>} */
264
+ /**
265
+ * Handle mapping of a chain's common name (e.g. 'ethereum' or "doravota") to
266
+ * its info (e.g. specififying CAIP-2 eip155:1 or Cosmos chainId 'votash')
267
+ *
268
+ * @type {MapStore<string, ChainInfo>}
269
+ */
258
270
  const chainInfos = zone.mapStore('chainInfos', {
259
271
  keyShape: M.string(),
260
272
  valueShape: chainInfoValueShape,
261
273
  });
262
- /** @type {MapStore<string, IBCConnectionInfo>} */
274
+ /**
275
+ * IBC connection paths, keyed by a function of each chain's Cosmos chainId
276
+ *
277
+ * @type {MapStore<IbcConnectionKey, IBCConnectionInfo>}
278
+ */
263
279
  const connectionInfos = zone.mapStore('connectionInfos', {
264
280
  keyShape: M.string(),
265
281
  valueShape: IBCConnectionInfoShape,
@@ -275,11 +291,26 @@ export const makeChainHub = (
275
291
  keyShape: BrandShape,
276
292
  valueShape: M.string(),
277
293
  });
278
- /** @type {MapStore<string, string>} */
294
+ /**
295
+ * Handle mapping of, for example, "osmosis" chain that has bech32 prefix
296
+ * "osmo" and chainId "osmosis-1".
297
+ *
298
+ * @type {MapStore<string, string>}
299
+ */
279
300
  const bech32PrefixToChainName = zone.mapStore('bech32PrefixToChainName', {
280
301
  keyShape: M.string(),
281
302
  valueShape: M.string(),
282
303
  });
304
+ /**
305
+ * CaipChainId is implied by the ChainInfo. The value in this store is a key
306
+ * into `chainInfos`.
307
+ *
308
+ * @type {MapStore<CaipChainId, string>}
309
+ */
310
+ const chainIdToChainName = zone.mapStore('chainIdToChainName', {
311
+ keyShape: M.string(),
312
+ valueShape: M.string(),
313
+ });
283
314
 
284
315
  /**
285
316
  * @param {Denom} denom - from perspective of the src/holding chain
@@ -288,7 +319,7 @@ export const makeChainHub = (
288
319
  const makeDenomKey = (denom, srcChainName) => `${srcChainName}:${denom}`;
289
320
 
290
321
  /**
291
- * @param {string} address
322
+ * @param {Bech32Address | string} address
292
323
  * @returns {string}
293
324
  */
294
325
  const resolveCosmosChainId = address => {
@@ -317,6 +348,7 @@ export const makeChainHub = (
317
348
  // TODO consider makeAtomicProvider for vows
318
349
  if (!chainInfos.has(chainName)) {
319
350
  chainInfos.init(chainName, chainInfo);
351
+ chainIdToChainName.init(chainInfoCaipId(chainInfo), chainName);
320
352
  if (chainInfo.bech32Prefix) {
321
353
  bech32PrefixToChainName.init(chainInfo.bech32Prefix, chainName);
322
354
  }
@@ -417,6 +449,7 @@ export const makeChainHub = (
417
449
  */
418
450
  registerChain(name, chainInfo) {
419
451
  chainInfos.init(name, chainInfo);
452
+ chainIdToChainName.init(chainInfoCaipId(chainInfo), name);
420
453
  if (chainInfo.namespace === 'cosmos' && chainInfo.bech32Prefix) {
421
454
  bech32PrefixToChainName.init(chainInfo.bech32Prefix, name);
422
455
  }
@@ -433,12 +466,17 @@ export const makeChainHub = (
433
466
  throw makeError(`Chain ${q(chainName)} not registered`);
434
467
  }
435
468
  const oldInfo = chainInfos.get(chainName);
469
+ // defensively check, for older versions which may not have `chainIdToChainName`
470
+ if (chainIdToChainName.has(chainInfoCaipId(oldInfo))) {
471
+ chainIdToChainName.delete(chainInfoCaipId(oldInfo));
472
+ }
436
473
  if (/** @type {CosmosChainInfo} */ (oldInfo).bech32Prefix) {
437
474
  bech32PrefixToChainName.delete(
438
475
  /** @type {CosmosChainInfo} */ (oldInfo).bech32Prefix,
439
476
  );
440
477
  }
441
478
  chainInfos.set(chainName, chainInfo);
479
+ chainIdToChainName.init(chainInfoCaipId(chainInfo), chainName);
442
480
  if (/** @type {CosmosChainInfo} */ (chainInfo).bech32Prefix) {
443
481
  bech32PrefixToChainName.init(
444
482
  /** @type {CosmosChainInfo} */ (chainInfo).bech32Prefix,
@@ -465,6 +503,20 @@ export const makeChainHub = (
465
503
  return lookupChainInfo(chainName);
466
504
  },
467
505
  /**
506
+ * @param {CaipChainId} chainId
507
+ * @returns {ChainInfo}
508
+ */
509
+ getChainInfoByChainId(chainId) {
510
+ // Either from registerChain or memoized remote lookup()
511
+ chainIdToChainName.has(chainId) ||
512
+ Fail`Chain name not found for ${q(chainId)}`;
513
+ const chainName = chainIdToChainName.get(chainId);
514
+ chainInfos.has(chainName) || Fail`Chain Info not found for ${q(chainId)}`;
515
+ return chainInfos.get(chainName);
516
+ },
517
+ /**
518
+ * Register information for a Cosmos chain
519
+ *
468
520
  * @param {string} primaryChainId
469
521
  * @param {string} counterpartyChainId
470
522
  * @param {IBCConnectionInfo} connectionInfo from primary to counterparty
@@ -480,8 +532,9 @@ export const makeChainHub = (
480
532
  /**
481
533
  * Update connection info by completely replacing existing entry
482
534
  *
483
- * @param {string} primaryChainId - ID of primary chain
484
- * @param {string} counterpartyChainId - ID of counterparty chain
535
+ * @param {string} primaryChainId - Cosmos chainId of primary chain
536
+ * @param {string} counterpartyChainId - Cosmos chainId of counterparty
537
+ * chain
485
538
  * @param {IBCConnectionInfo} connectionInfo - New connection info
486
539
  * @throws {Error} If connection not registered
487
540
  */
@@ -624,7 +677,8 @@ export const makeChainHub = (
624
677
  },
625
678
 
626
679
  /**
627
- * @param {string} partialId CAIP-10 account ID or a Cosmos bech32 address
680
+ * @param {AccountId | Bech32Address | string} partialId CAIP-10 account ID
681
+ * or a Cosmos bech32 address
628
682
  * @returns {AccountId}
629
683
  * @throws {Error} if chain info not found for bech32Prefix
630
684
  */
@@ -634,8 +688,10 @@ export const makeChainHub = (
634
688
  return /** @type {AccountId} */ (partialId);
635
689
  }
636
690
 
637
- const reference = resolveCosmosChainId(partialId);
638
- return `cosmos:${reference}:${partialId}`;
691
+ const cosmosChainId = resolveCosmosChainId(
692
+ /** @type {Bech32Address} */ (partialId),
693
+ );
694
+ return `cosmos:${cosmosChainId}:${partialId}`;
639
695
  },
640
696
 
641
697
  /**
@@ -654,9 +710,11 @@ export const makeChainHub = (
654
710
  });
655
711
  }
656
712
 
657
- const chainId = resolveCosmosChainId(partialId);
713
+ const cosmosChainId = resolveCosmosChainId(
714
+ /** @type {Bech32Address} */ (partialId),
715
+ );
658
716
  return harden({
659
- chainId,
717
+ chainId: cosmosChainId,
660
718
  value: partialId,
661
719
  encoding: /** @type {const} */ ('bech32'),
662
720
  });
@@ -24,6 +24,7 @@ export const IcaAccountHolderI: import("@endo/patterns").InterfaceGuard<{
24
24
  transferSteps: import("@endo/patterns").MethodGuard;
25
25
  asContinuingOffer: import("@endo/patterns").MethodGuard;
26
26
  getPublicTopics: import("@endo/patterns").MethodGuard;
27
+ depositForBurn: import("@endo/patterns").MethodGuard;
27
28
  }>;
28
29
  export const CosmosOrchestrationInvitationMakersI: import("@endo/patterns").InterfaceGuard<{
29
30
  Delegate: import("@endo/patterns").MethodGuard;
@@ -301,6 +302,7 @@ export function prepareCosmosOrchestrationAccountKit(zone: Zone, { chainHub, mak
301
302
  typeUrl: string;
302
303
  value: string;
303
304
  }[], opts?: Partial<Omit<import("@agoric/cosmic-proto/cosmos/tx/v1beta1/tx.js").TxBody, "messages">> | undefined): Vow<string>;
305
+ depositForBurn(mintRecipient: `${string}:${string}:${string}`, amount: AmountArg, caller?: `${string}:${string}:${string}` | undefined): Vow<void>;
304
306
  };
305
307
  }>;
306
308
  export function prepareCosmosOrchestrationAccount(zone: Zone, { chainHub, makeRecorderKit, timerService, vowTools, zcf }: {
@@ -1 +1 @@
1
- {"version":3,"file":"cosmos-orchestration-account.d.ts","sourceRoot":"","sources":["cosmos-orchestration-account.js"],"names":[],"mappings":"AA6IA,wCAAwC;AACxC;;;;;;;;;;;;;;;;;;;;;;;;;GASG;AAOH;;;;;;;;;;;GAoBE;AAYK,2DARI,IAAI,gGAEZ;IAAyB,QAAQ,EAAzB,QAAQ;IACgB,eAAe,EAAvC,eAAe;IACc,YAAY,EAAzC,OAAO,YAAY,CAAC;IACH,QAAQ,EAAzB,QAAQ;IACI,GAAG,EAAf,GAAG;CACb;kBAsGc,kBAAkB;kBAClB,eAAe;mBACf,gBAAgB;;aAEhB,UAAU;;;;;;;WAGV,OAAO,YAAY,CAAC;;;QAuC3B,wDAAwD;;;QAYxD;;;WAGG;6BAFQ,SAAS,GACP,IAAI;;;QASjB;;WAEG;8BADQ,SAAS,aAAa,CAAC,EAAE;;;QAYpC;;;WAGG;8BAFQ,SAAS,aAAa,CAAC,EAAE,GACvB,wBAAwB;;;QAgBrC;;;WAGG;8BAFQ,SAAS,aAAa,CAAC,EAAE,GACvB,wBAAwB,EAAE;;;QAiBvC;;WAEG;8BADQ,SAAS,aAAa,CAAC,EAAE;;;QAYpC;;WAEG;8BADQ,SAAS,aAAa,CAAC,EAAE;;;QAcpC;;WAEG;8BADQ,SAAS,aAAa,CAAC,EAAE;;;QAapC;;WAEG;8BADQ,SAAS,aAAa,CAAC,EAAE;;;QAapC;;WAEG;8BADQ,SAAS,aAAa,CAAC,EAAE;;;QAYpC;;;W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