@gfxlabs/oku-chains 1.11.16 → 1.11.18

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (55) hide show
  1. package/dist/browser.js +91 -7
  2. package/dist/index-mjs.js +88 -8
  3. package/dist/index.js +91 -7
  4. package/dist/types/definitions/arbitrum.d.ts +2 -0
  5. package/dist/types/definitions/avalanche.d.ts +2 -0
  6. package/dist/types/definitions/base.d.ts +2 -0
  7. package/dist/types/definitions/blast.d.ts +2 -0
  8. package/dist/types/definitions/bob.d.ts +2 -0
  9. package/dist/types/definitions/boba.d.ts +2 -0
  10. package/dist/types/definitions/bsc.d.ts +2 -0
  11. package/dist/types/definitions/celo.d.ts +2 -0
  12. package/dist/types/definitions/corn.d.ts +2 -0
  13. package/dist/types/definitions/etherlink.d.ts +2 -0
  14. package/dist/types/definitions/filecoin.d.ts +2 -0
  15. package/dist/types/definitions/gensyn.d.ts +11 -2
  16. package/dist/types/definitions/gnosis.d.ts +2 -0
  17. package/dist/types/definitions/goat.d.ts +3 -1
  18. package/dist/types/definitions/hemi.d.ts +2 -0
  19. package/dist/types/definitions/hyperevem.d.ts +2 -0
  20. package/dist/types/definitions/lens.d.ts +2 -0
  21. package/dist/types/definitions/lightlink.d.ts +3 -1
  22. package/dist/types/definitions/linea.d.ts +2 -0
  23. package/dist/types/definitions/lisk.d.ts +2 -0
  24. package/dist/types/definitions/mainnet.d.ts +2 -0
  25. package/dist/types/definitions/manta.d.ts +2 -0
  26. package/dist/types/definitions/mantle.d.ts +2 -0
  27. package/dist/types/definitions/matchain.d.ts +2 -0
  28. package/dist/types/definitions/metal.d.ts +2 -0
  29. package/dist/types/definitions/monad.d.ts +2 -0
  30. package/dist/types/definitions/moonbeam.d.ts +2 -0
  31. package/dist/types/definitions/nibiru.d.ts +2 -0
  32. package/dist/types/definitions/optimism.d.ts +2 -0
  33. package/dist/types/definitions/plasma.d.ts +2 -0
  34. package/dist/types/definitions/polygon.d.ts +2 -0
  35. package/dist/types/definitions/redbelly.d.ts +2 -0
  36. package/dist/types/definitions/ronin.d.ts +2 -0
  37. package/dist/types/definitions/rootstock.d.ts +2 -0
  38. package/dist/types/definitions/saga.d.ts +2 -0
  39. package/dist/types/definitions/scroll.d.ts +2 -0
  40. package/dist/types/definitions/sei.d.ts +2 -0
  41. package/dist/types/definitions/sonic.d.ts +2 -0
  42. package/dist/types/definitions/taiko.d.ts +2 -0
  43. package/dist/types/definitions/telos.d.ts +2 -0
  44. package/dist/types/definitions/tronShasta.d.ts +2 -0
  45. package/dist/types/definitions/unichain.d.ts +2 -0
  46. package/dist/types/definitions/worldchain.d.ts +2 -0
  47. package/dist/types/definitions/xdc.d.ts +2 -0
  48. package/dist/types/definitions/zerog.d.ts +3 -1
  49. package/dist/types/definitions/zkevm.d.ts +2 -0
  50. package/dist/types/definitions/zksync.d.ts +2 -0
  51. package/dist/types/index.d.ts +107 -5
  52. package/dist/types/spec/index.d.ts +4 -0
  53. package/dist/types/util/caip2.d.ts +52 -0
  54. package/dist/types/util/index.d.ts +5 -1
  55. 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 AI",
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: false,
2444
+ deprecated: true,
2438
2445
  estimatedSwapGas: 300000,
2439
2446
  estimatedBridgeGas: 200000,
2440
2447
  estimatedWrapGas: 60000,
@@ -3687,7 +3694,6 @@
3687
3694
  internalName: "monad",
3688
3695
  nativeLogoUrl: "https://cms.oku.trade/cdn/public/natives/monad.png",
3689
3696
  contracts: {
3690
- ...chains.monad.contracts,
3691
3697
  limitOrder: {
3692
3698
  address: viem.zeroAddress,
3693
3699
  },
@@ -6374,7 +6380,11 @@
6374
6380
  { symbol: "w0G", address: "0x1cd0690ff9a693f5ef2dd976660a8dafc81a109c" },
6375
6381
  ],
