@gardenfi/orderbook 0.2.0-beta.9 → 2.0.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.
package/dist/index.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("./index2.cjs"),e=require("./index3.cjs"),s=require("./index4.cjs"),t=require("./index5.cjs");exports.Orderbook=r.Orderbook;exports.BlockchainType=e.BlockchainType;exports.Chains=e.Chains;exports.getBlockchainType=e.getBlockchainType;exports.isBitcoin=e.isBitcoin;exports.isEVM=e.isEVM;exports.isMainnet=e.isMainnet;exports.OrdersProvider=s.OrdersProvider;exports.ArbitrumLocalnet=t.ArbitrumLocalnet;exports.EthereumLocalnet=t.EthereumLocalnet;exports.SupportedAssets=t.SupportedAssets;exports.WBTCArbitrumLocalnetAsset=t.WBTCArbitrumLocalnetAsset;exports.WBTCEthereumLocalnetAsset=t.WBTCEthereumLocalnetAsset;exports.bitcoinRegtestAsset=t.bitcoinRegtestAsset;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("./index2.cjs"),e=require("./index3.cjs"),o=require("./index4.cjs"),t=require("./index5.cjs");exports.Orderbook=r.Orderbook;exports.BlockchainType=e.BlockchainType;exports.Chains=e.Chains;exports.NetworkType=e.NetworkType;exports.TimeLocks=e.TimeLocks;exports.getBlockchainType=e.getBlockchainType;exports.getTimeLock=e.getTimeLock;exports.isBitcoin=e.isBitcoin;exports.isEVM=e.isEVM;exports.isMainnet=e.isMainnet;exports.OrdersProvider=o.OrdersProvider;exports.ArbitrumLocalnet=t.ArbitrumLocalnet;exports.EthereumLocalnet=t.EthereumLocalnet;exports.SupportedAssets=t.SupportedAssets;exports.WBTCArbitrumLocalnetAsset=t.WBTCArbitrumLocalnetAsset;exports.WBTCEthereumLocalnetAsset=t.WBTCEthereumLocalnetAsset;exports.bitcoinRegtestAsset=t.bitcoinRegtestAsset;
package/dist/index.js CHANGED
@@ -1,20 +1,23 @@
1
- import { Orderbook as r } from "./index2.js";
2
- import { BlockchainType as s, Chains as i, getBlockchainType as n, isBitcoin as c, isEVM as a, isMainnet as m } from "./index3.js";
3
- import { OrdersProvider as l } from "./index4.js";
1
+ import { Orderbook as o } from "./index2.js";
2
+ import { BlockchainType as i, Chains as s, NetworkType as c, TimeLocks as n, getBlockchainType as m, getTimeLock as p, isBitcoin as a, isEVM as T, isMainnet as k } from "./index3.js";
3
+ import { OrdersProvider as A } from "./index4.js";
4
4
  import { ArbitrumLocalnet as h, EthereumLocalnet as u, SupportedAssets as B, WBTCArbitrumLocalnetAsset as b, WBTCEthereumLocalnetAsset as d, bitcoinRegtestAsset as f } from "./index5.js";
5
5
  export {
6
6
  h as ArbitrumLocalnet,
7
- s as BlockchainType,
8
- i as Chains,
7
+ i as BlockchainType,
8
+ s as Chains,
9
9
  u as EthereumLocalnet,
10
- r as Orderbook,
11
- l as OrdersProvider,
10
+ c as NetworkType,
11
+ o as Orderbook,
12
+ A as OrdersProvider,
12
13
  B as SupportedAssets,
14
+ n as TimeLocks,
13
15
  b as WBTCArbitrumLocalnetAsset,
14
16
  d as WBTCEthereumLocalnetAsset,
15
17
  f as bitcoinRegtestAsset,
16
- n as getBlockchainType,
17
- c as isBitcoin,
18
- a as isEVM,
19
- m as isMainnet
18
+ m as getBlockchainType,
19
+ p as getTimeLock,
20
+ a as isBitcoin,
21
+ T as isEVM,
22
+ k as isMainnet
20
23
  };
