@agoric/orchestration 0.2.0-upgrade-19-devnet-dev-5428c4d.0 → 0.2.0-upgrade-22-dev-6fad137.0.6fad137

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 (183) hide show
  1. package/package.json +50 -42
  2. package/src/axelar-types.d.ts +51 -0
  3. package/src/axelar-types.d.ts.map +1 -0
  4. package/src/axelar-types.js +77 -0
  5. package/src/cctp-chain-info.d.ts +65 -0
  6. package/src/cctp-chain-info.d.ts.map +1 -0
  7. package/src/cctp-chain-info.js +52 -0
  8. package/src/chain-capabilities.d.ts +7 -12
  9. package/src/chain-capabilities.d.ts.map +1 -1
  10. package/src/chain-capabilities.js +46 -21
  11. package/src/chain-info.d.ts +1885 -226
  12. package/src/chain-info.d.ts.map +1 -1
  13. package/src/chain-info.js +45 -14
  14. package/src/cosmos-api.d.ts +61 -18
  15. package/src/cosmos-api.d.ts.map +1 -1
  16. package/src/cosmos-api.ts +72 -21
  17. package/src/ethereum-api.d.ts +6 -5
  18. package/src/ethereum-api.d.ts.map +1 -1
  19. package/src/ethereum-api.ts +8 -5
  20. package/src/examples/auto-stake-it-tap-kit.d.ts +4 -4
  21. package/src/examples/auto-stake-it-tap-kit.d.ts.map +1 -1
  22. package/src/examples/auto-stake-it-tap-kit.js +8 -8
  23. package/src/examples/auto-stake-it.contract.d.ts +6 -24
  24. package/src/examples/auto-stake-it.contract.d.ts.map +1 -1
  25. package/src/examples/auto-stake-it.contract.js +1 -0
  26. package/src/examples/axelar-gmp-account-kit.d.ts +78 -0
  27. package/src/examples/axelar-gmp-account-kit.d.ts.map +1 -0
  28. package/src/examples/axelar-gmp-account-kit.js +380 -0
  29. package/src/examples/axelar-gmp.contract.d.ts +52 -0
  30. package/src/examples/axelar-gmp.contract.d.ts.map +1 -0
  31. package/src/examples/axelar-gmp.contract.js +98 -0
  32. package/src/examples/axelar-gmp.flows.d.ts +21 -0
  33. package/src/examples/axelar-gmp.flows.d.ts.map +1 -0
  34. package/src/examples/axelar-gmp.flows.js +161 -0
  35. package/src/examples/basic-flows.contract.d.ts +6 -14
  36. package/src/examples/basic-flows.contract.d.ts.map +1 -1
  37. package/src/examples/basic-flows.contract.js +1 -0
  38. package/src/examples/send-anywhere.contract.d.ts +8 -28
  39. package/src/examples/send-anywhere.contract.d.ts.map +1 -1
  40. package/src/examples/send-anywhere.contract.js +49 -19
  41. package/src/examples/send-anywhere.flows.d.ts +563 -3
  42. package/src/examples/send-anywhere.flows.d.ts.map +1 -1
  43. package/src/examples/send-anywhere.flows.js +112 -31
  44. package/src/examples/stake-bld.contract.d.ts +14 -7
  45. package/src/examples/stake-bld.contract.d.ts.map +1 -1
  46. package/src/examples/stake-bld.contract.js +3 -1
  47. package/src/examples/stake-ica.contract.d.ts +108 -30
  48. package/src/examples/stake-ica.contract.d.ts.map +1 -1
  49. package/src/examples/stake-ica.contract.js +2 -1
  50. package/src/examples/staking-combinations.contract.d.ts +4 -12
  51. package/src/examples/staking-combinations.contract.d.ts.map +1 -1
  52. package/src/examples/staking-combinations.contract.js +5 -4
  53. package/src/examples/staking-combinations.flows.d.ts +2 -2
  54. package/src/examples/staking-combinations.flows.d.ts.map +1 -1
  55. package/src/examples/staking-combinations.flows.js +4 -4
  56. package/src/examples/swap-anything.contract.d.ts +48 -0
  57. package/src/examples/swap-anything.contract.d.ts.map +1 -0
  58. package/src/examples/swap-anything.contract.js +187 -0
  59. package/src/examples/swap-anything.flows.d.ts +32 -0
  60. package/src/examples/swap-anything.flows.d.ts.map +1 -0
  61. package/src/examples/swap-anything.flows.js +222 -0
  62. package/src/examples/swap.contract.d.ts +5 -14
  63. package/src/examples/swap.contract.d.ts.map +1 -1
  64. package/src/examples/swap.contract.js +2 -2
  65. package/src/examples/unbond.contract.d.ts +3 -3
  66. package/src/exos/README.md +1 -0
  67. package/src/exos/chain-hub-admin.d.ts +9 -9
  68. package/src/exos/chain-hub-admin.d.ts.map +1 -1
  69. package/src/exos/chain-hub-admin.js +17 -17
  70. package/src/exos/chain-hub.d.ts +77 -17
  71. package/src/exos/chain-hub.d.ts.map +1 -1
  72. package/src/exos/chain-hub.js +305 -55
  73. package/src/exos/combine-invitation-makers.d.ts.map +1 -1
  74. package/src/exos/combine-invitation-makers.js +4 -2
  75. package/src/exos/cosmos-interchain-service.d.ts +1 -0
  76. package/src/exos/cosmos-interchain-service.d.ts.map +1 -1
  77. package/src/exos/cosmos-interchain-service.js +1 -0
  78. package/src/exos/cosmos-orchestration-account.d.ts +95 -18
  79. package/src/exos/cosmos-orchestration-account.d.ts.map +1 -1
  80. package/src/exos/cosmos-orchestration-account.js +257 -114
  81. package/src/exos/ibc-packet.d.ts +36 -8
  82. package/src/exos/ibc-packet.d.ts.map +1 -1
  83. package/src/exos/ibc-packet.js +66 -11
  84. package/src/exos/ica-account-kit.d.ts +20 -6
  85. package/src/exos/ica-account-kit.d.ts.map +1 -1
  86. package/src/exos/ica-account-kit.js +23 -12
  87. package/src/exos/local-chain-facade.d.ts +3 -23
  88. package/src/exos/local-chain-facade.d.ts.map +1 -1
  89. package/src/exos/local-chain-facade.js +3 -3
  90. package/src/exos/local-orchestration-account.d.ts +59 -19
  91. package/src/exos/local-orchestration-account.d.ts.map +1 -1
  92. package/src/exos/local-orchestration-account.js +167 -40
  93. package/src/exos/orchestrator.d.ts +5 -15
  94. package/src/exos/orchestrator.d.ts.map +1 -1
  95. package/src/exos/orchestrator.js +10 -16
  96. package/src/exos/packet-tools.d.ts +4 -3
  97. package/src/exos/packet-tools.d.ts.map +1 -1
  98. package/src/exos/packet-tools.js +30 -12
  99. package/src/exos/portfolio-holder-kit.d.ts +1 -0
  100. package/src/exos/portfolio-holder-kit.d.ts.map +1 -1
  101. package/src/exos/portfolio-holder-kit.js +1 -0
  102. package/src/exos/remote-chain-facade.d.ts +5 -15
  103. package/src/exos/remote-chain-facade.d.ts.map +1 -1
  104. package/src/exos/remote-chain-facade.js +23 -13
  105. package/src/facade.js +1 -1
  106. package/src/fetched-chain-info.d.ts +2011 -502
  107. package/src/fetched-chain-info.js +1598 -172
  108. package/src/fixtures/query-flows.contract.d.ts +16 -8
  109. package/src/fixtures/query-flows.contract.d.ts.map +1 -1
  110. package/src/fixtures/query-flows.contract.js +20 -4
  111. package/src/orchestration-api.d.ts +83 -18
  112. package/src/orchestration-api.d.ts.map +1 -1
  113. package/src/orchestration-api.ts +100 -21
  114. package/src/proposals/start-axelar-gmp.js +153 -0
  115. package/src/proposals/start-send-anywhere.js +4 -0
  116. package/src/proposals/start-stakeAtom.js +29 -16
  117. package/src/proposals/start-stakeOsmo.js +29 -16
  118. package/src/proposals/start-swap-anything.js +133 -0
  119. package/src/stubs/viem-abi.d.ts +12 -0
  120. package/src/stubs/viem-abi.d.ts.map +1 -0
  121. package/src/stubs/viem-abi.ts +11 -0
  122. package/src/typeGuards.d.ts +21 -5
  123. package/src/typeGuards.d.ts.map +1 -1
  124. package/src/typeGuards.js +56 -14
  125. package/src/types.d.ts +1 -1
  126. package/src/types.d.ts.map +1 -1
  127. package/src/types.ts +2 -1
  128. package/src/utils/address.d.ts +16 -3
  129. package/src/utils/address.d.ts.map +1 -1
  130. package/src/utils/address.js +154 -5
  131. package/src/utils/agd-lib.d.ts +108 -0
  132. package/src/utils/agd-lib.d.ts.map +1 -0
  133. package/src/utils/agd-lib.js +158 -0
  134. package/src/utils/axelar-static-config.d.ts +34 -0
  135. package/src/utils/axelar-static-config.d.ts.map +1 -0
  136. package/src/utils/axelar-static-config.js +41 -0
  137. package/src/utils/chain-hub-helper.d.ts +8 -3
  138. package/src/utils/chain-hub-helper.d.ts.map +1 -1
  139. package/src/utils/chain-hub-helper.js +15 -8
  140. package/src/utils/chain-info.d.ts +5 -0
  141. package/src/utils/chain-info.d.ts.map +1 -0
  142. package/src/utils/chain-info.js +11 -0
  143. package/src/utils/cosmos.d.ts +1 -1
  144. package/src/utils/cosmos.d.ts.map +1 -1
  145. package/src/utils/cosmos.js +2 -2
  146. package/src/utils/gmp.d.ts +30 -0
  147. package/src/utils/gmp.d.ts.map +1 -0
  148. package/src/utils/gmp.js +119 -0
  149. package/src/utils/orchestrationAccount.js +6 -5
  150. package/src/utils/packet.d.ts +9 -9
  151. package/src/utils/packet.d.ts.map +1 -1
  152. package/src/utils/packet.js +21 -15
  153. package/src/utils/registry.d.ts +2 -12
  154. package/src/utils/registry.d.ts.map +1 -1
  155. package/src/utils/registry.js +4 -2
  156. package/src/utils/start-helper.d.ts +23 -8
  157. package/src/utils/start-helper.d.ts.map +1 -1
  158. package/src/utils/start-helper.js +13 -2
  159. package/src/utils/time.d.ts +11 -7
  160. package/src/utils/time.d.ts.map +1 -1
  161. package/src/utils/time.js +24 -13
  162. package/src/utils/zoe-tools.d.ts +2 -2
  163. package/src/utils/zoe-tools.d.ts.map +1 -1
  164. package/src/utils/zoe-tools.js +5 -2
  165. package/src/vat-orchestration.d.ts +1 -1
  166. package/src/vendor/viem/_esm-YOAV66U4.js +5814 -0
  167. package/src/vendor/viem/ccip-AAQDZF3N.js +14 -0
  168. package/src/vendor/viem/chunk-4EF4K2MH.js +4082 -0
  169. package/src/vendor/viem/chunk-4VNS5WPM.js +42 -0
  170. package/src/vendor/viem/chunk-XN4LUOIH.js +253 -0
  171. package/src/vendor/viem/secp256k1-WHBDSQB2.js +1914 -0
  172. package/src/vendor/viem/viem-abi.d.ts +1 -0
  173. package/src/vendor/viem/viem-abi.js +12 -0
  174. package/tools/contract-tests.d.ts +1816 -0
  175. package/tools/contract-tests.d.ts.map +1 -0
  176. package/tools/contract-tests.ts +324 -0
  177. package/tools/ibc-mocks.d.ts +85 -33
  178. package/tools/ibc-mocks.d.ts.map +1 -1
  179. package/tools/ibc-mocks.ts +204 -103
  180. package/tools/make-test-address.d.ts +2 -1
  181. package/tools/make-test-address.d.ts.map +1 -1
  182. package/tools/make-test-address.js +6 -2
  183. package/tsup.config.ts +26 -0
