@gardenfi/orderbook 2.1.8 → 2.1.9-beta.1

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/index2.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("./index6.cjs"),h=require("@gardenfi/utils"),i=require("./index7.cjs");class O{constructor(n){this.Url=n}async createOrder(n,o){const t=await o.getAuthHeaders();if(t.error)return r.Err(t.error);try{const s=await r.Fetcher.post(this.Url.endpoint("/relayer").endpoint("create-order"),{body:JSON.stringify(n),headers:{...t.val,"Content-Type":"application/json"}});return s.error?r.Err(s.error):s.result?r.Ok(s.result):r.Err("CreateOrder: Unexpected error, result is undefined")}catch(s){return r.Err("CreateOrder:",String(s))}}async getOrder(n,o){const t=o?`/id/${n}/matched`:`/id/${n}/unmatched`,s=this.Url.endpoint("orders").endpoint(t);try{const e=await r.Fetcher.get(s);return e.error?r.Err(e.error):e.result?r.Ok(e.result):r.Err("GetOrder: Unexpected error, result is undefined")}catch(e){return r.Err("GetOrder:",String(e))}}async getMatchedOrders(n,o,t){const s=i.ConstructUrl(this.Url.endpoint("orders"),`/user/${n}/matched`,{...t,status:o});try{const e=await r.Fetcher.get(s);return e.error?r.Err(e.error):e.result?r.Ok(e.result):r.Err("GetMatchedOrders: Unexpected error, result is undefined")}catch(e){return r.Err("GetMatchedOrders:",String(e))}}async getUnMatchedOrders(n,o){const t=i.ConstructUrl(this.Url.endpoint("orders"),`/user/${n}/unmatched`,o);try{const s=await r.Fetcher.get(t);return s.error?r.Err(s.error):s.result?r.Ok(s.result):r.Err("GetUnMatchedOrders: Unexpected error, result is undefined")}catch(s){return r.Err("GetUnMatchedOrders:",String(s))}}async getOrders(n,o){const t=n?"/matched":"/unmatched",s=i.ConstructUrl(this.Url.endpoint("orders"),t,o);try{const e=await r.Fetcher.get(s);return e.error?r.Err(e.error):e.result?r.Ok(e.result):r.Err("GetAllOrders: Unexpected error, result is undefined")}catch(e){return r.Err("GetAllOrders:",String(e))}}async subscribeOrders(n,o,t,s,e="all",u){let d=!1;const a=async()=>{if(!d){d=!0;try{const c=o?await this.getMatchedOrders(n,e,u):await this.getUnMatchedOrders(n,u);c.ok?await s(c.val):console.error("Error fetching orders:",c.error)}catch(c){console.error("Error fetching orders:",c)}finally{d=!1}}};await a();const l=setInterval(a,t);return()=>{clearInterval(l)}}async getOrdersCount(n){const o=this.Url.endpoint("orders").endpoint(`/user/${n}/count`);try{const t=await r.Fetcher.get(o);return t.error?r.Err(t.error):t.status===h.ApiStatus.Ok&&t.result!==void 0?r.Ok(t.result):r.Err("GetOrdersCount: Unexpected error, result is undefined")}catch(t){return r.Err("GetOrdersCount:",String(t))}}}exports.Orderbook=O;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("@gardenfi/utils"),i=require("./index6.cjs");class h{constructor(n){this.Url=n}async createOrder(n,o){const t=await o.getAuthHeaders();if(t.error)return r.Err(t.error);try{const s=await r.Fetcher.post(this.Url.endpoint("/relayer").endpoint("create-order"),{body:JSON.stringify(n),headers:{...t.val,"Content-Type":"application/json"}});return s.error?r.Err(s.error):s.result?r.Ok(s.result):r.Err("CreateOrder: Unexpected error, result is undefined")}catch(s){return r.Err("CreateOrder:",String(s))}}async getOrder(n,o){const t=o?`/id/${n}/matched`:`/id/${n}/unmatched`,s=this.Url.endpoint("orders").endpoint(t);try{const e=await r.Fetcher.get(s);return e.error?r.Err(e.error):e.result?r.Ok(e.result):r.Err("GetOrder: Unexpected error, result is undefined")}catch(e){return r.Err("GetOrder:",String(e))}}async getMatchedOrders(n,o,t){const s=i.ConstructUrl(this.Url.endpoint("orders"),`/user/${n}/matched`,{...t,status:o});try{const e=await r.Fetcher.get(s);return e.error?r.Err(e.error):e.result?r.Ok(e.result):r.Err("GetMatchedOrders: Unexpected error, result is undefined")}catch(e){return r.Err("GetMatchedOrders:",String(e))}}async getUnMatchedOrders(n,o){const t=i.ConstructUrl(this.Url.endpoint("orders"),`/user/${n}/unmatched`,o);try{const s=await r.Fetcher.get(t);return s.error?r.Err(s.error):s.result?r.Ok(s.result):r.Err("GetUnMatchedOrders: Unexpected error, result is undefined")}catch(s){return r.Err("GetUnMatchedOrders:",String(s))}}async getOrders(n,o){const t=n?"/matched":"/unmatched",s=i.ConstructUrl(this.Url.endpoint("orders"),t,o);try{const e=await r.Fetcher.get(s);return e.error?r.Err(e.error):e.result?r.Ok(e.result):r.Err("GetAllOrders: Unexpected error, result is undefined")}catch(e){return r.Err("GetAllOrders:",String(e))}}async subscribeOrders(n,o,t,s,e="all",u){let d=!1;const a=async()=>{if(!d){d=!0;try{const c=o?await this.getMatchedOrders(n,e,u):await this.getUnMatchedOrders(n,u);c.ok?await s(c.val):console.error("Error fetching orders:",c.error)}catch(c){console.error("Error fetching orders:",c)}finally{d=!1}}};await a();const l=setInterval(a,t);return()=>{clearInterval(l)}}async getOrdersCount(n){const o=this.Url.endpoint("orders").endpoint(`/user/${n}/count`);try{const t=await r.Fetcher.get(o);return t.error?r.Err(t.error):t.status===r.ApiStatus.Ok&&t.result!==void 0?r.Ok(t.result):r.Err("GetOrdersCount: Unexpected error, result is undefined")}catch(t){return r.Err("GetOrdersCount:",String(t))}}}exports.Orderbook=h;
package/dist/index2.js CHANGED
@@ -1,9 +1,8 @@
1
- import { Err as s, Fetcher as d, Ok as a } from "./index6.js";
2
- import { ApiStatus as f } from "@gardenfi/utils";
3
- import { ConstructUrl as u } from "./index7.js";
4
- class m {
5
- constructor(n) {
6
- this.Url = n;
1
+ import { Err as n, Fetcher as d, Ok as c, ApiStatus as f } from "@gardenfi/utils";
2
+ import { ConstructUrl as u } from "./index6.js";
3
+ class U {
4
+ constructor(s) {
5
+ this.Url = s;
7
6
  }
8
7
  /**
9
8
  * Creates an order
@@ -11,38 +10,38 @@ class m {
11
10
  * @param {IAuth} auth - The auth object.
12
11
  * @returns {string} The create order ID.
13
12
  */
14
- async createOrder(n, o) {
13
+ async createOrder(s, o) {
15
14
  const e = await o.getAuthHeaders();
16
- if (e.error) return s(e.error);
15
+ if (e.error) return n(e.error);
17
16
  try {
18
17
  const t = await d.post(
19
18
  this.Url.endpoint("/relayer").endpoint("create-order"),
20
19
  {
21
- body: JSON.stringify(n),
20
+ body: JSON.stringify(s),
22
21
  headers: {
23
22
  ...e.val,
24
23
  "Content-Type": "application/json"
25
24
  }
26
25
  }
27
26
  );
28
- return t.error ? s(t.error) : t.result ? a(t.result) : s("CreateOrder: Unexpected error, result is undefined");
27
+ return t.error ? n(t.error) : t.result ? c(t.result) : n("CreateOrder: Unexpected error, result is undefined");
29
28
  } catch (t) {
30
- return s("CreateOrder:", String(t));
29
+ return n("CreateOrder:", String(t));
31
30
  }
32
31
  }
33
- async getOrder(n, o) {
34
- const e = o ? `/id/${n}/matched` : `/id/${n}/unmatched`, t = this.Url.endpoint("orders").endpoint(e);
32
+ async getOrder(s, o) {
33
+ const e = o ? `/id/${s}/matched` : `/id/${s}/unmatched`, t = this.Url.endpoint("orders").endpoint(e);
35
34
  try {
36
35
  const r = await d.get(t);
37
- return r.error ? s(r.error) : r.result ? a(r.result) : s("GetOrder: Unexpected error, result is undefined");
36
+ return r.error ? n(r.error) : r.result ? c(r.result) : n("GetOrder: Unexpected error, result is undefined");
38
37
  } catch (r) {
39
- return s("GetOrder:", String(r));
38
+ return n("GetOrder:", String(r));
40
39
  }
41
40
  }
42
- async getMatchedOrders(n, o, e) {
41
+ async getMatchedOrders(s, o, e) {
43
42
  const t = u(
44
43
  this.Url.endpoint("orders"),
45
- `/user/${n}/matched`,
44
+ `/user/${s}/matched`,
46
45
  {
47
46
  ...e,
48
47
  status: o
@@ -52,51 +51,51 @@ class m {
52
51
  const r = await d.get(
53
52
  t
54
53
  );
55
- return r.error ? s(r.error) : r.result ? a(r.result) : s("GetMatchedOrders: Unexpected error, result is undefined");
54
+ return r.error ? n(r.error) : r.result ? c(r.result) : n("GetMatchedOrders: Unexpected error, result is undefined");
56
55
  } catch (r) {
57
- return s("GetMatchedOrders:", String(r));
56
+ return n("GetMatchedOrders:", String(r));
58
57
  }
59
58
  }
60
- async getUnMatchedOrders(n, o) {
59
+ async getUnMatchedOrders(s, o) {
61
60
  const e = u(
62
61
  this.Url.endpoint("orders"),
63
- `/user/${n}/unmatched`,
62
+ `/user/${s}/unmatched`,
64
63
  o
65
64
  );
66
65
  try {
67
66
  const t = await d.get(
68
67
  e
69
68
  );
70
- return t.error ? s(t.error) : t.result ? a(t.result) : s("GetUnMatchedOrders: Unexpected error, result is undefined");
69
+ return t.error ? n(t.error) : t.result ? c(t.result) : n("GetUnMatchedOrders: Unexpected error, result is undefined");
71
70
  } catch (t) {
72
- return s("GetUnMatchedOrders:", String(t));
71
+ return n("GetUnMatchedOrders:", String(t));
73
72
  }
74
73
  }
75
- async getOrders(n, o) {
76
- const e = n ? "/matched" : "/unmatched", t = u(
74
+ async getOrders(s, o) {
75
+ const e = s ? "/matched" : "/unmatched", t = u(
77
76
  this.Url.endpoint("orders"),
78
77
  e,
79
78
  o
80
79
  );
81
80
  try {
82
81
  const r = await d.get(t);
83
- return r.error ? s(r.error) : r.result ? a(r.result) : s("GetAllOrders: Unexpected error, result is undefined");
82
+ return r.error ? n(r.error) : r.result ? c(r.result) : n("GetAllOrders: Unexpected error, result is undefined");
84
83
  } catch (r) {
85
- return s("GetAllOrders:", String(r));
84
+ return n("GetAllOrders:", String(r));
86
85
  }
87
86
  }
88
- async subscribeOrders(n, o, e, t, r = "all", l) {
87
+ async subscribeOrders(s, o, e, t, r = "all", l) {
89
88
  let i = !1;
90
89
  const h = async () => {
91
90
  if (!i) {
92
91
  i = !0;
93
92
  try {
94
- const c = o ? await this.getMatchedOrders(n, r, l) : await this.getUnMatchedOrders(n, l);
95
- c.ok ? await t(
96
- c.val
97
- ) : console.error("Error fetching orders:", c.error);
98
- } catch (c) {
99
- console.error("Error fetching orders:", c);
93
+ const a = o ? await this.getMatchedOrders(s, r, l) : await this.getUnMatchedOrders(s, l);
94
+ a.ok ? await t(
95
+ a.val
96
+ ) : console.error("Error fetching orders:", a.error);
97
+ } catch (a) {
98
+ console.error("Error fetching orders:", a);
100
99
  } finally {
101
100
  i = !1;
102
101
  }
@@ -108,16 +107,16 @@ class m {
108
107
  clearInterval(O);
109
108
  };
110
109
  }
111
- async getOrdersCount(n) {
112
- const o = this.Url.endpoint("orders").endpoint(`/user/${n}/count`);
110
+ async getOrdersCount(s) {
111
+ const o = this.Url.endpoint("orders").endpoint(`/user/${s}/count`);
113
112
  try {
114
113
  const e = await d.get(o);
115
- return e.error ? s(e.error) : e.status === f.Ok && e.result !== void 0 ? a(e.result) : s("GetOrdersCount: Unexpected error, result is undefined");
114
+ return e.error ? n(e.error) : e.status === f.Ok && e.result !== void 0 ? c(e.result) : n("GetOrdersCount: Unexpected error, result is undefined");
116
115
  } catch (e) {
117
- return s("GetOrdersCount:", String(e));
116
+ return n("GetOrdersCount:", String(e));
118
117
  }
119
118
  }
120
119
  }
121
120
  export {
122
- m as Orderbook
121
+ U as Orderbook
123
122
  };
package/dist/index4.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("./index6.cjs"),l=require("@gardenfi/utils"),d=require("./index7.cjs");class O{constructor(s){this.url=new l.Url("/orders",s)}async getOrder(s,c){const t=c?`/id/matched/${s}`:`/id/unmatched/${s}`,n=this.url.endpoint(t);try{const e=await r.Fetcher.get(n);return e.error?r.Err(e.error):e.result?r.Ok(e.result):r.Err("GetOrder: Unexpected error, result is undefined")}catch(e){return r.Err("GetOrder:",String(e))}}async getMatchedOrders(s,c,t){const n=d.ConstructUrl(this.url,`/user/matched/${s}`,{...t,pending:c});try{const e=await r.Fetcher.get(n);return e.error?r.Err(e.error):e.result?r.Ok(e.result):r.Err("GetMatchedOrders: Unexpected error, result is undefined")}catch(e){return r.Err("GetMatchedOrders:",String(e))}}async getUnMatchedOrders(s,c){const t=d.ConstructUrl(this.url,`/user/unmatched/${s}`,c);try{const n=await r.Fetcher.get(t);return n.error?r.Err(n.error):n.result?r.Ok(n.result):r.Err("GetUnMatchedOrders: Unexpected error, result is undefined")}catch(n){return r.Err("GetUnMatchedOrders:",String(n))}}async getOrders(s,c){const t=s?"/matched":"/unmatched",n=d.ConstructUrl(this.url,t,c);try{const e=await r.Fetcher.get(n);return e.error?r.Err(e.error):e.result?r.Ok(e.result):r.Err("GetAllOrders: Unexpected error, result is undefined")}catch(e){return r.Err("GetAllOrders:",String(e))}}async subscribeOrders(s,c,t,n,e=!1,i){let o=!1;const a=async()=>{if(!o){o=!0;try{const u=c?await this.getMatchedOrders(s,e,i):await this.getUnMatchedOrders(s,i);u.ok?await n(u.val):console.error("Error fetching orders:",u.error)}catch(u){console.error("Error fetching orders:",u)}finally{o=!1}}};await a();const h=setInterval(a,t);return()=>{clearInterval(h)}}async getOrdersCount(s){const c=this.url.endpoint(`/user/count/${s}`);try{const t=await r.Fetcher.get(c);return t.error?r.Err(t.error):t.status===l.ApiStatus.Ok&&t.result!==void 0?r.Ok(t.result):r.Err("GetOrdersCount: Unexpected error, result is undefined")}catch(t){return r.Err("GetOrdersCount:",String(t))}}}exports.OrdersProvider=O;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("@gardenfi/utils"),d=require("./index6.cjs");class h{constructor(s){this.url=new r.Url("/orders",s)}async getOrder(s,c){const t=c?`/id/matched/${s}`:`/id/unmatched/${s}`,n=this.url.endpoint(t);try{const e=await r.Fetcher.get(n);return e.error?r.Err(e.error):e.result?r.Ok(e.result):r.Err("GetOrder: Unexpected error, result is undefined")}catch(e){return r.Err("GetOrder:",String(e))}}async getMatchedOrders(s,c,t){const n=d.ConstructUrl(this.url,`/user/matched/${s}`,{...t,pending:c});try{const e=await r.Fetcher.get(n);return e.error?r.Err(e.error):e.result?r.Ok(e.result):r.Err("GetMatchedOrders: Unexpected error, result is undefined")}catch(e){return r.Err("GetMatchedOrders:",String(e))}}async getUnMatchedOrders(s,c){const t=d.ConstructUrl(this.url,`/user/unmatched/${s}`,c);try{const n=await r.Fetcher.get(t);return n.error?r.Err(n.error):n.result?r.Ok(n.result):r.Err("GetUnMatchedOrders: Unexpected error, result is undefined")}catch(n){return r.Err("GetUnMatchedOrders:",String(n))}}async getOrders(s,c){const t=s?"/matched":"/unmatched",n=d.ConstructUrl(this.url,t,c);try{const e=await r.Fetcher.get(n);return e.error?r.Err(e.error):e.result?r.Ok(e.result):r.Err("GetAllOrders: Unexpected error, result is undefined")}catch(e){return r.Err("GetAllOrders:",String(e))}}async subscribeOrders(s,c,t,n,e=!1,i){let o=!1;const a=async()=>{if(!o){o=!0;try{const u=c?await this.getMatchedOrders(s,e,i):await this.getUnMatchedOrders(s,i);u.ok?await n(u.val):console.error("Error fetching orders:",u.error)}catch(u){console.error("Error fetching orders:",u)}finally{o=!1}}};await a();const l=setInterval(a,t);return()=>{clearInterval(l)}}async getOrdersCount(s){const c=this.url.endpoint(`/user/count/${s}`);try{const t=await r.Fetcher.get(c);return t.error?r.Err(t.error):t.status===r.ApiStatus.Ok&&t.result!==void 0?r.Ok(t.result):r.Err("GetOrdersCount: Unexpected error, result is undefined")}catch(t){return r.Err("GetOrdersCount:",String(t))}}}exports.OrdersProvider=h;
package/dist/index4.js CHANGED
@@ -1,12 +1,11 @@
1
- import { Fetcher as u, Err as s, Ok as d } from "./index6.js";
2
- import { Url as f, ApiStatus as g } from "@gardenfi/utils";
3
- import { ConstructUrl as i } from "./index7.js";
4
- class w {
1
+ import { Url as f, Fetcher as u, Err as s, Ok as d, ApiStatus as g } from "@gardenfi/utils";
2
+ import { ConstructUrl as i } from "./index6.js";
3
+ class m {
5
4
  constructor(t) {
6
5
  this.url = new f("/orders", t);
7
6
  }
8
- async getOrder(t, o) {
9
- const e = o ? `/id/matched/${t}` : `/id/unmatched/${t}`, n = this.url.endpoint(e);
7
+ async getOrder(t, c) {
8
+ const e = c ? `/id/matched/${t}` : `/id/unmatched/${t}`, n = this.url.endpoint(e);
10
9
  try {
11
10
  const r = await u.get(n);
12
11
  return r.error ? s(r.error) : r.result ? d(r.result) : s("GetOrder: Unexpected error, result is undefined");
@@ -14,10 +13,10 @@ class w {
14
13
  return s("GetOrder:", String(r));
15
14
  }
16
15
  }
17
- async getMatchedOrders(t, o, e) {
16
+ async getMatchedOrders(t, c, e) {
18
17
  const n = i(this.url, `/user/matched/${t}`, {
19
18
  ...e,
20
- pending: o
19
+ pending: c
21
20
  });
22
21
  try {
23
22
  const r = await u.get(
@@ -28,11 +27,11 @@ class w {
28
27
  return s("GetMatchedOrders:", String(r));
29
28
  }
30
29
  }
31
- async getUnMatchedOrders(t, o) {
30
+ async getUnMatchedOrders(t, c) {
32
31
  const e = i(
33
32
  this.url,
34
33
  `/user/unmatched/${t}`,
35
- o
34
+ c
36
35
  );
37
36
  try {
38
37
  const n = await u.get(
@@ -43,8 +42,8 @@ class w {
43
42
  return s("GetUnMatchedOrders:", String(n));
44
43
  }
45
44
  }
46
- async getOrders(t, o) {
47
- const e = t ? "/matched" : "/unmatched", n = i(this.url, e, o);
45
+ async getOrders(t, c) {
46
+ const e = t ? "/matched" : "/unmatched", n = i(this.url, e, c);
48
47
  try {
49
48
  const r = await u.get(n);
50
49
  return r.error ? s(r.error) : r.result ? d(r.result) : s("GetAllOrders: Unexpected error, result is undefined");
@@ -52,18 +51,18 @@ class w {
52
51
  return s("GetAllOrders:", String(r));
53
52
  }
54
53
  }
55
- async subscribeOrders(t, o, e, n, r = !1, l) {
54
+ async subscribeOrders(t, c, e, n, r = !1, l) {
56
55
  let a = !1;
57
56
  const h = async () => {
58
57
  if (!a) {
59
58
  a = !0;
60
59
  try {
61
- const c = o ? await this.getMatchedOrders(t, r, l) : await this.getUnMatchedOrders(t, l);
62
- c.ok ? await n(
63
- c.val
64
- ) : console.error("Error fetching orders:", c.error);
65
- } catch (c) {
66
- console.error("Error fetching orders:", c);
60
+ const o = c ? await this.getMatchedOrders(t, r, l) : await this.getUnMatchedOrders(t, l);
61
+ o.ok ? await n(
62
+ o.val
63
+ ) : console.error("Error fetching orders:", o.error);
64
+ } catch (o) {
65
+ console.error("Error fetching orders:", o);
67
66
  } finally {
68
67
  a = !1;
69
68
  }
@@ -76,9 +75,9 @@ class w {
76
75
  };
77
76
  }
78
77
  async getOrdersCount(t) {
79
- const o = this.url.endpoint(`/user/count/${t}`);
78
+ const c = this.url.endpoint(`/user/count/${t}`);
80
79
  try {
81
- const e = await u.get(o);
80
+ const e = await u.get(c);
82
81
  return e.error ? s(e.error) : e.status === g.Ok && e.result !== void 0 ? d(e.result) : s("GetOrdersCount: Unexpected error, result is undefined");
83
82
  } catch (e) {
84
83
  return s("GetOrdersCount:", String(e));
@@ -86,5 +85,5 @@ class w {
86
85
  }
87
86
  }
88
87
  export {
89
- w as OrdersProvider
88
+ m as OrdersProvider
90
89
  };
package/dist/index5.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./index3.cjs"),i={id:1001,name:"Starknet Localnet",nativeCurrency:{name:"Stark Token",symbol:"STRK",decimals:18},rpcUrls:{default:{http:["http://127.0.0.1:8547/"]}},testnet:!0},c={id:31338,name:"Arbitrum Localnet",nativeCurrency:{name:"Ethereum",symbol:"ETH",decimals:18},rpcUrls:{default:{http:["http://localhost:8546/"]}},testnet:!0},d={id:31337,name:"Ethereum Localnet",nativeCurrency:{name:"Ethereum",symbol:"ETH",decimals:18},rpcUrls:{default:{http:["http://localhost:8545/"]}},testnet:!0},o={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"},t={name:"WBTC Ethereum Localnet",decimals:8,symbol:"WBTC",chain:e.Chains.ethereum_localnet,atomicSwapAddress:"0xe7f1725E7734CE288F8367e1Bb143E90bb3F0512",tokenAddress:"0x5FbDB2315678afecb367f032d93F642f64180aa3"},s={name:"STRK Starknet Localnet",decimals:18,symbol:"STRK",chain:e.Chains.starknet_devnet,atomicSwapAddress:"0x15cf8b127aa850c97ed10de6f8b300cabc4f09232a57e63667af02fdef8a55a",tokenAddress:"0x51aa025f1c9948790113e4ebea826dee24542bc50902076c05892774210e8d2"},n={name:"ETH Starknet Localnet",decimals:18,symbol:"ETH",chain:e.Chains.starknet_devnet,atomicSwapAddress:"0x1890470168440bbb9df50988748924a74ea22de10d22a081e458737b9574e75",tokenAddress:"0x51aa025f1c9948790113e4ebea826dee24542bc50902076c05892774210e8d2"},m={localnet:{arbitrum_localnet_WBTC:a,ethereum_localnet_WBTC:t,starknet_localnet_STRK:s,starknet_localnet_ETH:n},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:"0x8219B871534F29ff7434519287131a875e0D8eCa",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:"0xbaFb499B60F9E30fd82A54342cb7695C92F5B527",atomicSwapAddress:"0xbcdad29ac77e5bb27fd528ab0045af630259fe4f"},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"},citrea_testnet_cBTC:{name:"Citrea Bitcoin",decimals:18,symbol:"cBTC",chain:e.Chains.citrea_testnet,logo:"https://garden-finance.imgix.net/token-images/bitcoin.svg",tokenAddress:"0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE",atomicSwapAddress:"0x6218FA00f47a61aCD8B46D6f1b15c4D730F803F2"},starknet_testnet_WBTC:{name:"Wrapped Bitcoin",decimals:8,symbol:"WBTC",chain:e.Chains.starknet_sepolia,logo:"https://garden-finance.imgix.net/token-images/wbtc.svg",tokenAddress:"0x496bef3ed20371382fbe0ca6a5a64252c5c848f9f1f0cccf8110fc4def912d5",atomicSwapAddress:"0x06579d255314109429a4477d89629bc2b94f529ae01979c2f8014f9246482603"},monad_testnet_cbBTC:{name:"Coinbase Bitcoin",decimals:8,symbol:"cbBTC",chain:e.Chains.monad_testnet,logo:"https://garden-finance.imgix.net/token-images/cbBTC.svg",tokenAddress:"0xaD9d14CA82d9BF97fFf745fFC7d48172A1c0969E",atomicSwapAddress:"0x1dC94FdcAd8Aee13cfd34Db8a26d26E31572805c"},monad_testnet_USDC:{name:"USD Coin",decimals:6,symbol:"USDC",chain:e.Chains.monad_testnet,logo:"https://garden-finance.imgix.net/token-images/usdc.svg",tokenAddress:"0x00ab86f54F436CfE15253845F139955ae0C00bAf",atomicSwapAddress:"0xE99D8A21d4F2ad2f90c279c869311503f9e25867"}},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"},bera_LBTC:{name:"Lombard Bitcoin",decimals:8,symbol:"LBTC",chain:e.Chains.bera,logo:"https://garden-finance.imgix.net/token-images/LBTC.svg",tokenAddress:"0xecAc9C5F704e954931349Da37F60E39f515c11c1",atomicSwapAddress:"0x39f3294352208905fc6ebf033954E6c6455CdB4C"},hyperliquid_uBTC:{name:"Unit Bitcoin",decimals:8,symbol:"uBTC",chain:e.Chains.hyperliquid,tokenAddress:"0x9FDBdA0A5e284c32744D2f17Ee5c74B284993463",atomicSwapAddress:"0x39f3294352208905fc6ebf033954E6c6455CdB4C"},starknet_WBTC:{name:"Wrapped Bitcoin",decimals:8,symbol:"WBTC",chain:e.Chains.starknet,logo:"https://garden-finance.imgix.net/token-images/wbtc.svg",tokenAddress:"0x3fe2b97c1fd336e750087d68b9b867997fd64a2661ff3ca5a7c771641e8e7ac",atomicSwapAddress:"0x7defd8eb3b770005ab1ca5f89ad31f98fb5bc3c52deaeafd130be3b49f967b4"},unichain_USDC:{name:"USD Coin",decimals:6,symbol:"USDC",chain:e.Chains.unichain,logo:"https://garden-finance.imgix.net/token-images/usdc.svg",tokenAddress:"0x078D782b760474a361dDA0AF3839290b0EF57AD6",atomicSwapAddress:"0x795Dcb58d1cd4789169D5F938Ea05E17ecEB68cA"},corn_BTCN:{name:"Bitcorn",decimals:18,symbol:"BTCN",chain:e.Chains.corn,logo:"https://garden-finance.imgix.net/token-images/bitcorn.jpg",tokenAddress:"0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE",atomicSwapAddress:"0xeaE7721d779276eb0f5837e2fE260118724a2Ba4"},botanix_BOTX:{name:"Botanix",decimals:18,symbol:"BTC",chain:e.Chains.botanix,logo:"https://garden-finance.imgix.net/chain_images/BotanixLogo.svg",tokenAddress:"0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE",atomicSwapAddress:"0x39f3294352208905fc6ebf033954E6c6455CdB4C"}}};exports.ArbitrumLocalnet=c;exports.ETHStarknetLocalnetAsset=n;exports.EthereumLocalnet=d;exports.STRKStarknetLocalnetAsset=s;exports.StarknetLocalnet=i;exports.SupportedAssets=m;exports.WBTCArbitrumLocalnetAsset=a;exports.WBTCEthereumLocalnetAsset=t;exports.bitcoinRegtestAsset=o;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./index3.cjs"),i={id:1001,name:"Starknet Localnet",nativeCurrency:{name:"Stark Token",symbol:"STRK",decimals:18},rpcUrls:{default:{http:["http://127.0.0.1:8547/"]}},testnet:!0},c={id:31338,name:"Arbitrum Localnet",nativeCurrency:{name:"Ethereum",symbol:"ETH",decimals:18},rpcUrls:{default:{http:["http://localhost:8546/"]}},testnet:!0},d={id:31337,name:"Ethereum Localnet",nativeCurrency:{name:"Ethereum",symbol:"ETH",decimals:18},rpcUrls:{default:{http:["http://localhost:8545/"]}},testnet:!0},o={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"},t={name:"WBTC Ethereum Localnet",decimals:8,symbol:"WBTC",chain:e.Chains.ethereum_localnet,atomicSwapAddress:"0xe7f1725E7734CE288F8367e1Bb143E90bb3F0512",tokenAddress:"0x5FbDB2315678afecb367f032d93F642f64180aa3"},s={name:"STRK Starknet Localnet",decimals:18,symbol:"STRK",chain:e.Chains.starknet_devnet,atomicSwapAddress:"0x15cf8b127aa850c97ed10de6f8b300cabc4f09232a57e63667af02fdef8a55a",tokenAddress:"0x51aa025f1c9948790113e4ebea826dee24542bc50902076c05892774210e8d2"},n={name:"ETH Starknet Localnet",decimals:18,symbol:"ETH",chain:e.Chains.starknet_devnet,atomicSwapAddress:"0x1890470168440bbb9df50988748924a74ea22de10d22a081e458737b9574e75",tokenAddress:"0x51aa025f1c9948790113e4ebea826dee24542bc50902076c05892774210e8d2"},m={localnet:{arbitrum_localnet_WBTC:a,ethereum_localnet_WBTC:t,starknet_localnet_STRK:s,starknet_localnet_ETH:n},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:"0xE918A5a47b8e0AFAC2382bC5D1e981613e63fB07"},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:"0xB47716a220C319b25a532594511D63EC68702CEf"},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:"0x88e1032252c712681A3659986F452E910D2134D8"},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:"0xbaFb499B60F9E30fd82A54342cb7695C92F5B527",atomicSwapAddress:"0xbcdad29ac77e5bb27fd528ab0045af630259fe4f"},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"},citrea_testnet_cBTC:{name:"Citrea Bitcoin",decimals:18,symbol:"cBTC",chain:e.Chains.citrea_testnet,logo:"https://garden-finance.imgix.net/token-images/bitcoin.svg",tokenAddress:"0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE",atomicSwapAddress:"0x6218FA00f47a61aCD8B46D6f1b15c4D730F803F2"},starknet_testnet_WBTC:{name:"Wrapped Bitcoin",decimals:8,symbol:"WBTC",chain:e.Chains.starknet_sepolia,logo:"https://garden-finance.imgix.net/token-images/wbtc.svg",tokenAddress:"0x496bef3ed20371382fbe0ca6a5a64252c5c848f9f1f0cccf8110fc4def912d5",atomicSwapAddress:"0x06579d255314109429a4477d89629bc2b94f529ae01979c2f8014f9246482603"},monad_testnet_cbBTC:{name:"Coinbase Bitcoin",decimals:8,symbol:"cbBTC",chain:e.Chains.monad_testnet,logo:"https://garden-finance.imgix.net/token-images/cbBTC.svg",tokenAddress:"0xaD9d14CA82d9BF97fFf745fFC7d48172A1c0969E",atomicSwapAddress:"0x1dC94FdcAd8Aee13cfd34Db8a26d26E31572805c"},monad_testnet_USDC:{name:"USD Coin",decimals:6,symbol:"USDC",chain:e.Chains.monad_testnet,logo:"https://garden-finance.imgix.net/token-images/usdc.svg",tokenAddress:"0x00ab86f54F436CfE15253845F139955ae0C00bAf",atomicSwapAddress:"0xE99D8A21d4F2ad2f90c279c869311503f9e25867"}},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"},bera_LBTC:{name:"Lombard Bitcoin",decimals:8,symbol:"LBTC",chain:e.Chains.bera,logo:"https://garden-finance.imgix.net/token-images/LBTC.svg",tokenAddress:"0xecAc9C5F704e954931349Da37F60E39f515c11c1",atomicSwapAddress:"0x39f3294352208905fc6ebf033954E6c6455CdB4C"},hyperliquid_uBTC:{name:"Unit Bitcoin",decimals:8,symbol:"uBTC",chain:e.Chains.hyperliquid,tokenAddress:"0x9FDBdA0A5e284c32744D2f17Ee5c74B284993463",atomicSwapAddress:"0x39f3294352208905fc6ebf033954E6c6455CdB4C"},starknet_WBTC:{name:"Wrapped Bitcoin",decimals:8,symbol:"WBTC",chain:e.Chains.starknet,logo:"https://garden-finance.imgix.net/token-images/wbtc.svg",tokenAddress:"0x3fe2b97c1fd336e750087d68b9b867997fd64a2661ff3ca5a7c771641e8e7ac",atomicSwapAddress:"0x7defd8eb3b770005ab1ca5f89ad31f98fb5bc3c52deaeafd130be3b49f967b4"},unichain_USDC:{name:"USD Coin",decimals:6,symbol:"USDC",chain:e.Chains.unichain,logo:"https://garden-finance.imgix.net/token-images/usdc.svg",tokenAddress:"0x078D782b760474a361dDA0AF3839290b0EF57AD6",atomicSwapAddress:"0x795Dcb58d1cd4789169D5F938Ea05E17ecEB68cA"},corn_BTCN:{name:"Bitcorn",decimals:18,symbol:"BTCN",chain:e.Chains.corn,logo:"https://garden-finance.imgix.net/token-images/bitcorn.jpg",tokenAddress:"0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE",atomicSwapAddress:"0xeaE7721d779276eb0f5837e2fE260118724a2Ba4"},botanix_BOTX:{name:"Botanix",decimals:18,symbol:"BTC",chain:e.Chains.botanix,logo:"https://garden-finance.imgix.net/chain_images/BotanixLogo.svg",tokenAddress:"0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE",atomicSwapAddress:"0x39f3294352208905fc6ebf033954E6c6455CdB4C"}}};exports.ArbitrumLocalnet=c;exports.ETHStarknetLocalnetAsset=n;exports.EthereumLocalnet=d;exports.STRKStarknetLocalnetAsset=s;exports.StarknetLocalnet=i;exports.SupportedAssets=m;exports.WBTCArbitrumLocalnetAsset=a;exports.WBTCEthereumLocalnetAsset=t;exports.bitcoinRegtestAsset=o;
package/dist/index5.js CHANGED
@@ -108,7 +108,7 @@ const c = {
108
108
  logo: "https://garden-finance.imgix.net/token-images/wbtc.svg",
109
109
  chain: e.arbitrum_sepolia,
110
110
  tokenAddress: "0x00ab86f54F436CfE15253845F139955ae0C00bAf",
111
- atomicSwapAddress: "0x1cd0bBd55fD66B4C5F7dfE434eFD009C09e628d1"
111
+ atomicSwapAddress: "0xE918A5a47b8e0AFAC2382bC5D1e981613e63fB07"
112
112
  },
113
113
  arbitrum_sepolia_SEED: {
114
114
  name: "Seed",
@@ -117,7 +117,7 @@ const c = {
117
117
  chain: e.arbitrum_sepolia,
118
118
  logo: "https://garden-finance.imgix.net/token-images/seed.svg",
119
119
  tokenAddress: "0x13DCec0762EcC5E666c207ab44Dc768e5e33070F",
120
- atomicSwapAddress: "0xD5FeDb4ceCB0F1D32788a190d9EB47D94D23eE4e"
120
+ atomicSwapAddress: "0xB47716a220C319b25a532594511D63EC68702CEf"
121
121
  },
122
122
  arbitrum_sepolia_iBTC: {
123
123
  name: "iBTC",
@@ -125,8 +125,8 @@ const c = {
125
125
  symbol: "iBTC",
126
126
  chain: e.arbitrum_sepolia,
127
127
  logo: "https://garden-finance.imgix.net/token-images/dlcBTCIcon.svg",
128
- tokenAddress: "0x8219B871534F29ff7434519287131a875e0D8eCa",
129
- atomicSwapAddress: "0xdfe6d9363ee96152d39391009a6723819d9e25eb"
128
+ tokenAddress: "0x685437f025c5f33A94818408C286bc1F023201Fc",
129
+ atomicSwapAddress: "0x88e1032252c712681A3659986F452E910D2134D8"
130
130
  },
131
131
  base_sepolia_WBTC: {
132
132
  name: "Wrapped Bitcoin",
package/dist/index6.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});var p=(a,t,e)=>{if(!t.has(a))throw TypeError("Cannot "+e)},u=(a,t,e)=>(p(a,t,"read from private field"),e?e.call(a):t.get(a)),w=(a,t,e)=>{if(t.has(a))throw TypeError("Cannot add the same private member more than once");t instanceof WeakSet?t.add(a):t.set(a,e)},f=(a,t,e,r)=>(p(a,t,"write to private field"),t.set(a,e),e);const d=a=>new Promise(t=>setTimeout(t,a));class g{constructor(t,e){this.maxRetries=Math.max(t,0),this.delay=e}async retry(t){let e=0,r;for(;e<this.maxRetries+1;)try{return await t()}catch(i){e++,r=i,await d(this.delay*e)}throw r}}const v=a=>{try{return JSON.parse(a)}catch{return a}};class m{static async _postWithFallback(t,e){let r="";for(const i of t)try{const s=await fetch(i,{method:"POST",...e});if(s.status>=500){r=await(s.text()||s.json());continue}return await this.parse(s)}catch(s){r=y(s);continue}throw new Error(r||"All APIs failed")}static async postWithFallback(t,e){return await n(e).retry(()=>this._postWithFallback(t,e))}static async _getWithFallback(t,e){let r="";for(const i of t)try{const s=await fetch(i,e);if(s.status>=500){r=await(s.text()||s.json());continue}return await this.parse(s)}catch(s){r=y(s);continue}throw new Error(r||"All APIs failed")}static async getWithFallback(t,e){return await n(e).retry(()=>this._getWithFallback(t,e))}static async _get(t,e){return await this.parse(await fetch(t,e))}static async get(t,e){return await n(e).retry(()=>this._get(t,e))}static async _post(t,e){return await this.parse(await fetch(t,{method:"POST",...e}))}static async post(t,e){return await n(e).retry(()=>this._post(t,e))}static async parse(t){const e=await t.text();if(t.status>=200&&t.status<300)return v(e);throw new Error(e)}}function y(a){return(a==null?void 0:a.message)||(a==null?void 0:a.toString())||"unknown error"}const n=a=>new g((a==null?void 0:a.retryCount)??2,(a==null?void 0:a.retryDelay)??1e3);var o,c,l;class h{constructor(t,e,r=void 0){w(this,o,void 0),w(this,c,void 0),w(this,l,void 0),f(this,o,t),f(this,l,r),f(this,c,e)}get ok(){return u(this,o)}get error(){return u(this,l)}get val(){return u(this,c)}}o=new WeakMap,c=new WeakMap,l=new WeakMap;const k=a=>new h(!0,a),W=(a,...t)=>{if(typeof a=="string"&&t&&t.length>0){let e=[a,...t].map(r=>{if(r){if(r instanceof Error)return r.message;if(typeof r=="string")return r;if(r!=null&&r.toString)return r.toString()}});return new h(!1,null,e.filter(r=>r!==void 0).join(" "))}return new h(!1,null,a)};exports.Err=W;exports.Fetcher=m;exports.Ok=k;exports.Result=h;exports.Retry=g;exports.safeParseJson=v;exports.sleep=d;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=(n,o,t)=>{const r=n.endpoint(o);return t&&Object.entries(t).forEach(([c,e])=>{e!==void 0&&r.searchParams.append(c,e.toString())}),r};exports.ConstructUrl=i;
package/dist/index6.js CHANGED
@@ -1,190 +1,9 @@
1
- var p = (e, t, a) => {
2
- if (!t.has(e))
3
- throw TypeError("Cannot " + a);
4
- }, h = (e, t, a) => (p(e, t, "read from private field"), a ? a.call(e) : t.get(e)), u = (e, t, a) => {
5
- if (t.has(e))
6
- throw TypeError("Cannot add the same private member more than once");
7
- t instanceof WeakSet ? t.add(e) : t.set(e, a);
8
- }, w = (e, t, a, r) => (p(e, t, "write to private field"), t.set(e, a), a);
9
- const d = (e) => new Promise((t) => setTimeout(t, e));
10
- class g {
11
- /**
12
- * @param {number} maxRetries - The maximum number of retries, if less < 0 then it is set to 0
13
- * @param {number} delay - The delay between retries
14
- */
15
- constructor(t, a) {
16
- this.maxRetries = Math.max(t, 0), this.delay = a;
17
- }
18
- /**
19
- * Retries a function until it succeeds or the max number of retries is reached
20
- *
21
- * @param {() => Promise<T>} fn - The function to retry
22
- * @return {Promise<T>} a Promise that resolves to the result of the function
23
- */
24
- async retry(t) {
25
- let a = 0, r;
26
- for (; a < this.maxRetries + 1; )
27
- try {
28
- return await t();
29
- } catch (i) {
30
- a++, r = i, await d(this.delay * a);
31
- }
32
- throw r;
33
- }
34
- }
35
- const v = (e) => {
36
- try {
37
- return JSON.parse(e);
38
- } catch {
39
- return e;
40
- }
41
- };
42
- class m {
43
- static async _postWithFallback(t, a) {
44
- let r = "";
45
- for (const i of t)
46
- try {
47
- const s = await fetch(i, {
48
- method: "POST",
49
- ...a
50
- });
51
- if (s.status >= 500) {
52
- r = await (s.text() || s.json());
53
- continue;
54
- }
55
- return await this.parse(s);
56
- } catch (s) {
57
- r = y(s);
58
- continue;
59
- }
60
- throw new Error(r || "All APIs failed");
61
- }
62
- /**
63
- * Asynchronously sends a POST request to multiple URLs with fallback logic.
64
- *
65
- * @param {string[]} input - array of URLs to send the POST request to
66
- * @param {RequestInit} [init] - optional request initialization options
67
- * @return {Promise<T>} a Promise that resolves to the parsed response data
68
- */
69
- static async postWithFallback(t, a) {
70
- return await n(a).retry(
71
- () => this._postWithFallback(t, a)
72
- );
73
- }
74
- static async _getWithFallback(t, a) {
75
- let r = "";
76
- for (const i of t)
77
- try {
78
- const s = await fetch(i, a);
79
- if (s.status >= 500) {
80
- r = await (s.text() || s.json());
81
- continue;
82
- }
83
- return await this.parse(s);
84
- } catch (s) {
85
- r = y(s);
86
- continue;
87
- }
88
- throw new Error(r || "All APIs failed");
89
- }
90
- /**
91
- * Asynchronously sends a POST request to multiple URLs with fallback mechanism.
92
- *
93
- * @param {string[]} input - An array of URLs to retrieve data from.
94
- * @param {RequestInit} [init] - Optional request options.
95
- * @return {Promise<T>} A promise that resolves to the retrieved data.
96
- */
97
- static async getWithFallback(t, a) {
98
- return await n(a).retry(
99
- () => this._getWithFallback(t, a)
100
- );
101
- }
102
- static async _get(t, a) {
103
- return await this.parse(await fetch(t, a));
104
- }
105
- /**
106
- * Asynchronously retrieves data of type T from the specified URL or RequestInfo, with optional initialization options.
107
- *
108
- * @param {RequestInfo | URL} input - The URL or RequestInfo to fetch data from
109
- * @param {RequestInit} init - Optional initialization options for the fetch request
110
- * @return {Promise<T>} The retrieved data of type T
111
- */
112
- static async get(t, a) {
113
- return await n(a).retry(() => this._get(t, a));
114
- }
115
- static async _post(t, a) {
116
- return await this.parse(
117
- await fetch(t, {
118
- method: "POST",
119
- ...a
120
- })
121
- );
122
- }
123
- /**
124
- * Asynchronously sends a POST request to the specified URL or RequestInfo, with optional initialization options.
125
- */
126
- static async post(t, a) {
127
- return await n(a).retry(() => this._post(t, a));
128
- }
129
- /**
130
- * Parses the response and returns the result as the specified type.
131
- *
132
- * @param {Response} res - the response object to be parsed
133
- * @return {Promise<T>} the parsed result of type T
134
- */
135
- static async parse(t) {
136
- const a = await t.text();
137
- if (t.status >= 200 && t.status < 300)
138
- return v(a);
139
- throw new Error(a);
140
- }
141
- }
142
- function y(e) {
143
- return (e == null ? void 0 : e.message) || (e == null ? void 0 : e.toString()) || "unknown error";
144
- }
145
- const n = (e) => new g((e == null ? void 0 : e.retryCount) ?? 2, (e == null ? void 0 : e.retryDelay) ?? 1e3);
146
- var o, c, l;
147
- class f {
148
- constructor(t, a, r = void 0) {
149
- u(this, o, void 0), u(this, c, void 0), u(this, l, void 0), w(this, o, t), w(this, l, r), w(this, c, a);
150
- }
151
- get ok() {
152
- return h(this, o);
153
- }
154
- get error() {
155
- return h(this, l);
156
- }
157
- get val() {
158
- return h(this, c);
159
- }
160
- }
161
- o = /* @__PURE__ */ new WeakMap(), c = /* @__PURE__ */ new WeakMap(), l = /* @__PURE__ */ new WeakMap();
162
- const k = (e) => new f(!0, e), W = (e, ...t) => {
163
- if (typeof e == "string" && t && t.length > 0) {
164
- let a = [e, ...t].map((r) => {
165
- if (r) {
166
- if (r instanceof Error)
167
- return r.message;
168
- if (typeof r == "string")
169
- return r;
170
- if (r != null && r.toString)
171
- return r.toString();
172
- }
173
- });
174
- return new f(
175
- !1,
176
- null,
177
- a.filter((r) => r !== void 0).join(" ")
178
- );
179
- }
180
- return new f(!1, null, e);
1
+ const i = (o, e, t) => {
2
+ const r = o.endpoint(e);
3
+ return t && Object.entries(t).forEach(([c, n]) => {
4
+ n !== void 0 && r.searchParams.append(c, n.toString());
5
+ }), r;
181
6
  };
182
7
  export {
183
- W as Err,
184
- m as Fetcher,
185
- k as Ok,
186
- f as Result,
187
- g as Retry,
188
- v as safeParseJson,
189
- d as sleep
8
+ i as ConstructUrl
190
9
  };
@@ -41,7 +41,7 @@ export declare const SupportedAssets: {
41
41
  readonly logo: "https://garden-finance.imgix.net/token-images/wbtc.svg";
42
42
  readonly chain: "arbitrum_sepolia";
43
43
  readonly tokenAddress: "0x00ab86f54F436CfE15253845F139955ae0C00bAf";
44
- readonly atomicSwapAddress: "0x1cd0bBd55fD66B4C5F7dfE434eFD009C09e628d1";
44
+ readonly atomicSwapAddress: "0xE918A5a47b8e0AFAC2382bC5D1e981613e63fB07";
45
45
  };
46
46
  readonly arbitrum_sepolia_SEED: {
47
47
  readonly name: "Seed";
@@ -50,7 +50,7 @@ export declare const SupportedAssets: {
50
50
  readonly chain: "arbitrum_sepolia";
51
51
  readonly logo: "https://garden-finance.imgix.net/token-images/seed.svg";
52
52
  readonly tokenAddress: "0x13DCec0762EcC5E666c207ab44Dc768e5e33070F";
53
- readonly atomicSwapAddress: "0xD5FeDb4ceCB0F1D32788a190d9EB47D94D23eE4e";
53
+ readonly atomicSwapAddress: "0xB47716a220C319b25a532594511D63EC68702CEf";
54
54
  };
55
55
  readonly arbitrum_sepolia_iBTC: {
56
56
  readonly name: "iBTC";
@@ -58,8 +58,8 @@ export declare const SupportedAssets: {
58
58
  readonly symbol: "iBTC";
59
59
  readonly chain: "arbitrum_sepolia";
60
60
  readonly logo: "https://garden-finance.imgix.net/token-images/dlcBTCIcon.svg";
61
- readonly tokenAddress: "0x8219B871534F29ff7434519287131a875e0D8eCa";
62
- readonly atomicSwapAddress: "0xdfe6d9363ee96152d39391009a6723819d9e25eb";
61
+ readonly tokenAddress: "0x685437f025c5f33A94818408C286bc1F023201Fc";
62
+ readonly atomicSwapAddress: "0x88e1032252c712681A3659986F452E910D2134D8";
63
63
  };
64
64
  readonly base_sepolia_WBTC: {
65
65
  readonly name: "Wrapped Bitcoin";
@@ -1,6 +1,5 @@
1
- import { AsyncResult } from '@catalogfi/utils';
2
1
  import { CreateOrder, CreateOrderRequestWithAdditionalData, IOrderbook, MatchedOrder, PaginatedData, PaginationConfig, Status } from './orderbook.types';
3
- import { IAuth, Url } from '@gardenfi/utils';
2
+ import { AsyncResult, IAuth, Url } from '@gardenfi/utils';
4
3
 
5
4
  /**
6
5
  * A class that allows you to create and manage orders with the orderbook url.
@@ -1,5 +1,4 @@
1
- import { AsyncResult } from '@catalogfi/utils';
2
- import { APIResponse, IAuth, IStore } from '@gardenfi/utils';
1
+ import { APIResponse, AsyncResult, IAuth, IStore } from '@gardenfi/utils';
3
2
  import { Asset, Chain } from '../asset';
4
3
 
5
4
  /**
@@ -1,4 +1,4 @@
1
- import { AsyncResult } from '@catalogfi/utils';
1
+ import { AsyncResult } from '@gardenfi/utils';
2
2
  import { CreateOrder, MatchedOrder, PaginatedData, PaginationConfig } from '../orderbook/orderbook.types';
3
3
 
4
4
  export interface IOrderProvider {
@@ -1,7 +1,6 @@
1
- import { AsyncResult } from '@catalogfi/utils';
2
1
  import { IOrderProvider } from './orders.types';
3
2
  import { CreateOrder, MatchedOrder, PaginatedData, PaginationConfig } from '../orderbook/orderbook.types';
4
- import { Url } from '@gardenfi/utils';
3
+ import { AsyncResult, Url } from '@gardenfi/utils';
5
4
 
6
5
  export declare class OrdersProvider implements IOrderProvider {
7
6
  private url;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gardenfi/orderbook",
3
- "version": "2.1.8",
3
+ "version": "2.1.9-beta.1",
4
4
  "type": "module",
5
5
  "main": "./dist/index.cjs",
6
6
  "module": "./dist/index.js",
@@ -26,7 +26,7 @@
26
26
  "registry": "https://registry.npmjs.org/"
27
27
  },
28
28
  "dependencies": {
29
- "@gardenfi/utils": "2.1.3",
29
+ "@gardenfi/utils": "2.1.3-beta.19",
30
30
  "bufferutil": "^4.0.8",
31
31
  "siwe": "^2.1.4",
32
32
  "utf-8-validate": "^6.0.3",
package/dist/index7.cjs DELETED
@@ -1 +0,0 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=(n,o,t)=>{const r=n.endpoint(o);return t&&Object.entries(t).forEach(([c,e])=>{e!==void 0&&r.searchParams.append(c,e.toString())}),r};exports.ConstructUrl=i;
package/dist/index7.js DELETED
@@ -1,9 +0,0 @@
1
- const i = (o, e, t) => {
2
- const r = o.endpoint(e);
3
- return t && Object.entries(t).forEach(([c, n]) => {
4
- n !== void 0 && r.searchParams.append(c, n.toString());
5
- }), r;
6
- };
7
- export {
8
- i as ConstructUrl
9
- };