@agoric/orchestration 0.1.1-dev-1ea0d4b.0 → 0.1.1-dev-4e588de.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 (55) hide show
  1. package/package.json +16 -16
  2. package/src/cosmos-api.d.ts +15 -9
  3. package/src/cosmos-api.d.ts.map +1 -1
  4. package/src/cosmos-api.ts +21 -9
  5. package/src/examples/auto-stake-it-tap-kit.d.ts +3 -3
  6. package/src/examples/auto-stake-it-tap-kit.d.ts.map +1 -1
  7. package/src/examples/auto-stake-it-tap-kit.js +7 -7
  8. package/src/examples/send-anywhere.flows.d.ts.map +1 -1
  9. package/src/examples/send-anywhere.flows.js +0 -1
  10. package/src/examples/stake-bld.contract.d.ts +4 -4
  11. package/src/examples/stake-bld.contract.d.ts.map +1 -1
  12. package/src/examples/stake-bld.contract.js +0 -1
  13. package/src/examples/stake-ica.contract.d.ts +5 -7
  14. package/src/examples/stake-ica.contract.d.ts.map +1 -1
  15. package/src/examples/staking-combinations.contract.js +4 -4
  16. package/src/examples/staking-combinations.flows.d.ts +2 -2
  17. package/src/examples/staking-combinations.flows.d.ts.map +1 -1
  18. package/src/examples/staking-combinations.flows.js +4 -4
  19. package/src/exos/chain-hub.d.ts +16 -8
  20. package/src/exos/chain-hub.d.ts.map +1 -1
  21. package/src/exos/chain-hub.js +60 -17
  22. package/src/exos/cosmos-orchestration-account.d.ts +14 -16
  23. package/src/exos/cosmos-orchestration-account.d.ts.map +1 -1
  24. package/src/exos/cosmos-orchestration-account.js +32 -21
  25. package/src/exos/ica-account-kit.d.ts +4 -4
  26. package/src/exos/ica-account-kit.d.ts.map +1 -1
  27. package/src/exos/ica-account-kit.js +5 -6
  28. package/src/exos/local-chain-facade.d.ts.map +1 -1
  29. package/src/exos/local-chain-facade.js +3 -4
  30. package/src/exos/local-orchestration-account.d.ts +12 -11
  31. package/src/exos/local-orchestration-account.d.ts.map +1 -1
  32. package/src/exos/local-orchestration-account.js +8 -7
  33. package/src/exos/portfolio-holder-kit.d.ts.map +1 -1
  34. package/src/exos/portfolio-holder-kit.js +0 -1
  35. package/src/exos/remote-chain-facade.d.ts.map +1 -1
  36. package/src/exos/remote-chain-facade.js +6 -6
  37. package/src/orchestration-api.d.ts +36 -10
  38. package/src/orchestration-api.d.ts.map +1 -1
  39. package/src/orchestration-api.ts +42 -10
  40. package/src/typeGuards.d.ts +11 -4
  41. package/src/typeGuards.d.ts.map +1 -1
  42. package/src/typeGuards.js +27 -12
  43. package/src/utils/address.d.ts +9 -2
  44. package/src/utils/address.d.ts.map +1 -1
  45. package/src/utils/address.js +45 -5
  46. package/src/utils/cosmos.d.ts.map +1 -1
  47. package/src/utils/cosmos.js +0 -2
  48. package/src/utils/orc.d.ts.map +1 -1
  49. package/src/utils/orc.js +0 -2
  50. package/src/utils/orchestrationAccount.js +6 -5
  51. package/src/utils/start-helper.d.ts +3 -2
  52. package/src/utils/start-helper.d.ts.map +1 -1
  53. package/tools/ibc-mocks.d.ts +4 -4
  54. package/tools/ibc-mocks.d.ts.map +1 -1
  55. package/tools/ibc-mocks.ts +4 -4
@@ -5,7 +5,7 @@ import { BrandShape } from '@agoric/ertp/src/typeGuards.js';
5
5
 
6
6
  import { VowShape } from '@agoric/vow';
7
7
  import {
8
- ChainAddressShape,
8
+ CosmosChainAddressShape,
9
9
  CoinShape,
10
10
  CosmosChainInfoShape,
11
11
  DenomAmountShape,
@@ -14,16 +14,17 @@ import {
14
14
  ForwardOptsShape,
15
15
  IBCChannelIDShape,
16
16
  IBCConnectionInfoShape,
17
+ AccountArgShape,
17
18
  } from '../typeGuards.js';
18
- import { getBech32Prefix } from '../utils/address.js';
19
+ import { getBech32Prefix, parseAccountId } from '../utils/address.js';
19
20
 
20
21
  /**
21
22
  * @import {NameHub} from '@agoric/vats';
22
23
  * @import {Vow, VowTools} from '@agoric/vow';
23
24
  * @import {Zone} from '@agoric/zone';
24
- * @import {CosmosAssetInfo, CosmosChainInfo, ForwardInfo, IBCConnectionInfo, IBCMsgTransferOptions, TransferRoute, GoDuration} from '../cosmos-api.js';
25
+ * @import {CosmosAssetInfo, CosmosChainInfo, ForwardInfo, IBCConnectionInfo, IBCMsgTransferOptions, TransferRoute, GoDuration, Bech32Address} from '../cosmos-api.js';
25
26
  * @import {ChainInfo, KnownChains} from '../chain-info.js';
26
- * @import {ChainAddress, Denom, DenomAmount} from '../orchestration-api.js';
27
+ * @import {AccountId, CosmosChainAddress, ScopedChainId, Denom, DenomAmount, AccountIdArg} from '../orchestration-api.js';
27
28
  * @import {Remote, TypedPattern} from '@agoric/internal';
28
29
  */
29
30
 
@@ -216,8 +217,9 @@ const ChainHubI = M.interface('ChainHub', {
216
217
  M.or(DenomDetailShape, M.undefined()),
217
218
  ),
218
219
  getDenom: M.call(BrandShape).returns(M.or(M.string(), M.undefined())),
219
- makeChainAddress: M.call(M.string()).returns(ChainAddressShape),
220
- makeTransferRoute: M.call(ChainAddressShape, DenomAmountShape, M.string())
220
+ makeChainAddress: M.call(M.string()).returns(CosmosChainAddressShape),
221
+ resolveAccountId: M.call(M.string()).returns(M.string()),
222
+ makeTransferRoute: M.call(AccountArgShape, DenomAmountShape, M.string())
221
223
  .optional(ForwardOptsShape)
222
224
  .returns(M.or(M.undefined(), TransferRouteShape)),
223
225
  });