package/package.json CHANGED
@@ -1,25 +1,27 @@
1
1
  {
2
2
  "name": "@agoric/orchestration",
3
- "version": "0.2.0-upgrade-19-devnet-dev-5428c4d.0+5428c4d",
3
+ "version": "0.2.0-upgrade-22-dev-6fad137.0.6fad137",
4
4
  "description": "Chain abstraction for Agoric's orchestration clients",
5
5
  "type": "module",
6
6
  "main": "index.js",
7
7
  "types": "index.js",
8
8
  "engines": {
9
- "node": ">=14.15.0"
9
+ "node": "^20.9 || ^22.11"
10
10
  },
11
11
  "scripts": {
12
- "build": "exit 0",
12
+ "esbuild:axelar": "esbuild ./src/examples/axelar-gmp.contract.js --platform=node --format=esm --bundle --outfile=dist/axelar-gmp.contract.bundle.js",
13
+ "codegen:viem-abi": "tsup",
14
+ "build": "yarn esbuild:axelar",
13
15
  "codegen": "scripts/fetch-chain-info.ts",
14
- "prepack": "tsc --build tsconfig.build.json",
15
- "postpack": "git clean -f '*.d.ts*' '*.tsbuildinfo'",
16
+ "prepack": "yarn run -T tsc --build tsconfig.build.json",
17
+ "postpack": "git clean -f '*.d.*ts*' '*.tsbuildinfo'",
16
18
  "test": "ava",
17
- "test:c8": "c8 --all $C8_OPTIONS ava",
19
+ "test:c8": "c8 --all ${C8_OPTIONS:-} ava",
18
20
  "test:xs": "exit 0",
19
- "lint": "run-s --continue-on-error lint:*",
20
- "lint:types": "tsc",
21
- "lint:eslint": "eslint .",
22
- "lint-fix": "yarn lint:eslint --fix"
21
+ "lint-fix": "yarn lint:eslint --fix",
22
+ "lint": "yarn run -T run-s --continue-on-error 'lint:*'",
23
+ "lint:eslint": "yarn run -T eslint .",
24
+ "lint:types": "yarn run -T tsc"
23
25
  },
24
26
  "repository": {
25
27
  "type": "git",
@@ -33,39 +35,45 @@
33
35
  },
34
36
  "homepage": "https://github.com/Agoric/agoric-sdk#readme",
35
37
  "dependencies": {
36
- "@agoric/async-flow": "0.2.0-upgrade-19-devnet-dev-5428c4d.0+5428c4d",
37
- "@agoric/cosmic-proto": "0.5.0-upgrade-19-devnet-dev-5428c4d.0+5428c4d",
38
- "@agoric/ertp": "0.16.3-upgrade-19-devnet-dev-5428c4d.0+5428c4d",
39
- "@agoric/internal": "0.4.0-upgrade-19-devnet-dev-5428c4d.0+5428c4d",
40
- "@agoric/network": "0.2.0-upgrade-19-devnet-dev-5428c4d.0+5428c4d",
41
- "@agoric/notifier": "0.7.0-upgrade-19-devnet-dev-5428c4d.0+5428c4d",
42
- "@agoric/store": "0.9.3-upgrade-19-devnet-dev-5428c4d.0+5428c4d",
43
- "@agoric/time": "0.3.3-upgrade-19-devnet-dev-5428c4d.0+5428c4d",
44
- "@agoric/vat-data": "0.5.3-upgrade-19-devnet-dev-5428c4d.0+5428c4d",
45
- "@agoric/vats": "0.16.0-upgrade-19-devnet-dev-5428c4d.0+5428c4d",
46
- "@agoric/vow": "0.2.0-upgrade-19-devnet-dev-5428c4d.0+5428c4d",
47
- "@agoric/zoe": "0.27.0-upgrade-19-devnet-dev-5428c4d.0+5428c4d",
48
- "@agoric/zone": "0.3.0-upgrade-19-devnet-dev-5428c4d.0+5428c4d",
49
- "@endo/base64": "^1.0.9",
50
- "@endo/errors": "^1.2.9",
51
- "@endo/far": "^1.1.10",
52
- "@endo/marshal": "^1.6.3",
53
- "@endo/patterns": "^1.4.8",
54
- "@noble/hashes": "^1.5.0"
38
+ "@agoric/async-flow": "0.2.0-upgrade-22-dev-6fad137.0.6fad137",
39
+ "@agoric/cosmic-proto": "0.5.0-upgrade-22-dev-6fad137.0.6fad137",
40
+ "@agoric/ertp": "0.17.0-upgrade-22-dev-6fad137.0.6fad137",
41
+ "@agoric/internal": "0.4.0-upgrade-22-dev-6fad137.0.6fad137",
42
+ "@agoric/network": "0.2.0-upgrade-22-dev-6fad137.0.6fad137",
43
+ "@agoric/notifier": "0.7.0-upgrade-22-dev-6fad137.0.6fad137",
44
+ "@agoric/store": "0.10.0-upgrade-22-dev-6fad137.0.6fad137",
45
+ "@agoric/time": "0.4.0-upgrade-22-dev-6fad137.0.6fad137",
46
+ "@agoric/vat-data": "0.6.0-upgrade-22-dev-6fad137.0.6fad137",
47
+ "@agoric/vats": "0.16.0-upgrade-22-dev-6fad137.0.6fad137",
48
+ "@agoric/vow": "0.2.0-upgrade-22-dev-6fad137.0.6fad137",
49
+ "@agoric/zoe": "0.27.0-upgrade-22-dev-6fad137.0.6fad137",
50
+ "@agoric/zone": "0.3.0-upgrade-22-dev-6fad137.0.6fad137",
51
+ "@cosmjs/encoding": "^0.36.0",
52
+ "@endo/base64": "^1.0.12",
53
+ "@endo/errors": "^1.2.13",
54
+ "@endo/eventual-send": "^1.3.4",
55
+ "@endo/far": "^1.1.14",
56
+ "@endo/marshal": "^1.8.0",
57
+ "@endo/patterns": "^1.7.0",
58
+ "@noble/hashes": "~1.5.0",
59
+ "bs58": "^6.0.0",
60
+ "esbuild": "^0.25.2"
55
61
  },
56
62
  "devDependencies": {
57
- "@agoric/swingset-liveslots": "0.10.3-upgrade-19-devnet-dev-5428c4d.0+5428c4d",
58
- "@chain-registry/client": "^1.47.4",
59
- "@cosmjs/amino": "^0.32.3",
60
- "@cosmjs/proto-signing": "^0.32.3",
61
- "@endo/bundle-source": "^3.5.1",
62
- "@endo/import-bundle": "^1.3.3",
63
- "@endo/ses-ava": "^1.2.9",
64
- "ava": "^5.3.1",
63
+ "@agoric/swingset-liveslots": "0.11.0-upgrade-22-dev-6fad137.0.6fad137",
64
+ "@chain-registry/client": "^1.53.194",
65
+ "@cosmjs/amino": "^0.36.0",
66
+ "@cosmjs/proto-signing": "^0.36.0",
67
+ "@endo/bundle-source": "^4.1.2",
68
+ "@endo/import-bundle": "^1.5.2",
69
+ "@endo/ses-ava": "^1.3.2",
70
+ "ava": "^5.3.0",
65
71
  "bech32": "^2.0.0",
66
- "c8": "^10.1.2",
67
- "prettier": "^3.4.2",
68
- "ts-blank-space": "^0.4.4"
72
+ "c8": "^10.1.3",
73
+ "prettier": "^3.5.3",
74
+ "ts-blank-space": "^0.6.2",
75
+ "tsup": "^8.5.0",
76
+ "viem": "^2.31.0"
69
77
  },
70
78
  "ava": {
71
79
  "extensions": {
@@ -95,7 +103,7 @@
95
103
  "access": "public"
96
104
  },
97
105
  "typeCoverage": {
98
- "atLeast": 97.77
106
+ "atLeast": 97.49
99
107
  },
100
- "gitHead": "5428c4da67b53cef7ff53ba7b2a28cf6ec8f643a"
108
+ "gitHead": "6fad137fde8808d0bed3e53e3897b3a8d2622b03"
101
109
  }
@@ -0,0 +1,51 @@
1
+ export namespace AxelarGMPMessageType {
2
+ let ContractCall: 1;
3
+ let ContractCallWithToken: 2;
4
+ let TokenTransfer: 3;
5
+ }
6
+ export type GMPMessageType = (typeof AxelarGMPMessageType)[keyof typeof AxelarGMPMessageType];
7
+ export type AxelarGmpIncomingMemo = {
8
+ source_chain: string;
9
+ source_address: string;
10
+ payload: string;
11
+ type: GMPMessageType;
12
+ };
13
+ export type AxelarFeeObject = {
14
+ amount: string;
15
+ recipient: Bech32Address;
16
+ };
17
+ export type AxelarGmpOutgoingMemo = {
18
+ destination_chain: string;
19
+ destination_address: string;
20
+ payload: number[] | null;
21
+ type: GMPMessageType;
22
+ fee?: AxelarFeeObject | undefined;
23
+ };
24
+ export type EvmTapState = {
25
+ localAccount: OrchestrationAccount<{
26
+ chainId: "agoric";
27
+ }>;
28
+ localChainAddress: CosmosChainAddress;
29
+ sourceChannel: IBCChannelID;
30
+ localDenom: Denom;
31
+ assets: any;
32
+ remoteChainInfo: any;
33
+ nonce: bigint;
34
+ };
35
+ export type ContractCall = {
36
+ target: `0x${string}`;
37
+ functionSignature: string;
38
+ args: unknown[];
39
+ };
40
+ export type AbiEncodedContractCall = {
41
+ target: `0x${string}`;
42
+ data: `0x${string}`;
43
+ };
44
+ export type SupportedEVMChains = keyof typeof EVM_CHAINS;
45
+ import type { Bech32Address } from '@agoric/orchestration';
46
+ import type { OrchestrationAccount } from '@agoric/orchestration';
47
+ import type { CosmosChainAddress } from '@agoric/orchestration';
48
+ import type { IBCChannelID } from '@agoric/vats';
49
+ import type { Denom } from '@agoric/orchestration';
50
+ import type { EVM_CHAINS } from './utils/gmp.js';
51
+ //# sourceMappingURL=axelar-types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"axelar-types.d.ts","sourceRoot":"","sources":["axelar-types.js"],"names":[],"mappings":";;;;;6BAwBa,CAAC,OAAO,oBAAoB,EAAE,MAAM,OAAO,oBAAoB,CAAC;;kBAK/D,MAAM;oBACN,MAAM;aACN,MAAM;UACN,cAAc;;;YAKd,MAAM;eACN,aAAa;;;uBAKb,MAAM;yBACN,MAAM;aACN,MAAM,EAAE,GAAG,IAAI;UACf,cAAc;;;;kBAMd,qBAAqB;QAAE,OAAO,EAAE,QAAQ,CAAA;KAAE,CAAC;uBAC3C,kBAAkB;mBAClB,YAAY;gBACZ,KAAK;YACL,GAAG;qBACH,GAAG;WACH,MAAM;;;YAKN,KAAK,MAAM,EAAE;uBACb,MAAM;UACN,OAAO,EAAE;;;YAKT,KAAK,MAAM,EAAE;UACb,KAAK,MAAM,EAAE;;iCAId,MAAa,iBAAU;mCAvEV,uBAAuB;0CAAvB,uBAAuB;wCAAvB,uBAAuB;kCAClB,cAAc;2BADnB,uBAAuB;gCAEpB,gBAAgB"}
@@ -0,0 +1,77 @@
1
+ /**
2
+ * @import {OrchestrationAccount,
3
+ * CosmosChainAddress,
4
+ * Denom,
5
+ * Bech32Address,} from '@agoric/orchestration';
6
+ * @import {IBCChannelID} from '@agoric/vats';
7
+ * @import {EVM_CHAINS} from './utils/gmp.js';
8
+ */
9
+
10
+ // NOTE: The following 3 types are also documented in README.md located at:
11
+ // @agoric/orchestration/docs/axelar-gmp/README.md
12
+ // - GMPMessageType
13
+ // - AxelarFeeObject
14
+ // - AxelarGmpOutgoingMemo
15
+ // If you change any of these, you must also update the README to keep it in sync.
16
+
17
+ export const AxelarGMPMessageType = /** @type {const} */ ({
18
+ ContractCall: 1,
19
+ ContractCallWithToken: 2,
20
+ TokenTransfer: 3,
21
+ });
22
+ harden(AxelarGMPMessageType);
23
+
24
+ /**
25
+ * @typedef {(typeof AxelarGMPMessageType)[keyof typeof AxelarGMPMessageType]} GMPMessageType
26
+ */
27
+
28
+ /**
29
+ * @typedef {object} AxelarGmpIncomingMemo
30
+ * @property {string} source_chain
31
+ * @property {string} source_address
32
+ * @property {string} payload
33
+ * @property {GMPMessageType} type
34
+ */
35
+
36
+ /**
37
+ * @typedef {object} AxelarFeeObject
38
+ * @property {string} amount
39
+ * @property {Bech32Address} recipient
40
+ */
41
+
42
+ /**
43
+ * @typedef {object} AxelarGmpOutgoingMemo
44
+ * @property {string} destination_chain
45
+ * @property {string} destination_address
46
+ * @property {number[] | null} payload
47
+ * @property {GMPMessageType} type
48
+ * @property {AxelarFeeObject} [fee]
49
+ */
50
+
51
+ /**
52
+ * @typedef {object} EvmTapState
53
+ * @property {OrchestrationAccount<{ chainId: 'agoric' }>} localAccount
54
+ * @property {CosmosChainAddress} localChainAddress
55
+ * @property {IBCChannelID} sourceChannel
56
+ * @property {Denom} localDenom
57
+ * @property {any} assets
58
+ * @property {any} remoteChainInfo
59
+ * @property {bigint} nonce
60
+ */
61
+
62
+ /**
63
+ * @typedef {object} ContractCall
64
+ * @property {`0x${string}`} target
65
+ * @property {string} functionSignature
66
+ * @property {unknown[]} args
67
+ */
68
+
69
+ /**
70
+ * @typedef {object} AbiEncodedContractCall
71
+ * @property {`0x${string}`} target
72
+ * @property {`0x${string}`} data
73
+ */
74
+
75
+ /**
76
+ * @typedef {keyof typeof EVM_CHAINS} SupportedEVMChains
77
+ */
@@ -0,0 +1,65 @@
1
+ declare namespace _default {
2
+ namespace ethereum {
3
+ let namespace: "eip155";
4
+ let reference: "1";
5
+ let cctpDestinationDomain: 0;
6
+ }
7
+ namespace avalanche {
8
+ let namespace_1: "eip155";
9
+ export { namespace_1 as namespace };
10
+ let reference_1: "43114";
11
+ export { reference_1 as reference };
12
+ let cctpDestinationDomain_1: 1;
13
+ export { cctpDestinationDomain_1 as cctpDestinationDomain };
14
+ }
15
+ namespace optimism {
16
+ let namespace_2: "eip155";
17
+ export { namespace_2 as namespace };
18
+ let reference_2: "10";
19
+ export { reference_2 as reference };
20
+ let cctpDestinationDomain_2: 2;
21
+ export { cctpDestinationDomain_2 as cctpDestinationDomain };
22
+ }
23
+ namespace arbitrum {
24
+ let namespace_3: "eip155";
25
+ export { namespace_3 as namespace };
26
+ let reference_3: "42161";
27
+ export { reference_3 as reference };
28
+ let cctpDestinationDomain_3: 3;
29
+ export { cctpDestinationDomain_3 as cctpDestinationDomain };
30
+ }
31
+ namespace noble {
32
+ let namespace_4: "cosmos";
33
+ export { namespace_4 as namespace };
34
+ let reference_4: "noble-1";
35
+ export { reference_4 as reference };
36
+ let cctpDestinationDomain_4: 4;
37
+ export { cctpDestinationDomain_4 as cctpDestinationDomain };
38
+ }
39
+ namespace solana {
40
+ let namespace_5: "solana";
41
+ export { namespace_5 as namespace };
42
+ let reference_5: "5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp";
43
+ export { reference_5 as reference };
44
+ let cctpDestinationDomain_5: 5;
45
+ export { cctpDestinationDomain_5 as cctpDestinationDomain };
46
+ }
47
+ namespace base {
48
+ let namespace_6: "eip155";
49
+ export { namespace_6 as namespace };
50
+ let reference_6: "8453";
51
+ export { reference_6 as reference };
52
+ let cctpDestinationDomain_6: 6;
53
+ export { cctpDestinationDomain_6 as cctpDestinationDomain };
54
+ }
55
+ namespace polygon {
56
+ let namespace_7: "eip155";
57
+ export { namespace_7 as namespace };
58
+ let reference_7: "137";
59
+ export { reference_7 as reference };
60
+ let cctpDestinationDomain_7: 7;
61
+ export { cctpDestinationDomain_7 as cctpDestinationDomain };
62
+ }
63
+ }
64
+ export default _default;
65
+ //# sourceMappingURL=cctp-chain-info.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cctp-chain-info.d.ts","sourceRoot":"","sources":["cctp-chain-info.js"],"names":[],"mappings":""}
@@ -0,0 +1,52 @@
1
+ /**
2
+ * sourced from https://developers.circle.com/stablecoins/supported-domains and
3
+ * https://chainlist.org/ on 19 March 2025
4
+ *
5
+ * @satisfies {Record<string, import('./orchestration-api').BaseChainInfo>}
6
+ */
7
+ export default /** @type {const} } */ ({
8
+ ethereum: {
9
+ namespace: 'eip155',
10
+ reference: '1',
11
+ cctpDestinationDomain: 0,
12
+ },
13
+ // Avalanche C-Chain
14
+ avalanche: {
15
+ namespace: 'eip155',
16
+ reference: '43114',
17
+ cctpDestinationDomain: 1,
18
+ },
19
+ // OP Mainnet
20
+ optimism: {
21
+ namespace: 'eip155',
22
+ reference: '10',
23
+ cctpDestinationDomain: 2,
24
+ },
25
+ // Arbitrum One
26
+ arbitrum: {
27
+ namespace: 'eip155',
28
+ reference: '42161',
29
+ cctpDestinationDomain: 3,
30
+ },
31
+ noble: {
32
+ namespace: 'cosmos',
33
+ reference: 'noble-1',
34
+ cctpDestinationDomain: 4,
35
+ },
36
+ solana: {
37
+ namespace: 'solana',
38
+ reference: '5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp',
39
+ cctpDestinationDomain: 5,
40
+ },
41
+ base: {
42
+ namespace: 'eip155',
43
+ reference: '8453',
44
+ cctpDestinationDomain: 6,
45
+ },
46
+ // Polygon PoS
47
+ polygon: {
48
+ namespace: 'eip155',
49
+ reference: '137',
50
+ cctpDestinationDomain: 7,
51
+ },
52
+ });
@@ -1,17 +1,12 @@
1
- export function withChainCapabilities(chainInfo: Record<string, CosmosChainInfo>, opts?: {
2
- PfmEnabled: Record<string, boolean>;
3
- IcqEnabled: Record<string, boolean>;
4
- IcaEnabled: Record<string, boolean>;
5
- }): Record<string, {
1
+ export function withChainCapabilities<T extends Record<string, CosmosChainInfo>>(chainInfo: T, { PfmEnabled: pfmOpts, IcqEnabled: icqOpts, IcaEnabled: icaOpts, }?: {
2
+ PfmEnabled?: Record<string, boolean>;
3
+ IcqEnabled?: Record<string, boolean>;
4
+ IcaEnabled?: Record<string, boolean>;
5
+ }): { [K in keyof T]: T[K] & {
6
6
  pfmEnabled: boolean;
7
7
  icqEnabled: boolean;
8
8
  icaEnabled: boolean;
9
- bech32Prefix?: string;
10
- chainId: string;
11
- connections?: Record<string, import("@agoric/orchestration").IBCConnectionInfo>;
12
- stakingTokens?: Readonly<Array<{
13
- denom: string;
14
- }>>;
15
- }>;
9
+ cctpDestinationDomain?: number;
10
+ }; };
16
11
  import type { CosmosChainInfo } from '@agoric/orchestration';
17
12
  //# sourceMappingURL=chain-capabilities.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"chain-capabilities.d.ts","sourceRoot":"","sources":["chain-capabilities.js"],"names":[],"mappings":"AAmEO,iDAPI,MAAM,CAAC,MAAM,EAAE,eAAe,CAAC,SAC/B;IACN,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACpC,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACpC,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACrC;;;;;;;;;;GAgBH;qCAzE+C,uBAAuB"}
1
+ {"version":3,"file":"chain-capabilities.d.ts","sourceRoot":"","sources":["chain-capabilities.js"],"names":[],"mappings":"AAsFO,sCAhBwC,CAAC,SAAlC,MAAM,CAAC,MAAM,EAAE,eAAe,CAAE,aACnC,CAAC,uEACD;IACN,UAAU,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACrC,UAAU,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACrC,UAAU,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACtC,GACS,GACP,CAAC,IAAI,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG;IACrB,UAAU,EAAE,OAAO,CAAC;IACpB,UAAU,EAAE,OAAO,CAAC;IACpB,UAAU,EAAE,OAAO,CAAC;IACpB,qBAAqB,CAAC,EAAE,MAAM,CAAC;CAChC,GACF,CAsBA;qCAhG8B,uBAAuB"}
@@ -5,13 +5,16 @@
5
5
  */
6
6
 
7
7
  import { objectMap } from '@endo/patterns';
8
+ import cctpChainInfo from './cctp-chain-info.js';
8
9
 
9
- /** @import {CosmosChainInfo, KnownChains} from '@agoric/orchestration'; */
10
+ /**
11
+ * @import {CosmosChainInfo} from '@agoric/orchestration';
12
+ */
10
13
 
11
14
  /**
12
15
  * Chains with the async-icq (icq-1) module available.
13
16
  *
14
- * @satisfies {Partial<Record<keyof KnownChains, boolean>>}
17
+ * @satisfies {Record<string, boolean>}
15
18
  */
16
19
  const IcqEnabled = /** @type {const} */ ({
17
20
  omniflixhub: true,
@@ -22,7 +25,7 @@ harden(IcqEnabled);
22
25
  /**
23
26
  * Chains with the packet-forward-middleware module available.
24
27
  *
25
- * @satisfies {Partial<Record<keyof KnownChains, boolean>>}
28
+ * @satisfies {Record<string, boolean>}
26
29
  */
27
30
  const PfmEnabled = /** @type {const} */ ({
28
31
  agoric: true,
@@ -40,8 +43,12 @@ const PfmEnabled = /** @type {const} */ ({
40
43
  });
41
44
  harden(PfmEnabled);
42
45
 
46
+ /**
47
+ * Chains with the interchain-accounts (ICS-27) module enabled as a host.
48
+ *
49
+ * @satisfies {Record<string, boolean>}
50
+ */
43
51
  const IcaEnabled = /** @type {const} */ ({
44
- agoric: true,
45
52
  celestia: true,
46
53
  cosmoshub: true,
47
54
  dydx: true,
@@ -58,25 +65,43 @@ const IcaEnabled = /** @type {const} */ ({
58
65
  harden(IcaEnabled);
59
66
 
60
67
  /**
61
- * @param {Record<string, CosmosChainInfo>} chainInfo
68
+ * Adds chain capabilities to cosmos chains that are not currently indexed in
69
+ * `@cosmos/chain-registry` but are necessary for `@agoric/orchestration`.
70
+ *
71
+ * @template {Record<string, CosmosChainInfo>} T
72
+ * @param {T} chainInfo
62
73
  * @param {{
63
- * PfmEnabled: Record<string, boolean>;
64
- * IcqEnabled: Record<string, boolean>;
65
- * IcaEnabled: Record<string, boolean>;
74
+ * PfmEnabled?: Record<string, boolean>;
75
+ * IcqEnabled?: Record<string, boolean>;
76
+ * IcaEnabled?: Record<string, boolean>;
66
77
  * }} [opts]
78
+ * @returns {{
79
+ * [K in keyof T]: T[K] & {
80
+ * pfmEnabled: boolean;
81
+ * icqEnabled: boolean;
82
+ * icaEnabled: boolean;
83
+ * cctpDestinationDomain?: number;
84
+ * };
85
+ * }}
67
86
  */
68
87
  export const withChainCapabilities = (
69
88
  chainInfo,
70
- opts = {
71
- PfmEnabled,
72
- IcqEnabled,
73
- IcaEnabled,
74
- },
75
- ) => {
76
- return objectMap(chainInfo, (info, name) => ({
77
- ...info,
78
- pfmEnabled: !!opts.PfmEnabled[name],
79
- icqEnabled: !!opts.IcqEnabled[name],
80
- icaEnabled: !!opts.IcqEnabled[name],
81
- }));
82
- };
89
+ {
90
+ PfmEnabled: pfmOpts = PfmEnabled,
91
+ IcqEnabled: icqOpts = IcqEnabled,
92
+ IcaEnabled: icaOpts = IcaEnabled,
93
+ } = {},
94
+ ) =>
95
+ objectMap(chainInfo, (info, name) => {
96
+ const chainName = /** @type {string} */ (name);
97
+ const cctpDestinationDomain =
98
+ cctpChainInfo?.[chainName]?.cctpDestinationDomain;
99
+
100
+ return {
101
+ ...info,
102
+ pfmEnabled: !!pfmOpts[chainName],
103
+ icqEnabled: !!icqOpts[chainName],
104
+ icaEnabled: !!icaOpts[chainName],
105
+ ...(cctpDestinationDomain && { cctpDestinationDomain }),
106
+ };
107
+ });