@gardenfi/orderbook 0.2.0-beta.41 → 0.2.0-beta.43
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 +1 -1
- package/dist/index2.js +20 -20
- package/dist/index5.cjs +1 -1
- package/dist/index5.js +31 -31
- package/dist/src/lib/constants.d.ts +175 -27
- package/dist/src/lib/orderbook/orderbook.d.ts +1 -1
- package/dist/src/lib/orderbook/orderbook.types.d.ts +1 -1
- package/package.json +2 -2
package/dist/index2.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("@catalogfi/utils"),
|
|
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
|
|
2
|
-
import { MAINNET_ORDERBOOK_API as
|
|
3
|
-
import { Url as
|
|
4
|
-
import { OrdersProvider as
|
|
5
|
-
class
|
|
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
|
|
12
|
+
const e = new d(
|
|
13
13
|
"/relayer",
|
|
14
|
-
r.url ??
|
|
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
|
|
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
|
|
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:
|
|
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 ?
|
|
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
|
|
70
|
-
var
|
|
71
|
-
const
|
|
72
|
-
return
|
|
73
|
-
|
|
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
|
-
|
|
77
|
-
|
|
78
|
-
a
|
|
77
|
+
a,
|
|
78
|
+
t
|
|
79
79
|
) : () => {
|
|
80
80
|
};
|
|
81
81
|
}
|
|
@@ -86,5 +86,5 @@ class c extends p {
|
|
|
86
86
|
}
|
|
87
87
|
}
|
|
88
88
|
export {
|
|
89
|
-
|
|
89
|
+
u as Orderbook
|
|
90
90
|
};
|
package/dist/index5.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
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},
|
|
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
|
|
2
|
+
const i = {
|
|
3
3
|
id: 31338,
|
|
4
4
|
name: "Arbitrum Localnet",
|
|
5
5
|
nativeCurrency: {
|
|
@@ -13,7 +13,7 @@ const s = {
|
|
|
13
13
|
}
|
|
14
14
|
},
|
|
15
15
|
testnet: !0
|
|
16
|
-
},
|
|
16
|
+
}, n = {
|
|
17
17
|
id: 31337,
|
|
18
18
|
name: "Ethereum Localnet",
|
|
19
19
|
nativeCurrency: {
|
|
@@ -27,7 +27,7 @@ const s = {
|
|
|
27
27
|
}
|
|
28
28
|
},
|
|
29
29
|
testnet: !0
|
|
30
|
-
},
|
|
30
|
+
}, c = {
|
|
31
31
|
name: "Bitcoin Regtest",
|
|
32
32
|
decimals: 8,
|
|
33
33
|
symbol: "BTC",
|
|
@@ -41,20 +41,20 @@ const s = {
|
|
|
41
41
|
chain: e.arbitrum_localnet,
|
|
42
42
|
atomicSwapAddress: "0xDc64a140Aa3E981100a9becA4E685f962f0cF6C9",
|
|
43
43
|
tokenAddress: "0xe7f1725E7734CE288F8367e1Bb143E90bb3F0512"
|
|
44
|
-
},
|
|
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
|
-
},
|
|
51
|
+
}, d = {
|
|
52
52
|
localnet: {
|
|
53
|
-
|
|
54
|
-
|
|
53
|
+
arbitrum_localnet_WBTC: a,
|
|
54
|
+
ethereum_localnet_WBTC: s
|
|
55
55
|
},
|
|
56
56
|
testnet: {
|
|
57
|
-
|
|
57
|
+
bitcoin_testnet_BTC: {
|
|
58
58
|
name: "BTC",
|
|
59
59
|
decimals: 8,
|
|
60
60
|
symbol: "BTC",
|
|
@@ -62,7 +62,7 @@ const s = {
|
|
|
62
62
|
tokenAddress: "primary",
|
|
63
63
|
atomicSwapAddress: "primary"
|
|
64
64
|
},
|
|
65
|
-
|
|
65
|
+
ethereum_sepolia_WBTC: {
|
|
66
66
|
name: "Wrapped Bitcoin",
|
|
67
67
|
decimals: 8,
|
|
68
68
|
symbol: "WBTC",
|
|
@@ -71,7 +71,7 @@ const s = {
|
|
|
71
71
|
tokenAddress: "0x4D68da063577F98C55166c7AF6955cF58a97b20A",
|
|
72
72
|
atomicSwapAddress: "0x3C6a17b8cD92976D1D91E491c93c98cd81998265"
|
|
73
73
|
},
|
|
74
|
-
|
|
74
|
+
arbitrum_sepolia_WBTC: {
|
|
75
75
|
name: "Wrapped Bitcoin",
|
|
76
76
|
decimals: 8,
|
|
77
77
|
symbol: "WBTC",
|
|
@@ -80,7 +80,7 @@ const s = {
|
|
|
80
80
|
tokenAddress: "0x00ab86f54F436CfE15253845F139955ae0C00bAf",
|
|
81
81
|
atomicSwapAddress: "0x1cd0bBd55fD66B4C5F7dfE434eFD009C09e628d1"
|
|
82
82
|
},
|
|
83
|
-
|
|
83
|
+
arbitrum_sepolia_SEED: {
|
|
84
84
|
name: "Seed",
|
|
85
85
|
decimals: 18,
|
|
86
86
|
symbol: "SEED",
|
|
@@ -89,7 +89,7 @@ const s = {
|
|
|
89
89
|
tokenAddress: "0x13DCec0762EcC5E666c207ab44Dc768e5e33070F",
|
|
90
90
|
atomicSwapAddress: "0xD5FeDb4ceCB0F1D32788a190d9EB47D94D23eE4e"
|
|
91
91
|
},
|
|
92
|
-
|
|
92
|
+
arbitrum_sepolia_iBTC: {
|
|
93
93
|
name: "iBTC",
|
|
94
94
|
decimals: 8,
|
|
95
95
|
symbol: "iBTC",
|
|
@@ -98,7 +98,7 @@ const s = {
|
|
|
98
98
|
tokenAddress: "0x685437f025c5f33a94818408c286bc1f023201fc",
|
|
99
99
|
atomicSwapAddress: "0xdfe6d9363ee96152d39391009a6723819d9e25eb"
|
|
100
100
|
},
|
|
101
|
-
|
|
101
|
+
base_sepolia_WBTC: {
|
|
102
102
|
name: "Wrapped Bitcoin",
|
|
103
103
|
decimals: 8,
|
|
104
104
|
symbol: "WBTC",
|
|
@@ -107,7 +107,7 @@ const s = {
|
|
|
107
107
|
tokenAddress: "0x13DCec0762EcC5E666c207ab44Dc768e5e33070F",
|
|
108
108
|
atomicSwapAddress: "0x00ab86f54F436CfE15253845F139955ae0C00bAf"
|
|
109
109
|
},
|
|
110
|
-
|
|
110
|
+
base_sepolia_USDT: {
|
|
111
111
|
name: "Tether USD",
|
|
112
112
|
decimals: 6,
|
|
113
113
|
symbol: "USDT",
|
|
@@ -116,7 +116,7 @@ const s = {
|
|
|
116
116
|
tokenAddress: "0xD72Fc3e7D52301b3e5f7d4E3366F88d5C8747520",
|
|
117
117
|
atomicSwapAddress: "0xB391CA6D0A76CD2A927bC314856E8a374a225CFc"
|
|
118
118
|
},
|
|
119
|
-
|
|
119
|
+
base_sepolia_iBTC: {
|
|
120
120
|
name: "iBTC",
|
|
121
121
|
decimals: 8,
|
|
122
122
|
symbol: "iBTC",
|
|
@@ -125,7 +125,7 @@ const s = {
|
|
|
125
125
|
tokenAddress: "0x0b0D554D9573bAe1a7556d220847f45182918B28",
|
|
126
126
|
atomicSwapAddress: "0xbcdad29ac77e5bb27fd528ab0045af630259fe4f"
|
|
127
127
|
},
|
|
128
|
-
|
|
128
|
+
bera_testnet_WBTC: {
|
|
129
129
|
name: "Wrapped Bitcoin",
|
|
130
130
|
decimals: 8,
|
|
131
131
|
symbol: "WBTC",
|
|
@@ -134,7 +134,7 @@ const s = {
|
|
|
134
134
|
tokenAddress: "0x00ab86f54F436CfE15253845F139955ae0C00bAf",
|
|
135
135
|
atomicSwapAddress: "0x1dC94FdcAd8Aee13cfd34Db8a26d26E31572805c"
|
|
136
136
|
},
|
|
137
|
-
|
|
137
|
+
citrea_testnet_WCBTC: {
|
|
138
138
|
name: "Wrapped Citrea Bitcoin",
|
|
139
139
|
decimals: 18,
|
|
140
140
|
symbol: "WCBTC",
|
|
@@ -145,7 +145,7 @@ const s = {
|
|
|
145
145
|
}
|
|
146
146
|
},
|
|
147
147
|
mainnet: {
|
|
148
|
-
|
|
148
|
+
bitcoin_BTC: {
|
|
149
149
|
name: "BTC",
|
|
150
150
|
decimals: 8,
|
|
151
151
|
symbol: "BTC",
|
|
@@ -153,7 +153,7 @@ const s = {
|
|
|
153
153
|
tokenAddress: "primary",
|
|
154
154
|
atomicSwapAddress: "primary"
|
|
155
155
|
},
|
|
156
|
-
|
|
156
|
+
base_cbBTC: {
|
|
157
157
|
name: "Coinbase Bitcoin",
|
|
158
158
|
decimals: 8,
|
|
159
159
|
symbol: "cbBTC",
|
|
@@ -162,7 +162,7 @@ const s = {
|
|
|
162
162
|
tokenAddress: "0xcbB7C0000aB88B473b1f5aFd9ef808440eed33Bf",
|
|
163
163
|
atomicSwapAddress: "0xeae7721d779276eb0f5837e2fe260118724a2ba4"
|
|
164
164
|
},
|
|
165
|
-
|
|
165
|
+
base_USDC: {
|
|
166
166
|
name: "USD Coin",
|
|
167
167
|
decimals: 6,
|
|
168
168
|
symbol: "USDC",
|
|
@@ -171,7 +171,7 @@ const s = {
|
|
|
171
171
|
tokenAddress: "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
|
|
172
172
|
atomicSwapAddress: "0xd8a6e3fca403d79b6ad6216b60527f51cc967d39"
|
|
173
173
|
},
|
|
174
|
-
|
|
174
|
+
ethereum_WBTC: {
|
|
175
175
|
name: "Wrapped Bitcoin",
|
|
176
176
|
decimals: 8,
|
|
177
177
|
symbol: "WBTC",
|
|
@@ -180,7 +180,7 @@ const s = {
|
|
|
180
180
|
tokenAddress: "0x2260FAC5E5542a773Aa44fBCfeDf7C193bc2C599",
|
|
181
181
|
atomicSwapAddress: "0x795dcb58d1cd4789169d5f938ea05e17eceb68ca"
|
|
182
182
|
},
|
|
183
|
-
|
|
183
|
+
ethereum_USDC: {
|
|
184
184
|
name: "USD Coin",
|
|
185
185
|
decimals: 6,
|
|
186
186
|
symbol: "USDC",
|
|
@@ -189,7 +189,7 @@ const s = {
|
|
|
189
189
|
tokenAddress: "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48",
|
|
190
190
|
atomicSwapAddress: "0xd8a6e3fca403d79b6ad6216b60527f51cc967d39"
|
|
191
191
|
},
|
|
192
|
-
|
|
192
|
+
ethereum_cbBTC: {
|
|
193
193
|
name: "Coinbase Bitcoin",
|
|
194
194
|
decimals: 8,
|
|
195
195
|
symbol: "cbBTC",
|
|
@@ -198,7 +198,7 @@ const s = {
|
|
|
198
198
|
tokenAddress: "0xcbB7C0000aB88B473b1f5aFd9ef808440eed33Bf",
|
|
199
199
|
atomicSwapAddress: "0xeae7721d779276eb0f5837e2fe260118724a2ba4"
|
|
200
200
|
},
|
|
201
|
-
|
|
201
|
+
arbitrum_WBTC: {
|
|
202
202
|
name: "Wrapped Bitcoin",
|
|
203
203
|
decimals: 8,
|
|
204
204
|
symbol: "WBTC",
|
|
@@ -207,7 +207,7 @@ const s = {
|
|
|
207
207
|
tokenAddress: "0x2f2a2543B76A4166549F7aaB2e75Bef0aefC5B0f",
|
|
208
208
|
atomicSwapAddress: "0x6b6303fab8ec7232b4f2a7b9fa58e5216f608fcb"
|
|
209
209
|
},
|
|
210
|
-
|
|
210
|
+
arbitrum_USDC: {
|
|
211
211
|
name: "USD Coin",
|
|
212
212
|
decimals: 6,
|
|
213
213
|
symbol: "USDC",
|
|
@@ -216,7 +216,7 @@ const s = {
|
|
|
216
216
|
tokenAddress: "0xaf88d065e77c8cC2239327C5EDb3A432268e5831",
|
|
217
217
|
atomicSwapAddress: "0xeae7721d779276eb0f5837e2fe260118724a2ba4"
|
|
218
218
|
},
|
|
219
|
-
|
|
219
|
+
arbitrum_iBTC: {
|
|
220
220
|
name: "iBTC",
|
|
221
221
|
decimals: 8,
|
|
222
222
|
symbol: "iBTC",
|
|
@@ -228,10 +228,10 @@ const s = {
|
|
|
228
228
|
}
|
|
229
229
|
};
|
|
230
230
|
export {
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
231
|
+
i as ArbitrumLocalnet,
|
|
232
|
+
n as EthereumLocalnet,
|
|
233
|
+
d as SupportedAssets,
|
|
234
234
|
a as WBTCArbitrumLocalnetAsset,
|
|
235
|
-
|
|
236
|
-
|
|
235
|
+
s as WBTCEthereumLocalnetAsset,
|
|
236
|
+
c as bitcoinRegtestAsset
|
|
237
237
|
};
|
|
@@ -6,34 +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
|
-
|
|
10
|
-
localnet: {
|
|
11
|
-
|
|
12
|
-
|
|
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
13
|
};
|
|
14
|
-
testnet: {
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
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
|
+
};
|
|
25
104
|
};
|
|
26
|
-
mainnet: {
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
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
|
+
};
|
|
36
186
|
};
|
|
37
187
|
};
|
|
38
|
-
export declare const SupportedAssets: SupportedAssets;
|
|
39
|
-
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
|
|
41
|
+
subscribeToOrders(interval: number, cb: (orders: PaginatedData<MatchedOrder>) => Promise<void>, paginationConfig?: PaginationConfig, pending?: boolean): Promise<() => void>;
|
|
42
42
|
getUserOrdersCount(): AsyncResult<number, string>;
|
|
43
43
|
}
|
|
@@ -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
|
|
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.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gardenfi/orderbook",
|
|
3
|
-
"version": "0.2.0-beta.
|
|
3
|
+
"version": "0.2.0-beta.43",
|
|
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.
|
|
30
|
+
"@gardenfi/utils": "^0.0.1-beta.21",
|
|
31
31
|
"bufferutil": "^4.0.8",
|
|
32
32
|
"siwe": "^2.1.4",
|
|
33
33
|
"utf-8-validate": "^6.0.3",
|