@swapkit/types 0.2.2 → 0.3.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.
@@ -5,14 +5,15 @@ export declare enum Chain {
5
5
  Base = "BASE",
6
6
  Berachain = "BERA",
7
7
  BinanceSmartChain = "BSC",
8
- Cardano = "ADA",
8
+ Bitcoin = "BTC",
9
+ BitcoinCash = "BCH",
9
10
  Botanix = "BOTANIX",
11
+ Cardano = "ADA",
12
+ Chainflip = "FLIP",
10
13
  Core = "CORE",
11
14
  Corn = "CORN",
12
- Cronos = "CRO",
13
- Bitcoin = "BTC",
14
- BitcoinCash = "BCH",
15
15
  Cosmos = "GAIA",
16
+ Cronos = "CRO",
16
17
  Dash = "DASH",
17
18
  Dogecoin = "DOGE",
18
19
  Ethereum = "ETH",
@@ -20,24 +21,25 @@ export declare enum Chain {
20
21
  Harbor = "HARBOR",
21
22
  Hyperevm = "HYPEREVM",
22
23
  Kujira = "KUJI",
23
- Sonic = "SONIC",
24
- Unichain = "UNI",
25
- XLayer = "XLAYER",
26
24
  Litecoin = "LTC",
27
25
  Maya = "MAYA",
26
+ MegaETH = "MEGAETH",
27
+ Monad = "MONAD",
28
28
  Near = "NEAR",
29
29
  Noble = "NOBLE",
30
30
  Optimism = "OP",
31
31
  Polkadot = "DOT",
32
- Chainflip = "FLIP",
33
32
  Polygon = "POL",
34
33
  Radix = "XRD",
35
34
  Ripple = "XRP",
36
- THORChain = "THOR",
37
35
  Solana = "SOL",
36
+ Sonic = "SONIC",
38
37
  Sui = "SUI",
38
+ THORChain = "THOR",
39
39
  Ton = "TON",
40
40
  Tron = "TRON",
41
+ Unichain = "UNI",
42
+ XLayer = "XLAYER",
41
43
  Zcash = "ZEC"
42
44
  }
43
45
  export declare enum StagenetChain {
@@ -79,6 +81,8 @@ export declare enum ChainId {
79
81
  Litecoin = "litecoin",
80
82
  Maya = "mayachain-mainnet-v1",
81
83
  MayaStagenet = "mayachain-stagenet-v1",
84
+ MegaETH = "4326",
85
+ Monad = "143",
82
86
  Near = "near",
83
87
  Noble = "noble-1",
84
88
  Optimism = "10",
@@ -1 +1 @@
1
- {"version":3,"file":"_enums.d.ts","sourceRoot":"","sources":["../../../src/chains/_enums.ts"],"names":[],"mappings":"AAAA,oBAAY,KAAK;IACf,QAAQ,QAAQ;IAChB,MAAM,WAAW;IACjB,SAAS,SAAS;IAClB,IAAI,SAAS;IACb,SAAS,SAAS;IAClB,iBAAiB,QAAQ;IACzB,OAAO,QAAQ;IACf,OAAO,YAAY;IACnB,IAAI,SAAS;IACb,IAAI,SAAS;IACb,MAAM,QAAQ;IACd,OAAO,QAAQ;IACf,WAAW,QAAQ;IACnB,MAAM,SAAS;IACf,IAAI,SAAS;IACb,QAAQ,SAAS;IACjB,QAAQ,QAAQ;IAChB,MAAM,QAAQ;IACd,MAAM,WAAW;IACjB,QAAQ,aAAa;IACrB,MAAM,SAAS;IACf,KAAK,UAAU;IACf,QAAQ,QAAQ;IAChB,MAAM,WAAW;IACjB,QAAQ,QAAQ;IAChB,IAAI,SAAS;IACb,IAAI,SAAS;IACb,KAAK,UAAU;IACf,QAAQ,OAAO;IACf,QAAQ,QAAQ;IAChB,SAAS,SAAS;IAClB,OAAO,QAAQ;IACf,KAAK,QAAQ;IACb,MAAM,QAAQ;IACd,SAAS,SAAS;IAClB,MAAM,QAAQ;IACd,GAAG,QAAQ;IACX,GAAG,QAAQ;IACX,IAAI,SAAS;IACb,KAAK,QAAQ;CACd;AAED,oBAAY,aAAa;IACvB,MAAM,gBAAgB;IACtB,SAAS,kBAAkB;IAC3B,IAAI,kBAAkB;CACvB;AAED;;;;;;GAMG;AACH,oBAAY,OAAO;IACjB,QAAQ,UAAU;IAClB,MAAM,eAAe;IACrB,SAAS,UAAU;IACnB,IAAI,SAAS;IACb,SAAS,UAAU;IACnB,iBAAiB,OAAO;IACxB,OAAO,YAAY;IACnB,WAAW,gBAAgB;IAC3B,OAAO,SAAS;IAChB,OAAO,YAAY;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@ -169,7 +169,7 @@ export declare const EVMChainConfigs: readonly [{
169
169
  chainIdHex: "0x64";
170
170
  }, {
171
171
  readonly baseDecimal: 18;
172
- readonly blockTime: 2;
172
+ readonly blockTime: 1;
173
173
  readonly chain: Chain.Hyperevm;
174
174
  readonly chainId: ChainId.Hyperevm;
175
175
  readonly chainIdHex: "0x3e7";
@@ -181,6 +181,34 @@ export declare const EVMChainConfigs: readonly [{
181
181
  readonly type: "evm";
182
182
  } & {
183
183
  chainIdHex: "0x3e7";
184
+ }, {
185
+ readonly baseDecimal: 18;
186
+ readonly blockTime: 0.01;
187
+ readonly chain: Chain.MegaETH;
188
+ readonly chainId: ChainId.MegaETH;
189
+ readonly chainIdHex: "0x10e6";
190
+ readonly explorerUrl: "";
191
+ readonly name: "MegaETH";
192
+ readonly nativeCurrency: "ETH";
193
+ readonly networkDerivationPath: [number, number, number, number, number];
194
+ readonly rpcUrls: [];
195
+ readonly type: "evm";
196
+ } & {
197
+ chainIdHex: "0x10e6";
198
+ }, {
199
+ readonly baseDecimal: 18;
200
+ readonly blockTime: 0.4;
201
+ readonly chain: Chain.Monad;
202
+ readonly chainId: ChainId.Monad;
203
+ readonly chainIdHex: "0x8f";
204
+ readonly explorerUrl: "https://monvision.io";
205
+ readonly name: "Monad";
206
+ readonly nativeCurrency: "MON";
207
+ readonly networkDerivationPath: [number, number, number, number, number];
208
+ readonly rpcUrls: [];
209
+ readonly type: "evm";
210
+ } & {
211
+ chainIdHex: "0x8f";
184
212
  }, {
185
213
  readonly baseDecimal: 18;
186
214
  readonly blockTime: 2;
@@ -243,11 +271,11 @@ export declare const EVMChainConfigs: readonly [{
243
271
  readonly chain: Chain.XLayer;
244
272
  readonly chainId: ChainId.XLayer;
245
273
  readonly chainIdHex: "0xc4";
246
- readonly explorerUrl: "https://okbscan.com";
274
+ readonly explorerUrl: "https://www.oklink.com/x-layer";
247
275
  readonly name: "X Layer";
248
276
  readonly nativeCurrency: "OKB";
249
277
  readonly networkDerivationPath: [number, number, number, number, number];
250
- readonly rpcUrls: ["https://rpc.xlayer.tech"];
278
+ readonly rpcUrls: ["https://xlayerrpc.okx.com"];
251
279
  readonly type: "evm";
252
280
  } & {
253
281
  chainIdHex: "0xc4";
@@ -1 +1 @@
1
- {"version":3,"file":"evm.d.ts","sourceRoot":"","sources":["../../../src/chains/evm.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,MAAM,UAAU,CAAC;AA8Q1C,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAmBlB,CAAC;AACX,eAAO,MAAM,SAAS,ySAoBZ,CAAC;AACX,MAAM,MAAM,QAAQ,GAAG,CAAC,OAAO,SAAS,CAAC,CAAC,MAAM,CAAC,CAAC"}
1
+ {"version":3,"file":"evm.d.ts","sourceRoot":"","sources":["../../../src/chains/evm.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,MAAM,UAAU,CAAC;AA0S1C,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAqBlB,CAAC;AACX,eAAO,MAAM,SAAS,ySAuBZ,CAAC;AACX,MAAM,MAAM,QAAQ,GAAG,CAAC,OAAO,SAAS,CAAC,CAAC,MAAM,CAAC,CAAC"}
@@ -227,7 +227,7 @@ export declare const AllChainConfigs: (({
227
227
  chainIdHex: "0x138de";
228
228
  }) | ({
229
229
  readonly baseDecimal: 18;
230
- readonly blockTime: 2;
230
+ readonly blockTime: 1;
231
231
  readonly chain: Chain.Hyperevm;
232
232
  readonly chainId: ChainId.Hyperevm;
233
233
  readonly chainIdHex: "0x3e7";
@@ -315,11 +315,11 @@ export declare const AllChainConfigs: (({
315
315
  readonly chain: Chain.XLayer;
316
316
  readonly chainId: ChainId.XLayer;
317
317
  readonly chainIdHex: "0xc4";
318
- readonly explorerUrl: "https://okbscan.com";
318
+ readonly explorerUrl: "https://www.oklink.com/x-layer";
319
319
  readonly name: "X Layer";
320
320
  readonly nativeCurrency: "OKB";
321
321
  readonly networkDerivationPath: [number, number, number, number, number];
322
- readonly rpcUrls: ["https://rpc.xlayer.tech"];
322
+ readonly rpcUrls: ["https://xlayerrpc.okx.com"];
323
323
  readonly type: "evm";
324
324
  } & {
325
325
  chainIdHex: "0xc4";
@@ -337,6 +337,34 @@ export declare const AllChainConfigs: (({
337
337
  readonly type: "evm";
338
338
  } & {
339
339
  chainIdHex: "0x92";
340
+ }) | ({
341
+ readonly baseDecimal: 18;
342
+ readonly blockTime: 0.4;
343
+ readonly chain: Chain.Monad;
344
+ readonly chainId: ChainId.Monad;
345
+ readonly chainIdHex: "0x8f";
346
+ readonly explorerUrl: "https://monvision.io";
347
+ readonly name: "Monad";
348
+ readonly nativeCurrency: "MON";
349
+ readonly networkDerivationPath: [number, number, number, number, number];
350
+ readonly rpcUrls: [];
351
+ readonly type: "evm";
352
+ } & {
353
+ chainIdHex: "0x8f";
354
+ }) | ({
355
+ readonly baseDecimal: 18;
356
+ readonly blockTime: 0.01;
357
+ readonly chain: Chain.MegaETH;
358
+ readonly chainId: ChainId.MegaETH;
359
+ readonly chainIdHex: "0x10e6";
360
+ readonly explorerUrl: "";
361
+ readonly name: "MegaETH";
362
+ readonly nativeCurrency: "ETH";
363
+ readonly networkDerivationPath: [number, number, number, number, number];
364
+ readonly rpcUrls: [];
365
+ readonly type: "evm";
366
+ } & {
367
+ chainIdHex: "0x10e6";
340
368
  }) | ({
341
369
  readonly baseDecimal: 24;
342
370
  readonly blockTime: 1;
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/chains/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,KAAK,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAO9D,cAAc,UAAU,CAAC;AACzB,cAAc,UAAU,CAAC;AACzB,cAAc,OAAO,CAAC;AACtB,cAAc,UAAU,CAAC;AACzB,cAAc,aAAa,CAAC;AAC5B,cAAc,QAAQ,CAAC;AAEvB,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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nB,CAAC,IAAI,WAAW,CAAC,OAAO,CAAC,GAAG,OAAO,CAAC,WAAW,EAAE;QAAE,KAAK,EAAE,CAAC,CAAA;KAAE,CAAC;CAChE,GAAG;KACD,CAAC,IAAI,WAAW,CAAC,SAAS,CAAC,GAAG,OAAO,CAAC,WAAW,EAAE;QAAE,OAAO,EAAE,CAAC,CAAA;KAAE,CAAC;CACpE,CAAC;AAWF,wBAAgB,cAAc,CAAC,CAAC,SAAS,MAAM,cAAc,EAAE,cAAc,EAAE,CAAC,GAAG,cAAc,CAAC,CAAC,CAAC,CAInG;AA+BD,eAAO,MAAM,SAAS;;;;;CAKrB,CAAC;AAEF;;;;;;GAMG;AACH,eAAO,MAAM,QAAQ,EAAE,MAAM,CAAC,KAAK,GAAG,aAAa,EAAE,MAAM,CAAW,CAAC;AAEvE;;;;;GAKG;AACH,eAAO,MAAM,aAAa,EAAE,MAAM,CAAC,KAAK,EAAE,MAAM,CAAgB,CAAC;AAEjE;;;;;;;;;GASG;AACH,eAAO,MAAM,cAAc,EAEtB,EACH,QAAQ,EAAE,CAAC,IAAI,KAAK,GAAG,aAAa,GAAG,OAAO,CAAC,WAAW,EAAE;IAAE,KAAK,EAAE,CAAC,CAAA;CAAE,CAAC,CAAC,SAAS,CAAC,GACrF,CAAC;AAEF;;;;;;;;GAQG;AACH,eAAO,MAAM,cAAc,wBAAiB,CAAC;AAE7C;;;;;;;;GAQG;AACH,eAAO,MAAM,WAAW,uBAAqB,CAAC;AAE9C;;;;;;;;GAQG;AACH,eAAO,MAAM,UAAU,uBAAmB,CAAC"}
package/package.json CHANGED
@@ -2,9 +2,14 @@
2
2
  "author": "swapkit-oss",
3
3
  "description": "SwapKit - Shared Types",
4
4
  "exports": {
5
- ".": { "import": "./dist/index.js", "require": "./dist/index.cjs", "types": "./dist/types/index.d.ts" }
5
+ ".": {
6
+ "bun": "./src/index.ts",
7
+ "import": "./dist/index.js",
8
+ "require": "./dist/index.cjs",
9
+ "types": "./dist/types/index.d.ts"
10
+ }
6
11
  },
7
- "files": ["dist/"],
12
+ "files": ["dist/", "src/"],
8
13
  "homepage": "https://github.com/swapkit/SwapKit",
9
14
  "license": "Apache-2.0",
10
15
  "name": "@swapkit/types",
@@ -17,5 +22,5 @@
17
22
  "type-check:go": "tsgo"
18
23
  },
19
24
  "type": "module",
20
- "version": "0.2.2"
25
+ "version": "0.3.0"
21
26
  }
@@ -0,0 +1,22 @@
1
+ import type { Chain, ChainId, StagenetChain } from "./_enums";
2
+
3
+ type ChainIdHexType<T> = T extends { chainIdHex: infer U } ? (U extends string ? U : undefined) : undefined;
4
+
5
+ export function createChain<
6
+ const Name extends string,
7
+ const Type extends "utxo" | "evm" | "cosmos" | "substrate" | "others",
8
+ const Params extends {
9
+ baseDecimal: number;
10
+ blockTime: number;
11
+ chain: Chain | StagenetChain;
12
+ chainId: ChainId;
13
+ explorerUrl: string;
14
+ name: Name;
15
+ nativeCurrency: string;
16
+ networkDerivationPath: [number, number, number, number, number?];
17
+ rpcUrls: string[];
18
+ type: Type;
19
+ } & ({ chainIdHex: string } | { chainIdHex?: never }),
20
+ >(params: Params): Params & { chainIdHex: ChainIdHexType<Params> } {
21
+ return params as Params & { chainIdHex: ChainIdHexType<Params> };
22
+ }
@@ -0,0 +1,105 @@
1
+ export enum Chain {
2
+ Arbitrum = "ARB",
3
+ Aurora = "AURORA",
4
+ Avalanche = "AVAX",
5
+ Base = "BASE",
6
+ Berachain = "BERA",
7
+ BinanceSmartChain = "BSC",
8
+ Bitcoin = "BTC",
9
+ BitcoinCash = "BCH",
10
+ Botanix = "BOTANIX",
11
+ Cardano = "ADA",
12
+ Chainflip = "FLIP",
13
+ Core = "CORE",
14
+ Corn = "CORN",
15
+ Cosmos = "GAIA",
16
+ Cronos = "CRO",
17
+ Dash = "DASH",
18
+ Dogecoin = "DOGE",
19
+ Ethereum = "ETH",
20
+ Gnosis = "GNO",
21
+ Harbor = "HARBOR",
22
+ Hyperevm = "HYPEREVM",
23
+ Kujira = "KUJI",
24
+ Litecoin = "LTC",
25
+ Maya = "MAYA",
26
+ MegaETH = "MEGAETH",
27
+ Monad = "MONAD",
28
+ Near = "NEAR",
29
+ Noble = "NOBLE",
30
+ Optimism = "OP",
31
+ Polkadot = "DOT",
32
+ Polygon = "POL",
33
+ Radix = "XRD",
34
+ Ripple = "XRP",
35
+ Solana = "SOL",
36
+ Sonic = "SONIC",
37
+ Sui = "SUI",
38
+ THORChain = "THOR",
39
+ Ton = "TON",
40
+ Tron = "TRON",
41
+ Unichain = "UNI",
42
+ XLayer = "XLAYER",
43
+ Zcash = "ZEC",
44
+ }
45
+
46
+ export enum StagenetChain {
47
+ Harbor = "MAYA_HARBOR",
48
+ THORChain = "THOR_STAGENET",
49
+ Maya = "MAYA_STAGENET",
50
+ }
51
+
52
+ /**
53
+ * ChainId enum - chain identifiers for different networks
54
+ *
55
+ * Note: Full-name properties (e.g., Arbitrum, Avalanche) will be discontinued in future versions.
56
+ * Please use the short-handle properties (e.g., ARB, AVAX) instead.
57
+ * The network configuration will be migrated to a more streamlined approach with one object per chain.
58
+ */
59
+ export enum ChainId {
60
+ Arbitrum = "42161",
61
+ Aurora = "1313161554",
62
+ Avalanche = "43114",
63
+ Base = "8453",
64
+ Berachain = "80094",
65
+ BinanceSmartChain = "56",
66
+ Bitcoin = "bitcoin",
67
+ BitcoinCash = "bitcoincash",
68
+ Botanix = "3637",
69
+ Cardano = "cardano",
70
+ Chainflip = "chainflip",
71
+ Core = "1116",
72
+ Corn = "21000000",
73
+ Cosmos = "cosmoshub-4",
74
+ Cronos = "25",
75
+ Dash = "dash",
76
+ Dogecoin = "dogecoin",
77
+ Ethereum = "1",
78
+ Gnosis = "100",
79
+ Harbor = "harbor-1",
80
+ HarborStagenet = "harbor-stagenet-1",
81
+ Hyperevm = "2868",
82
+ Kujira = "kaiyo-1",
83
+ Litecoin = "litecoin",
84
+ Maya = "mayachain-mainnet-v1",
85
+ MayaStagenet = "mayachain-stagenet-v1",
86
+ MegaETH = "4326",
87
+ Monad = "143",
88
+ Near = "near",
89
+ Noble = "noble-1",
90
+ Optimism = "10",
91
+ Polkadot = "polkadot",
92
+ Polygon = "137",
93
+ Radix = "radix-mainnet",
94
+ Ripple = "ripple",
95
+ Solana = "solana",
96
+ Sonic = "146",
97
+ Sui = "sui",
98
+ THORChain = "thorchain-1",
99
+ THORChainStagenet = "thorchain-stagenet-v2",
100
+ Ton = "ton",
101
+ Tron = "728126428",
102
+ Unichain = "130",
103
+ XLayer = "196",
104
+ Zcash = "zcash",
105
+ }
@@ -0,0 +1,159 @@
1
+ import { createChain } from "./_createChain";
2
+ import { Chain, ChainId, StagenetChain } from "./_enums";
3
+
4
+ const type = "cosmos";
5
+
6
+ export const GAIAConfig = createChain({
7
+ baseDecimal: 6,
8
+ blockTime: 2,
9
+ chain: Chain.Cosmos,
10
+ chainId: ChainId.Cosmos,
11
+ explorerUrl: "https://www.mintscan.io/cosmos",
12
+ name: "Cosmos",
13
+ nativeCurrency: "ATOM",
14
+ networkDerivationPath: [44, 118, 0, 0, 0],
15
+ rpcUrls: ["https://cosmos-rpc.publicnode.com:443", "https://cosmos-rpc.publicnode.com"],
16
+ type,
17
+ });
18
+
19
+ export const THORConfig = createChain({
20
+ baseDecimal: 8,
21
+ blockTime: 6,
22
+ chain: Chain.THORChain,
23
+ chainId: ChainId.THORChain,
24
+ explorerUrl: "https://runescan.io",
25
+ name: "THORChain",
26
+ nativeCurrency: "RUNE",
27
+ networkDerivationPath: [44, 931, 0, 0, 0],
28
+ nodeUrl: "https://thornode.ninerealms.com",
29
+ rpcUrls: ["https://rpc.ninerealms.com", "https://thornode.ninerealms.com"],
30
+ type,
31
+ });
32
+
33
+ export const StagenetTHORConfig = createChain({
34
+ baseDecimal: 8,
35
+ blockTime: 6,
36
+ chain: StagenetChain.THORChain,
37
+ chainId: ChainId.THORChainStagenet,
38
+ explorerUrl: "https://runescan.io",
39
+ name: "THORChain",
40
+ nativeCurrency: "RUNE",
41
+ networkDerivationPath: [44, 931, 0, 0, 0],
42
+ nodeUrl: "https://stagenet-thornode.ninerealms.com",
43
+ rpcUrls: ["https://stagenet-rpc.ninerealms.com", "https://stagenet-thornode.ninerealms.com"],
44
+ type,
45
+ });
46
+
47
+ export const MAYAConfig = createChain({
48
+ baseDecimal: 8,
49
+ blockTime: 6,
50
+ chain: Chain.Maya,
51
+ chainId: ChainId.Maya,
52
+ explorerUrl: "https://www.mayascan.org",
53
+ name: "Maya",
54
+ nativeCurrency: "CACAO",
55
+ networkDerivationPath: [44, 931, 0, 0, 0],
56
+ nodeUrl: "https://mayanode.mayachain.info",
57
+ rpcUrls: [
58
+ "https://tendermint.mayachain.info",
59
+ "https://maya-tendermint.publicnode.com",
60
+ "https://mayanode.mayachain.info",
61
+ ],
62
+ type,
63
+ });
64
+
65
+ export const HARBORConfig = createChain({
66
+ baseDecimal: 8,
67
+ blockTime: 6,
68
+ chain: Chain.Harbor,
69
+ chainId: ChainId.Harbor,
70
+ explorerUrl: "",
71
+ name: "Harbor",
72
+ nativeCurrency: "HRB",
73
+ networkDerivationPath: [44, 931, 0, 0, 0],
74
+ rpcUrls: ["https://xnode.harbor-dev.xyz/xnode"],
75
+ type,
76
+ });
77
+
78
+ export const StagenetHARBORConfig = createChain({
79
+ baseDecimal: 8,
80
+ blockTime: 6,
81
+ chain: StagenetChain.Harbor,
82
+ chainId: ChainId.HarborStagenet,
83
+ explorerUrl: "",
84
+ name: "Harbor",
85
+ nativeCurrency: "HRB",
86
+ networkDerivationPath: [44, 931, 0, 0, 0],
87
+ rpcUrls: ["https://xnode.harbor-dev.xyz/xnode"],
88
+ type,
89
+ });
90
+
91
+ export const StagenetMAYAConfig = createChain({
92
+ baseDecimal: 8,
93
+ blockTime: 6,
94
+ chain: StagenetChain.Maya,
95
+ chainId: ChainId.MayaStagenet,
96
+ explorerUrl: "https://www.mayascan.org",
97
+ name: "Maya",
98
+ nativeCurrency: "CACAO",
99
+ networkDerivationPath: [44, 931, 0, 0, 0],
100
+ nodeUrl: "https://stagenet.mayanode.mayachain.info",
101
+ rpcUrls: ["https://stagenet.mayanode.mayachain.info"],
102
+ type,
103
+ });
104
+
105
+ export const KUJIConfig = createChain({
106
+ baseDecimal: 6,
107
+ blockTime: 2.2,
108
+ chain: Chain.Kujira,
109
+ chainId: ChainId.Kujira,
110
+ explorerUrl: "https://finder.kujira.network/kaiyo-1",
111
+ name: "Kujira",
112
+ nativeCurrency: "KUJI",
113
+ networkDerivationPath: [44, 118, 0, 0, 0],
114
+ rpcUrls: ["https://kujira-rpc.ibs.team", "https://kujira-rpc.polkachu.com", "https://rpc-kujira.synergynodes.com/"],
115
+ type,
116
+ });
117
+
118
+ export const NOBLEConfig = createChain({
119
+ baseDecimal: 6,
120
+ blockTime: 1.3,
121
+ chain: Chain.Noble,
122
+ chainId: ChainId.Noble,
123
+ explorerUrl: "https://www.mintscan.io/noble",
124
+ name: "Noble",
125
+ nativeCurrency: "USDC",
126
+ networkDerivationPath: [44, 118, 0, 0, 0],
127
+ rpcUrls: ["https://noble-rpc.polkachu.com", "https://rpc.noble.xyz", "https://rpc.cosmos.directory/noble"],
128
+ type,
129
+ });
130
+
131
+ export const CosmosChainConfigs = [GAIAConfig, THORConfig, MAYAConfig, KUJIConfig, NOBLEConfig, HARBORConfig] as const;
132
+ export const CosmosChains = [
133
+ Chain.Cosmos,
134
+ Chain.Kujira,
135
+ Chain.Maya,
136
+ Chain.Noble,
137
+ Chain.THORChain,
138
+ Chain.Harbor,
139
+ ] as const;
140
+ export type CosmosChain = (typeof CosmosChains)[number];
141
+
142
+ export const StagenetCosmosChainConfigs = [StagenetTHORConfig, StagenetMAYAConfig, StagenetHARBORConfig] as const;
143
+ export const StagenetCosmosChains = [StagenetChain.Maya, StagenetChain.THORChain, StagenetChain.Harbor] as const;
144
+ export type StagenetCosmosChain = (typeof StagenetCosmosChains)[number];
145
+
146
+ export const CosmosChainPrefixes: Record<CosmosChain | StagenetCosmosChain, string> = {
147
+ [GAIAConfig.chain]: "cosmos",
148
+ [THORConfig.chain]: "thor",
149
+ [StagenetTHORConfig.chain]: "sthor",
150
+ [MAYAConfig.chain]: "maya",
151
+ [StagenetMAYAConfig.chain]: "smaya",
152
+ [KUJIConfig.chain]: "kujira",
153
+ [NOBLEConfig.chain]: "noble",
154
+ [HARBORConfig.chain]: "harbor",
155
+ [StagenetHARBORConfig.chain]: "sharbor",
156
+ };
157
+
158
+ export const TCLikeChains = [THORConfig.chain, MAYAConfig.chain] as const;
159
+ export type TCLikeChain = (typeof TCLikeChains)[number];