@wormhole-foundation/sdk-base 0.1.0-beta.3

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.
@@ -0,0 +1,8 @@
1
+ import { finalityThreshold } from "../src/constants/finality";
2
+
3
+ describe("Finality tests", function () {
4
+ const mainnetFinality = finalityThreshold("Mainnet", "Ethereum");
5
+ it("should correctly access values", function () {
6
+ expect(mainnetFinality).toEqual(64);
7
+ });
8
+ });
@@ -0,0 +1,173 @@
1
+ import { describe, expect, it } from "@jest/globals";
2
+
3
+ import { Layout, addFixedValues } from "@wormhole-foundation/sdk-base";
4
+
5
+ const testLayout = [
6
+ { name: "fixedDirectPrimitive", binary: "uint", size: 1, custom: 3 },
7
+ {
8
+ name: "fixedDirectCustom",
9
+ binary: "uint",
10
+ size: 1,
11
+ custom: { to: 42, from: 1 },
12
+ },
13
+ { name: "dynamicDirectPrimitive", binary: "uint", size: 1 },
14
+ {
15
+ name: "dynamicDirectCustom",
16
+ binary: "uint",
17
+ size: 1,
18
+ custom: { to: (val: number) => val + 1, from: (val: number) => val - 1 },
19
+ },
20
+ {
21
+ name: "someDynamicObject",
22
+ binary: "object",
23
+ layout: [
24
+ { name: "someDynamicBytes", binary: "bytes", size: 4 },
25
+ { name: "someDynamicLengthBytes", binary: "bytes", lengthSize: 4 },
26
+ ],
27
+ },
28
+ {
29
+ name: "objectWithOnlyFixed",
30
+ binary: "object",
31
+ layout: [
32
+ {
33
+ name: "someFixedObjectUint",
34
+ binary: "uint",
35
+ size: 1,
36
+ custom: { to: 13, from: 1 },
37
+ },
38
+ ],
39
+ },
40
+ {
41
+ name: "objectWithSomeFixed",
42
+ binary: "object",
43
+ layout: [
44
+ {
45
+ name: "someFixedBytes",
46
+ binary: "bytes",
47
+ custom: { to: new Uint8Array(4), from: new Uint8Array(4) },
48
+ },
49
+ {
50
+ name: "someFixedUint",
51
+ binary: "uint",
52
+ size: 1,
53
+ custom: { to: 33, from: 1 },
54
+ },
55
+ { name: "someDynamicUint", binary: "uint", size: 1 },
56
+ ],
57
+ },
58
+ {
59
+ name: "arrayWithOnlyFixed",
60
+ binary: "array",
61
+ lengthSize: 1,
62
+ layout: [
63
+ { name: "someFixedArrayUint", binary: "uint", size: 1, custom: 12 },
64
+ ],
65
+ },
66
+ {
67
+ name: "arrayWithSomeFixed",
68
+ binary: "array",
69
+ lengthSize: 1,
70
+ layout: [
71
+ { name: "someDynamicUint", binary: "uint", size: 1 },
72
+ { name: "someFixedUint", binary: "uint", size: 1, custom: 25 },
73
+ {
74
+ name: "someFixedBytes",
75
+ binary: "bytes",
76
+ custom: { to: new Uint8Array(4), from: new Uint8Array(4) },
77
+ },
78
+ ],
79
+ },
80
+ {
81
+ name: "arrayWithOnlyDynamic",
82
+ binary: "array",
83
+ lengthSize: 1,
84
+ layout: [{ name: "someDynamicArrayUint", binary: "uint", size: 1 }],
85
+ },
86
+ ] as const satisfies Layout;
87
+
88
+ describe("Layout tests", function () {
89
+ it("should correctly add fixed values", function () {
90
+ const dynamicValues = {
91
+ dynamicDirectPrimitive: 2,
92
+ dynamicDirectCustom: 4,
93
+ someDynamicObject: {
94
+ someDynamicBytes: new Uint8Array(4),
95
+ someDynamicLengthBytes: new Uint8Array(5),
96
+ },
97
+ objectWithSomeFixed: { someDynamicUint: 8 },
98
+ arrayWithSomeFixed: [{ someDynamicUint: 10 }, { someDynamicUint: 11 }],
99
+ arrayWithOnlyDynamic: [
100
+ { someDynamicArrayUint: 14 },
101
+ { someDynamicArrayUint: 16 },
102
+ ],
103
+ };
104
+
105
+ const complete = addFixedValues(testLayout, dynamicValues);
106
+ expect(complete).toEqual({
107
+ fixedDirectPrimitive: 3,
108
+ fixedDirectCustom: 42,
109
+ dynamicDirectPrimitive: 2,
110
+ dynamicDirectCustom: 4,
111
+ someDynamicObject: {
112
+ someDynamicBytes: new Uint8Array(4),
113
+ someDynamicLengthBytes: new Uint8Array(5),
114
+ },
115
+ objectWithOnlyFixed: { someFixedObjectUint: 13 },
116
+ objectWithSomeFixed: {
117
+ someDynamicUint: 8,
118
+ someFixedBytes: new Uint8Array(4),
119
+ someFixedUint: 33,
120
+ },
121
+ arrayWithOnlyFixed: [],
122
+ arrayWithSomeFixed: [
123
+ {
124
+ someDynamicUint: 10,
125
+ someFixedUint: 25,
126
+ someFixedBytes: new Uint8Array(4),
127
+ },
128
+ {
129
+ someDynamicUint: 11,
130
+ someFixedUint: 25,
131
+ someFixedBytes: new Uint8Array(4),
132
+ },
133
+ ],
134
+ arrayWithOnlyDynamic: [
135
+ { someDynamicArrayUint: 14 },
136
+ { someDynamicArrayUint: 16 },
137
+ ],
138
+ });
139
+ });
140
+ });
141
+
142
+ // type FixedItems = FixedItemsOfLayout<typeof testLayout>;
143
+ // type DynamicItems = DynamicItemsOfLayout<typeof testLayout>;
144
+
145
+ // const testFunc = <L extends Layout>(layout: L, fixedVals: LayoutToType<FixedItemsOfLayout<L>>) => {
146
+ // return Object.keys(fixedVals).reduce((acc, key) => acc + key, "");
147
+ // }
148
+
149
+ // const test = testFunc(
150
+ // testLayout, {
151
+ // "fixedDirectPrimitive": 3,
152
+ // "fixedDirectCustom": 42,
153
+ // "objectWithOnlyFixed": { "someFixedObjectUint": 13 },
154
+ // "objectWithSomeFixed": {
155
+ // "someFixedBytes": new Uint8Array(4),
156
+ // "someFixedUint": 33,
157
+ // },
158
+ // "arrayWithOnlyFixed": [
159
+ // { "someFixedArrayUint": 12 },
160
+ // { "someFixedArrayUint": 12 },
161
+ // ],
162
+ // "arrayWithSomeFixed": [
163
+ // {
164
+ // "someFixedUint": 25,
165
+ // "someFixedBytes": new Uint8Array(4),
166
+ // },
167
+ // {
168
+ // "someFixedUint": 25,
169
+ // "someFixedBytes": new Uint8Array(4),
170
+ // },
171
+ // ]
172
+ // }
173
+ // );
package/package.json ADDED
@@ -0,0 +1,15 @@
1
+ {
2
+ "name": "@wormhole-foundation/sdk-base",
3
+ "version": "0.1.0-beta.3",
4
+ "main": "./dist/cjs/index.js",
5
+ "module": "./dist/esm/index.js",
6
+ "types":"./dist/esm/index.d.ts",
7
+ "scripts": {
8
+ "test": "jest --config ../../jest.config.ts __tests__/*.ts",
9
+ "build:cjs":"tsc -p ./tsconfig.cjs.json",
10
+ "build:esm":"tsc -p ./tsconfig.esm.json",
11
+ "build":"npm run build:cjs && npm run build:esm",
12
+ "rebuild":"npm run clean && npm run build:cjs && npm run build:esm",
13
+ "clean": "rm -rf ./dist && rm -f ./*.tsbuildinfo"
14
+ }
15
+ }
@@ -0,0 +1,104 @@
1
+ import { zip } from "../utils/array";
2
+ import { constMap } from "../utils/mapping";
3
+
4
+ //Typescript being the absolute mess that it is has no way to turn the keys of an object that is
5
+ // declared `as const` into an `as const` array (see:
6
+ // https://github.com/microsoft/TypeScript/issues/31652), however the other way around works fine,
7
+ // hence we're defining the mapping via its entry representation and deriving it from taht
8
+ const chainsAndChainIdEntries = [
9
+ //Unlike the old sdk, we are not including an "Unset" chain with chainId 0 here because:
10
+ // * no other types would be associated with it (such as contracts or a platform)
11
+ // * avoids awkward "chain but not 'Unset'" checks
12
+ // * "off" is not a TV channel either
13
+ //Instead we'll use `null` for chain and 0 as the chainId where appropriate (e.g. governance VAAs)
14
+ ["Solana", 1],
15
+ ["Ethereum", 2],
16
+ ["Terra", 3],
17
+ ["Bsc", 4],
18
+ ["Polygon", 5],
19
+ ["Avalanche", 6],
20
+ ["Oasis", 7],
21
+ ["Algorand", 8],
22
+ ["Aurora", 9],
23
+ ["Fantom", 10],
24
+ ["Karura", 11],
25
+ ["Acala", 12],
26
+ ["Klaytn", 13],
27
+ ["Celo", 14],
28
+ ["Near", 15],
29
+ ["Moonbeam", 16],
30
+ ["Neon", 17],
31
+ ["Terra2", 18],
32
+ ["Injective", 19],
33
+ ["Osmosis", 20],
34
+ ["Sui", 21],
35
+ ["Aptos", 22],
36
+ ["Arbitrum", 23],
37
+ ["Optimism", 24],
38
+ ["Gnosis", 25],
39
+ ["Pythnet", 26],
40
+ ["Xpla", 28],
41
+ ["Btc", 29],
42
+ ["Base", 30],
43
+ ["Sei", 32],
44
+ ["Wormchain", 3104],
45
+ // holy cow, how ugly of a hack is that?! - a chainId that's exclusive to a testnet!
46
+ ["Sepolia", 10002],
47
+ ] as const;
48
+
49
+ export const [chains, chainIds] = zip(chainsAndChainIdEntries);
50
+ export type ChainName = (typeof chains)[number];
51
+ export type ChainId = (typeof chainIds)[number];
52
+ export type Chain = ChainName | ChainId;
53
+
54
+ export const chainToChainId = constMap(chainsAndChainIdEntries);
55
+ export const chainIdToChain = constMap(chainsAndChainIdEntries, [1, 0]);
56
+
57
+ export const isChain = (chain: string): chain is ChainName =>
58
+ chainToChainId.has(chain);
59
+ export const isChainId = (chainId: number): chainId is ChainId =>
60
+ chainIdToChain.has(chainId);
61
+
62
+ export function assertChainId(chainId: number): asserts chainId is ChainId {
63
+ if (!isChainId(chainId)) throw Error(`Unknown Wormhole chain id: ${chainId}`);
64
+ }
65
+
66
+ export function assertChain(chain: string): asserts chain is ChainName {
67
+ if (!isChain(chain)) throw Error(`Unknown Wormhole chain: ${chain}`);
68
+ }
69
+
70
+ //safe assertion that allows chaining
71
+ export const asChainId = (chainId: number): ChainId => {
72
+ assertChainId(chainId);
73
+ return chainId;
74
+ };
75
+
76
+ export const toChainId = (chain: number | string | Chain): ChainId => {
77
+ switch (typeof chain) {
78
+ case "string":
79
+ if (isChain(chain)) return chainToChainId(chain);
80
+ break;
81
+ case "number":
82
+ if (isChainId(chain)) return chain;
83
+ break;
84
+ }
85
+ throw Error(`Cannot convert to ChainId: ${chain}`);
86
+ };
87
+
88
+ export const toChainName = (
89
+ chain: number | string | Chain | bigint
90
+ ): ChainName => {
91
+ switch (typeof chain) {
92
+ case "string":
93
+ if (isChain(chain)) return chain;
94
+ break;
95
+ case "number":
96
+ if (isChainId(chain)) return chainIdToChain(chain);
97
+ break;
98
+ case "bigint":
99
+ if (isChainId(Number(chain)))
100
+ return chainIdToChain(Number(chain) as ChainId);
101
+ break;
102
+ }
103
+ throw Error(`Cannot convert to ChainName: ${chain}`);
104
+ };
@@ -0,0 +1,119 @@
1
+ import { Network } from "./networks";
2
+ import { Chain, ChainName } from "./chains";
3
+ import { zip, constMap, RoArray } from "../utils";
4
+
5
+ const circleAPIs = [
6
+ ["Mainnet", "https://iris-api.circle.com/v1/attestations"],
7
+ ["Testnet", "https://iris-api-sandbox.circle.com/v1/attestations"],
8
+ ] as const satisfies RoArray<readonly [Network, string]>;
9
+
10
+ // https://developers.circle.com/stablecoin/docs/cctp-technical-reference#domain-list
11
+ const circleDomains = [
12
+ ["Ethereum", 0],
13
+ ["Avalanche", 1],
14
+ ["Optimism", 2],
15
+ ["Arbitrum", 3],
16
+ ] as const satisfies RoArray<readonly [ChainName, number]>;
17
+
18
+ const usdcContracts = [
19
+ [
20
+ "Mainnet",
21
+ [
22
+ ["Ethereum", "0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48"],
23
+ ["Avalanche", "0xb97ef9ef8734c71904d8002f8b6bc66dd9c48a6e"],
24
+ ["Arbitrum", "0xaf88d065e77c8cC2239327C5EDb3A432268e5831"],
25
+ ["Optimism", "0x179522635726710dd7d2035a81d856de4aa7836c"],
26
+ ],
27
+ ],
28
+ [
29
+ "Testnet",
30
+ [
31
+ ["Avalanche", "0x5425890298aed601595a70AB815c96711a31Bc65"],
32
+ ["Arbitrum", "0xfd064A18f3BF249cf1f87FC203E90D8f650f2d63"],
33
+ ["Ethereum", "0x07865c6e87b9f70255377e024ace6630c1eaa37f"],
34
+ ["Optimism", "0xe05606174bac4A6364B31bd0eCA4bf4dD368f8C6"],
35
+ ],
36
+ ],
37
+ ] as const satisfies RoArray<
38
+ readonly [Network, RoArray<readonly [ChainName, string]>]
39
+ >;
40
+
41
+ export const [circleChains, circleChainIds] = zip(circleDomains);
42
+ export type CircleChainName = (typeof circleChains)[number];
43
+ export type CircleChainId = (typeof circleChainIds)[number];
44
+
45
+ export const [circleNetworks, _] = zip(usdcContracts);
46
+ export type CircleNetwork = (typeof circleNetworks)[number];
47
+
48
+ export const circleChainId = constMap(circleDomains);
49
+ export const circleChainIdToChainName = constMap(circleDomains, [1, 0]);
50
+ export const circleAPI = constMap(circleAPIs);
51
+
52
+ export const usdcContract = constMap(usdcContracts);
53
+
54
+ export const isCircleChain = (
55
+ chain: string | ChainName | CircleChainName
56
+ ): chain is CircleChainName => circleChainId.has(chain);
57
+
58
+ export const isCircleChainId = (chainId: number): chainId is CircleChainId =>
59
+ circleChainIdToChainName.has(chainId);
60
+
61
+ export const isCircleSupported = (
62
+ network: Network,
63
+ chain: string | ChainName | CircleChainName
64
+ ): network is CircleNetwork => usdcContract.has(network, chain);
65
+
66
+ export function assertCircleChainId(
67
+ chainId: number
68
+ ): asserts chainId is CircleChainId {
69
+ if (!isCircleChainId(chainId))
70
+ throw Error(`Unknown Circle chain id: ${chainId}`);
71
+ }
72
+
73
+ export function assertCircleChain(
74
+ chain: string
75
+ ): asserts chain is CircleChainName {
76
+ if (!isCircleChain(chain)) throw Error(`Unknown Circle chain: ${chain}`);
77
+ }
78
+
79
+ //safe assertion that allows chaining
80
+ export const asCircleChainId = (chainId: number): CircleChainId => {
81
+ assertCircleChainId(chainId);
82
+ return chainId;
83
+ };
84
+
85
+ export const toCircleChainId = (
86
+ chain: number | bigint | string | Chain
87
+ ): CircleChainId => {
88
+ switch (typeof chain) {
89
+ case "string":
90
+ if (isCircleChain(chain)) return circleChainId(chain);
91
+ break;
92
+ case "number":
93
+ if (isCircleChainId(chain)) return chain;
94
+ break;
95
+ case "bigint":
96
+ const ci = Number(chain);
97
+ if (isCircleChainId(ci)) return ci;
98
+ break;
99
+ }
100
+ throw Error(`Cannot convert to ChainId: ${chain}`);
101
+ };
102
+
103
+ export const toCircleChainName = (
104
+ chain: number | string | Chain | bigint
105
+ ): ChainName => {
106
+ switch (typeof chain) {
107
+ case "string":
108
+ if (isCircleChain(chain)) return chain;
109
+ break;
110
+ case "number":
111
+ if (isCircleChainId(chain)) return circleChainIdToChainName(chain);
112
+ break;
113
+ case "bigint":
114
+ const cid = Number(chain);
115
+ if (isCircleChainId(cid)) return circleChainIdToChainName(cid);
116
+ break;
117
+ }
118
+ throw Error(`Cannot convert to ChainName: ${chain}`);
119
+ };
@@ -0,0 +1,99 @@
1
+ import { RoArray } from "../../utils";
2
+ import { ChainName } from "../chains";
3
+ import { Network } from "../networks";
4
+
5
+ export type CircleContracts = {
6
+ tokenMessenger: string;
7
+ messageTransmitter: string;
8
+ wormholeRelayer: string;
9
+ wormhole: string;
10
+ };
11
+
12
+ export const circleContracts = [
13
+ [
14
+ "Mainnet",
15
+ [
16
+ [
17
+ "Arbitrum",
18
+ {
19
+ tokenMessenger: "0x19330d10D9Cc8751218eaf51E8885D058642E08A",
20
+ messageTransmitter: "0xC30362313FBBA5cf9163F0bb16a0e01f01A896ca",
21
+ wormholeRelayer: "0x4cb69FaE7e7Af841e44E1A1c30Af640739378bb2",
22
+ wormhole: "0x2703483b1a5a7c577e8680de9df8be03c6f30e3c",
23
+ },
24
+ ],
25
+
26
+ [
27
+ "Avalanche",
28
+ {
29
+ tokenMessenger: "0x6b25532e1060ce10cc3b0a99e5683b91bfde6982",
30
+ messageTransmitter: "0x8186359af5f57fbb40c6b14a588d2a59c0c29880",
31
+ wormholeRelayer: "0x4cb69FaE7e7Af841e44E1A1c30Af640739378bb2",
32
+ wormhole: "0x09Fb06A271faFf70A651047395AaEb6265265F13",
33
+ },
34
+ ],
35
+ [
36
+ "Ethereum",
37
+ {
38
+ tokenMessenger: "0xbd3fa81b58ba92a82136038b25adec7066af3155",
39
+ messageTransmitter: "0x0a992d191deec32afe36203ad87d7d289a738f81",
40
+ wormholeRelayer: "0x4cb69FaE7e7Af841e44E1A1c30Af640739378bb2",
41
+ wormhole: "0x09Fb06A271faFf70A651047395AaEb6265265F13",
42
+ },
43
+ ],
44
+ [
45
+ "Optimism",
46
+ {
47
+ tokenMessenger: "0x2B4069517957735bE00ceE0fadAE88a26365528f",
48
+ messageTransmitter: "0x09Fb06A271faFf70A651047395AaEb6265265F13",
49
+ wormholeRelayer: "0x4cb69FaE7e7Af841e44E1A1c30Af640739378bb2",
50
+ wormhole: "0x2703483b1a5a7c577e8680de9df8be03c6f30e3c",
51
+ },
52
+ ],
53
+ ],
54
+ ],
55
+
56
+ [
57
+ "Testnet",
58
+ [
59
+ [
60
+ "Arbitrum",
61
+ {
62
+ tokenMessenger: "0x12dcfd3fe2e9eac2859fd1ed86d2ab8c5a2f9352",
63
+ messageTransmitter: "0x109bc137cb64eab7c0b1dddd1edf341467dc2d35",
64
+ wormholeRelayer: "0xbf683d541e11320418ca78ec13309938e6c5922f",
65
+ wormhole: "0x2e8f5e00a9c5d450a72700546b89e2b70dfb00f2",
66
+ },
67
+ ],
68
+ [
69
+ "Avalanche",
70
+ {
71
+ tokenMessenger: "0xeb08f243e5d3fcff26a9e38ae5520a669f4019d0",
72
+ messageTransmitter: "0xa9fb1b3009dcb79e2fe346c16a604b8fa8ae0a79",
73
+ wormholeRelayer: "0x774a70bbd03327c21460b60f25b677d9e46ab458",
74
+ wormhole: "0x58f4c17449c90665891c42e14d34aae7a26a472e",
75
+ },
76
+ ],
77
+ [
78
+ "Ethereum",
79
+ {
80
+ tokenMessenger: "0xd0c3da58f55358142b8d3e06c1c30c5c6114efe8",
81
+ messageTransmitter: "0x26413e8157cd32011e726065a5462e97dd4d03d9",
82
+ wormholeRelayer: "0x17da1ff5386d044c63f00747b5b8ad1e3806448d",
83
+ wormhole: "0x0a69146716b3a21622287efa1607424c663069a4",
84
+ },
85
+ ],
86
+ [
87
+ "Optimism",
88
+ {
89
+ tokenMessenger: "0x23a04d5935ed8bc8e3eb78db3541f0abfb001c6e",
90
+ messageTransmitter: "0x9ff9a4da6f2157a9c82ce756f8fd7e0d75be8895",
91
+ wormholeRelayer: "0x4cb69FaE7e7Af841e44E1A1c30Af640739378bb2",
92
+ wormhole: "0x2703483b1a5a7c577e8680de9df8be03c6f30e3c",
93
+ },
94
+ ],
95
+ ],
96
+ ],
97
+ ] as const satisfies RoArray<
98
+ readonly [Network, RoArray<readonly [ChainName, CircleContracts]>]
99
+ >;
@@ -0,0 +1,125 @@
1
+ import { Network } from "../networks";
2
+ import { ChainName } from "../chains";
3
+ import { RoArray } from "../../utils";
4
+
5
+ export const coreBridgeContracts = [
6
+ [
7
+ "Mainnet",
8
+ [
9
+ ["Solana", "worm2ZoG2kUd4vFXhvjh93UUH596ayRfgQ2MgjNMTth"],
10
+ ["Ethereum", "0x98f3c9e6E3fAce36bAAd05FE09d375Ef1464288B"],
11
+ ["Terra", "terra1dq03ugtd40zu9hcgdzrsq6z2z4hwhc9tqk2uy5"],
12
+ ["Bsc", "0x98f3c9e6E3fAce36bAAd05FE09d375Ef1464288B"],
13
+ ["Polygon", "0x7A4B5a56256163F07b2C80A7cA55aBE66c4ec4d7"],
14
+ ["Avalanche", "0x54a8e5f9c4CbA08F9943965859F6c34eAF03E26c"],
15
+ ["Oasis", "0xfE8cD454b4A1CA468B57D79c0cc77Ef5B6f64585"],
16
+ ["Algorand", "842125965"],
17
+ ["Aurora", "0xa321448d90d4e5b0A732867c18eA198e75CAC48E"],
18
+ ["Fantom", "0x126783A6Cb203a3E35344528B26ca3a0489a1485"],
19
+ ["Karura", "0xa321448d90d4e5b0A732867c18eA198e75CAC48E"],
20
+ ["Acala", "0xa321448d90d4e5b0A732867c18eA198e75CAC48E"],
21
+ ["Klaytn", "0x0C21603c4f3a6387e241c0091A7EA39E43E90bb7"],
22
+ ["Celo", "0xa321448d90d4e5b0A732867c18eA198e75CAC48E"],
23
+ ["Near", "contract.wormhole_crypto.near"],
24
+ ["Injective", "inj17p9rzwnnfxcjp32un9ug7yhhzgtkhvl9l2q74d"],
25
+ [
26
+ "Aptos",
27
+ "0x5bc11445584a763c1fa7ed39081f1b920954da14e04b32440cba863d03e19625",
28
+ ],
29
+ [
30
+ "Sui",
31
+ "0xaeab97f96cf9877fee2883315d459552b2b921edc16d7ceac6eab944dd88919c",
32
+ ],
33
+ ["Moonbeam", "0xC8e2b0cD52Cf01b0Ce87d389Daa3d414d4cE29f3"],
34
+ [
35
+ "Terra2",
36
+ "terra12mrnzvhx3rpej6843uge2yyfppfyd3u9c3uq223q8sl48huz9juqffcnhp",
37
+ ],
38
+ ["Arbitrum", "0xa5f208e072434bC67592E4C49C1B991BA79BCA46"],
39
+ ["Optimism", "0xEe91C335eab126dF5fDB3797EA9d6aD93aeC9722"],
40
+ ["Gnosis", "0xa321448d90d4e5b0A732867c18eA198e75CAC48E"],
41
+ ["Pythnet", "H3fxXJ86ADW2PNuDDmZJg6mzTtPxkYCpNuQUTgmJ7AjU"],
42
+ [
43
+ "Xpla",
44
+ "xpla1jn8qmdda5m6f6fqu9qv46rt7ajhklg40ukpqchkejcvy8x7w26cqxamv3w",
45
+ ],
46
+ ["Sei", "sei1gjrrme22cyha4ht2xapn3f08zzw6z3d4uxx6fyy9zd5dyr3yxgzqqncdqn"],
47
+ ],
48
+ ],
49
+ [
50
+ "Testnet",
51
+ [
52
+ ["Solana", "3u8hJUVTA4jH1wYAyUur7FFZVQ8H635K3tSHHF4ssjQ5"],
53
+ ["Ethereum", "0x706abc4E45D419950511e474C7B9Ed348A4a716c"],
54
+ ["Terra", "terra1pd65m0q9tl3v8znnz5f5ltsfegyzah7g42cx5v"],
55
+ ["Bsc", "0x68605AD7b15c732a30b1BbC62BE8F2A509D74b4D"],
56
+ ["Polygon", "0x0CBE91CF822c73C2315FB05100C2F714765d5c20"],
57
+ ["Avalanche", "0x7bbcE28e64B3F8b84d876Ab298393c38ad7aac4C"],
58
+ ["Oasis", "0xc1C338397ffA53a2Eb12A7038b4eeb34791F8aCb"],
59
+ ["Algorand", "86525623"],
60
+ ["Aurora", "0xBd07292de7b505a4E803CEe286184f7Acf908F5e"],
61
+ ["Fantom", "0x1BB3B4119b7BA9dfad76B0545fb3F531383c3bB7"],
62
+ ["Karura", "0xE4eacc10990ba3308DdCC72d985f2a27D20c7d03"],
63
+ ["Acala", "0x4377B49d559c0a9466477195C6AdC3D433e265c0"],
64
+ ["Klaytn", "0x1830CC6eE66c84D2F177B94D544967c774E624cA"],
65
+ ["Celo", "0x88505117CA88e7dd2eC6EA1E13f0948db2D50D56"],
66
+ ["Near", "wormhole.wormhole.Testnet"],
67
+ ["Injective", "inj1xx3aupmgv3ce537c0yce8zzd3sz567syuyedpg"],
68
+ [
69
+ "Osmosis",
70
+ "osmo1hggkxr0hpw83f8vuft7ruvmmamsxmwk2hzz6nytdkzyup9krt0dq27sgyx",
71
+ ],
72
+ [
73
+ "Aptos",
74
+ "0x5bc11445584a763c1fa7ed39081f1b920954da14e04b32440cba863d03e19625",
75
+ ],
76
+ [
77
+ "Sui",
78
+ "0x31358d198147da50db32eda2562951d53973a0c0ad5ed738e9b17d88b213d790",
79
+ ],
80
+ ["Moonbeam", "0xa5B7D85a8f27dd7907dc8FdC21FA5657D5E2F901"],
81
+ ["Neon", "0x268557122Ffd64c85750d630b716471118F323c8"],
82
+ [
83
+ "Terra2",
84
+ "terra19nv3xr5lrmmr7egvrk2kqgw4kcn43xrtd5g0mpgwwvhetusk4k7s66jyv0",
85
+ ],
86
+ ["Arbitrum", "0xC7A204bDBFe983FCD8d8E61D02b475D4073fF97e"],
87
+ ["Optimism", "0x6b9C8671cdDC8dEab9c719bB87cBd3e782bA6a35"],
88
+ ["Gnosis", "0xE4eacc10990ba3308DdCC72d985f2a27D20c7d03"],
89
+ ["Pythnet", "EUrRARh92Cdc54xrDn6qzaqjA77NRrCcfbr8kPwoTL4z"],
90
+ [
91
+ "Xpla",
92
+ "xpla1upkjn4mthr0047kahvn0llqx4qpqfn75lnph4jpxfn8walmm8mqsanyy35",
93
+ ],
94
+ ["Base", "0x23908A62110e21C04F3A4e011d24F901F911744A"],
95
+ ["Sei", "sei1nna9mzp274djrgzhzkac2gvm3j27l402s4xzr08chq57pjsupqnqaj0d5s"],
96
+ ["Sepolia", "0x4a8bc80Ed5a4067f1CCf107057b8270E0cC11A78"],
97
+ ],
98
+ ],
99
+ [
100
+ "Devnet",
101
+ [
102
+ ["Solana", "Bridge1p5gheXUvJ6jGWGeCsgPKgnE3YgdGKRVCMY9o"],
103
+ ["Ethereum", "0xC89Ce4735882C9F0f0FE26686c53074E09B0D550"],
104
+ ["Terra", "terra18vd8fpwxzck93qlwghaj6arh4p7c5n896xzem5"],
105
+ ["Bsc", "0xC89Ce4735882C9F0f0FE26686c53074E09B0D550"],
106
+ ["Algorand", "4"],
107
+ ["Near", "wormhole.test.near"],
108
+ [
109
+ "Aptos",
110
+ "0xde0036a9600559e295d5f6802ef6f3f802f510366e0c23912b0655d972166017",
111
+ ],
112
+ [
113
+ "Sui",
114
+ "0x5a5160ca3c2037f4b4051344096ef7a48ebf4400b3f385e57ea90e1628a8bde0",
115
+ ],
116
+ [
117
+ "Terra2",
118
+ "terra14hj2tavq8fpesdwxxcu44rty3hh90vhujrvcmstl4zr3txmfvw9ssrc8au",
119
+ ],
120
+ ["Wormchain", "wormhole1ap5vgur5zlgys8whugfegnn43emka567dtq0jl"],
121
+ ],
122
+ ],
123
+ ] as const satisfies RoArray<
124
+ readonly [Network, RoArray<readonly [ChainName, string]>]
125
+ >;
@@ -0,0 +1,15 @@
1
+ import * as core from "./core";
2
+ import * as tb from "./tokenBridge";
3
+ import * as nb from "./nftBridge";
4
+ import * as r from "./relayer";
5
+ import * as circle from "./circle";
6
+
7
+ import { constMap } from "../../utils";
8
+
9
+ export const coreBridge = constMap(core.coreBridgeContracts);
10
+ export const tokenBridge = constMap(tb.tokenBridgeContracts);
11
+ export const nftBridge = constMap(nb.nftBridgeContracts);
12
+ export const relayer = constMap(r.relayerContracts);
13
+
14
+ export { CircleContracts } from "./circle";
15
+ export const circleContracts = constMap(circle.circleContracts);