@gfxlabs/oku-chains 1.11.16 → 1.11.17
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.
- package/dist/browser.js +86 -5
- package/dist/index-mjs.js +83 -6
- package/dist/index.js +86 -5
- package/dist/types/definitions/arbitrum.d.ts +2 -0
- package/dist/types/definitions/avalanche.d.ts +2 -0
- package/dist/types/definitions/base.d.ts +2 -0
- package/dist/types/definitions/blast.d.ts +2 -0
- package/dist/types/definitions/bob.d.ts +2 -0
- package/dist/types/definitions/boba.d.ts +2 -0
- package/dist/types/definitions/bsc.d.ts +2 -0
- package/dist/types/definitions/celo.d.ts +2 -0
- package/dist/types/definitions/corn.d.ts +2 -0
- package/dist/types/definitions/etherlink.d.ts +2 -0
- package/dist/types/definitions/filecoin.d.ts +2 -0
- package/dist/types/definitions/gensyn.d.ts +11 -2
- package/dist/types/definitions/gnosis.d.ts +2 -0
- package/dist/types/definitions/goat.d.ts +3 -1
- package/dist/types/definitions/hemi.d.ts +2 -0
- package/dist/types/definitions/hyperevem.d.ts +2 -0
- package/dist/types/definitions/lens.d.ts +2 -0
- package/dist/types/definitions/lightlink.d.ts +3 -1
- package/dist/types/definitions/linea.d.ts +2 -0
- package/dist/types/definitions/lisk.d.ts +2 -0
- package/dist/types/definitions/mainnet.d.ts +2 -0
- package/dist/types/definitions/manta.d.ts +2 -0
- package/dist/types/definitions/mantle.d.ts +2 -0
- package/dist/types/definitions/matchain.d.ts +2 -0
- package/dist/types/definitions/metal.d.ts +2 -0
- package/dist/types/definitions/monad.d.ts +2 -0
- package/dist/types/definitions/moonbeam.d.ts +2 -0
- package/dist/types/definitions/nibiru.d.ts +2 -0
- package/dist/types/definitions/optimism.d.ts +2 -0
- package/dist/types/definitions/plasma.d.ts +2 -0
- package/dist/types/definitions/polygon.d.ts +2 -0
- package/dist/types/definitions/redbelly.d.ts +2 -0
- package/dist/types/definitions/ronin.d.ts +2 -0
- package/dist/types/definitions/rootstock.d.ts +2 -0
- package/dist/types/definitions/saga.d.ts +2 -0
- package/dist/types/definitions/scroll.d.ts +2 -0
- package/dist/types/definitions/sei.d.ts +2 -0
- package/dist/types/definitions/sonic.d.ts +2 -0
- package/dist/types/definitions/taiko.d.ts +2 -0
- package/dist/types/definitions/telos.d.ts +2 -0
- package/dist/types/definitions/tronShasta.d.ts +2 -0
- package/dist/types/definitions/unichain.d.ts +2 -0
- package/dist/types/definitions/worldchain.d.ts +2 -0
- package/dist/types/definitions/xdc.d.ts +2 -0
- package/dist/types/definitions/zerog.d.ts +2 -0
- package/dist/types/definitions/zkevm.d.ts +2 -0
- package/dist/types/definitions/zksync.d.ts +2 -0
- package/dist/types/index.d.ts +106 -4
- package/dist/types/spec/index.d.ts +4 -0
- package/dist/types/util/caip2.d.ts +52 -0
- package/dist/types/util/index.d.ts +5 -1
- package/package.json +1 -1
package/dist/browser.js
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
})(this, (function (exports, chains, viem) { 'use strict';
|
|
6
6
|
|
|
7
7
|
const makeConfig = (x) => {
|
|
8
|
-
return x;
|
|
8
|
+
return { caip2Namespace: "eip155", ...x };
|
|
9
9
|
};
|
|
10
10
|
|
|
11
11
|
const arbitrum = makeConfig({
|
|
@@ -1750,7 +1750,7 @@
|
|
|
1750
1750
|
formatters: undefined,
|
|
1751
1751
|
serializers: undefined,
|
|
1752
1752
|
id: 685689,
|
|
1753
|
-
name: "Gensyn
|
|
1753
|
+
name: "Gensyn",
|
|
1754
1754
|
nativeCurrency: {
|
|
1755
1755
|
decimals: 18,
|
|
1756
1756
|
name: "Ether",
|
|
@@ -1780,7 +1780,14 @@
|
|
|
1780
1780
|
markets: {},
|
|
1781
1781
|
bridges: {},
|
|
1782
1782
|
oracles: {},
|
|
1783
|
-
morpho: {
|
|
1783
|
+
morpho: {
|
|
1784
|
+
deployBlock: 7520470,
|
|
1785
|
+
morpho: "0x8c45B34999883FF4B47cD3be095D585682cd9227",
|
|
1786
|
+
bundler3: "0xE09314FE5Fc41FEc8f3e6042085dD3CeE24c877c",
|
|
1787
|
+
vaultV2Factory: "0xe2558155AEcEF57cAADB98e39b0538ab0ae95693",
|
|
1788
|
+
morphoMarketV1AdapterV2Factory: "0x155134544AE2Ec3AB23034BF620538482C5E3c40",
|
|
1789
|
+
morphoMarketV1RegistryV2: "0x53A687347c822D222058d3E99a566a3D3c0638e1",
|
|
1790
|
+
},
|
|
1784
1791
|
initCodeHash: "0xe34f199b19b2b4f47f68442619d555527d244f78a3297ea89325f843f87b8b54",
|
|
1785
1792
|
uniswap: {
|
|
1786
1793
|
deployBlock: 6184635,
|
|
@@ -2000,7 +2007,7 @@
|
|
|
2000
2007
|
|
|
2001
2008
|
const goat = makeConfig({
|
|
2002
2009
|
...chains.goat,
|
|
2003
|
-
name: "GOAT",
|
|
2010
|
+
name: "GOAT Network",
|
|
2004
2011
|
blockTimeSeconds: 3,
|
|
2005
2012
|
launchTime: 1742159744,
|
|
2006
2013
|
transactionType: "eip1559",
|
|
@@ -2434,7 +2441,7 @@
|
|
|
2434
2441
|
transactionType: "legacy",
|
|
2435
2442
|
sortIndex: 24,
|
|
2436
2443
|
logoUrl: "https://cms.oku.trade/cdn/public/chains/lightlink-logo.svg",
|
|
2437
|
-
deprecated:
|
|
2444
|
+
deprecated: true,
|
|
2438
2445
|
estimatedSwapGas: 300000,
|
|
2439
2446
|
estimatedBridgeGas: 200000,
|
|
2440
2447
|
estimatedWrapGas: 60000,
|
|
@@ -6650,6 +6657,76 @@
|
|
|
6650
6657
|
},
|
|
6651
6658
|
});
|
|
6652
6659
|
|
|
6660
|
+
/**
|
|
6661
|
+
* Parse a CAIP-2 chain ID string into its namespace and reference components.
|
|
6662
|
+
*
|
|
6663
|
+
* @example
|
|
6664
|
+
* ```ts
|
|
6665
|
+
* parseCAIP2("eip155:1")
|
|
6666
|
+
* // => { namespace: "eip155", reference: "1" }
|
|
6667
|
+
* ```
|
|
6668
|
+
*
|
|
6669
|
+
* @throws {Error} If the string does not contain exactly one ':'
|
|
6670
|
+
*/
|
|
6671
|
+
function parseCAIP2(caip2) {
|
|
6672
|
+
const sep = caip2.indexOf(":");
|
|
6673
|
+
if (sep === -1 || sep !== caip2.lastIndexOf(":")) {
|
|
6674
|
+
throw new Error(`Invalid CAIP-2 identifier: "${caip2}"`);
|
|
6675
|
+
}
|
|
6676
|
+
return {
|
|
6677
|
+
namespace: caip2.slice(0, sep),
|
|
6678
|
+
reference: caip2.slice(sep + 1),
|
|
6679
|
+
};
|
|
6680
|
+
}
|
|
6681
|
+
/**
|
|
6682
|
+
* Format a CAIP-2 chain ID string from namespace and reference components.
|
|
6683
|
+
*
|
|
6684
|
+
* @example
|
|
6685
|
+
* ```ts
|
|
6686
|
+
* formatCAIP2({ namespace: "eip155", reference: "1" })
|
|
6687
|
+
* // => "eip155:1"
|
|
6688
|
+
* ```
|
|
6689
|
+
*/
|
|
6690
|
+
function formatCAIP2(id) {
|
|
6691
|
+
return `${id.namespace}:${id.reference}`;
|
|
6692
|
+
}
|
|
6693
|
+
/**
|
|
6694
|
+
* Convert a chain config to its CAIP-2 identifier string.
|
|
6695
|
+
*
|
|
6696
|
+
* @example
|
|
6697
|
+
* ```ts
|
|
6698
|
+
* import { mainnet } from "@gfxlabs/oku-chains";
|
|
6699
|
+
* toCAIP2(mainnet)
|
|
6700
|
+
* // => "eip155:1"
|
|
6701
|
+
* ```
|
|
6702
|
+
*/
|
|
6703
|
+
function toCAIP2(chain) {
|
|
6704
|
+
return formatCAIP2({
|
|
6705
|
+
namespace: chain.caip2Namespace,
|
|
6706
|
+
reference: String(chain.id),
|
|
6707
|
+
});
|
|
6708
|
+
}
|
|
6709
|
+
/**
|
|
6710
|
+
* Look up a chain config by its CAIP-2 identifier string from a list of chains.
|
|
6711
|
+
*
|
|
6712
|
+
* @example
|
|
6713
|
+
* ```ts
|
|
6714
|
+
* import { MAINNET_CHAINS } from "@gfxlabs/oku-chains";
|
|
6715
|
+
* fromCAIP2("eip155:1", MAINNET_CHAINS)
|
|
6716
|
+
* // => mainnet chain config
|
|
6717
|
+
* ```
|
|
6718
|
+
*
|
|
6719
|
+
* @throws {Error} If the CAIP-2 string is invalid or no matching chain is found
|
|
6720
|
+
*/
|
|
6721
|
+
function fromCAIP2(caip2, chains) {
|
|
6722
|
+
const { namespace, reference } = parseCAIP2(caip2);
|
|
6723
|
+
const chain = chains.find((c) => c.caip2Namespace === namespace && String(c.id) === reference);
|
|
6724
|
+
if (!chain) {
|
|
6725
|
+
throw new Error(`No chain found for CAIP-2 identifier: "${caip2}"`);
|
|
6726
|
+
}
|
|
6727
|
+
return chain;
|
|
6728
|
+
}
|
|
6729
|
+
|
|
6653
6730
|
const MAINNET_CHAINS = [
|
|
6654
6731
|
arbitrum,
|
|
6655
6732
|
base,
|
|
@@ -6712,6 +6789,8 @@
|
|
|
6712
6789
|
exports.corn = corn;
|
|
6713
6790
|
exports.etherlink = etherlink;
|
|
6714
6791
|
exports.filecoin = filecoin;
|
|
6792
|
+
exports.formatCAIP2 = formatCAIP2;
|
|
6793
|
+
exports.fromCAIP2 = fromCAIP2;
|
|
6715
6794
|
exports.gensyn = gensyn;
|
|
6716
6795
|
exports.gnosis = gnosis;
|
|
6717
6796
|
exports.goat = goat;
|
|
@@ -6730,6 +6809,7 @@
|
|
|
6730
6809
|
exports.moonbeam = moonbeam;
|
|
6731
6810
|
exports.nibiru = nibiru;
|
|
6732
6811
|
exports.optimism = optimism;
|
|
6812
|
+
exports.parseCAIP2 = parseCAIP2;
|
|
6733
6813
|
exports.plasma = plasma;
|
|
6734
6814
|
exports.polygon = polygon;
|
|
6735
6815
|
exports.polygonZkEvm = polygonZkEvm;
|
|
@@ -6742,6 +6822,7 @@
|
|
|
6742
6822
|
exports.sonic = sonic;
|
|
6743
6823
|
exports.taiko = taiko;
|
|
6744
6824
|
exports.telos = telos;
|
|
6825
|
+
exports.toCAIP2 = toCAIP2;
|
|
6745
6826
|
exports.tronShasta = tronShasta;
|
|
6746
6827
|
exports.unichain = unichain;
|
|
6747
6828
|
exports.worldchain = worldchain;
|
package/dist/index-mjs.js
CHANGED
|
@@ -2,7 +2,7 @@ import { arbitrum as arbitrum$1, avalanche as avalanche$1, base as base$1, blast
|
|
|
2
2
|
import { zeroAddress } from 'viem';
|
|
3
3
|
|
|
4
4
|
const makeConfig = (x) => {
|
|
5
|
-
return x;
|
|
5
|
+
return { caip2Namespace: "eip155", ...x };
|
|
6
6
|
};
|
|
7
7
|
|
|
8
8
|
const arbitrum = makeConfig({
|
|
@@ -1747,7 +1747,7 @@ const gensyn = makeConfig({
|
|
|
1747
1747
|
formatters: undefined,
|
|
1748
1748
|
serializers: undefined,
|
|
1749
1749
|
id: 685689,
|
|
1750
|
-
name: "Gensyn
|
|
1750
|
+
name: "Gensyn",
|
|
1751
1751
|
nativeCurrency: {
|
|
1752
1752
|
decimals: 18,
|
|
1753
1753
|
name: "Ether",
|
|
@@ -1777,7 +1777,14 @@ const gensyn = makeConfig({
|
|
|
1777
1777
|
markets: {},
|
|
1778
1778
|
bridges: {},
|
|
1779
1779
|
oracles: {},
|
|
1780
|
-
morpho: {
|
|
1780
|
+
morpho: {
|
|
1781
|
+
deployBlock: 7520470,
|
|
1782
|
+
morpho: "0x8c45B34999883FF4B47cD3be095D585682cd9227",
|
|
1783
|
+
bundler3: "0xE09314FE5Fc41FEc8f3e6042085dD3CeE24c877c",
|
|
1784
|
+
vaultV2Factory: "0xe2558155AEcEF57cAADB98e39b0538ab0ae95693",
|
|
1785
|
+
morphoMarketV1AdapterV2Factory: "0x155134544AE2Ec3AB23034BF620538482C5E3c40",
|
|
1786
|
+
morphoMarketV1RegistryV2: "0x53A687347c822D222058d3E99a566a3D3c0638e1",
|
|
1787
|
+
},
|
|
1781
1788
|
initCodeHash: "0xe34f199b19b2b4f47f68442619d555527d244f78a3297ea89325f843f87b8b54",
|
|
1782
1789
|
uniswap: {
|
|
1783
1790
|
deployBlock: 6184635,
|
|
@@ -1997,7 +2004,7 @@ const gnosis = makeConfig({
|
|
|
1997
2004
|
|
|
1998
2005
|
const goat = makeConfig({
|
|
1999
2006
|
...goat$1,
|
|
2000
|
-
name: "GOAT",
|
|
2007
|
+
name: "GOAT Network",
|
|
2001
2008
|
blockTimeSeconds: 3,
|
|
2002
2009
|
launchTime: 1742159744,
|
|
2003
2010
|
transactionType: "eip1559",
|
|
@@ -2431,7 +2438,7 @@ const lightlink = makeConfig({
|
|
|
2431
2438
|
transactionType: "legacy",
|
|
2432
2439
|
sortIndex: 24,
|
|
2433
2440
|
logoUrl: "https://cms.oku.trade/cdn/public/chains/lightlink-logo.svg",
|
|
2434
|
-
deprecated:
|
|
2441
|
+
deprecated: true,
|
|
2435
2442
|
estimatedSwapGas: 300000,
|
|
2436
2443
|
estimatedBridgeGas: 200000,
|
|
2437
2444
|
estimatedWrapGas: 60000,
|
|
@@ -6647,6 +6654,76 @@ const zkSync = makeConfig({
|
|
|
6647
6654
|
},
|
|
6648
6655
|
});
|
|
6649
6656
|
|
|
6657
|
+
/**
|
|
6658
|
+
* Parse a CAIP-2 chain ID string into its namespace and reference components.
|
|
6659
|
+
*
|
|
6660
|
+
* @example
|
|
6661
|
+
* ```ts
|
|
6662
|
+
* parseCAIP2("eip155:1")
|
|
6663
|
+
* // => { namespace: "eip155", reference: "1" }
|
|
6664
|
+
* ```
|
|
6665
|
+
*
|
|
6666
|
+
* @throws {Error} If the string does not contain exactly one ':'
|
|
6667
|
+
*/
|
|
6668
|
+
function parseCAIP2(caip2) {
|
|
6669
|
+
const sep = caip2.indexOf(":");
|
|
6670
|
+
if (sep === -1 || sep !== caip2.lastIndexOf(":")) {
|
|
6671
|
+
throw new Error(`Invalid CAIP-2 identifier: "${caip2}"`);
|
|
6672
|
+
}
|
|
6673
|
+
return {
|
|
6674
|
+
namespace: caip2.slice(0, sep),
|
|
6675
|
+
reference: caip2.slice(sep + 1),
|
|
6676
|
+
};
|
|
6677
|
+
}
|
|
6678
|
+
/**
|
|
6679
|
+
* Format a CAIP-2 chain ID string from namespace and reference components.
|
|
6680
|
+
*
|
|
6681
|
+
* @example
|
|
6682
|
+
* ```ts
|
|
6683
|
+
* formatCAIP2({ namespace: "eip155", reference: "1" })
|
|
6684
|
+
* // => "eip155:1"
|
|
6685
|
+
* ```
|
|
6686
|
+
*/
|
|
6687
|
+
function formatCAIP2(id) {
|
|
6688
|
+
return `${id.namespace}:${id.reference}`;
|
|
6689
|
+
}
|
|
6690
|
+
/**
|
|
6691
|
+
* Convert a chain config to its CAIP-2 identifier string.
|
|
6692
|
+
*
|
|
6693
|
+
* @example
|
|
6694
|
+
* ```ts
|
|
6695
|
+
* import { mainnet } from "@gfxlabs/oku-chains";
|
|
6696
|
+
* toCAIP2(mainnet)
|
|
6697
|
+
* // => "eip155:1"
|
|
6698
|
+
* ```
|
|
6699
|
+
*/
|
|
6700
|
+
function toCAIP2(chain) {
|
|
6701
|
+
return formatCAIP2({
|
|
6702
|
+
namespace: chain.caip2Namespace,
|
|
6703
|
+
reference: String(chain.id),
|
|
6704
|
+
});
|
|
6705
|
+
}
|
|
6706
|
+
/**
|
|
6707
|
+
* Look up a chain config by its CAIP-2 identifier string from a list of chains.
|
|
6708
|
+
*
|
|
6709
|
+
* @example
|
|
6710
|
+
* ```ts
|
|
6711
|
+
* import { MAINNET_CHAINS } from "@gfxlabs/oku-chains";
|
|
6712
|
+
* fromCAIP2("eip155:1", MAINNET_CHAINS)
|
|
6713
|
+
* // => mainnet chain config
|
|
6714
|
+
* ```
|
|
6715
|
+
*
|
|
6716
|
+
* @throws {Error} If the CAIP-2 string is invalid or no matching chain is found
|
|
6717
|
+
*/
|
|
6718
|
+
function fromCAIP2(caip2, chains) {
|
|
6719
|
+
const { namespace, reference } = parseCAIP2(caip2);
|
|
6720
|
+
const chain = chains.find((c) => c.caip2Namespace === namespace && String(c.id) === reference);
|
|
6721
|
+
if (!chain) {
|
|
6722
|
+
throw new Error(`No chain found for CAIP-2 identifier: "${caip2}"`);
|
|
6723
|
+
}
|
|
6724
|
+
return chain;
|
|
6725
|
+
}
|
|
6726
|
+
|
|
6650
6727
|
const MAINNET_CHAINS = [
|
|
6651
6728
|
arbitrum,
|
|
6652
6729
|
base,
|
|
@@ -6697,4 +6774,4 @@ const MAINNET_CHAINS = [
|
|
|
6697
6774
|
gensyn,
|
|
6698
6775
|
];
|
|
6699
6776
|
|
|
6700
|
-
export { MAINNET_CHAINS, arbitrum, avalanche, base, blast, bob, boba, bsc, celo, corn, etherlink, filecoin, gensyn, gnosis, goat, hemi, hyperevm, lens, lightlink, linea, lisk, mainnet, manta, mantle, matchain, metal, monad, moonbeam, nibiru, optimism, plasma, polygon, polygonZkEvm, redbelly, ronin, rootstock, saga, scroll, sei, sonic, taiko, telos, tronShasta, unichain, worldchain, xdc, zerog, zkSync };
|
|
6777
|
+
export { MAINNET_CHAINS, arbitrum, avalanche, base, blast, bob, boba, bsc, celo, corn, etherlink, filecoin, formatCAIP2, fromCAIP2, gensyn, gnosis, goat, hemi, hyperevm, lens, lightlink, linea, lisk, mainnet, manta, mantle, matchain, metal, monad, moonbeam, nibiru, optimism, parseCAIP2, plasma, polygon, polygonZkEvm, redbelly, ronin, rootstock, saga, scroll, sei, sonic, taiko, telos, toCAIP2, tronShasta, unichain, worldchain, xdc, zerog, zkSync };
|
package/dist/index.js
CHANGED
|
@@ -4,7 +4,7 @@ var chains = require('viem/chains');
|
|
|
4
4
|
var viem = require('viem');
|
|
5
5
|
|
|
6
6
|
const makeConfig = (x) => {
|
|
7
|
-
return x;
|
|
7
|
+
return { caip2Namespace: "eip155", ...x };
|
|
8
8
|
};
|
|
9
9
|
|
|
10
10
|
const arbitrum = makeConfig({
|
|
@@ -1749,7 +1749,7 @@ const gensyn = makeConfig({
|
|
|
1749
1749
|
formatters: undefined,
|
|
1750
1750
|
serializers: undefined,
|
|
1751
1751
|
id: 685689,
|
|
1752
|
-
name: "Gensyn
|
|
1752
|
+
name: "Gensyn",
|
|
1753
1753
|
nativeCurrency: {
|
|
1754
1754
|
decimals: 18,
|
|
1755
1755
|
name: "Ether",
|
|
@@ -1779,7 +1779,14 @@ const gensyn = makeConfig({
|
|
|
1779
1779
|
markets: {},
|
|
1780
1780
|
bridges: {},
|
|
1781
1781
|
oracles: {},
|
|
1782
|
-
morpho: {
|
|
1782
|
+
morpho: {
|
|
1783
|
+
deployBlock: 7520470,
|
|
1784
|
+
morpho: "0x8c45B34999883FF4B47cD3be095D585682cd9227",
|
|
1785
|
+
bundler3: "0xE09314FE5Fc41FEc8f3e6042085dD3CeE24c877c",
|
|
1786
|
+
vaultV2Factory: "0xe2558155AEcEF57cAADB98e39b0538ab0ae95693",
|
|
1787
|
+
morphoMarketV1AdapterV2Factory: "0x155134544AE2Ec3AB23034BF620538482C5E3c40",
|
|
1788
|
+
morphoMarketV1RegistryV2: "0x53A687347c822D222058d3E99a566a3D3c0638e1",
|
|
1789
|
+
},
|
|
1783
1790
|
initCodeHash: "0xe34f199b19b2b4f47f68442619d555527d244f78a3297ea89325f843f87b8b54",
|
|
1784
1791
|
uniswap: {
|
|
1785
1792
|
deployBlock: 6184635,
|
|
@@ -1999,7 +2006,7 @@ const gnosis = makeConfig({
|
|
|
1999
2006
|
|
|
2000
2007
|
const goat = makeConfig({
|
|
2001
2008
|
...chains.goat,
|
|
2002
|
-
name: "GOAT",
|
|
2009
|
+
name: "GOAT Network",
|
|
2003
2010
|
blockTimeSeconds: 3,
|
|
2004
2011
|
launchTime: 1742159744,
|
|
2005
2012
|
transactionType: "eip1559",
|
|
@@ -2433,7 +2440,7 @@ const lightlink = makeConfig({
|
|
|
2433
2440
|
transactionType: "legacy",
|
|
2434
2441
|
sortIndex: 24,
|
|
2435
2442
|
logoUrl: "https://cms.oku.trade/cdn/public/chains/lightlink-logo.svg",
|
|
2436
|
-
deprecated:
|
|
2443
|
+
deprecated: true,
|
|
2437
2444
|
estimatedSwapGas: 300000,
|
|
2438
2445
|
estimatedBridgeGas: 200000,
|
|
2439
2446
|
estimatedWrapGas: 60000,
|
|
@@ -6649,6 +6656,76 @@ const zkSync = makeConfig({
|
|
|
6649
6656
|
},
|
|
6650
6657
|
});
|
|
6651
6658
|
|
|
6659
|
+
/**
|
|
6660
|
+
* Parse a CAIP-2 chain ID string into its namespace and reference components.
|
|
6661
|
+
*
|
|
6662
|
+
* @example
|
|
6663
|
+
* ```ts
|
|
6664
|
+
* parseCAIP2("eip155:1")
|
|
6665
|
+
* // => { namespace: "eip155", reference: "1" }
|
|
6666
|
+
* ```
|
|
6667
|
+
*
|
|
6668
|
+
* @throws {Error} If the string does not contain exactly one ':'
|
|
6669
|
+
*/
|
|
6670
|
+
function parseCAIP2(caip2) {
|
|
6671
|
+
const sep = caip2.indexOf(":");
|
|
6672
|
+
if (sep === -1 || sep !== caip2.lastIndexOf(":")) {
|
|
6673
|
+
throw new Error(`Invalid CAIP-2 identifier: "${caip2}"`);
|
|
6674
|
+
}
|
|
6675
|
+
return {
|
|
6676
|
+
namespace: caip2.slice(0, sep),
|
|
6677
|
+
reference: caip2.slice(sep + 1),
|
|
6678
|
+
};
|
|
6679
|
+
}
|
|
6680
|
+
/**
|
|
6681
|
+
* Format a CAIP-2 chain ID string from namespace and reference components.
|
|
6682
|
+
*
|
|
6683
|
+
* @example
|
|
6684
|
+
* ```ts
|
|
6685
|
+
* formatCAIP2({ namespace: "eip155", reference: "1" })
|
|
6686
|
+
* // => "eip155:1"
|
|
6687
|
+
* ```
|
|
6688
|
+
*/
|
|
6689
|
+
function formatCAIP2(id) {
|
|
6690
|
+
return `${id.namespace}:${id.reference}`;
|
|
6691
|
+
}
|
|
6692
|
+
/**
|
|
6693
|
+
* Convert a chain config to its CAIP-2 identifier string.
|
|
6694
|
+
*
|
|
6695
|
+
* @example
|
|
6696
|
+
* ```ts
|
|
6697
|
+
* import { mainnet } from "@gfxlabs/oku-chains";
|
|
6698
|
+
* toCAIP2(mainnet)
|
|
6699
|
+
* // => "eip155:1"
|
|
6700
|
+
* ```
|
|
6701
|
+
*/
|
|
6702
|
+
function toCAIP2(chain) {
|
|
6703
|
+
return formatCAIP2({
|
|
6704
|
+
namespace: chain.caip2Namespace,
|
|
6705
|
+
reference: String(chain.id),
|
|
6706
|
+
});
|
|
6707
|
+
}
|
|
6708
|
+
/**
|
|
6709
|
+
* Look up a chain config by its CAIP-2 identifier string from a list of chains.
|
|
6710
|
+
*
|
|
6711
|
+
* @example
|
|
6712
|
+
* ```ts
|
|
6713
|
+
* import { MAINNET_CHAINS } from "@gfxlabs/oku-chains";
|
|
6714
|
+
* fromCAIP2("eip155:1", MAINNET_CHAINS)
|
|
6715
|
+
* // => mainnet chain config
|
|
6716
|
+
* ```
|
|
6717
|
+
*
|
|
6718
|
+
* @throws {Error} If the CAIP-2 string is invalid or no matching chain is found
|
|
6719
|
+
*/
|
|
6720
|
+
function fromCAIP2(caip2, chains) {
|
|
6721
|
+
const { namespace, reference } = parseCAIP2(caip2);
|
|
6722
|
+
const chain = chains.find((c) => c.caip2Namespace === namespace && String(c.id) === reference);
|
|
6723
|
+
if (!chain) {
|
|
6724
|
+
throw new Error(`No chain found for CAIP-2 identifier: "${caip2}"`);
|
|
6725
|
+
}
|
|
6726
|
+
return chain;
|
|
6727
|
+
}
|
|
6728
|
+
|
|
6652
6729
|
const MAINNET_CHAINS = [
|
|
6653
6730
|
arbitrum,
|
|
6654
6731
|
base,
|
|
@@ -6711,6 +6788,8 @@ exports.celo = celo;
|
|
|
6711
6788
|
exports.corn = corn;
|
|
6712
6789
|
exports.etherlink = etherlink;
|
|
6713
6790
|
exports.filecoin = filecoin;
|
|
6791
|
+
exports.formatCAIP2 = formatCAIP2;
|
|
6792
|
+
exports.fromCAIP2 = fromCAIP2;
|
|
6714
6793
|
exports.gensyn = gensyn;
|
|
6715
6794
|
exports.gnosis = gnosis;
|
|
6716
6795
|
exports.goat = goat;
|
|
@@ -6729,6 +6808,7 @@ exports.monad = monad;
|
|
|
6729
6808
|
exports.moonbeam = moonbeam;
|
|
6730
6809
|
exports.nibiru = nibiru;
|
|
6731
6810
|
exports.optimism = optimism;
|
|
6811
|
+
exports.parseCAIP2 = parseCAIP2;
|
|
6732
6812
|
exports.plasma = plasma;
|
|
6733
6813
|
exports.polygon = polygon;
|
|
6734
6814
|
exports.polygonZkEvm = polygonZkEvm;
|
|
@@ -6741,6 +6821,7 @@ exports.sei = sei;
|
|
|
6741
6821
|
exports.sonic = sonic;
|
|
6742
6822
|
exports.taiko = taiko;
|
|
6743
6823
|
exports.telos = telos;
|
|
6824
|
+
exports.toCAIP2 = toCAIP2;
|
|
6744
6825
|
exports.tronShasta = tronShasta;
|
|
6745
6826
|
exports.unichain = unichain;
|
|
6746
6827
|
exports.worldchain = worldchain;
|
|
@@ -207,4 +207,6 @@ export declare const arbitrum: Readonly<{
|
|
|
207
207
|
}] | undefined | undefined;
|
|
208
208
|
serializers?: import("viem").ChainSerializers<undefined, import("viem").TransactionSerializable<bigint, number>> | undefined;
|
|
209
209
|
verifyHash?: ((client: import("viem").Client, parameters: import("viem").VerifyHashActionParameters) => Promise<import("viem").VerifyHashActionReturnType>) | undefined | undefined;
|
|
210
|
+
} & {
|
|
211
|
+
caip2Namespace: string;
|
|
210
212
|
}>;
|
|
@@ -148,4 +148,6 @@ export declare const avalanche: Readonly<{
|
|
|
148
148
|
}] | undefined | undefined;
|
|
149
149
|
serializers?: import("viem").ChainSerializers<undefined, import("viem").TransactionSerializable<bigint, number>> | undefined;
|
|
150
150
|
verifyHash?: ((client: import("viem").Client, parameters: import("viem").VerifyHashActionParameters) => Promise<import("viem").VerifyHashActionReturnType>) | undefined | undefined;
|
|
151
|
+
} & {
|
|
152
|
+
caip2Namespace: string;
|
|
151
153
|
}>;
|
|
@@ -469,4 +469,6 @@ export declare const base: Readonly<{
|
|
|
469
469
|
readonly transaction: typeof import("viem/chains").serializeTransactionOpStack;
|
|
470
470
|
};
|
|
471
471
|
verifyHash?: ((client: import("viem").Client, parameters: import("viem").VerifyHashActionParameters) => Promise<import("viem").VerifyHashActionReturnType>) | undefined | undefined;
|
|
472
|
+
} & {
|
|
473
|
+
caip2Namespace: string;
|
|
472
474
|
}>;
|
|
@@ -411,4 +411,6 @@ export declare const blast: Readonly<{
|
|
|
411
411
|
readonly transaction: typeof import("viem/chains").serializeTransactionOpStack;
|
|
412
412
|
};
|
|
413
413
|
verifyHash?: ((client: import("viem").Client, parameters: import("viem").VerifyHashActionParameters) => Promise<import("viem").VerifyHashActionReturnType>) | undefined | undefined;
|
|
414
|
+
} & {
|
|
415
|
+
caip2Namespace: string;
|
|
414
416
|
}>;
|
|
@@ -409,4 +409,6 @@ export declare const bob: Readonly<{
|
|
|
409
409
|
readonly transaction: typeof import("viem/chains").serializeTransactionOpStack;
|
|
410
410
|
};
|
|
411
411
|
verifyHash?: ((client: import("viem").Client, parameters: import("viem").VerifyHashActionParameters) => Promise<import("viem").VerifyHashActionReturnType>) | undefined | undefined;
|
|
412
|
+
} & {
|
|
413
|
+
caip2Namespace: string;
|
|
412
414
|
}>;
|
|
@@ -141,4 +141,6 @@ export declare const boba: Readonly<{
|
|
|
141
141
|
}] | undefined | undefined;
|
|
142
142
|
serializers?: import("viem").ChainSerializers<undefined, import("viem").TransactionSerializable<bigint, number>> | undefined;
|
|
143
143
|
verifyHash?: ((client: import("viem").Client, parameters: import("viem").VerifyHashActionParameters) => Promise<import("viem").VerifyHashActionReturnType>) | undefined | undefined;
|
|
144
|
+
} & {
|
|
145
|
+
caip2Namespace: string;
|
|
144
146
|
}>;
|
|
@@ -187,4 +187,6 @@ export declare const bsc: Readonly<{
|
|
|
187
187
|
}] | undefined | undefined;
|
|
188
188
|
serializers?: import("viem").ChainSerializers<undefined, import("viem").TransactionSerializable<bigint, number>> | undefined;
|
|
189
189
|
verifyHash?: ((client: import("viem").Client, parameters: import("viem").VerifyHashActionParameters) => Promise<import("viem").VerifyHashActionReturnType>) | undefined | undefined;
|
|
190
|
+
} & {
|
|
191
|
+
caip2Namespace: string;
|
|
190
192
|
}>;
|
|
@@ -995,4 +995,6 @@ export declare const celo: Readonly<{
|
|
|
995
995
|
readonly transaction: typeof import("viem/chains").serializeTransactionCelo;
|
|
996
996
|
};
|
|
997
997
|
verifyHash?: ((client: import("viem").Client, parameters: import("viem").VerifyHashActionParameters) => Promise<import("viem").VerifyHashActionReturnType>) | undefined | undefined;
|
|
998
|
+
} & {
|
|
999
|
+
caip2Namespace: string;
|
|
998
1000
|
}>;
|
|
@@ -138,4 +138,6 @@ export declare const corn: Readonly<{
|
|
|
138
138
|
}] | undefined | undefined;
|
|
139
139
|
serializers?: import("viem").ChainSerializers<undefined, import("viem").TransactionSerializable<bigint, number>> | undefined;
|
|
140
140
|
verifyHash?: ((client: import("viem").Client, parameters: import("viem").VerifyHashActionParameters) => Promise<import("viem").VerifyHashActionReturnType>) | undefined | undefined;
|
|
141
|
+
} & {
|
|
142
|
+
caip2Namespace: string;
|
|
141
143
|
}>;
|
|
@@ -146,4 +146,6 @@ export declare const etherlink: Readonly<{
|
|
|
146
146
|
}] | undefined | undefined;
|
|
147
147
|
serializers?: import("viem").ChainSerializers<undefined, import("viem").TransactionSerializable<bigint, number>> | undefined;
|
|
148
148
|
verifyHash?: ((client: import("viem").Client, parameters: import("viem").VerifyHashActionParameters) => Promise<import("viem").VerifyHashActionReturnType>) | undefined | undefined;
|
|
149
|
+
} & {
|
|
150
|
+
caip2Namespace: string;
|
|
149
151
|
}>;
|
|
@@ -145,4 +145,6 @@ export declare const filecoin: Readonly<{
|
|
|
145
145
|
}] | undefined | undefined;
|
|
146
146
|
serializers?: import("viem").ChainSerializers<undefined, import("viem").TransactionSerializable<bigint, number>> | undefined;
|
|
147
147
|
verifyHash?: ((client: import("viem").Client, parameters: import("viem").VerifyHashActionParameters) => Promise<import("viem").VerifyHashActionReturnType>) | undefined | undefined;
|
|
148
|
+
} & {
|
|
149
|
+
caip2Namespace: string;
|
|
148
150
|
}>;
|
|
@@ -6,7 +6,7 @@ export declare const gensyn: Readonly<{
|
|
|
6
6
|
formatters: undefined;
|
|
7
7
|
serializers: undefined;
|
|
8
8
|
id: 685689;
|
|
9
|
-
name: "Gensyn
|
|
9
|
+
name: "Gensyn";
|
|
10
10
|
nativeCurrency: {
|
|
11
11
|
decimals: number;
|
|
12
12
|
name: string;
|
|
@@ -38,7 +38,14 @@ export declare const gensyn: Readonly<{
|
|
|
38
38
|
markets: {};
|
|
39
39
|
bridges: {};
|
|
40
40
|
oracles: {};
|
|
41
|
-
morpho: {
|
|
41
|
+
morpho: {
|
|
42
|
+
deployBlock: number;
|
|
43
|
+
morpho: "0x8c45B34999883FF4B47cD3be095D585682cd9227";
|
|
44
|
+
bundler3: "0xE09314FE5Fc41FEc8f3e6042085dD3CeE24c877c";
|
|
45
|
+
vaultV2Factory: "0xe2558155AEcEF57cAADB98e39b0538ab0ae95693";
|
|
46
|
+
morphoMarketV1AdapterV2Factory: "0x155134544AE2Ec3AB23034BF620538482C5E3c40";
|
|
47
|
+
morphoMarketV1RegistryV2: "0x53A687347c822D222058d3E99a566a3D3c0638e1";
|
|
48
|
+
};
|
|
42
49
|
initCodeHash: "0xe34f199b19b2b4f47f68442619d555527d244f78a3297ea89325f843f87b8b54";
|
|
43
50
|
uniswap: {
|
|
44
51
|
deployBlock: number;
|
|
@@ -98,4 +105,6 @@ export declare const gensyn: Readonly<{
|
|
|
98
105
|
address: "0x5d6b0f5335ec95cD2aB7E52f2A0750dd86502435";
|
|
99
106
|
};
|
|
100
107
|
};
|
|
108
|
+
} & {
|
|
109
|
+
caip2Namespace: string;
|
|
101
110
|
}>;
|
|
@@ -179,4 +179,6 @@ export declare const gnosis: Readonly<{
|
|
|
179
179
|
}] | undefined | undefined;
|
|
180
180
|
serializers?: import("viem").ChainSerializers<undefined, import("viem").TransactionSerializable<bigint, number>> | undefined;
|
|
181
181
|
verifyHash?: ((client: import("viem").Client, parameters: import("viem").VerifyHashActionParameters) => Promise<import("viem").VerifyHashActionReturnType>) | undefined | undefined;
|
|
182
|
+
} & {
|
|
183
|
+
caip2Namespace: string;
|
|
182
184
|
}>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export declare const goat: Readonly<{
|
|
2
|
-
name: "GOAT";
|
|
2
|
+
name: "GOAT Network";
|
|
3
3
|
blockTimeSeconds: 3;
|
|
4
4
|
launchTime: 1742159744;
|
|
5
5
|
transactionType: "eip1559";
|
|
@@ -127,4 +127,6 @@ export declare const goat: Readonly<{
|
|
|
127
127
|
}] | undefined | undefined;
|
|
128
128
|
serializers?: import("viem").ChainSerializers<undefined, import("viem").TransactionSerializable<bigint, number>> | undefined;
|
|
129
129
|
verifyHash?: ((client: import("viem").Client, parameters: import("viem").VerifyHashActionParameters) => Promise<import("viem").VerifyHashActionReturnType>) | undefined | undefined;
|
|
130
|
+
} & {
|
|
131
|
+
caip2Namespace: string;
|
|
130
132
|
}>;
|
|
@@ -146,4 +146,6 @@ export declare const hemi: Readonly<{
|
|
|
146
146
|
serializers?: import("viem").ChainSerializers<undefined, import("viem").TransactionSerializable<bigint, number>> | undefined;
|
|
147
147
|
verifyHash?: ((client: import("viem").Client, parameters: import("viem").VerifyHashActionParameters) => Promise<import("viem").VerifyHashActionReturnType>) | undefined | undefined;
|
|
148
148
|
network: "Hemi";
|
|
149
|
+
} & {
|
|
150
|
+
caip2Namespace: string;
|
|
149
151
|
}>;
|
|
@@ -116,4 +116,6 @@ export declare const hyperevm: Readonly<{
|
|
|
116
116
|
}] | undefined | undefined;
|
|
117
117
|
serializers?: import("viem").ChainSerializers<undefined, import("viem").TransactionSerializable<bigint, number>> | undefined;
|
|
118
118
|
verifyHash?: ((client: import("viem").Client, parameters: import("viem").VerifyHashActionParameters) => Promise<import("viem").VerifyHashActionReturnType>) | undefined | undefined;
|
|
119
|
+
} & {
|
|
120
|
+
caip2Namespace: string;
|
|
119
121
|
}>;
|
|
@@ -131,4 +131,6 @@ export declare const lens: Readonly<{
|
|
|
131
131
|
}] | undefined | undefined;
|
|
132
132
|
serializers?: import("viem").ChainSerializers<undefined, import("viem").TransactionSerializable<bigint, number>> | undefined;
|
|
133
133
|
verifyHash?: ((client: import("viem").Client, parameters: import("viem").VerifyHashActionParameters) => Promise<import("viem").VerifyHashActionReturnType>) | undefined | undefined;
|
|
134
|
+
} & {
|
|
135
|
+
caip2Namespace: string;
|
|
134
136
|
}>;
|
|
@@ -5,7 +5,7 @@ export declare const lightlink: Readonly<{
|
|
|
5
5
|
transactionType: "legacy";
|
|
6
6
|
sortIndex: 24;
|
|
7
7
|
logoUrl: "https://cms.oku.trade/cdn/public/chains/lightlink-logo.svg";
|
|
8
|
-
deprecated:
|
|
8
|
+
deprecated: true;
|
|
9
9
|
estimatedSwapGas: 300000;
|
|
10
10
|
estimatedBridgeGas: 200000;
|
|
11
11
|
estimatedWrapGas: 60000;
|
|
@@ -137,4 +137,6 @@ export declare const lightlink: Readonly<{
|
|
|
137
137
|
serializers?: import("viem").ChainSerializers<undefined, import("viem").TransactionSerializable<bigint, number>> | undefined;
|
|
138
138
|
verifyHash?: ((client: import("viem").Client, parameters: import("viem").VerifyHashActionParameters) => Promise<import("viem").VerifyHashActionReturnType>) | undefined | undefined;
|
|
139
139
|
network: "lightlink-phoenix";
|
|
140
|
+
} & {
|
|
141
|
+
caip2Namespace: string;
|
|
140
142
|
}>;
|
|
@@ -177,4 +177,6 @@ export declare const linea: Readonly<{
|
|
|
177
177
|
}] | undefined | undefined;
|
|
178
178
|
serializers?: import("viem").ChainSerializers<undefined, import("viem").TransactionSerializable<bigint, number>> | undefined;
|
|
179
179
|
verifyHash?: ((client: import("viem").Client, parameters: import("viem").VerifyHashActionParameters) => Promise<import("viem").VerifyHashActionReturnType>) | undefined | undefined;
|
|
180
|
+
} & {
|
|
181
|
+
caip2Namespace: string;
|
|
180
182
|
}>;
|
|
@@ -388,4 +388,6 @@ export declare const lisk: Readonly<{
|
|
|
388
388
|
};
|
|
389
389
|
verifyHash?: ((client: import("viem").Client, parameters: import("viem").VerifyHashActionParameters) => Promise<import("viem").VerifyHashActionReturnType>) | undefined | undefined;
|
|
390
390
|
network: "lisk";
|
|
391
|
+
} & {
|
|
392
|
+
caip2Namespace: string;
|
|
391
393
|
}>;
|
|
@@ -223,4 +223,6 @@ export declare const mainnet: Readonly<{
|
|
|
223
223
|
}] | undefined | undefined;
|
|
224
224
|
serializers?: import("viem").ChainSerializers<undefined, import("viem").TransactionSerializable<bigint, number>> | undefined;
|
|
225
225
|
verifyHash?: ((client: import("viem").Client, parameters: import("viem").VerifyHashActionParameters) => Promise<import("viem").VerifyHashActionReturnType>) | undefined | undefined;
|
|
226
|
+
} & {
|
|
227
|
+
caip2Namespace: string;
|
|
226
228
|
}>;
|
|
@@ -139,4 +139,6 @@ export declare const manta: Readonly<{
|
|
|
139
139
|
serializers?: import("viem").ChainSerializers<undefined, import("viem").TransactionSerializable<bigint, number>> | undefined;
|
|
140
140
|
verifyHash?: ((client: import("viem").Client, parameters: import("viem").VerifyHashActionParameters) => Promise<import("viem").VerifyHashActionReturnType>) | undefined | undefined;
|
|
141
141
|
network: "manta";
|
|
142
|
+
} & {
|
|
143
|
+
caip2Namespace: string;
|
|
142
144
|
}>;
|
|
@@ -156,4 +156,6 @@ export declare const mantle: Readonly<{
|
|
|
156
156
|
}] | undefined | undefined;
|
|
157
157
|
serializers?: import("viem").ChainSerializers<undefined, import("viem").TransactionSerializable<bigint, number>> | undefined;
|
|
158
158
|
verifyHash?: ((client: import("viem").Client, parameters: import("viem").VerifyHashActionParameters) => Promise<import("viem").VerifyHashActionReturnType>) | undefined | undefined;
|
|
159
|
+
} & {
|
|
160
|
+
caip2Namespace: string;
|
|
159
161
|
}>;
|