6376
6382
  stables: ["0x1f3aa82227281ca364bfb3d253b0f1af1da6473e"],
6377
- watchlist: ["0x5c1e4669c5208adc0163273d51928890b663237f"],
6383
+ watchlist: [
6384
+ "0x5c1e4669c5208adc0163273d51928890b663237f",
6385
+ "0xb5cb173dc8f8e8379343d12faa0cd66cb2db7d2e",
6386
+ "0x5B7698191ac6f42F8AA1B42EC8ce535E63423F67",
6387
+ ],
6378
6388
  internalName: "zerog",
6379
6389
  nativeLogoUrl: "https://cms.oku.trade/cdn/public/natives/0g.svg",
6380
6390
  contracts: {
@@ -6650,6 +6660,76 @@
6650
6660
  },
6651
6661
  });
6652
6662
 
6663
+ /**
6664
+ * Parse a CAIP-2 chain ID string into its namespace and reference components.
6665
+ *
6666
+ * @example
6667
+ * ```ts
6668
+ * parseCAIP2("eip155:1")
6669
+ * // => { namespace: "eip155", reference: "1" }
6670
+ * ```
6671
+ *
6672
+ * @throws {Error} If the string does not contain exactly one ':'
6673
+ */
6674
+ function parseCAIP2(caip2) {
6675
+ const sep = caip2.indexOf(":");
6676
+ if (sep === -1 || sep !== caip2.lastIndexOf(":")) {
6677
+ throw new Error(`Invalid CAIP-2 identifier: "${caip2}"`);
6678
+ }
6679
+ return {
6680
+ namespace: caip2.slice(0, sep),
6681
+ reference: caip2.slice(sep + 1),
6682
+ };
6683
+ }
6684
+ /**
6685
+ * Format a CAIP-2 chain ID string from namespace and reference components.
6686
+ *
6687
+ * @example
6688
+ * ```ts
6689
+ * formatCAIP2({ namespace: "eip155", reference: "1" })
6690
+ * // => "eip155:1"
6691
+ * ```
6692
+ */
6693
+ function formatCAIP2(id) {
6694
+ return `${id.namespace}:${id.reference}`;
6695
+ }
6696
+ /**
6697
+ * Convert a chain config to its CAIP-2 identifier string.
6698
+ *
6699
+ * @example
6700
+ * ```ts
6701
+ * import { mainnet } from "@gfxlabs/oku-chains";
6702
+ * toCAIP2(mainnet)
6703
+ * // => "eip155:1"
6704
+ * ```
6705
+ */
6706
+ function toCAIP2(chain) {
6707
+ return formatCAIP2({
6708
+ namespace: chain.caip2Namespace,
6709
+ reference: String(chain.id),
6710
+ });
6711
+ }
6712
+ /**
6713
+ * Look up a chain config by its CAIP-2 identifier string from a list of chains.
6714
+ *
6715
+ * @example
6716
+ * ```ts
6717
+ * import { MAINNET_CHAINS } from "@gfxlabs/oku-chains";
6718
+ * fromCAIP2("eip155:1", MAINNET_CHAINS)
6719
+ * // => mainnet chain config
6720
+ * ```
6721
+ *
6722
+ * @throws {Error} If the CAIP-2 string is invalid or no matching chain is found
6723
+ */
6724
+ function fromCAIP2(caip2, chains) {
6725
+ const { namespace, reference } = parseCAIP2(caip2);
6726
+ const chain = chains.find((c) => c.caip2Namespace === namespace && String(c.id) === reference);
6727
+ if (!chain) {
6728
+ throw new Error(`No chain found for CAIP-2 identifier: "${caip2}"`);
6729
+ }
6730
+ return chain;
6731
+ }
6732
+
6653
6733
  const MAINNET_CHAINS = [
6654
6734
  arbitrum,
6655
6735
  base,
@@ -6712,6 +6792,8 @@
6712
6792
  exports.corn = corn;
6713
6793
  exports.etherlink = etherlink;
6714
6794
  exports.filecoin = filecoin;
6795
+ exports.formatCAIP2 = formatCAIP2;
6796
+ exports.fromCAIP2 = fromCAIP2;
6715
6797
  exports.gensyn = gensyn;
6716
6798
  exports.gnosis = gnosis;
6717
6799
  exports.goat = goat;
@@ -6730,6 +6812,7 @@
6730
6812
  exports.moonbeam = moonbeam;
6731
6813
  exports.nibiru = nibiru;
6732
6814
  exports.optimism = optimism;
6815
+ exports.parseCAIP2 = parseCAIP2;
6733
6816
  exports.plasma = plasma;
6734
6817
  exports.polygon = polygon;
6735
6818
  exports.polygonZkEvm = polygonZkEvm;
@@ -6742,6 +6825,7 @@
6742
6825
  exports.sonic = sonic;
6743
6826
  exports.taiko = taiko;
6744
6827
  exports.telos = telos;
6828
+ exports.toCAIP2 = toCAIP2;
6745
6829
  exports.tronShasta = tronShasta;
6746
6830
  exports.unichain = unichain;
6747
6831
  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 AI",
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: false,
2441
+ deprecated: true,
2435
2442
  estimatedSwapGas: 300000,
2436
2443
  estimatedBridgeGas: 200000,
2437
2444
  estimatedWrapGas: 60000,
@@ -3684,7 +3691,6 @@ const monad = makeConfig({
3684
3691
  internalName: "monad",
3685
3692
  nativeLogoUrl: "https://cms.oku.trade/cdn/public/natives/monad.png",
3686
3693
  contracts: {
3687
- ...monad$1.contracts,
3688
3694
  limitOrder: {
3689
3695
  address: zeroAddress,
3690
3696
  },
@@ -6371,7 +6377,11 @@ const zerog = makeConfig({
6371
6377
  { symbol: "w0G", address: "0x1cd0690ff9a693f5ef2dd976660a8dafc81a109c" },
6372
6378
  ],
6373
6379
  stables: ["0x1f3aa82227281ca364bfb3d253b0f1af1da6473e"],
6374
- watchlist: ["0x5c1e4669c5208adc0163273d51928890b663237f"],
6380
+ watchlist: [
6381
+ "0x5c1e4669c5208adc0163273d51928890b663237f",
6382
+ "0xb5cb173dc8f8e8379343d12faa0cd66cb2db7d2e",
6383
+ "0x5B7698191ac6f42F8AA1B42EC8ce535E63423F67",
6384
+ ],
6375
6385
  internalName: "zerog",
6376
6386
  nativeLogoUrl: "https://cms.oku.trade/cdn/public/natives/0g.svg",
6377
6387
  contracts: {
@@ -6647,6 +6657,76 @@ const zkSync = makeConfig({
6647
6657
  },
6648
6658
  });
6649
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
+
6650
6730
  const MAINNET_CHAINS = [
6651
6731
  arbitrum,
6652
6732
  base,
@@ -6697,4 +6777,4 @@ const MAINNET_CHAINS = [
6697
6777
  gensyn,
6698
6778
  ];
6699
6779
 
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 };
6780
+ 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 AI",
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: false,
2443
+ deprecated: true,
2437
2444
  estimatedSwapGas: 300000,
2438
2445
  estimatedBridgeGas: 200000,
2439
2446
  estimatedWrapGas: 60000,
@@ -3686,7 +3693,6 @@ const monad = makeConfig({
3686
3693
  internalName: "monad",
3687
3694
  nativeLogoUrl: "https://cms.oku.trade/cdn/public/natives/monad.png",
3688
3695
  contracts: {
3689
- ...chains.monad.contracts,
3690
3696
  limitOrder: {
3691
3697
  address: viem.zeroAddress,
3692
3698
  },
@@ -6373,7 +6379,11 @@ const zerog = makeConfig({
6373
6379
  { symbol: "w0G", address: "0x1cd0690ff9a693f5ef2dd976660a8dafc81a109c" },
6374
6380
  ],
6375
6381
  stables: ["0x1f3aa82227281ca364bfb3d253b0f1af1da6473e"],
6376
- watchlist: ["0x5c1e4669c5208adc0163273d51928890b663237f"],
6382
+ watchlist: [
6383
+ "0x5c1e4669c5208adc0163273d51928890b663237f",
6384
+ "0xb5cb173dc8f8e8379343d12faa0cd66cb2db7d2e",
6385
+ "0x5B7698191ac6f42F8AA1B42EC8ce535E63423F67",
6386
+ ],
6377
6387
  internalName: "zerog",
6378
6388
  nativeLogoUrl: "https://cms.oku.trade/cdn/public/natives/0g.svg",
6379
6389
  contracts: {
@@ -6649,6 +6659,76 @@ const zkSync = makeConfig({
6649
6659
  },
6650
6660
  });
6651
6661
 
6662
+ /**
6663
+ * Parse a CAIP-2 chain ID string into its namespace and reference components.
6664
+ *
6665
+ * @example
6666
+ * ```ts
6667
+ * parseCAIP2("eip155:1")
6668
+ * // => { namespace: "eip155", reference: "1" }
6669
+ * ```
6670
+ *
6671
+ * @throws {Error} If the string does not contain exactly one ':'
6672
+ */
6673
+ function parseCAIP2(caip2) {
6674
+ const sep = caip2.indexOf(":");
6675
+ if (sep === -1 || sep !== caip2.lastIndexOf(":")) {
6676
+ throw new Error(`Invalid CAIP-2 identifier: "${caip2}"`);
6677
+ }
6678
+ return {
6679
+ namespace: caip2.slice(0, sep),
6680
+ reference: caip2.slice(sep + 1),
6681
+ };
6682
+ }
6683
+ /**
6684
+ * Format a CAIP-2 chain ID string from namespace and reference components.
6685
+ *
6686
+ * @example
6687
+ * ```ts
6688
+ * formatCAIP2({ namespace: "eip155", reference: "1" })
6689
+ * // => "eip155:1"
6690
+ * ```
6691
+ */
6692
+ function formatCAIP2(id) {
6693
+ return `${id.namespace}:${id.reference}`;
6694
+ }
6695
+ /**
6696
+ * Convert a chain config to its CAIP-2 identifier string.
6697
+ *
6698
+ * @example
6699
+ * ```ts
6700
+ * import { mainnet } from "@gfxlabs/oku-chains";
6701
+ * toCAIP2(mainnet)
6702
+ * // => "eip155:1"
6703
+ * ```
6704
+ */
6705
+ function toCAIP2(chain) {
6706
+ return formatCAIP2({
6707
+ namespace: chain.caip2Namespace,
6708
+ reference: String(chain.id),
6709
+ });
6710
+ }
6711
+ /**
6712
+ * Look up a chain config by its CAIP-2 identifier string from a list of chains.
6713
+ *
6714
+ * @example
6715
+ * ```ts
6716
+ * import { MAINNET_CHAINS } from "@gfxlabs/oku-chains";
6717
+ * fromCAIP2("eip155:1", MAINNET_CHAINS)
6718
+ * // => mainnet chain config
6719
+ * ```
6720
+ *
6721
+ * @throws {Error} If the CAIP-2 string is invalid or no matching chain is found
6722
+ */
6723
+ function fromCAIP2(caip2, chains) {
6724
+ const { namespace, reference } = parseCAIP2(caip2);
6725
+ const chain = chains.find((c) => c.caip2Namespace === namespace && String(c.id) === reference);
6726
+ if (!chain) {
6727
+ throw new Error(`No chain found for CAIP-2 identifier: "${caip2}"`);
6728
+ }
6729
+ return chain;
6730
+ }
6731
+
6652
6732
  const MAINNET_CHAINS = [
6653
6733
  arbitrum,
6654
6734
  base,
@@ -6711,6 +6791,8 @@ exports.celo = celo;
6711
6791
  exports.corn = corn;
6712
6792
  exports.etherlink = etherlink;
6713
6793
  exports.filecoin = filecoin;
6794
+ exports.formatCAIP2 = formatCAIP2;
6795
+ exports.fromCAIP2 = fromCAIP2;
6714
6796
  exports.gensyn = gensyn;
6715
6797
  exports.gnosis = gnosis;
6716
6798
  exports.goat = goat;
@@ -6729,6 +6811,7 @@ exports.monad = monad;
6729
6811
  exports.moonbeam = moonbeam;
6730
6812
  exports.nibiru = nibiru;
6731
6813
  exports.optimism = optimism;
6814
+ exports.parseCAIP2 = parseCAIP2;
6732
6815
  exports.plasma = plasma;
6733
6816
  exports.polygon = polygon;
6734
6817
  exports.polygonZkEvm = polygonZkEvm;
@@ -6741,6 +6824,7 @@ exports.sei = sei;
6741
6824
  exports.sonic = sonic;
6742
6825
  exports.taiko = taiko;
6743
6826
  exports.telos = telos;
6827
+ exports.toCAIP2 = toCAIP2;
6744
6828
  exports.tronShasta = tronShasta;
6745
6829
  exports.unichain = unichain;
6746
6830
  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 AI";
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
  }>;