package/dist/index2.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("@catalogfi/utils"),d=require("./index6.cjs"),l=require("@gardenfi/utils"),o=require("./index4.cjs");class i extends o.OrdersProvider{constructor(r){const e=new l.Url("/relayer",r.url??d.MAINNET_ORDERBOOK_API);super(e),this.Url=e,this.walletClient=r.walletClient,this.auth=r.auth}static async init(r){return await r.auth.getToken(),new i(r)}async createOrder(r){const e=await this.auth.getToken();if(e.error)return s.Err(e.error);try{const t=await s.Fetcher.post(this.Url.endpoint("create-order"),{body:JSON.stringify(r),headers:{Authorization:l.Authorization(e.val),"Content-Type":"application/json"}});return t.error?s.Err(t.error):t.result?s.Ok(t.result):s.Err("CreateOrder: Unexpected error, result is undefined")}catch(t){return s.Err("CreateOrder:",String(t))}}async fetchOrders(r,e=!1,t){var n;const a=(n=this.walletClient.account)==null?void 0:n.address;return a?r?await super.getMatchedOrders(a,e,t):await super.getUnMatchedOrders(a,t):s.Err("Wallet client does not have an account")}async subscribeToOrders(r,e,t,a,n){var c;const u=(c=this.walletClient.account)==null?void 0:c.address;return u?await super.subscribeOrders(u,r,e,t,a,n):()=>{}}async getUserOrdersCount(){var e;const r=(e=this.walletClient.account)==null?void 0:e.address;return r?super.getOrdersCount(r):s.Err("Wallet client does not have an account")}}exports.Orderbook=i;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("@catalogfi/utils"),l=require("./index6.cjs"),c=require("@gardenfi/utils"),d=require("./index4.cjs");class i extends d.OrdersProvider{constructor(r){const e=new c.Url("/relayer",r.url??l.MAINNET_ORDERBOOK_API);super(e),this.Url=e,this.walletClient=r.walletClient,this.auth=r.auth}static async init(r){return await r.auth.getToken(),new i(r)}async createOrder(r){const e=await this.auth.getToken();if(e.error)return s.Err(e.error);try{const t=await s.Fetcher.post(this.Url.endpoint("create-order"),{body:JSON.stringify(r),headers:{Authorization:c.Authorization(e.val),"Content-Type":"application/json"}});return t.error?s.Err(t.error):t.result?s.Ok(t.result):s.Err("CreateOrder: Unexpected error, result is undefined")}catch(t){return s.Err("CreateOrder:",String(t))}}async fetchOrders(r,e=!1,t){var n;const a=(n=this.walletClient.account)==null?void 0:n.address;return a?r?await super.getMatchedOrders(a,e,t):await super.getUnMatchedOrders(a,t):s.Err("Wallet client does not have an account")}async subscribeToOrders(r,e,t,a){var u;const n=(u=this.walletClient.account)==null?void 0:u.address;return n?await super.subscribeOrders(n,!0,r,e,a,t):()=>{}}async getUserOrdersCount(){var e;const r=(e=this.walletClient.account)==null?void 0:e.address;return r?super.getOrdersCount(r):s.Err("Wallet client does not have an account")}}exports.Orderbook=i;
package/dist/index2.js CHANGED
@@ -1,17 +1,17 @@
1
- import { Err as s, Fetcher as o, Ok as l } from "@catalogfi/utils";
2
- import { MAINNET_ORDERBOOK_API as d } from "./index6.js";
3
- import { Url as h, Authorization as O } from "@gardenfi/utils";
4
- import { OrdersProvider as p } from "./index4.js";
5
- class c extends p {
1
+ import { Err as s, Fetcher as c, Ok as o } from "@catalogfi/utils";
2
+ import { MAINNET_ORDERBOOK_API as l } from "./index6.js";
3
+ import { Url as d, Authorization as h } from "@gardenfi/utils";
4
+ import { OrdersProvider as O } from "./index4.js";
5
+ class u extends O {
6
6
  /**
7
7
  * Creates an instance of Orderbook. Does not login to the orderbook.
8
8
  * @constructor
9
9
  * @param {OrderbookConfig} orderbookConfig - The configuration object for the orderbook.
10
10
  */
11
11
  constructor(r) {
12
- const e = new h(
12
+ const e = new d(
13
13
  "/relayer",
14
- r.url ?? d
14
+ r.url ?? l
15
15
  );
16
16
  super(e), this.Url = e, this.walletClient = r.walletClient, this.auth = r.auth;
17
17
  }
@@ -20,7 +20,7 @@ class c extends p {
20
20
  * @param {OrderbookConfig} orderbookConfig - The configuration object for the orderbook.
21
21
  */
22
22
  static async init(r) {
23
- return await r.auth.getToken(), new c(r);
23
+ return await r.auth.getToken(), new u(r);
24
24
  }
25
25
  /**
26
26
  * Creates an order
@@ -31,17 +31,17 @@ class c extends p {
31
31
  const e = await this.auth.getToken();
32
32
  if (e.error) return s(e.error);
33
33
  try {
34
- const t = await o.post(
34
+ const t = await c.post(
35
35
  this.Url.endpoint("create-order"),
36
36
  {
37
37
  body: JSON.stringify(r),
38
38
  headers: {
39
- Authorization: O(e.val),
39
+ Authorization: h(e.val),
40
40
  "Content-Type": "application/json"
41
41
  }
42
42
  }
43
43
  );
44
- return t.error ? s(t.error) : t.result ? l(t.result) : s("CreateOrder: Unexpected error, result is undefined");
44
+ return t.error ? s(t.error) : t.result ? o(t.result) : s("CreateOrder: Unexpected error, result is undefined");
45
45
  } catch (t) {
46
46
  return s("CreateOrder:", String(t));
47
47
  }
@@ -66,16 +66,16 @@ class c extends p {
66
66
  * @param paginationConfig - The configuration for the pagination
67
67
  * @returns {() => void} A function to unsubscribe from the order updates
68
68
  */
69
- async subscribeToOrders(r, e, t, a, n) {
70
- var u;
71
- const i = (u = this.walletClient.account) == null ? void 0 : u.address;
72
- return i ? await super.subscribeOrders(
73
- i,
69
+ async subscribeToOrders(r, e, t, a) {
70
+ var i;
71
+ const n = (i = this.walletClient.account) == null ? void 0 : i.address;
72
+ return n ? await super.subscribeOrders(
73
+ n,
74
+ !0,
74
75
  r,
75
76
  e,
76
- t,
77
77
  a,
78
- n
78
+ t
79
79
  ) : () => {
80
80
  };
81
81
  }
@@ -86,5 +86,5 @@ class c extends p {
86
86
  }
87
87
  }
88
88
  export {
89
- c as Orderbook
89
+ u as Orderbook
90
90
  };
package/dist/index3.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});var r=(e=>(e.Bitcoin="Bitcoin",e.EVM="EVM",e))(r||{});const t={bitcoin:"bitcoin",bitcoin_testnet:"bitcoin_testnet",bitcoin_regtest:"bitcoin_regtest",ethereum:"ethereum",ethereum_arbitrum:"ethereum_arbitrum",ethereum_sepolia:"ethereum_sepolia",arbitrum_localnet:"arbitrum_localnet",arbitrum_sepolia:"arbitrum_sepolia",ethereum_localnet:"ethereum_localnet"},n=e=>!(e===t.ethereum_sepolia||e===t.bitcoin_testnet||e===t.bitcoin_regtest||e===t.arbitrum_localnet||e===t.ethereum_localnet||e===t.arbitrum_sepolia),i=e=>e===t.bitcoin||e===t.bitcoin_testnet||e===t.bitcoin_regtest,o=e=>e===t.ethereum||e===t.ethereum_arbitrum||e===t.ethereum_sepolia||e===t.ethereum_localnet||e===t.arbitrum_localnet||e===t.arbitrum_sepolia,u=e=>{if(i(e))return"Bitcoin";if(o(e))return"EVM";throw new Error("Invalid or unsupported chain")};exports.BlockchainType=r;exports.Chains=t;exports.getBlockchainType=u;exports.isBitcoin=i;exports.isEVM=o;exports.isMainnet=n;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});var i=(e=>(e.Bitcoin="Bitcoin",e.EVM="EVM",e))(i||{}),o=(e=>(e.mainnet="mainnet",e.testnet="testnet",e.localnet="localnet",e))(o||{});const t={bitcoin:"bitcoin",bitcoin_testnet:"bitcoin_testnet",bitcoin_regtest:"bitcoin_regtest",ethereum:"ethereum",base:"base",arbitrum:"arbitrum",ethereum_sepolia:"ethereum_sepolia",arbitrum_localnet:"arbitrum_localnet",arbitrum_sepolia:"arbitrum_sepolia",ethereum_localnet:"ethereum_localnet",base_sepolia:"base_sepolia",bera_testnet:"bera_testnet",citrea_testnet:"citrea_testnet"},a=e=>!(e===t.ethereum_sepolia||e===t.bitcoin_testnet||e===t.bitcoin_regtest||e===t.arbitrum_localnet||e===t.ethereum_localnet||e===t.arbitrum_sepolia||e===t.base_sepolia||e===t.bera_testnet||e===t.citrea_testnet),s=e=>e===t.bitcoin||e===t.bitcoin_testnet||e===t.bitcoin_regtest,n=e=>e===t.ethereum||e===t.arbitrum||e===t.ethereum_sepolia||e===t.ethereum_localnet||e===t.arbitrum_localnet||e===t.arbitrum_sepolia||e===t.base_sepolia||e===t.base||e===t.bera_testnet||e===t.citrea_testnet,r={[t.bitcoin]:144,[t.bitcoin_testnet]:144,[t.bitcoin_regtest]:144,[t.ethereum]:7200,[t.arbitrum]:7200,[t.ethereum_sepolia]:7200,[t.arbitrum_localnet]:7200,[t.arbitrum_sepolia]:7200,[t.ethereum_localnet]:7200,[t.base_sepolia]:7200,[t.base]:43200,[t.bera_testnet]:28800,[t.citrea_testnet]:28800},l=e=>{if(s(e))return"Bitcoin";if(n(e))return"EVM";throw new Error("Invalid or unsupported chain")},_=e=>{if(!r[e])throw new Error("Invalid or unsupported chain");return r[e]};exports.BlockchainType=i;exports.Chains=t;exports.NetworkType=o;exports.TimeLocks=r;exports.getBlockchainType=l;exports.getTimeLock=_;exports.isBitcoin=s;exports.isEVM=n;exports.isMainnet=a;
package/dist/index3.js CHANGED
@@ -1,24 +1,48 @@
1
- var r = /* @__PURE__ */ ((e) => (e.Bitcoin = "Bitcoin", e.EVM = "EVM", e))(r || {});
1
+ var i = /* @__PURE__ */ ((e) => (e.Bitcoin = "Bitcoin", e.EVM = "EVM", e))(i || {}), o = /* @__PURE__ */ ((e) => (e.mainnet = "mainnet", e.testnet = "testnet", e.localnet = "localnet", e))(o || {});
2
2
  const t = {
3
3
  bitcoin: "bitcoin",
4
4
  bitcoin_testnet: "bitcoin_testnet",
5
5
  bitcoin_regtest: "bitcoin_regtest",
6
6
  ethereum: "ethereum",
7
- ethereum_arbitrum: "ethereum_arbitrum",
7
+ base: "base",
8
+ arbitrum: "arbitrum",
8
9
  ethereum_sepolia: "ethereum_sepolia",
9
10
  arbitrum_localnet: "arbitrum_localnet",
10
11
  arbitrum_sepolia: "arbitrum_sepolia",
11
- ethereum_localnet: "ethereum_localnet"
12
- }, u = (e) => !(e === t.ethereum_sepolia || e === t.bitcoin_testnet || e === t.bitcoin_regtest || e === t.arbitrum_localnet || e === t.ethereum_localnet || e === t.arbitrum_sepolia), i = (e) => e === t.bitcoin || e === t.bitcoin_testnet || e === t.bitcoin_regtest, o = (e) => e === t.ethereum || e === t.ethereum_arbitrum || e === t.ethereum_sepolia || e === t.ethereum_localnet || e === t.arbitrum_localnet || e === t.arbitrum_sepolia, n = (e) => {
13
- if (i(e)) return "Bitcoin";
14
- if (o(e)) return "EVM";
12
+ ethereum_localnet: "ethereum_localnet",
13
+ base_sepolia: "base_sepolia",
14
+ bera_testnet: "bera_testnet",
15
+ citrea_testnet: "citrea_testnet"
16
+ }, a = (e) => !(e === t.ethereum_sepolia || e === t.bitcoin_testnet || e === t.bitcoin_regtest || e === t.arbitrum_localnet || e === t.ethereum_localnet || e === t.arbitrum_sepolia || e === t.base_sepolia || e === t.bera_testnet || e === t.citrea_testnet), s = (e) => e === t.bitcoin || e === t.bitcoin_testnet || e === t.bitcoin_regtest, n = (e) => e === t.ethereum || e === t.arbitrum || e === t.ethereum_sepolia || e === t.ethereum_localnet || e === t.arbitrum_localnet || e === t.arbitrum_sepolia || e === t.base_sepolia || e === t.base || e === t.bera_testnet || e === t.citrea_testnet, r = {
17
+ [t.bitcoin]: 144,
18
+ [t.bitcoin_testnet]: 144,
19
+ [t.bitcoin_regtest]: 144,
20
+ [t.ethereum]: 7200,
21
+ [t.arbitrum]: 7200,
22
+ [t.ethereum_sepolia]: 7200,
23
+ [t.arbitrum_localnet]: 7200,
24
+ [t.arbitrum_sepolia]: 7200,
25
+ [t.ethereum_localnet]: 7200,
26
+ [t.base_sepolia]: 7200,
27
+ [t.base]: 43200,
28
+ [t.bera_testnet]: 28800,
29
+ [t.citrea_testnet]: 28800
30
+ }, _ = (e) => {
31
+ if (s(e)) return "Bitcoin";
32
+ if (n(e)) return "EVM";
15
33
  throw new Error("Invalid or unsupported chain");
34
+ }, b = (e) => {
35
+ if (!r[e]) throw new Error("Invalid or unsupported chain");
36
+ return r[e];
16
37
  };
17
38
  export {
18
- r as BlockchainType,
39
+ i as BlockchainType,
19
40
  t as Chains,
20
- n as getBlockchainType,
21
- i as isBitcoin,
22
- o as isEVM,
23
- u as isMainnet
41
+ o as NetworkType,
42
+ r as TimeLocks,
43
+ _ as getBlockchainType,
44
+ b as getTimeLock,
45
+ s as isBitcoin,
46
+ n as isEVM,
47
+ a as isMainnet
24
48
  };
package/dist/index5.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./index3.cjs"),a={id:31338,name:"Arbitrum Localnet",nativeCurrency:{name:"Ethereum",symbol:"ETH",decimals:18},rpcUrls:{default:{http:["http://localhost:8546/"]}},testnet:!0},n={id:31337,name:"Ethereum Localnet",nativeCurrency:{name:"Ethereum",symbol:"ETH",decimals:18},rpcUrls:{default:{http:["http://localhost:8545/"]}},testnet:!0},r={name:"Bitcoin Regtest",decimals:8,symbol:"BTC",chain:e.Chains.bitcoin_regtest,atomicSwapAddress:"primary",tokenAddress:"primary"},t={name:"WBTC Arbitrum Localnet",decimals:8,symbol:"WBTC",chain:e.Chains.arbitrum_localnet,atomicSwapAddress:"0xDc64a140Aa3E981100a9becA4E685f962f0cF6C9",tokenAddress:"0xe7f1725E7734CE288F8367e1Bb143E90bb3F0512"},s={name:"WBTC Ethereum Localnet",decimals:8,symbol:"WBTC",chain:e.Chains.ethereum_localnet,atomicSwapAddress:"0xe7f1725E7734CE288F8367e1Bb143E90bb3F0512",tokenAddress:"0x5FbDB2315678afecb367f032d93F642f64180aa3"},c={localnet:{[e.Chains.arbitrum_localnet]:t,[e.Chains.ethereum_localnet]:s},testnet:{[e.Chains.bitcoin_testnet]:{name:"BTC",decimals:8,symbol:"BTC",chain:e.Chains.bitcoin_testnet,tokenAddress:"primary",atomicSwapAddress:"primary"},[e.Chains.ethereum_sepolia]:{name:"WBTC",decimals:8,symbol:"WBTC",chain:e.Chains.ethereum_sepolia,tokenAddress:"0x00ab86f54F436CfE15253845F139955ae0C00bAf",atomicSwapAddress:"0x1cd0bBd55fD66B4C5F7dfE434eFD009C09e628d1"},[e.Chains.arbitrum_sepolia]:{name:"WBTC",decimals:8,symbol:"WBTC",chain:e.Chains.ethereum_sepolia,tokenAddress:"0x4D68da063577F98C55166c7AF6955cF58a97b20A",atomicSwapAddress:"0x3C6a17b8cD92976D1D91E491c93c98cd81998265"}},mainnet:{}};exports.ArbitrumLocalnet=a;exports.EthereumLocalnet=n;exports.SupportedAssets=c;exports.WBTCArbitrumLocalnetAsset=t;exports.WBTCEthereumLocalnetAsset=s;exports.bitcoinRegtestAsset=r;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./index3.cjs"),t={id:31338,name:"Arbitrum Localnet",nativeCurrency:{name:"Ethereum",symbol:"ETH",decimals:18},rpcUrls:{default:{http:["http://localhost:8546/"]}},testnet:!0},i={id:31337,name:"Ethereum Localnet",nativeCurrency:{name:"Ethereum",symbol:"ETH",decimals:18},rpcUrls:{default:{http:["http://localhost:8545/"]}},testnet:!0},n={name:"Bitcoin Regtest",decimals:8,symbol:"BTC",chain:e.Chains.bitcoin_regtest,atomicSwapAddress:"primary",tokenAddress:"primary"},a={name:"WBTC Arbitrum Localnet",decimals:8,symbol:"WBTC",chain:e.Chains.arbitrum_localnet,atomicSwapAddress:"0xDc64a140Aa3E981100a9becA4E685f962f0cF6C9",tokenAddress:"0xe7f1725E7734CE288F8367e1Bb143E90bb3F0512"},s={name:"WBTC Ethereum Localnet",decimals:8,symbol:"WBTC",chain:e.Chains.ethereum_localnet,atomicSwapAddress:"0xe7f1725E7734CE288F8367e1Bb143E90bb3F0512",tokenAddress:"0x5FbDB2315678afecb367f032d93F642f64180aa3"},c={localnet:{arbitrum_localnet_WBTC:a,ethereum_localnet_WBTC:s},testnet:{bitcoin_testnet_BTC:{name:"BTC",decimals:8,symbol:"BTC",chain:e.Chains.bitcoin_testnet,tokenAddress:"primary",atomicSwapAddress:"primary"},ethereum_sepolia_WBTC:{name:"Wrapped Bitcoin",decimals:8,symbol:"WBTC",chain:e.Chains.ethereum_sepolia,logo:"https://garden-finance.imgix.net/token-images/wbtc.svg",tokenAddress:"0x4D68da063577F98C55166c7AF6955cF58a97b20A",atomicSwapAddress:"0x3C6a17b8cD92976D1D91E491c93c98cd81998265"},arbitrum_sepolia_WBTC:{name:"Wrapped Bitcoin",decimals:8,symbol:"WBTC",logo:"https://garden-finance.imgix.net/token-images/wbtc.svg",chain:e.Chains.arbitrum_sepolia,tokenAddress:"0x00ab86f54F436CfE15253845F139955ae0C00bAf",atomicSwapAddress:"0x1cd0bBd55fD66B4C5F7dfE434eFD009C09e628d1"},arbitrum_sepolia_SEED:{name:"Seed",decimals:18,symbol:"SEED",chain:e.Chains.arbitrum_sepolia,logo:"https://garden-finance.imgix.net/token-images/seed.svg",tokenAddress:"0x13DCec0762EcC5E666c207ab44Dc768e5e33070F",atomicSwapAddress:"0xD5FeDb4ceCB0F1D32788a190d9EB47D94D23eE4e"},arbitrum_sepolia_iBTC:{name:"iBTC",decimals:8,symbol:"iBTC",chain:e.Chains.arbitrum_sepolia,logo:"https://garden-finance.imgix.net/token-images/dlcBTCIcon.svg",tokenAddress:"0x685437f025c5f33a94818408c286bc1f023201fc",atomicSwapAddress:"0xdfe6d9363ee96152d39391009a6723819d9e25eb"},base_sepolia_WBTC:{name:"Wrapped Bitcoin",decimals:8,symbol:"WBTC",chain:e.Chains.base_sepolia,logo:"https://garden-finance.imgix.net/token-images/wbtc.svg",tokenAddress:"0x13DCec0762EcC5E666c207ab44Dc768e5e33070F",atomicSwapAddress:"0x00ab86f54F436CfE15253845F139955ae0C00bAf"},base_sepolia_USDT:{name:"Tether USD",decimals:6,symbol:"USDT",chain:e.Chains.base_sepolia,logo:"https://garden-finance.imgix.net/token-images/usdt.svg",tokenAddress:"0xD72Fc3e7D52301b3e5f7d4E3366F88d5C8747520",atomicSwapAddress:"0xB391CA6D0A76CD2A927bC314856E8a374a225CFc"},base_sepolia_iBTC:{name:"iBTC",decimals:8,symbol:"iBTC",chain:e.Chains.base_sepolia,logo:"https://garden-finance.imgix.net/token-images/dlcBTCIcon.svg",tokenAddress:"0x0b0D554D9573bAe1a7556d220847f45182918B28",atomicSwapAddress:"0xbcdad29ac77e5bb27fd528ab0045af630259fe4f"},bera_testnet_WBTC:{name:"Wrapped Bitcoin",decimals:8,symbol:"WBTC",chain:e.Chains.bera_testnet,logo:"https://garden-finance.imgix.net/token-images/wbtc.svg",tokenAddress:"0x00ab86f54F436CfE15253845F139955ae0C00bAf",atomicSwapAddress:"0x1dC94FdcAd8Aee13cfd34Db8a26d26E31572805c"},citrea_testnet_WCBTC:{name:"Wrapped Citrea Bitcoin",decimals:18,symbol:"WCBTC",chain:e.Chains.citrea_testnet,logo:"https://garden-finance.imgix.net/token-images/wbtc.svg",tokenAddress:"0x8d0c9d1c17aE5e40ffF9bE350f57840E9E66Cd93",atomicSwapAddress:"0xaD9d14CA82d9BF97fFf745fFC7d48172A1c0969E"}},mainnet:{bitcoin_BTC:{name:"BTC",decimals:8,symbol:"BTC",chain:e.Chains.bitcoin,tokenAddress:"primary",atomicSwapAddress:"primary"},base_cbBTC:{name:"Coinbase Bitcoin",decimals:8,symbol:"cbBTC",chain:e.Chains.base,logo:"https://garden-finance.imgix.net/token-images/cbBTC.svg",tokenAddress:"0xcbB7C0000aB88B473b1f5aFd9ef808440eed33Bf",atomicSwapAddress:"0xeae7721d779276eb0f5837e2fe260118724a2ba4"},base_USDC:{name:"USD Coin",decimals:6,symbol:"USDC",chain:e.Chains.base,logo:"https://garden-finance.imgix.net/token-images/usdc.svg",tokenAddress:"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",atomicSwapAddress:"0xd8a6e3fca403d79b6ad6216b60527f51cc967d39"},ethereum_WBTC:{name:"Wrapped Bitcoin",decimals:8,symbol:"WBTC",chain:e.Chains.ethereum,logo:"https://garden-finance.imgix.net/token-images/wbtc.svg",tokenAddress:"0x2260FAC5E5542a773Aa44fBCfeDf7C193bc2C599",atomicSwapAddress:"0x795dcb58d1cd4789169d5f938ea05e17eceb68ca"},ethereum_USDC:{name:"USD Coin",decimals:6,symbol:"USDC",chain:e.Chains.ethereum,logo:"https://garden-finance.imgix.net/token-images/usdc.svg",tokenAddress:"0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48",atomicSwapAddress:"0xd8a6e3fca403d79b6ad6216b60527f51cc967d39"},ethereum_cbBTC:{name:"Coinbase Bitcoin",decimals:8,symbol:"cbBTC",chain:e.Chains.ethereum,logo:"https://garden-finance.imgix.net/token-images/cbBTC.svg",tokenAddress:"0xcbB7C0000aB88B473b1f5aFd9ef808440eed33Bf",atomicSwapAddress:"0xeae7721d779276eb0f5837e2fe260118724a2ba4"},arbitrum_WBTC:{name:"Wrapped Bitcoin",decimals:8,symbol:"WBTC",chain:e.Chains.arbitrum,logo:"https://garden-finance.imgix.net/token-images/wbtc.svg",tokenAddress:"0x2f2a2543B76A4166549F7aaB2e75Bef0aefC5B0f",atomicSwapAddress:"0x6b6303fab8ec7232b4f2a7b9fa58e5216f608fcb"},arbitrum_USDC:{name:"USD Coin",decimals:6,symbol:"USDC",chain:e.Chains.arbitrum,logo:"https://garden-finance.imgix.net/token-images/usdc.svg",tokenAddress:"0xaf88d065e77c8cC2239327C5EDb3A432268e5831",atomicSwapAddress:"0xeae7721d779276eb0f5837e2fe260118724a2ba4"},arbitrum_iBTC:{name:"iBTC",decimals:8,symbol:"iBTC",chain:e.Chains.arbitrum,logo:"https://garden-finance.imgix.net/token-images/iBTC.svg",tokenAddress:"0x050C24dBf1eEc17babE5fc585F06116A259CC77A",atomicSwapAddress:"0xdc74a45e86dedf1ff7c6dac77e0c2f082f9e4f72"}}};exports.ArbitrumLocalnet=t;exports.EthereumLocalnet=i;exports.SupportedAssets=c;exports.WBTCArbitrumLocalnetAsset=a;exports.WBTCEthereumLocalnetAsset=s;exports.bitcoinRegtestAsset=n;
package/dist/index5.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import { Chains as e } from "./index3.js";
2
- const c = {
2
+ const i = {
3
3
  id: 31338,
4
4
  name: "Arbitrum Localnet",
5
5
  nativeCurrency: {
@@ -13,7 +13,7 @@ const c = {
13
13
  }
14
14
  },
15
15
  testnet: !0
16
- }, r = {
16
+ }, n = {
17
17
  id: 31337,
18
18
  name: "Ethereum Localnet",
19
19
  nativeCurrency: {
@@ -27,34 +27,34 @@ const c = {
27
27
  }
28
28
  },
29
29
  testnet: !0
30
- }, n = {
30
+ }, c = {
31
31
  name: "Bitcoin Regtest",
32
32
  decimals: 8,
33
33
  symbol: "BTC",
34
34
  chain: e.bitcoin_regtest,
35
35
  atomicSwapAddress: "primary",
36
36
  tokenAddress: "primary"
37
- }, t = {
37
+ }, a = {
38
38
  name: "WBTC Arbitrum Localnet",
39
39
  decimals: 8,
40
40
  symbol: "WBTC",
41
41
  chain: e.arbitrum_localnet,
42
42
  atomicSwapAddress: "0xDc64a140Aa3E981100a9becA4E685f962f0cF6C9",
43
43
  tokenAddress: "0xe7f1725E7734CE288F8367e1Bb143E90bb3F0512"
44
- }, a = {
44
+ }, s = {
45
45
  name: "WBTC Ethereum Localnet",
46
46
  decimals: 8,
47
47
  symbol: "WBTC",
48
48
  chain: e.ethereum_localnet,
49
49
  atomicSwapAddress: "0xe7f1725E7734CE288F8367e1Bb143E90bb3F0512",
50
50
  tokenAddress: "0x5FbDB2315678afecb367f032d93F642f64180aa3"
51
- }, m = {
51
+ }, d = {
52
52
  localnet: {
53
- [e.arbitrum_localnet]: t,
54
- [e.ethereum_localnet]: a
53
+ arbitrum_localnet_WBTC: a,
54
+ ethereum_localnet_WBTC: s
55
55
  },
56
56
  testnet: {
57
- [e.bitcoin_testnet]: {
57
+ bitcoin_testnet_BTC: {
58
58
  name: "BTC",
59
59
  decimals: 8,
60
60
  symbol: "BTC",
@@ -62,30 +62,176 @@ const c = {
62
62
  tokenAddress: "primary",
63
63
  atomicSwapAddress: "primary"
64
64
  },
65
- [e.ethereum_sepolia]: {
66
- name: "WBTC",
65
+ ethereum_sepolia_WBTC: {
66
+ name: "Wrapped Bitcoin",
67
67
  decimals: 8,
68
68
  symbol: "WBTC",
69
69
  chain: e.ethereum_sepolia,
70
+ logo: "https://garden-finance.imgix.net/token-images/wbtc.svg",
71
+ tokenAddress: "0x4D68da063577F98C55166c7AF6955cF58a97b20A",
72
+ atomicSwapAddress: "0x3C6a17b8cD92976D1D91E491c93c98cd81998265"
73
+ },
74
+ arbitrum_sepolia_WBTC: {
75
+ name: "Wrapped Bitcoin",
76
+ decimals: 8,
77
+ symbol: "WBTC",
78
+ logo: "https://garden-finance.imgix.net/token-images/wbtc.svg",
79
+ chain: e.arbitrum_sepolia,
70
80
  tokenAddress: "0x00ab86f54F436CfE15253845F139955ae0C00bAf",
71
81
  atomicSwapAddress: "0x1cd0bBd55fD66B4C5F7dfE434eFD009C09e628d1"
72
82
  },
73
- [e.arbitrum_sepolia]: {
74
- name: "WBTC",
83
+ arbitrum_sepolia_SEED: {
84
+ name: "Seed",
85
+ decimals: 18,
86
+ symbol: "SEED",
87
+ chain: e.arbitrum_sepolia,
88
+ logo: "https://garden-finance.imgix.net/token-images/seed.svg",
89
+ tokenAddress: "0x13DCec0762EcC5E666c207ab44Dc768e5e33070F",
90
+ atomicSwapAddress: "0xD5FeDb4ceCB0F1D32788a190d9EB47D94D23eE4e"
91
+ },
92
+ arbitrum_sepolia_iBTC: {
93
+ name: "iBTC",
94
+ decimals: 8,
95
+ symbol: "iBTC",
96
+ chain: e.arbitrum_sepolia,
97
+ logo: "https://garden-finance.imgix.net/token-images/dlcBTCIcon.svg",
98
+ tokenAddress: "0x685437f025c5f33a94818408c286bc1f023201fc",
99
+ atomicSwapAddress: "0xdfe6d9363ee96152d39391009a6723819d9e25eb"
100
+ },
101
+ base_sepolia_WBTC: {
102
+ name: "Wrapped Bitcoin",
75
103
  decimals: 8,
76
104
  symbol: "WBTC",
77
- chain: e.ethereum_sepolia,
78
- tokenAddress: "0x4D68da063577F98C55166c7AF6955cF58a97b20A",
79
- atomicSwapAddress: "0x3C6a17b8cD92976D1D91E491c93c98cd81998265"
105
+ chain: e.base_sepolia,
106
+ logo: "https://garden-finance.imgix.net/token-images/wbtc.svg",
107
+ tokenAddress: "0x13DCec0762EcC5E666c207ab44Dc768e5e33070F",
108
+ atomicSwapAddress: "0x00ab86f54F436CfE15253845F139955ae0C00bAf"
109
+ },
110
+ base_sepolia_USDT: {
111
+ name: "Tether USD",
112
+ decimals: 6,
113
+ symbol: "USDT",
114
+ chain: e.base_sepolia,
115
+ logo: "https://garden-finance.imgix.net/token-images/usdt.svg",
116
+ tokenAddress: "0xD72Fc3e7D52301b3e5f7d4E3366F88d5C8747520",
117
+ atomicSwapAddress: "0xB391CA6D0A76CD2A927bC314856E8a374a225CFc"
118
+ },
119
+ base_sepolia_iBTC: {
120
+ name: "iBTC",
121
+ decimals: 8,
122
+ symbol: "iBTC",
123
+ chain: e.base_sepolia,
124
+ logo: "https://garden-finance.imgix.net/token-images/dlcBTCIcon.svg",
125
+ tokenAddress: "0x0b0D554D9573bAe1a7556d220847f45182918B28",
126
+ atomicSwapAddress: "0xbcdad29ac77e5bb27fd528ab0045af630259fe4f"
127
+ },
128
+ bera_testnet_WBTC: {
129
+ name: "Wrapped Bitcoin",
130
+ decimals: 8,
131
+ symbol: "WBTC",
132
+ chain: e.bera_testnet,
133
+ logo: "https://garden-finance.imgix.net/token-images/wbtc.svg",
134
+ tokenAddress: "0x00ab86f54F436CfE15253845F139955ae0C00bAf",
135
+ atomicSwapAddress: "0x1dC94FdcAd8Aee13cfd34Db8a26d26E31572805c"
136
+ },
137
+ citrea_testnet_WCBTC: {
138
+ name: "Wrapped Citrea Bitcoin",
139
+ decimals: 18,
140
+ symbol: "WCBTC",
141
+ chain: e.citrea_testnet,
142
+ logo: "https://garden-finance.imgix.net/token-images/wbtc.svg",
143
+ tokenAddress: "0x8d0c9d1c17aE5e40ffF9bE350f57840E9E66Cd93",
144
+ atomicSwapAddress: "0xaD9d14CA82d9BF97fFf745fFC7d48172A1c0969E"
80
145
  }
81
146
  },
82
- mainnet: {}
147
+ mainnet: {
148
+ bitcoin_BTC: {
149
+ name: "BTC",
150
+ decimals: 8,
151
+ symbol: "BTC",
152
+ chain: e.bitcoin,
153
+ tokenAddress: "primary",
154
+ atomicSwapAddress: "primary"
155
+ },
156
+ base_cbBTC: {
157
+ name: "Coinbase Bitcoin",
158
+ decimals: 8,
159
+ symbol: "cbBTC",
160
+ chain: e.base,
161
+ logo: "https://garden-finance.imgix.net/token-images/cbBTC.svg",
162
+ tokenAddress: "0xcbB7C0000aB88B473b1f5aFd9ef808440eed33Bf",
163
+ atomicSwapAddress: "0xeae7721d779276eb0f5837e2fe260118724a2ba4"
164
+ },
165
+ base_USDC: {
166
+ name: "USD Coin",
167
+ decimals: 6,
168
+ symbol: "USDC",
169
+ chain: e.base,
170
+ logo: "https://garden-finance.imgix.net/token-images/usdc.svg",
171
+ tokenAddress: "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
172
+ atomicSwapAddress: "0xd8a6e3fca403d79b6ad6216b60527f51cc967d39"
173
+ },
174
+ ethereum_WBTC: {
175
+ name: "Wrapped Bitcoin",
176
+ decimals: 8,
177
+ symbol: "WBTC",
178
+ chain: e.ethereum,
179
+ logo: "https://garden-finance.imgix.net/token-images/wbtc.svg",
180
+ tokenAddress: "0x2260FAC5E5542a773Aa44fBCfeDf7C193bc2C599",
181
+ atomicSwapAddress: "0x795dcb58d1cd4789169d5f938ea05e17eceb68ca"
182
+ },
183
+ ethereum_USDC: {
184
+ name: "USD Coin",
185
+ decimals: 6,
186
+ symbol: "USDC",
187
+ chain: e.ethereum,
188
+ logo: "https://garden-finance.imgix.net/token-images/usdc.svg",
189
+ tokenAddress: "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48",
190
+ atomicSwapAddress: "0xd8a6e3fca403d79b6ad6216b60527f51cc967d39"
191
+ },
192
+ ethereum_cbBTC: {
193
+ name: "Coinbase Bitcoin",
194
+ decimals: 8,
195
+ symbol: "cbBTC",
196
+ chain: e.ethereum,
197
+ logo: "https://garden-finance.imgix.net/token-images/cbBTC.svg",
198
+ tokenAddress: "0xcbB7C0000aB88B473b1f5aFd9ef808440eed33Bf",
199
+ atomicSwapAddress: "0xeae7721d779276eb0f5837e2fe260118724a2ba4"
200
+ },
201
+ arbitrum_WBTC: {
202
+ name: "Wrapped Bitcoin",
203
+ decimals: 8,
204
+ symbol: "WBTC",
205
+ chain: e.arbitrum,
206
+ logo: "https://garden-finance.imgix.net/token-images/wbtc.svg",
207
+ tokenAddress: "0x2f2a2543B76A4166549F7aaB2e75Bef0aefC5B0f",
208
+ atomicSwapAddress: "0x6b6303fab8ec7232b4f2a7b9fa58e5216f608fcb"
209
+ },
210
+ arbitrum_USDC: {
211
+ name: "USD Coin",
212
+ decimals: 6,
213
+ symbol: "USDC",
214
+ chain: e.arbitrum,
215
+ logo: "https://garden-finance.imgix.net/token-images/usdc.svg",
216
+ tokenAddress: "0xaf88d065e77c8cC2239327C5EDb3A432268e5831",
217
+ atomicSwapAddress: "0xeae7721d779276eb0f5837e2fe260118724a2ba4"
218
+ },
219
+ arbitrum_iBTC: {
220
+ name: "iBTC",
221
+ decimals: 8,
222
+ symbol: "iBTC",
223
+ chain: e.arbitrum,
224
+ logo: "https://garden-finance.imgix.net/token-images/iBTC.svg",
225
+ tokenAddress: "0x050C24dBf1eEc17babE5fc585F06116A259CC77A",
226
+ atomicSwapAddress: "0xdc74a45e86dedf1ff7c6dac77e0c2f082f9e4f72"
227
+ }
228
+ }
83
229
  };
84
230
  export {
85
- c as ArbitrumLocalnet,
86
- r as EthereumLocalnet,
87
- m as SupportedAssets,
88
- t as WBTCArbitrumLocalnetAsset,
89
- a as WBTCEthereumLocalnetAsset,
90
- n as bitcoinRegtestAsset
231
+ i as ArbitrumLocalnet,
232
+ n as EthereumLocalnet,
233
+ d as SupportedAssets,
234
+ a as WBTCArbitrumLocalnetAsset,
235
+ s as WBTCEthereumLocalnetAsset,
236
+ c as bitcoinRegtestAsset
91
237
  };
@@ -1,7 +1,7 @@
1
1
  export { Orderbook } from './lib/orderbook/orderbook';
2
2
  export type * from './lib/orderbook/orderbook.types';
3
3
  export type { Chain, EvmChain, Asset } from './lib/asset';
4
- export { Chains, BlockchainType, isMainnet, isBitcoin, isEVM, getBlockchainType, } from './lib/asset';
4
+ export { Chains, BlockchainType, isMainnet, isBitcoin, isEVM, getBlockchainType, NetworkType, TimeLocks, getTimeLock, } from './lib/asset';
5
5
  export { OrdersProvider } from './lib/orders/ordersProvider';
6
6
  export type { IOrderProvider } from './lib/orders/orders.types';
7
7
  export { WBTCArbitrumLocalnetAsset, WBTCEthereumLocalnetAsset, ArbitrumLocalnet, EthereumLocalnet, bitcoinRegtestAsset, SupportedAssets, } from './lib/constants';
@@ -34,15 +34,21 @@ export declare const Chains: {
34
34
  readonly bitcoin_testnet: "bitcoin_testnet";
35
35
  readonly bitcoin_regtest: "bitcoin_regtest";
36
36
  readonly ethereum: "ethereum";
37
- readonly ethereum_arbitrum: "ethereum_arbitrum";
37
+ readonly base: "base";
38
+ readonly arbitrum: "arbitrum";
38
39
  readonly ethereum_sepolia: "ethereum_sepolia";
39
40
  readonly arbitrum_localnet: "arbitrum_localnet";
40
41
  readonly arbitrum_sepolia: "arbitrum_sepolia";
41
42
  readonly ethereum_localnet: "ethereum_localnet";
43
+ readonly base_sepolia: "base_sepolia";
44
+ readonly bera_testnet: "bera_testnet";
45
+ readonly citrea_testnet: "citrea_testnet";
42
46
  };
43
47
  export type Chain = keyof typeof Chains;
44
48
  export type EvmChain = keyof Omit<typeof Chains, 'bitcoin' | 'bitcoin_testnet' | 'bitcoin_regtest'>;
45
- export declare const isMainnet: (chain: Chain) => chain is "bitcoin" | "ethereum" | "ethereum_arbitrum";
49
+ export declare const isMainnet: (chain: Chain) => chain is "bitcoin" | "ethereum" | "base" | "arbitrum";
46
50
  export declare const isBitcoin: (chain: Chain) => chain is "bitcoin" | "bitcoin_testnet" | "bitcoin_regtest";
47
- export declare const isEVM: (chain: Chain) => chain is "ethereum" | "ethereum_arbitrum" | "ethereum_sepolia" | "arbitrum_localnet" | "arbitrum_sepolia" | "ethereum_localnet";
51
+ export declare const isEVM: (chain: Chain) => chain is "ethereum" | "base" | "arbitrum" | "ethereum_sepolia" | "arbitrum_localnet" | "arbitrum_sepolia" | "ethereum_localnet" | "base_sepolia" | "bera_testnet" | "citrea_testnet";
52
+ export declare const TimeLocks: Record<Chain, number>;
48
53
  export declare const getBlockchainType: (chain: Chain) => BlockchainType;
54
+ export declare const getTimeLock: (chain: Chain) => number;
@@ -6,10 +6,182 @@ export declare const EthereumLocalnet: Chain;
6
6
  export declare const bitcoinRegtestAsset: Asset;
7
7
  export declare const WBTCArbitrumLocalnetAsset: Asset;
8
8
  export declare const WBTCEthereumLocalnetAsset: Asset;
9
- type SupportedAssets = {
10
- [chain: string]: {
11
- [asset: string]: Asset;
9
+ export declare const SupportedAssets: {
10
+ readonly localnet: {
11
+ readonly arbitrum_localnet_WBTC: import('./asset').AssetToken;
12
+ readonly ethereum_localnet_WBTC: import('./asset').AssetToken;
13
+ };
14
+ readonly testnet: {
15
+ readonly bitcoin_testnet_BTC: {
16
+ readonly name: "BTC";
17
+ readonly decimals: 8;
18
+ readonly symbol: "BTC";
19
+ readonly chain: "bitcoin_testnet";
20
+ readonly tokenAddress: "primary";
21
+ readonly atomicSwapAddress: "primary";
22
+ };
23
+ readonly ethereum_sepolia_WBTC: {
24
+ readonly name: "Wrapped Bitcoin";
25
+ readonly decimals: 8;
26
+ readonly symbol: "WBTC";
27
+ readonly chain: "ethereum_sepolia";
28
+ readonly logo: "https://garden-finance.imgix.net/token-images/wbtc.svg";
29
+ readonly tokenAddress: "0x4D68da063577F98C55166c7AF6955cF58a97b20A";
30
+ readonly atomicSwapAddress: "0x3C6a17b8cD92976D1D91E491c93c98cd81998265";
31
+ };
32
+ readonly arbitrum_sepolia_WBTC: {
33
+ readonly name: "Wrapped Bitcoin";
34
+ readonly decimals: 8;
35
+ readonly symbol: "WBTC";
36
+ readonly logo: "https://garden-finance.imgix.net/token-images/wbtc.svg";
37
+ readonly chain: "arbitrum_sepolia";
38
+ readonly tokenAddress: "0x00ab86f54F436CfE15253845F139955ae0C00bAf";
39
+ readonly atomicSwapAddress: "0x1cd0bBd55fD66B4C5F7dfE434eFD009C09e628d1";
40
+ };
41
+ readonly arbitrum_sepolia_SEED: {
42
+ readonly name: "Seed";
43
+ readonly decimals: 18;
44
+ readonly symbol: "SEED";
45
+ readonly chain: "arbitrum_sepolia";
46
+ readonly logo: "https://garden-finance.imgix.net/token-images/seed.svg";
47
+ readonly tokenAddress: "0x13DCec0762EcC5E666c207ab44Dc768e5e33070F";
48
+ readonly atomicSwapAddress: "0xD5FeDb4ceCB0F1D32788a190d9EB47D94D23eE4e";
49
+ };
50
+ readonly arbitrum_sepolia_iBTC: {
51
+ readonly name: "iBTC";
52
+ readonly decimals: 8;
53
+ readonly symbol: "iBTC";
54
+ readonly chain: "arbitrum_sepolia";
55
+ readonly logo: "https://garden-finance.imgix.net/token-images/dlcBTCIcon.svg";
56
+ readonly tokenAddress: "0x685437f025c5f33a94818408c286bc1f023201fc";
57
+ readonly atomicSwapAddress: "0xdfe6d9363ee96152d39391009a6723819d9e25eb";
58
+ };
59
+ readonly base_sepolia_WBTC: {
60
+ readonly name: "Wrapped Bitcoin";
61
+ readonly decimals: 8;
62
+ readonly symbol: "WBTC";
63
+ readonly chain: "base_sepolia";
64
+ readonly logo: "https://garden-finance.imgix.net/token-images/wbtc.svg";
65
+ readonly tokenAddress: "0x13DCec0762EcC5E666c207ab44Dc768e5e33070F";
66
+ readonly atomicSwapAddress: "0x00ab86f54F436CfE15253845F139955ae0C00bAf";
67
+ };
68
+ readonly base_sepolia_USDT: {
69
+ readonly name: "Tether USD";
70
+ readonly decimals: 6;
71
+ readonly symbol: "USDT";
72
+ readonly chain: "base_sepolia";
73
+ readonly logo: "https://garden-finance.imgix.net/token-images/usdt.svg";
74
+ readonly tokenAddress: "0xD72Fc3e7D52301b3e5f7d4E3366F88d5C8747520";
75
+ readonly atomicSwapAddress: "0xB391CA6D0A76CD2A927bC314856E8a374a225CFc";
76
+ };
77
+ readonly base_sepolia_iBTC: {
78
+ readonly name: "iBTC";
79
+ readonly decimals: 8;
80
+ readonly symbol: "iBTC";
81
+ readonly chain: "base_sepolia";
82
+ readonly logo: "https://garden-finance.imgix.net/token-images/dlcBTCIcon.svg";
83
+ readonly tokenAddress: "0x0b0D554D9573bAe1a7556d220847f45182918B28";
84
+ readonly atomicSwapAddress: "0xbcdad29ac77e5bb27fd528ab0045af630259fe4f";
85
+ };
86
+ readonly bera_testnet_WBTC: {
87
+ readonly name: "Wrapped Bitcoin";
88
+ readonly decimals: 8;
89
+ readonly symbol: "WBTC";
90
+ readonly chain: "bera_testnet";
91
+ readonly logo: "https://garden-finance.imgix.net/token-images/wbtc.svg";
92
+ readonly tokenAddress: "0x00ab86f54F436CfE15253845F139955ae0C00bAf";
93
+ readonly atomicSwapAddress: "0x1dC94FdcAd8Aee13cfd34Db8a26d26E31572805c";
94
+ };
95
+ readonly citrea_testnet_WCBTC: {
96
+ readonly name: "Wrapped Citrea Bitcoin";
97
+ readonly decimals: 18;
98
+ readonly symbol: "WCBTC";
99
+ readonly chain: "citrea_testnet";
100
+ readonly logo: "https://garden-finance.imgix.net/token-images/wbtc.svg";
101
+ readonly tokenAddress: "0x8d0c9d1c17aE5e40ffF9bE350f57840E9E66Cd93";
102
+ readonly atomicSwapAddress: "0xaD9d14CA82d9BF97fFf745fFC7d48172A1c0969E";
103
+ };
104
+ };
105
+ readonly mainnet: {
106
+ readonly bitcoin_BTC: {
107
+ readonly name: "BTC";
108
+ readonly decimals: 8;
109
+ readonly symbol: "BTC";
110
+ readonly chain: "bitcoin";
111
+ readonly tokenAddress: "primary";
112
+ readonly atomicSwapAddress: "primary";
113
+ };
114
+ readonly base_cbBTC: {
115
+ readonly name: "Coinbase Bitcoin";
116
+ readonly decimals: 8;
117
+ readonly symbol: "cbBTC";
118
+ readonly chain: "base";
119
+ readonly logo: "https://garden-finance.imgix.net/token-images/cbBTC.svg";
120
+ readonly tokenAddress: "0xcbB7C0000aB88B473b1f5aFd9ef808440eed33Bf";
121
+ readonly atomicSwapAddress: "0xeae7721d779276eb0f5837e2fe260118724a2ba4";
122
+ };
123
+ readonly base_USDC: {
124
+ readonly name: "USD Coin";
125
+ readonly decimals: 6;
126
+ readonly symbol: "USDC";
127
+ readonly chain: "base";
128
+ readonly logo: "https://garden-finance.imgix.net/token-images/usdc.svg";
129
+ readonly tokenAddress: "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913";
130
+ readonly atomicSwapAddress: "0xd8a6e3fca403d79b6ad6216b60527f51cc967d39";
131
+ };
132
+ readonly ethereum_WBTC: {
133
+ readonly name: "Wrapped Bitcoin";
134
+ readonly decimals: 8;
135
+ readonly symbol: "WBTC";
136
+ readonly chain: "ethereum";
137
+ readonly logo: "https://garden-finance.imgix.net/token-images/wbtc.svg";
138
+ readonly tokenAddress: "0x2260FAC5E5542a773Aa44fBCfeDf7C193bc2C599";
139
+ readonly atomicSwapAddress: "0x795dcb58d1cd4789169d5f938ea05e17eceb68ca";
140
+ };
141
+ readonly ethereum_USDC: {
142
+ readonly name: "USD Coin";
143
+ readonly decimals: 6;
144
+ readonly symbol: "USDC";
145
+ readonly chain: "ethereum";
146
+ readonly logo: "https://garden-finance.imgix.net/token-images/usdc.svg";
147
+ readonly tokenAddress: "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48";
148
+ readonly atomicSwapAddress: "0xd8a6e3fca403d79b6ad6216b60527f51cc967d39";
149
+ };
150
+ readonly ethereum_cbBTC: {
151
+ readonly name: "Coinbase Bitcoin";
152
+ readonly decimals: 8;
153
+ readonly symbol: "cbBTC";
154
+ readonly chain: "ethereum";
155
+ readonly logo: "https://garden-finance.imgix.net/token-images/cbBTC.svg";
156
+ readonly tokenAddress: "0xcbB7C0000aB88B473b1f5aFd9ef808440eed33Bf";
157
+ readonly atomicSwapAddress: "0xeae7721d779276eb0f5837e2fe260118724a2ba4";
158
+ };
159
+ readonly arbitrum_WBTC: {
160
+ readonly name: "Wrapped Bitcoin";
161
+ readonly decimals: 8;
162
+ readonly symbol: "WBTC";
163
+ readonly chain: "arbitrum";
164
+ readonly logo: "https://garden-finance.imgix.net/token-images/wbtc.svg";
165
+ readonly tokenAddress: "0x2f2a2543B76A4166549F7aaB2e75Bef0aefC5B0f";
166
+ readonly atomicSwapAddress: "0x6b6303fab8ec7232b4f2a7b9fa58e5216f608fcb";
167
+ };
168
+ readonly arbitrum_USDC: {
169
+ readonly name: "USD Coin";
170
+ readonly decimals: 6;
171
+ readonly symbol: "USDC";
172
+ readonly chain: "arbitrum";
173
+ readonly logo: "https://garden-finance.imgix.net/token-images/usdc.svg";
174
+ readonly tokenAddress: "0xaf88d065e77c8cC2239327C5EDb3A432268e5831";
175
+ readonly atomicSwapAddress: "0xeae7721d779276eb0f5837e2fe260118724a2ba4";
176
+ };
177
+ readonly arbitrum_iBTC: {
178
+ readonly name: "iBTC";
179
+ readonly decimals: 8;
180
+ readonly symbol: "iBTC";
181
+ readonly chain: "arbitrum";
182
+ readonly logo: "https://garden-finance.imgix.net/token-images/iBTC.svg";
183
+ readonly tokenAddress: "0x050C24dBf1eEc17babE5fc585F06116A259CC77A";
184
+ readonly atomicSwapAddress: "0xdc74a45e86dedf1ff7c6dac77e0c2f082f9e4f72";
185
+ };
12
186
  };
13
187
  };
14
- export declare const SupportedAssets: SupportedAssets;
15
- export {};
@@ -38,6 +38,6 @@ export declare class Orderbook extends OrdersProvider implements IOrderbook {
38
38
  * @param paginationConfig - The configuration for the pagination
39
39
  * @returns {() => void} A function to unsubscribe from the order updates
40
40
  */
41
- subscribeToOrders<T extends boolean>(matched: T, interval: number, cb: (orders: PaginatedData<T extends true ? MatchedOrder : CreateOrder>) => Promise<void>, pending?: boolean, paginationConfig?: PaginationConfig): Promise<() => void>;
41
+ subscribeToOrders(interval: number, cb: (orders: PaginatedData<MatchedOrder>) => Promise<void>, paginationConfig?: PaginationConfig, pending?: boolean): Promise<() => void>;
42
42
  getUserOrdersCount(): AsyncResult<number, string>;
43
43
  }
@@ -101,7 +101,7 @@ export interface IOrderbook extends IOrderProvider {
101
101
  */
102
102
  createOrder(order: CreateOrderRequestWithAdditionalData): AsyncResult<string, string>;
103
103
  /**
104
- * Wrapper for the getOrder method in the OrdersProvider class to abstract the address parameter.
104
+ * Wrapper for the getOrders method in the OrdersProvider class to abstract the address parameter.
105
105
  * @param matched - Whether to get matched or unmatched orders
106
106
  * @param paginationConfig - The pagination configuration
107
107
  * @param pending - Whether to get pending orders
@@ -116,7 +116,7 @@ export interface IOrderbook extends IOrderProvider {
116
116
  * @param paginationConfig - The configuration for the pagination
117
117
  * @returns {() => void} A function to unsubscribe from the order updates
118
118
  */
119
- subscribeToOrders<T extends boolean>(matched: T, interval: number, cb: (orders: PaginatedData<T extends true ? MatchedOrder : CreateOrder>) => Promise<void>, pending?: boolean, paginationConfig?: PaginationConfig): Promise<() => void>;
119
+ subscribeToOrders(interval: number, cb: (orders: PaginatedData<MatchedOrder>) => Promise<void>, paginationConfig?: PaginationConfig, pending?: boolean): Promise<() => void>;
120
120
  /**
121
121
  * Get the current orders count associated with the provided address. Used to calculate nonce for secret generation.
122
122
  * @returns {AsyncResult<number, string>} A promise that resolves to the orders count.
@@ -138,7 +138,7 @@ export type AdditionalData = {
138
138
  sig: string;
139
139
  input_token_price: number;
140
140
  output_token_price: number;
141
- deadline: string;
141
+ deadline: number;
142
142
  bitcoin_optional_recipient?: string;
143
143
  [key: string]: any;
144
144
  };
@@ -194,6 +194,7 @@ export type Swap = {
194
194
  initiate_block_number: string | null;
195
195
  redeem_block_number: string | null;
196
196
  refund_block_number: string | null;
197
+ required_confirmations: number;
197
198
  };
198
199
  export type MatchedOrder = {
199
200
  created_at: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gardenfi/orderbook",
3
- "version": "0.2.0-beta.9",
3
+ "version": "2.0.0",
4
4
  "type": "module",
5
5
  "main": "./dist/index.cjs",
6
6
  "module": "./dist/index.js",
@@ -27,7 +27,7 @@
27
27
  },
28
28
  "dependencies": {
29
29
  "@catalogfi/utils": "^0.1.6",
30
- "@gardenfi/utils": "^0.0.1-beta.13",
30
+ "@gardenfi/utils": "^2.0.0",
31
31
  "bufferutil": "^4.0.8",
32
32
  "siwe": "^2.1.4",
33
33
  "utf-8-validate": "^6.0.3",