@@ -268,6 +270,21 @@ export const makeChainHub = (zone, agoricNames, vowTools) => {
268
270
  */
269
271
  const makeDenomKey = (denom, srcChainName) => `${srcChainName}:${denom}`;
270
272
 
273
+ /**
274
+ * @param {string} address
275
+ * @returns {string}
276
+ */
277
+ const resolveCosmosChainId = address => {
278
+ // Infer it from the bech32 prefix
279
+ const prefix = getBech32Prefix(address);
280
+ if (!bech32PrefixToChainName.has(prefix)) {
281
+ throw makeError(`Chain info not found for bech32Prefix ${q(prefix)}`);
282
+ }
283
+ const chainName = bech32PrefixToChainName.get(prefix);
284
+ const { chainId } = chainInfos.get(chainName);
285
+ return chainId;
286
+ };
287
+
271
288
  const lookupChainInfo = vowTools.retryable(
272
289
  zone,
273
290
  'lookupChainInfo',
@@ -490,23 +507,44 @@ export const makeChainHub = (zone, agoricNames, vowTools) => {
490
507
  return undefined;
491
508
  },
492
509
  /**
493
- * @param {string} address bech32 address
494
- * @returns {ChainAddress}
510
+ * @param {string} partialId CAIP-10 account ID or a Cosmos bech32 address
511
+ * @returns {AccountId}
512
+ * @throws {Error} if chain info not found for bech32Prefix
513
+ */
514
+ resolveAccountId(partialId) {
515
+ const parsed = parseAccountId(partialId);
516
+ if ('namespace' in parsed) {
517
+ // It is already fully qualified
518
+ return /** @type {AccountId} */ (partialId);
519
+ }
520
+
521
+ const reference = resolveCosmosChainId(partialId);
522
+ return `cosmos:${reference}:${partialId}`;
523
+ },
524
+ /**
525
+ * @param {string} partialId CAIP-10 account ID or a Cosmos bech32 address
526
+ * @returns {CosmosChainAddress}
495
527
  * @throws {Error} if chain info not found for bech32Prefix
496
528
  */
497
- makeChainAddress(address) {
498
- const prefix = getBech32Prefix(address);
499
- if (!bech32PrefixToChainName.has(prefix)) {
500
- throw makeError(`Chain info not found for bech32Prefix ${q(prefix)}`);
529
+ makeChainAddress(partialId) {
530
+ const parsed = parseAccountId(partialId);
531
+
532
+ if ('namespace' in parsed) {
533
+ assert.equal(parsed.namespace, 'cosmos');
534
+ return harden({
535
+ chainId: parsed.reference,
536
+ value: parsed.accountAddress,
537
+ });
501
538
  }
502
- const chainName = bech32PrefixToChainName.get(prefix);
503
- const { chainId } = chainInfos.get(chainName);
539
+
540
+ const chainId = resolveCosmosChainId(parsed.accountAddress);
504
541
  return harden({
505
542
  chainId,
506
- value: address,
507
- encoding: /** @type {const} */ ('bech32'),
543
+ value: parsed.accountAddress,
508
544
  });
509
545
  },
546
+ // TODO document whether this is limited to IBC
547
+ // Not urgent because it's vat-local
510
548
  /**
511
549
  * Determine the transfer route for a destination and amount given the
512
550
  * current holding chain.
@@ -516,7 +554,7 @@ export const makeChainHub = (zone, agoricNames, vowTools) => {
516
554
  *
517
555
  * XXX consider accepting AmountArg #10449
518
556
  *
519
- * @param {ChainAddress} destination
557
+ * @param {AccountIdArg} destination
520
558
  * @param {DenomAmount} denomAmount
521
559
  * @param {string} srcChainName
522
560
  * @param {IBCMsgTransferOptions['forwardOpts']} [forwardOpts]
@@ -545,6 +583,11 @@ export const makeChainHub = (zone, agoricNames, vowTools) => {
545
583
 
546
584
  const holdingChainId = chainInfos.get(srcChainName).chainId;
547
585
 
586
+ destination =
587
+ typeof destination === 'string'
588
+ ? chainHub.makeChainAddress(destination)
589
+ : destination;
590
+
548
591
  // asset is transferring to or from the issuing chain, return direct route
549
592
  if (baseChainId === destination.chainId || baseName === srcChainName) {
550
593
  // TODO use getConnectionInfo once its sync
@@ -44,7 +44,7 @@ export function prepareCosmosOrchestrationAccountKit(zone: Zone, { chainHub, mak
44
44
  vowTools: VowTools;
45
45
  zcf: ZCF;
46
46
  }): (args_0: {
47
- chainAddress: ChainAddress;
47
+ chainAddress: CosmosChainAddress;
48
48
  localAddress: LocalIbcAddress;
49
49
  remoteAddress: RemoteIbcAddress;
50
50
  }, io: {
@@ -155,7 +155,7 @@ export function prepareCosmosOrchestrationAccountKit(zone: Zone, { chainHub, mak
155
155
  * bigint,
156
156
  * ]} results
157
157
  * @param {{
158
- * destination: ChainAddress;
158
+ * destination: CosmosChainAddress;
159
159
  * opts?: IBCMsgTransferOptions;
160
160
  * token: Coin;
161
161
  * }} ctx
@@ -163,7 +163,7 @@ export function prepareCosmosOrchestrationAccountKit(zone: Zone, { chainHub, mak
163
163
  onFulfilled([{ transferChannel }, timeoutTimestamp]: [{
164
164
  transferChannel: IBCConnectionInfo["transferChannel"];
165
165
  }, bigint], { opts, token, destination }: {
166
- destination: ChainAddress;
166
+ destination: CosmosChainAddress;
167
167
  opts?: IBCMsgTransferOptions;
168
168
  token: Coin;
169
169
  }): Vow<undefined>;
@@ -195,11 +195,11 @@ export function prepareCosmosOrchestrationAccountKit(zone: Zone, { chainHub, mak
195
195
  DeactivateAccount(): Promise<Invitation<Vow<void>, undefined>>;
196
196
  ReactivateAccount(): Promise<Invitation<Vow<void>, undefined>>;
197
197
  Send(): Promise<Invitation<Vow<void>, {
198
- toAccount: ChainAddress;
198
+ toAccount: CosmosChainAddress;
199
199
  amount: AmountArg;
200
200
  }>>;
201
201
  SendAll(): Promise<Invitation<Vow<void>, {
202
- toAccount: ChainAddress;
202
+ toAccount: CosmosChainAddress;
203
203
  amounts: AmountArg[];
204
204
  }>>;
205
205
  /**
@@ -210,27 +210,27 @@ export function prepareCosmosOrchestrationAccountKit(zone: Zone, { chainHub, mak
210
210
  TransferAccount(): never;
211
211
  Transfer(): Promise<Invitation<Vow<void>, {
212
212
  amount: AmountArg;
213
- destination: ChainAddress;
213
+ destination: CosmosChainAddress;
214
214
  opts?: IBCMsgTransferOptions;
215
215
  }>>;
216
216
  };
217
217
  holder: {
218
218
  asContinuingOffer(): Vow<import("@agoric/async-flow").HostInterface<import("../utils/zoe-tools.js").ResolvedContinuingOfferResult>>;
219
219
  getPublicTopics(): Vow<import("@agoric/async-flow").HostInterface<Record<string, import("@agoric/zoe/src/contractSupport/topics.js").ResolvedPublicTopic<unknown>>>>;
220
- getAddress(): import("@agoric/async-flow").HostInterface<ChainAddress>;
220
+ getAddress(): import("@agoric/async-flow").HostInterface<CosmosChainAddress>;
221
221
  delegate(validator: CosmosValidatorAddress, amount: AmountArg): Vow<void>;
222
222
  redelegate(srcValidator: CosmosValidatorAddress, dstValidator: CosmosValidatorAddress, amount: AmountArg): Vow<void>;
223
223
  withdrawReward(validator: CosmosValidatorAddress): Vow<import("../orchestration-api.js").DenomAmount[]>;
224
224
  getBalance(denom: import("../orchestration-api.js").DenomArg): Vow<import("../orchestration-api.js").DenomAmount>;
225
225
  getBalances(): Vow<import("../orchestration-api.js").DenomAmount[]>;
226
- send(toAccount: ChainAddress, amount: AmountArg): Vow<void>;
227
- sendAll(toAccount: ChainAddress, amounts: AmountArg[]): Vow<void>;
228
- transfer(destination: ChainAddress, amount: AmountArg, opts?: IBCMsgTransferOptions | undefined): Vow<void>;
226
+ send(toAccount: CosmosChainAddress, amount: AmountArg): Vow<void>;
227
+ sendAll(toAccount: CosmosChainAddress, amounts: AmountArg[]): Vow<void>;
228
+ transfer(destination: import("../orchestration-api.js").AccountIdArg, amount: AmountArg, opts?: IBCMsgTransferOptions | undefined): Vow<void>;
229
229
  transferSteps(amount: AmountArg, msg: import("../orchestration-api.js").TransferMsg): Vow<void>;
230
230
  withdrawRewards(): Vow<import("../orchestration-api.js").DenomAmount[]>;
231
231
  undelegate(delegations: {
232
232
  amount: AmountArg;
233
- delegator?: ChainAddress;
233
+ delegator?: CosmosChainAddress;
234
234
  validator: CosmosValidatorAddress;
235
235
  }[]): Vow<void>;
236
236
  deactivate(): Vow<void>;
@@ -240,12 +240,10 @@ export function prepareCosmosOrchestrationAccountKit(zone: Zone, { chainHub, mak
240
240
  delegator: {
241
241
  chainId: string;
242
242
  value: string;
243
- encoding: "bech32" | "ethereum";
244
243
  };
245
244
  validator: {
246
245
  chainId: string;
247
246
  value: `${string}valoper${string}`;
248
- encoding: "bech32";
249
247
  };
250
248
  amount: {
251
249
  denom: import("../orchestration-api.js").Denom;
@@ -311,14 +309,14 @@ export function prepareCosmosOrchestrationAccount(zone: Zone, { chainHub, makeRe
311
309
  zcf: ZCF;
312
310
  }): (...args: Parameters<ReturnType<typeof prepareCosmosOrchestrationAccountKit>>) => CosmosOrchestrationAccountKit["holder"];
313
311
  export type CosmosOrchestrationAccountNotification = {
314
- chainAddress: ChainAddress;
312
+ chainAddress: CosmosChainAddress;
315
313
  };
316
314
  /**
317
315
  * Internal to the IcaAccountHolder exo
318
316
  */
319
317
  export type State = {
320
318
  account: IcaAccount;
321
- chainAddress: ChainAddress;
319
+ chainAddress: CosmosChainAddress;
322
320
  icqConnection: ICQConnection | undefined;
323
321
  localAddress: LocalIbcAddress;
324
322
  remoteAddress: RemoteIbcAddress;
@@ -337,7 +335,7 @@ import type { MakeRecorderKit } from '@agoric/zoe/src/contractSupport/recorder.j
337
335
  import type { TimerService } from '@agoric/time';
338
336
  import type { Remote } from '@agoric/internal';
339
337
  import type { VowTools } from '@agoric/vow';
340
- import type { ChainAddress } from '../types.js';
338
+ import type { CosmosChainAddress } from '../types.js';
341
339
  import type { LocalIbcAddress } from '@agoric/vats/tools/ibc-utils.js';
342
340
  import type { RemoteIbcAddress } from '@agoric/vats/tools/ibc-utils.js';
343
341
  import type { IcaAccount } from '../types.js';
@@ -1 +1 @@
1
- {"version":3,"file":"cosmos-orchestration-account.d.ts","sourceRoot":"","sources":["cosmos-orchestration-account.js"],"names":[],"mappings":"AA4IA,wCAAwC;AACxC;;;;;;;;;;;;;;;;;;;;;;;;;GASG;AAOH;;;;;;;;;;;GAkBE;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,YAAY;kBACZ,eAAe;mBACf,gBAAgB;;aAEhB,UAAU;;;;;;;WAGV,OAAO,YAAY,CAAC;;;QAkC3B,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;;;WAGG;8BAFQ,SAA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aAAa;0BAExQ,kDAAkD;8CAFyM,aAAa;2CAAb,aAAa;uCAAb,aAAa;2CAAb,aAAa;4CAAb,aAAa;mCAAb,aAAa;iCAChP,6CAA6C"}
@@ -46,7 +46,7 @@ import { Fail, makeError, q } from '@endo/errors';
46
46
  import { E } from '@endo/far';
47
47
  import {
48
48
  AmountArgShape,
49
- ChainAddressShape,
49
+ CosmosChainAddressShape,
50
50
  DelegationShape,
51
51
  DenomAmountShape,
52
52
  IBCTransferOptionsShape,
@@ -67,7 +67,7 @@ import { makeTimestampHelper } from '../utils/time.js';
67
67
 
68
68
  /**
69
69
  * @import {HostOf} from '@agoric/async-flow';
70
- * @import {AmountArg, IcaAccount, ChainAddress, CosmosValidatorAddress, ICQConnection, StakingAccountActions, StakingAccountQueries, OrchestrationAccountCommon, CosmosRewardsResponse, IBCConnectionInfo, IBCMsgTransferOptions, ChainHub, CosmosDelegationResponse} from '../types.js';
70
+ * @import {AmountArg, IcaAccount, CosmosChainAddress, CosmosValidatorAddress, ICQConnection, StakingAccountActions, StakingAccountQueries, OrchestrationAccountCommon, CosmosRewardsResponse, IBCConnectionInfo, IBCMsgTransferOptions, ChainHub, CosmosDelegationResponse} from '../types.js';
71
71
  * @import {RecorderKit, MakeRecorderKit} from '@agoric/zoe/src/contractSupport/recorder.js';
72
72
  * @import {Coin} from '@agoric/cosmic-proto/cosmos/base/v1beta1/coin.js';
73
73
  * @import {Remote} from '@agoric/internal';
@@ -88,14 +88,14 @@ const { Vow$ } = NetworkShape; // TODO #9611
88
88
 
89
89
  /**
90
90
  * @typedef {object} CosmosOrchestrationAccountNotification
91
- * @property {ChainAddress} chainAddress
91
+ * @property {CosmosChainAddress} chainAddress
92
92
  */
93
93
 
94
94
  /**
95
95
  * @private
96
96
  * @typedef {{
97
97
  * account: IcaAccount;
98
- * chainAddress: ChainAddress;
98
+ * chainAddress: CosmosChainAddress;
99
99
  * icqConnection: ICQConnection | undefined;
100
100
  * localAddress: LocalIbcAddress;
101
101
  * remoteAddress: RemoteIbcAddress;
@@ -114,14 +114,14 @@ const { Vow$ } = NetworkShape; // TODO #9611
114
114
 
115
115
  /** @see {StakingAccountActions} */
116
116
  const stakingAccountActionsMethods = {
117
- delegate: M.call(ChainAddressShape, AmountArgShape).returns(VowShape),
117
+ delegate: M.call(CosmosChainAddressShape, AmountArgShape).returns(VowShape),
118
118
  redelegate: M.call(
119
- ChainAddressShape,
120
- ChainAddressShape,
119
+ CosmosChainAddressShape,
120
+ CosmosChainAddressShape,
121
121
  AmountArgShape,
122
122
  ).returns(VowShape),
123
123
  undelegate: M.call(M.arrayOf(DelegationShape)).returns(VowShape),
124
- withdrawReward: M.call(ChainAddressShape).returns(
124
+ withdrawReward: M.call(CosmosChainAddressShape).returns(
125
125
  Vow$(M.arrayOf(DenomAmountShape)),
126
126
  ),
127
127
  withdrawRewards: M.call().returns(Vow$(M.arrayOf(DenomAmountShape))),
@@ -129,12 +129,12 @@ const stakingAccountActionsMethods = {
129
129
 
130
130
  /** @see {StakingAccountQueries} */
131
131
  const stakingAccountQueriesMethods = {
132
- getDelegation: M.call(ChainAddressShape).returns(VowShape),
132
+ getDelegation: M.call(CosmosChainAddressShape).returns(VowShape),
133
133
  getDelegations: M.call().returns(VowShape),
134
- getUnbondingDelegation: M.call(ChainAddressShape).returns(VowShape),
134
+ getUnbondingDelegation: M.call(CosmosChainAddressShape).returns(VowShape),
135
135
  getUnbondingDelegations: M.call().returns(VowShape),
136
136
  getRedelegations: M.call().returns(VowShape),
137
- getReward: M.call(ChainAddressShape).returns(VowShape),
137
+ getReward: M.call(CosmosChainAddressShape).returns(VowShape),
138
138
  getRewards: M.call().returns(VowShape),
139
139
  };
140
140
 
@@ -158,13 +158,15 @@ const PUBLIC_TOPICS = {
158
158
  export const CosmosOrchestrationInvitationMakersI = M.interface(
159
159
  'invitationMakers',
160
160
  {
161
- Delegate: M.call(ChainAddressShape, AmountArgShape).returns(M.promise()),
161
+ Delegate: M.call(CosmosChainAddressShape, AmountArgShape).returns(
162
+ M.promise(),
163
+ ),
162
164
  Redelegate: M.call(
163
- ChainAddressShape,
164
- ChainAddressShape,
165
+ CosmosChainAddressShape,
166
+ CosmosChainAddressShape,
165
167
  AmountArgShape,
166
168
  ).returns(M.promise()),
167
- WithdrawReward: M.call(ChainAddressShape).returns(M.promise()),
169
+ WithdrawReward: M.call(CosmosChainAddressShape).returns(M.promise()),
168
170
  Undelegate: M.call(M.arrayOf(DelegationShape)).returns(M.promise()),
169
171
  DeactivateAccount: M.call().returns(M.promise()),
170
172
  ReactivateAccount: M.call().returns(M.promise()),
@@ -232,7 +234,7 @@ export const prepareCosmosOrchestrationAccountKit = (
232
234
  transferWatcher: M.interface('transferWatcher', {
233
235
  onFulfilled: M.call([M.record(), M.nat()])
234
236
  .optional({
235
- destination: ChainAddressShape,
237
+ destination: CosmosChainAddressShape,
236
238
  opts: M.or(M.undefined(), IBCTransferOptionsShape),
237
239
  token: {
238
240
  denom: M.string(),
@@ -286,7 +288,7 @@ export const prepareCosmosOrchestrationAccountKit = (
286
288
  },
287
289
  /**
288
290
  * @param {object} info
289
- * @param {ChainAddress} info.chainAddress
291
+ * @param {CosmosChainAddress} info.chainAddress
290
292
  * @param {LocalIbcAddress} info.localAddress
291
293
  * @param {RemoteIbcAddress} info.remoteAddress
292
294
  * @param {object} io
@@ -561,7 +563,7 @@ export const prepareCosmosOrchestrationAccountKit = (
561
563
  * bigint,
562
564
  * ]} results
563
565
  * @param {{
564
- * destination: ChainAddress;
566
+ * destination: CosmosChainAddress;
565
567
  * opts?: IBCMsgTransferOptions;
566
568
  * token: Coin;
567
569
  * }} ctx
@@ -655,7 +657,7 @@ export const prepareCosmosOrchestrationAccountKit = (
655
657
  /**
656
658
  * @type {OfferHandler<
657
659
  * Vow<void>,
658
- * { toAccount: ChainAddress; amount: AmountArg }
660
+ * { toAccount: CosmosChainAddress; amount: AmountArg }
659
661
  * >}
660
662
  */
661
663
  const offerHandler = (seat, { toAccount, amount }) => {
@@ -668,7 +670,7 @@ export const prepareCosmosOrchestrationAccountKit = (
668
670
  /**
669
671
  * @type {OfferHandler<
670
672
  * Vow<void>,
671
- * { toAccount: ChainAddress; amounts: AmountArg[] }
673
+ * { toAccount: CosmosChainAddress; amounts: AmountArg[] }
672
674
  * >}
673
675
  */
674
676
  const offerHandler = (seat, { toAccount, amounts }) => {
@@ -691,7 +693,7 @@ export const prepareCosmosOrchestrationAccountKit = (
691
693
  * Vow<void>,
692
694
  * {
693
695
  * amount: AmountArg;
694
- * destination: ChainAddress;
696
+ * destination: CosmosChainAddress;
695
697
  * opts?: IBCMsgTransferOptions;
696
698
  * }
697
699
  * >}
@@ -896,6 +898,15 @@ export const prepareCosmosOrchestrationAccountKit = (
896
898
  transfer(destination, amount, opts) {
897
899
  trace('transfer', destination, amount, opts);
898
900
  return asVow(() => {
901
+ // `destination` arg can be non-Cosmos per the common `.transfer` method signature
902
+ // but this implementation only supports transferring to another Cosmos chain.
903
+ // It relies on `makeChainAddress` to throw if `destination` has another namespace.
904
+ destination =
905
+ typeof destination === 'string'
906
+ ? // If `destination` is not actually CAIP-10 then this will throw
907
+ chainHub.makeChainAddress(destination)
908
+ : destination;
909
+
899
910
  const { helper } = this.facets;
900
911
  const token = helper.amountToCoin(amount);
901
912
 
@@ -14,8 +14,8 @@ export function prepareIcaAccountKit(zone: Zone, { watch, asVow }: VowTools): (c
14
14
  onFulfilled(ack: string): string;
15
15
  };
16
16
  account: {
17
- /** @returns {ChainAddress} */
18
- getAddress(): ChainAddress;
17
+ /** @returns {CosmosChainAddress} */
18
+ getAddress(): CosmosChainAddress;
19
19
  getLocalAddress(): `/ibc-port/${string}`;
20
20
  getRemoteAddress(): `/${string}ibc-port/${string}/ordered/${string}` | `/${string}ibc-port/${string}/unordered/${string}`;
21
21
  getPort(): Port;
@@ -71,14 +71,14 @@ export type State = {
71
71
  localAddress: LocalIbcAddress | undefined;
72
72
  requestedRemoteAddress: string;
73
73
  remoteAddress: RemoteIbcAddress | undefined;
74
- chainAddress: ChainAddress | undefined;
74
+ chainAddress: CosmosChainAddress | undefined;
75
75
  isInitiatingClose: boolean;
76
76
  };
77
77
  export type IcaAccountKit = ReturnType<ReturnType<typeof prepareIcaAccountKit>>;
78
78
  import type { Zone } from '@agoric/base-zone';
79
79
  import type { VowTools } from '@agoric/vow';
80
80
  import type { Port } from '@agoric/network';
81
- import type { ChainAddress } from '../types.js';
81
+ import type { CosmosChainAddress } from '../types.js';
82
82
  import type { Vow } from '@agoric/vow';
83
83
  import type { AnyJson } from '@agoric/cosmic-proto';
84
84
  import type { TxBody } from '@agoric/cosmic-proto/cosmos/tx/v1beta1/tx.js';
@@ -1 +1 @@
1
- {"version":3,"file":"ica-account-kit.d.ts","sourceRoot":"","sources":["ica-account-kit.js"],"names":[],"mappings":"AA8BA;;;;;;;;;GAWG;AA0BI,2CAJI,IAAI,oBACJ,QAAQ;;QAiCX,0BAA0B;yBAAd,MAAM;;;QAMlB,8BAA8B;sBAAhB,YAAY;;;;;QAyB1B;;;;;;;;;WASG;+BALQ,OAAO,EAAE,SACT,IAAI,CAAC,MAAM,EAAE,UAAU,CAAC,GACtB,IAAI,MAAM,CAAC;;;;;QA0CxB;;;;WAIG;2BAHQ,OAAO,UAAU,CAAC,aAClB,eAAe,cACf,gBAAgB;QAiB3B;;;;;;;;;;;;;;;;WAgBG;6BAHQ,OAAO,UAAU,CAAC,UAClB,OAAO;;GAkBvB;;;;oBAtLU;IACR,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE,IAAI,CAAC;IACX,UAAU,EAAE,OAAO,UAAU,CAAC,GAAG,SAAS,CAAC;IAC3C,YAAY,EAAE,eAAe,GAAG,SAAS,CAAC;IAC1C,sBAAsB,EAAE,MAAM,CAAC;IAC/B,aAAa,EAAE,gBAAgB,GAAG,SAAS,CAAC;IAC5C,YAAY,EAAE,YAAY,GAAG,SAAS,CAAC;IACvC,iBAAiB,EAAE,OAAO,CAAC;CAC5B;4BA+KU,UAAU,CAAC,UAAU,CAAC,OA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+5,7 @@ import { M } from '@endo/patterns';
5
5
  import { NonNullish, makeTracer } from '@agoric/internal';
6
6
  import { VowShape } from '@agoric/vow';
7
7
  import {
8
- ChainAddressShape,
8
+ CosmosChainAddressShape,
9
9
  OutboundConnectionHandlerI,
10
10
  Proto3Shape,
11
11
  TxBodyOptsShape,
@@ -21,7 +21,7 @@ import { makeTxPacket, parseTxPacket } from '../utils/packet.js';
21
21
  * @import {AnyJson} from '@agoric/cosmic-proto';
22
22
  * @import {TxBody} from '@agoric/cosmic-proto/cosmos/tx/v1beta1/tx.js';
23
23
  * @import {LocalIbcAddress, RemoteIbcAddress} from '@agoric/vats/tools/ibc-utils.js';
24
- * @import {ChainAddress, IcaAccount} from '../types.js';
24
+ * @import {CosmosChainAddress, IcaAccount} from '../types.js';
25
25
  */
26
26
 
27
27
  const trace = makeTracer('IcaAccountKit');
@@ -29,7 +29,7 @@ const trace = makeTracer('IcaAccountKit');
29
29
  const UNPARSABLE_CHAIN_ADDRESS = 'UNPARSABLE_CHAIN_ADDRESS';
30
30
 
31
31
  export const IcaAccountI = M.interface('IcaAccount', {
32
- getAddress: M.call().returns(ChainAddressShape),
32
+ getAddress: M.call().returns(CosmosChainAddressShape),
33
33
  getLocalAddress: M.call().returns(M.string()),
34
34
  getRemoteAddress: M.call().returns(M.string()),
35
35
  getPort: M.call().returns(M.remotable('Port')),
@@ -51,7 +51,7 @@ export const IcaAccountI = M.interface('IcaAccount', {
51
51
  * localAddress: LocalIbcAddress | undefined;
52
52
  * requestedRemoteAddress: string;
53
53
  * remoteAddress: RemoteIbcAddress | undefined;
54
- * chainAddress: ChainAddress | undefined;
54
+ * chainAddress: CosmosChainAddress | undefined;
55
55
  * isInitiatingClose: boolean;
56
56
  * }} State
57
57
  * Internal to the IcaAccountKit exo
@@ -101,7 +101,7 @@ export const prepareIcaAccountKit = (zone, { watch, asVow }) =>
101
101
  },
102
102
  },
103
103
  account: {
104
- /** @returns {ChainAddress} */
104
+ /** @returns {CosmosChainAddress} */
105
105
  getAddress() {
106
106
  return NonNullish(
107
107
  this.state.chainAddress,
@@ -191,7 +191,6 @@ export const prepareIcaAccountKit = (zone, { watch, asVow }) =>
191
191
  this.state.chainAddress = harden({
192
192
  value: address || UNPARSABLE_CHAIN_ADDRESS,
193
193
  chainId: this.state.chainId,
194
- encoding: 'bech32',
195
194
  });
196
195
  },
197
196
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"local-chain-facade.d.ts","sourceRoot":"","sources":["local-chain-facade.js"],"names":[],"mappings":"AA8LO,8CAJI,IAAI,UACJ,sBAAsB;;;;;;;;;;;;;;;;;;;;;;IAtFzB,6DAA6D;mBAA/C,IAAI,4BAA4B,CAAC,QAAQ,CAAC,CAAC;;;;;;;;;;GA4FhE;;;;;;;;;;;uBArKa,MAAM,OAAO,CAAC,SAAS,EAAE,CAAC;;qCAO3B;IACR,gCAAgC,EAAE,gCAAgC,CAAC;IACnE,aAAa,EAAE,OAAO,uBAAuB,CAAC,CAAC;IAC/C,WAAW,EAAE,OAAO,WAAW,CAAC,GAAG,SAAS,CAAC;IAC7C,WAAW,EAAE,OAAO,OAAO,CAAC,CAAC;IAC7B,KAAK,EAAE,OAAO,YAAY,CAAC,CAAC;IAC5B,UAAU,EAAE,OAAO,UAAU,CAAC,CAAC;IAC/B,QAAQ,EAAE,QAAQ,CAAC;CACpB;mCAyJU,UAAU,CAAC,OAAO,uBAAuB,CAAC;+BAC1C,UAAU,CAAC,oBAAoB,CAAC;0BAzLvB,mBAAmB;uCASiE,aAAa;yBAHxF,aAAa;kDAEoC,kCAAkC;+BAJvF,8BAA8B;sDAIuB,kCAAkC;6CADzE,qBAAqB;4BALtC,kBAAkB;6BAGjB,cAAc;kCAJT,cAAc;gCAEgB,gCAAgC;8BAG7D,aAAa"}
1
+ {"version":3,"file":"local-chain-facade.d.ts","sourceRoot":"","sources":["local-chain-facade.js"],"names":[],"mappings":"AA6LO,8CAJI,IAAI,UACJ,sBAAsB;;;;;;;;;;;;;;;;;;;;;;IArFzB,6DAA6D;mBAA/C,IAAI,4BAA4B,CAAC,QAAQ,CAAC,CAAC;;;;;;;;;;GA2FhE;;;;;;;;;;;uBApKa,MAAM,OAAO,CAAC,SAAS,EAAE,CAAC;;qCAO3B;IACR,gCAAgC,EAAE,gCAAgC,CAAC;IACnE,aAAa,EAAE,OAAO,uBAAuB,CAAC,CAAC;IAC/C,WAAW,EAAE,OAAO,WAAW,CAAC,GAAG,SAAS,CAAC;IAC7C,WAAW,EAAE,OAAO,OAAO,CAAC,CAAC;IAC7B,KAAK,EAAE,OAAO,YAAY,CAAC,CAAC;IAC5B,UAAU,EAAE,OAAO,UAAU,CAAC,CAAC;IAC/B,QAAQ,EAAE,QAAQ,CAAC;CACpB;mCAwJU,UAAU,CAAC,OAAO,uBAAuB,CAAC;+BAC1C,UAAU,CAAC,oBAAoB,CAAC;0BAxLvB,mBAAmB;uCASuE,aAAa;yBAH9F,aAAa;kDAEoC,kCAAkC;+BAJvF,8BAA8B;sDAIuB,kCAAkC;6CADzE,qBAAqB;4BALtC,kBAAkB;6BAGjB,cAAc;kCAJT,cAAc;gCAEgB,gCAAgC;8BAG7D,aAAa"}
@@ -19,7 +19,7 @@ import { chainFacadeMethods, TypedJsonShape } from '../typeGuards.js';
19
19
  * @import {Vow, VowTools} from '@agoric/vow';
20
20
  * @import {CosmosInterchainService} from './exo-interfaces.js';
21
21
  * @import {LocalOrchestrationAccountKit, MakeLocalOrchestrationAccountKit} from './local-orchestration-account.js';
22
- * @import {Chain, ChainAddress, ChainInfo, CosmosChainInfo, IBCConnectionInfo, OrchestrationAccount} from '../types.js';
22
+ * @import {Chain, CosmosChainAddress, ChainInfo, CosmosChainInfo, IBCConnectionInfo, OrchestrationAccount} from '../types.js';
23
23
  */
24
24
 
25
25
  /**
@@ -142,7 +142,7 @@ const prepareLocalChainFacadeKit = (
142
142
  },
143
143
  makeAccountWatcher: {
144
144
  /**
145
- * @param {[LocalChainAccount, ChainAddress['value']]} results
145
+ * @param {[LocalChainAccount, CosmosChainAddress['value']]} results
146
146
  */
147
147
  onFulfilled([account, address]) {
148
148
  const optionalStorageNode = storageNode
@@ -159,7 +159,7 @@ const prepareLocalChainFacadeKit = (
159
159
  * @param {Remote<StorageNode>} childNode
160
160
  * @param {{
161
161
  * account: LocalChainAccount;
162
- * address: ChainAddress['value'];
162
+ * address: CosmosChainAddress['value'];
163
163
  * }} ctx
164
164
  */
165
165
  onFulfilled(childNode, { account, address }) {
@@ -168,7 +168,6 @@ const prepareLocalChainFacadeKit = (
168
168
  account,
169
169
  address: harden({
170
170
  value: address,
171
- encoding: 'bech32',
172
171
  chainId: localChainInfo.chainId,
173
172
  }),
174
173
  // FIXME storage path https://github.com/Agoric/agoric-sdk/issues/9066
@@ -8,7 +8,7 @@ export function prepareLocalOrchestrationAccountKit(zone: Zone, { makeRecorderKi
8
8
  zoeTools: ZoeTools;
9
9
  }): (args_0: {
10
10
  account: LocalChainAccount;
11
- address: ChainAddress;
11
+ address: CosmosChainAddress;
12
12
  storageNode?: Remote<globalThis.StorageNode> | undefined;
13
13
  }) => import("@endo/exo").GuardedKit<{
14
14
  helper: {
@@ -32,16 +32,16 @@ export function prepareLocalOrchestrationAccountKit(zone: Zone, { makeRecorderKi
32
32
  Undelegate(validatorAddress: string, ertpAmount: Amount<"nat">): Promise<Invitation<Vow<TimestampRecord>, undefined>>;
33
33
  CloseAccount(): never;
34
34
  Send(): Promise<Invitation<Vow<void>, {
35
- toAccount: ChainAddress;
35
+ toAccount: CosmosChainAddress;
36
36
  amount: AmountArg;
37
37
  }>>;
38
38
  SendAll(): Promise<Invitation<Vow<void>, {
39
- toAccount: ChainAddress;
39
+ toAccount: CosmosChainAddress;
40
40
  amounts: AmountArg[];
41
41
  }>>;
42
42
  Transfer(): Promise<Invitation<Vow<void>, {
43
43
  amount: AmountArg;
44
- destination: ChainAddress;
44
+ destination: CosmosChainAddress;
45
45
  opts?: IBCMsgTransferOptions;
46
46
  }>>;
47
47
  Withdraw(): Promise<Invitation<Vow<void>, undefined>>;
@@ -156,11 +156,11 @@ export function prepareLocalOrchestrationAccountKit(zone: Zone, { makeRecorderKi
156
156
  }[]): Vow<{
157
157
  '@type': string;
158
158
  }[]>;
159
- getAddress(): ChainAddress;
160
- send(toAccount: ChainAddress, amount: AmountArg): Vow<void>;
161
- sendAll(toAccount: ChainAddress, amounts: AmountArg[]): Vow<void>;
159
+ getAddress(): CosmosChainAddress;
160
+ send(toAccount: CosmosChainAddress, amount: AmountArg): Vow<void>;
161
+ sendAll(toAccount: CosmosChainAddress, amounts: AmountArg[]): Vow<void>;
162
162
  /**
163
- * @param {ChainAddress} destination
163
+ * @param {AccountIdArg} destination
164
164
  * @param {AmountArg} amount an ERTP {@link Amount} or a
165
165
  * {@link DenomAmount}
166
166
  * @param {IBCMsgTransferOptions} [opts] if either timeoutHeight or
@@ -171,7 +171,7 @@ export function prepareLocalOrchestrationAccountKit(zone: Zone, { makeRecorderKi
171
171
  * recognized, or the transfer is rejected (insufficient funds,
172
172
  * timeout)
173
173
  */
174
- transfer(destination: ChainAddress, amount: AmountArg, opts?: IBCMsgTransferOptions): Vow<any>;
174
+ transfer(destination: AccountIdArg, amount: AmountArg, opts?: IBCMsgTransferOptions): Vow<any>;
175
175
  transferSteps(amount: AmountArg, msg: import("@agoric/orchestration").TransferMsg): Vow<void>;
176
176
  sendThenWaitForAck(packetSender: Remote<import("./packet-tools.js").PacketSender>, opts?: import("./packet-tools.js").PacketOptions | undefined): import("@agoric/async-flow").HostInterface<Vow<any>>;
177
177
  matchFirstPacket(args_0?: import("@agoric/vow").EVow<globalThis.Pattern>): import("@agoric/async-flow").HostInterface<Vow<{
@@ -191,7 +191,7 @@ export type State = {
191
191
  topicKit: RecorderKit<LocalChainAccountNotification> | undefined;
192
192
  packetTools: PacketTools;
193
193
  account: LocalChainAccount;
194
- address: ChainAddress;
194
+ address: CosmosChainAddress;
195
195
  };
196
196
  export type MakeLocalOrchestrationAccountKit = ReturnType<typeof prepareLocalOrchestrationAccountKit>;
197
197
  export type LocalOrchestrationAccountKit = ReturnType<MakeLocalOrchestrationAccountKit>;
@@ -204,7 +204,7 @@ import type { ChainHub } from './chain-hub.js';
204
204
  import type { LocalChain } from '@agoric/vats/src/localchain.js';
205
205
  import type { ZoeTools } from '../utils/zoe-tools.js';
206
206
  import type { LocalChainAccount } from '@agoric/vats/src/localchain.js';
207
- import type { ChainAddress } from '@agoric/orchestration';
207
+ import type { CosmosChainAddress } from '@agoric/orchestration';
208
208
  import type { AmountArg } from '@agoric/orchestration';
209
209
  import type { Coin } from '@agoric/cosmic-proto/cosmos/base/v1beta1/coin.js';
210
210
  import type { Vow } from '@agoric/vow';
@@ -215,6 +215,7 @@ import type { JsonSafe } from '@agoric/cosmic-proto';
215
215
  import type { TransferRoute } from '@agoric/orchestration';
216
216
  import type { DenomAmount } from '@agoric/orchestration';
217
217
  import type { ResponseTo } from '@agoric/cosmic-proto';
218
+ import type { AccountIdArg } from '@agoric/orchestration';
218
219
  import type { RecorderKit } from '@agoric/zoe/src/contractSupport/recorder.js';
219
220
  import type { PacketTools } from './packet-tools.js';
220
221
  //# sourceMappingURL=local-orchestration-account.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"local-orchestration-account.d.ts","sourceRoot":"","sources":["local-orchestration-account.js"],"names":[],"mappings":"AAiGO,0DAVI,IAAI,qFAEZ;IAAgC,eAAe,EAAvC,eAAe;IACH,GAAG,EAAf,GAAG;IAC0B,YAAY,EAAzC,OAAO,YAAY,CAAC;IACH,QAAQ,EAAzB,QAAQ;IACS,QAAQ,EAAzB,QAAQ;IACmB,UAAU,EAArC,OAAO,UAAU,CAAC;IACD,QAAQ,EAAzB,QAAQ;CAClB;aAqFc,iBAAiB;aACjB,YAAY;;;;QAoBnB;;;WAGG;6BAFQ,SAAS,GACP,IAAI;;;QAOjB;;;WAGG;mCAFQ,MAAM,cACN,MAAM,CAAC,KAAK,CAAC;;QAiCxB;;;WAGG;qCAFQ,MAAM,cACN,MAAM,CAAC,KAA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