@gardenfi/orderbook 0.2.0-beta.40 → 0.2.0-beta.42
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/index3.cjs +1 -1
- package/dist/index3.js +9 -7
- package/dist/index5.cjs +1 -1
- package/dist/index5.js +9 -0
- package/dist/src/lib/asset.d.ts +2 -1
- package/dist/src/lib/constants.d.ts +1 -0
- 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/index3.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
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"},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),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,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},l=e=>{if(s(e))return"Bitcoin";if(n(e))return"EVM";throw new Error("Invalid or unsupported chain")},
|
|
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
|
@@ -11,8 +11,9 @@ const t = {
|
|
|
11
11
|
arbitrum_sepolia: "arbitrum_sepolia",
|
|
12
12
|
ethereum_localnet: "ethereum_localnet",
|
|
13
13
|
base_sepolia: "base_sepolia",
|
|
14
|
-
bera_testnet: "bera_testnet"
|
|
15
|
-
|
|
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 = {
|
|
16
17
|
[t.bitcoin]: 144,
|
|
17
18
|
[t.bitcoin_testnet]: 144,
|
|
18
19
|
[t.bitcoin_regtest]: 144,
|
|
@@ -24,12 +25,13 @@ const t = {
|
|
|
24
25
|
[t.ethereum_localnet]: 7200,
|
|
25
26
|
[t.base_sepolia]: 7200,
|
|
26
27
|
[t.base]: 43200,
|
|
27
|
-
[t.bera_testnet]: 28800
|
|
28
|
-
|
|
28
|
+
[t.bera_testnet]: 28800,
|
|
29
|
+
[t.citrea_testnet]: 28800
|
|
30
|
+
}, _ = (e) => {
|
|
29
31
|
if (s(e)) return "Bitcoin";
|
|
30
32
|
if (n(e)) return "EVM";
|
|
31
33
|
throw new Error("Invalid or unsupported chain");
|
|
32
|
-
},
|
|
34
|
+
}, b = (e) => {
|
|
33
35
|
if (!r[e]) throw new Error("Invalid or unsupported chain");
|
|
34
36
|
return r[e];
|
|
35
37
|
};
|
|
@@ -38,8 +40,8 @@ export {
|
|
|
38
40
|
t as Chains,
|
|
39
41
|
o as NetworkType,
|
|
40
42
|
r as TimeLocks,
|
|
41
|
-
|
|
42
|
-
|
|
43
|
+
_ as getBlockchainType,
|
|
44
|
+
b as getTimeLock,
|
|
43
45
|
s as isBitcoin,
|
|
44
46
|
n as isEVM,
|
|
45
47
|
a as isMainnet
|
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},d={id:31337,name:"Ethereum Localnet",nativeCurrency:{name:"Ethereum",symbol:"ETH",decimals:18},rpcUrls:{default:{http:["http://localhost:8545/"]}},testnet:!0},c={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"},i={localnet:{arbitrum_localnet_0xdc64a140aa3e981100a9beca4e685f962f0cf6c9:a,ethereum_localnet_0xe7f1725e7734ce288f8367e1bb143e90bb3f0512:s},testnet:{bitcoin_testnet_primary:{name:"BTC",decimals:8,symbol:"BTC",chain:e.Chains.bitcoin_testnet,tokenAddress:"primary",atomicSwapAddress:"primary"},ethereum_sepolia_0x3c6a17b8cd92976d1d91e491c93c98cd81998265:{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_0x1cd0bbd55fd66b4c5f7dfe434efd009c09e628d1:{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_0xd5fedb4cecb0f1d32788a190d9eb47d94d23ee4e:{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_0xdfe6d9363ee96152d39391009a6723819d9e25eb:{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_0x00ab86f54f436cfe15253845f139955ae0c00baf:{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_0xb391ca6d0a76cd2a927bc314856e8a374a225cfc:{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_0xbcdad29ac77e5bb27fd528ab0045af630259fe4f:{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_0x1dc94fdcad8aee13cfd34db8a26d26e31572805c:{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_0xad9d14ca82d9bf97fff745ffc7d48172a1c0969e:{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_primary:{name:"BTC",decimals:8,symbol:"BTC",chain:e.Chains.bitcoin,tokenAddress:"primary",atomicSwapAddress:"primary"},base_0xeae7721d779276eb0f5837e2fe260118724a2ba4:{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_0xd8a6e3fca403d79b6ad6216b60527f51cc967d39:{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_0x795dcb58d1cd4789169d5f938ea05e17eceb68ca:{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_0xd8a6e3fca403d79b6ad6216b60527f51cc967d39:{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_0xeae7721d779276eb0f5837e2fe260118724a2ba4:{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_0x6b6303fab8ec7232b4f2a7b9fa58e5216f608fcb:{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_0xeae7721d779276eb0f5837e2fe260118724a2ba4:{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_0xdc74a45e86dedf1ff7c6dac77e0c2f082f9e4f72:{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=d;exports.SupportedAssets=i;exports.WBTCArbitrumLocalnetAsset=a;exports.WBTCEthereumLocalnetAsset=s;exports.bitcoinRegtestAsset=c;
|
package/dist/index5.js
CHANGED
|
@@ -133,6 +133,15 @@ const s = {
|
|
|
133
133
|
logo: "https://garden-finance.imgix.net/token-images/wbtc.svg",
|
|
134
134
|
tokenAddress: "0x00ab86f54F436CfE15253845F139955ae0C00bAf",
|
|
135
135
|
atomicSwapAddress: "0x1dC94FdcAd8Aee13cfd34Db8a26d26E31572805c"
|
|
136
|
+
},
|
|
137
|
+
citrea_testnet_0xad9d14ca82d9bf97fff745ffc7d48172a1c0969e: {
|
|
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"
|
|
136
145
|
}
|
|
137
146
|
},
|
|
138
147
|
mainnet: {
|
package/dist/src/lib/asset.d.ts
CHANGED
|
@@ -42,12 +42,13 @@ export declare const Chains: {
|
|
|
42
42
|
readonly ethereum_localnet: "ethereum_localnet";
|
|
43
43
|
readonly base_sepolia: "base_sepolia";
|
|
44
44
|
readonly bera_testnet: "bera_testnet";
|
|
45
|
+
readonly citrea_testnet: "citrea_testnet";
|
|
45
46
|
};
|
|
46
47
|
export type Chain = keyof typeof Chains;
|
|
47
48
|
export type EvmChain = keyof Omit<typeof Chains, 'bitcoin' | 'bitcoin_testnet' | 'bitcoin_regtest'>;
|
|
48
49
|
export declare const isMainnet: (chain: Chain) => chain is "bitcoin" | "ethereum" | "base" | "arbitrum";
|
|
49
50
|
export declare const isBitcoin: (chain: Chain) => chain is "bitcoin" | "bitcoin_testnet" | "bitcoin_regtest";
|
|
50
|
-
export declare const isEVM: (chain: Chain) => chain is "ethereum" | "base" | "arbitrum" | "ethereum_sepolia" | "arbitrum_localnet" | "arbitrum_sepolia" | "ethereum_localnet" | "base_sepolia" | "bera_testnet";
|
|
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";
|
|
51
52
|
export declare const TimeLocks: Record<Chain, number>;
|
|
52
53
|
export declare const getBlockchainType: (chain: Chain) => BlockchainType;
|
|
53
54
|
export declare const getTimeLock: (chain: Chain) => number;
|
|
@@ -21,6 +21,7 @@ type SupportedAssets = {
|
|
|
21
21
|
base_sepolia_0xb391ca6d0a76cd2a927bc314856e8a374a225cfc: Asset;
|
|
22
22
|
base_sepolia_0xbcdad29ac77e5bb27fd528ab0045af630259fe4f: Asset;
|
|
23
23
|
bera_testnet_0x1dc94fdcad8aee13cfd34db8a26d26e31572805c: Asset;
|
|
24
|
+
citrea_testnet_0xad9d14ca82d9bf97fff745ffc7d48172a1c0969e: Asset;
|
|
24
25
|
};
|
|
25
26
|
mainnet: {
|
|
26
27
|
bitcoin_primary: Asset;
|
|
@@ -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.42",
|
|
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.20",
|
|
31
31
|
"bufferutil": "^4.0.8",
|
|
32
32
|
"siwe": "^2.1.4",
|
|
33
33
|
"utf-8-validate": "^6.0.3",
|