@gardenfi/orderbook 2.4.2 → 2.4.3-beta.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +1 -1
- package/dist/index.js +16 -13
- package/dist/index3.cjs +1 -1
- package/dist/index3.js +25 -19
- package/dist/src/index.d.ts +2 -3
- package/dist/src/lib/asset.d.ts +7 -3
- package/dist/src/lib/orderbook/orderbook.types.d.ts +7 -0
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("./index2.cjs"),e=require("./index3.cjs"),t=require("./index4.cjs");exports.Orderbook=s.Orderbook;exports.BlockchainType=e.BlockchainType;exports.Chains=e.Chains;exports.NativeTokenAddress=e.NativeTokenAddress;exports.NetworkType=e.NetworkType;exports.getBlockchainType=e.getBlockchainType;exports.isBitcoin=e.isBitcoin;exports.isEVM=e.isEVM;exports.isEvmNativeToken=e.isEvmNativeToken;exports.isMainnet=e.isMainnet;exports.isSolana=e.isSolana;exports.isSolanaNativeToken=e.isSolanaNativeToken;exports.isStarknet=e.isStarknet;exports.ArbitrumLocalnet=t.ArbitrumLocalnet;exports.EthereumLocalnet=t.EthereumLocalnet;exports.SOLSolanaLocalnetAsset=t.SOLSolanaLocalnetAsset;exports.STRKStarknetLocalnetAsset=t.STRKStarknetLocalnetAsset;exports.StarknetLocalnet=t.StarknetLocalnet;exports.SupportedAssets=t.SupportedAssets;exports.WBTCArbitrumLocalnetAsset=t.WBTCArbitrumLocalnetAsset;exports.WBTCEthereumLocalnetAsset=t.WBTCEthereumLocalnetAsset;exports.bitcoinRegtestAsset=t.bitcoinRegtestAsset;
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("./index2.cjs"),e=require("./index3.cjs"),t=require("./index4.cjs");exports.Orderbook=s.Orderbook;exports.BlockchainType=e.BlockchainType;exports.Chains=e.Chains;exports.NativeTokenAddress=e.NativeTokenAddress;exports.NetworkType=e.NetworkType;exports.getBlockchainType=e.getBlockchainType;exports.isBitcoin=e.isBitcoin;exports.isEVM=e.isEVM;exports.isEvmNativeToken=e.isEvmNativeToken;exports.isMainnet=e.isMainnet;exports.isNativeToken=e.isNativeToken;exports.isSolana=e.isSolana;exports.isSolanaNativeToken=e.isSolanaNativeToken;exports.isStarknet=e.isStarknet;exports.isSui=e.isSui;exports.ArbitrumLocalnet=t.ArbitrumLocalnet;exports.ETHStarknetLocalnetAsset=t.ETHStarknetLocalnetAsset;exports.EthereumLocalnet=t.EthereumLocalnet;exports.SOLSolanaLocalnetAsset=t.SOLSolanaLocalnetAsset;exports.STRKStarknetLocalnetAsset=t.STRKStarknetLocalnetAsset;exports.StarknetLocalnet=t.StarknetLocalnet;exports.SupportedAssets=t.SupportedAssets;exports.WBTCArbitrumLocalnetAsset=t.WBTCArbitrumLocalnetAsset;exports.WBTCEthereumLocalnetAsset=t.WBTCEthereumLocalnetAsset;exports.bitcoinRegtestAsset=t.bitcoinRegtestAsset;
|
package/dist/index.js
CHANGED
|
@@ -1,27 +1,30 @@
|
|
|
1
1
|
import { Orderbook as o } from "./index2.js";
|
|
2
|
-
import { BlockchainType as a, Chains as n, NativeTokenAddress as i, NetworkType as r, getBlockchainType as c, isBitcoin as l, isEVM as k, isEvmNativeToken as
|
|
3
|
-
import { ArbitrumLocalnet as
|
|
2
|
+
import { BlockchainType as a, Chains as n, NativeTokenAddress as i, NetworkType as r, getBlockchainType as c, isBitcoin as l, isEVM as k, isEvmNativeToken as S, isMainnet as T, isNativeToken as A, isSolana as L, isSolanaNativeToken as m, isStarknet as p, isSui as u } from "./index3.js";
|
|
3
|
+
import { ArbitrumLocalnet as v, ETHStarknetLocalnetAsset as B, EthereumLocalnet as E, SOLSolanaLocalnetAsset as N, STRKStarknetLocalnetAsset as b, StarknetLocalnet as d, SupportedAssets as f, WBTCArbitrumLocalnetAsset as x, WBTCEthereumLocalnetAsset as y, bitcoinRegtestAsset as C } from "./index4.js";
|
|
4
4
|
export {
|
|
5
|
-
|
|
5
|
+
v as ArbitrumLocalnet,
|
|
6
6
|
a as BlockchainType,
|
|
7
7
|
n as Chains,
|
|
8
|
-
|
|
8
|
+
B as ETHStarknetLocalnetAsset,
|
|
9
|
+
E as EthereumLocalnet,
|
|
9
10
|
i as NativeTokenAddress,
|
|
10
11
|
r as NetworkType,
|
|
11
12
|
o as Orderbook,
|
|
12
|
-
|
|
13
|
+
N as SOLSolanaLocalnetAsset,
|
|
13
14
|
b as STRKStarknetLocalnetAsset,
|
|
14
15
|
d as StarknetLocalnet,
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
16
|
+
f as SupportedAssets,
|
|
17
|
+
x as WBTCArbitrumLocalnetAsset,
|
|
18
|
+
y as WBTCEthereumLocalnetAsset,
|
|
19
|
+
C as bitcoinRegtestAsset,
|
|
19
20
|
c as getBlockchainType,
|
|
20
21
|
l as isBitcoin,
|
|
21
22
|
k as isEVM,
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
23
|
+
S as isEvmNativeToken,
|
|
24
|
+
T as isMainnet,
|
|
25
|
+
A as isNativeToken,
|
|
26
|
+
L as isSolana,
|
|
25
27
|
m as isSolanaNativeToken,
|
|
26
|
-
p as isStarknet
|
|
28
|
+
p as isStarknet,
|
|
29
|
+
u as isSui
|
|
27
30
|
};
|
package/dist/index3.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});var
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});var l=(e=>(e.Bitcoin="Bitcoin",e.EVM="EVM",e.Solana="Solana",e.Starknet="Starknet",e.Sui="Sui",e))(l||{}),_=(e=>(e.mainnet="mainnet",e.testnet="testnet",e.localnet="localnet",e))(_||{});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",solana:"solana",solana_testnet:"solana_testnet",solana_localnet:"solana_localnet",bera_testnet:"bera_testnet",citrea_testnet:"citrea_testnet",bera:"bera",monad_testnet:"monad_testnet",starknet:"starknet",starknet_sepolia:"starknet_sepolia",starknet_devnet:"starknet_devnet",hyperliquid_testnet:"hyperliquid_testnet",hyperliquid:"hyperliquid",unichain:"unichain",corn:"corn",botanix:"botanix",bnbchain:"bnbchain",bnbchain_testnet:"bnbchain_testnet",sui:"sui",sui_testnet:"sui_testnet"},d=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.solana_testnet||e===t.solana_localnet||e===t.bera_testnet||e===t.citrea_testnet||e===t.monad_testnet||e===t.starknet_devnet||e===t.starknet_sepolia||e===t.hyperliquid_testnet||e===t.bnbchain_testnet||e===t.sui_testnet),r=e=>e===t.bitcoin||e===t.bitcoin_testnet||e===t.bitcoin_regtest,s=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||e===t.bera||e===t.monad_testnet||e===t.hyperliquid_testnet||e===t.hyperliquid||e===t.unichain||e===t.corn||e===t.botanix||e===t.bnbchain||e===t.bnbchain_testnet,o=e=>e===t.solana||e===t.solana_testnet||e===t.solana_localnet,i=e=>e===t.starknet||e===t.starknet_devnet||e===t.starknet_sepolia,a=e=>e===t.sui||e===t.sui_testnet,p=e=>{if(r(e))return"Bitcoin";if(s(e))return"EVM";if(o(e))return"Solana";if(i(e))return"Starknet";if(a(e))return"Sui";throw new Error("Invalid or unsupported chain")},u="0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE",b=(e,n)=>s(e)&&n.toLowerCase()===u.toLowerCase(),m=(e,n)=>o(e)&&n.toLowerCase()==="primary",k=e=>b(e.chain,e.tokenAddress)||m(e.chain,e.tokenAddress)||r(e.chain)||a(e.chain)||!i(e.chain);exports.BlockchainType=l;exports.Chains=t;exports.NativeTokenAddress=u;exports.NetworkType=_;exports.getBlockchainType=p;exports.isBitcoin=r;exports.isEVM=s;exports.isEvmNativeToken=b;exports.isMainnet=d;exports.isNativeToken=k;exports.isSolana=o;exports.isSolanaNativeToken=m;exports.isStarknet=i;exports.isSui=a;
|
package/dist/index3.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var
|
|
1
|
+
var _ = /* @__PURE__ */ ((e) => (e.Bitcoin = "Bitcoin", e.EVM = "EVM", e.Solana = "Solana", e.Starknet = "Starknet", e.Sui = "Sui", e))(_ || {}), l = /* @__PURE__ */ ((e) => (e.mainnet = "mainnet", e.testnet = "testnet", e.localnet = "localnet", e))(l || {});
|
|
2
2
|
const t = {
|
|
3
3
|
bitcoin: "bitcoin",
|
|
4
4
|
bitcoin_testnet: "bitcoin_testnet",
|
|
@@ -27,25 +27,31 @@ const t = {
|
|
|
27
27
|
corn: "corn",
|
|
28
28
|
botanix: "botanix",
|
|
29
29
|
bnbchain: "bnbchain",
|
|
30
|
-
bnbchain_testnet: "bnbchain_testnet"
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
if (
|
|
35
|
-
if (
|
|
30
|
+
bnbchain_testnet: "bnbchain_testnet",
|
|
31
|
+
sui: "sui",
|
|
32
|
+
sui_testnet: "sui_testnet"
|
|
33
|
+
}, d = (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.solana_testnet || e === t.solana_localnet || e === t.bera_testnet || e === t.citrea_testnet || e === t.monad_testnet || e === t.starknet_devnet || e === t.starknet_sepolia || e === t.hyperliquid_testnet || e === t.bnbchain_testnet || e === t.sui_testnet), r = (e) => e === t.bitcoin || e === t.bitcoin_testnet || e === t.bitcoin_regtest, s = (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 || e === t.bera || e === t.monad_testnet || e === t.hyperliquid_testnet || e === t.hyperliquid || e === t.unichain || e === t.corn || e === t.botanix || e === t.bnbchain || e === t.bnbchain_testnet, o = (e) => e === t.solana || e === t.solana_testnet || e === t.solana_localnet, a = (e) => e === t.starknet || e === t.starknet_devnet || e === t.starknet_sepolia, i = (e) => e === t.sui || e === t.sui_testnet, p = (e) => {
|
|
34
|
+
if (r(e)) return "Bitcoin";
|
|
35
|
+
if (s(e)) return "EVM";
|
|
36
|
+
if (o(e)) return "Solana";
|
|
37
|
+
if (a(e)) return "Starknet";
|
|
38
|
+
if (i(e)) return "Sui";
|
|
36
39
|
throw new Error("Invalid or unsupported chain");
|
|
37
|
-
},
|
|
40
|
+
}, u = "0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE", b = (e, n) => s(e) && n.toLowerCase() === u.toLowerCase(), m = (e, n) => o(e) && n.toLowerCase() === "primary", E = (e) => b(e.chain, e.tokenAddress) || m(e.chain, e.tokenAddress) || r(e.chain) || i(e.chain) || // Starknet doesn't have a native token
|
|
41
|
+
!a(e.chain);
|
|
38
42
|
export {
|
|
39
|
-
|
|
43
|
+
_ as BlockchainType,
|
|
40
44
|
t as Chains,
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
45
|
+
u as NativeTokenAddress,
|
|
46
|
+
l as NetworkType,
|
|
47
|
+
p as getBlockchainType,
|
|
48
|
+
r as isBitcoin,
|
|
49
|
+
s as isEVM,
|
|
50
|
+
b as isEvmNativeToken,
|
|
51
|
+
d as isMainnet,
|
|
52
|
+
E as isNativeToken,
|
|
53
|
+
o as isSolana,
|
|
54
|
+
m as isSolanaNativeToken,
|
|
55
|
+
a as isStarknet,
|
|
56
|
+
i as isSui
|
|
51
57
|
};
|
package/dist/src/index.d.ts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
export { Orderbook } from './lib/orderbook/orderbook';
|
|
2
2
|
export type * from './lib/orderbook/orderbook.types';
|
|
3
|
-
export
|
|
4
|
-
export
|
|
5
|
-
export { WBTCArbitrumLocalnetAsset, WBTCEthereumLocalnetAsset, ArbitrumLocalnet, EthereumLocalnet, bitcoinRegtestAsset, SOLSolanaLocalnetAsset, SupportedAssets, StarknetLocalnet, STRKStarknetLocalnetAsset, } from './lib/constants';
|
|
3
|
+
export * from './lib/asset';
|
|
4
|
+
export * from './lib/constants';
|
package/dist/src/lib/asset.d.ts
CHANGED
|
@@ -14,7 +14,8 @@ export declare enum BlockchainType {
|
|
|
14
14
|
Bitcoin = "Bitcoin",
|
|
15
15
|
EVM = "EVM",
|
|
16
16
|
Solana = "Solana",
|
|
17
|
-
Starknet = "Starknet"
|
|
17
|
+
Starknet = "Starknet",
|
|
18
|
+
Sui = "Sui"
|
|
18
19
|
}
|
|
19
20
|
export declare enum NetworkType {
|
|
20
21
|
mainnet = "mainnet",
|
|
@@ -60,14 +61,17 @@ export declare const Chains: {
|
|
|
60
61
|
readonly botanix: "botanix";
|
|
61
62
|
readonly bnbchain: "bnbchain";
|
|
62
63
|
readonly bnbchain_testnet: "bnbchain_testnet";
|
|
64
|
+
readonly sui: "sui";
|
|
65
|
+
readonly sui_testnet: "sui_testnet";
|
|
63
66
|
};
|
|
64
67
|
export type Chain = keyof typeof Chains;
|
|
65
|
-
export type EvmChain = keyof Omit<typeof Chains, 'bitcoin' | 'bitcoin_testnet' | 'bitcoin_regtest' | 'solana' | 'solana_testnet' | 'solana_localnet' | 'starknet' | 'starknet_devnet' | 'starknet_sepolia'>;
|
|
66
|
-
export declare const isMainnet: (chain: Chain) => chain is "bitcoin" | "ethereum" | "base" | "arbitrum" | "solana" | "bera" | "starknet" | "hyperliquid" | "unichain" | "corn" | "botanix" | "bnbchain";
|
|
68
|
+
export type EvmChain = keyof Omit<typeof Chains, 'bitcoin' | 'bitcoin_testnet' | 'bitcoin_regtest' | 'solana' | 'solana_testnet' | 'solana_localnet' | 'starknet' | 'starknet_devnet' | 'starknet_sepolia' | 'sui' | 'sui_testnet'>;
|
|
69
|
+
export declare const isMainnet: (chain: Chain) => chain is "bitcoin" | "ethereum" | "base" | "arbitrum" | "solana" | "bera" | "starknet" | "hyperliquid" | "unichain" | "corn" | "botanix" | "bnbchain" | "sui";
|
|
67
70
|
export declare const isBitcoin: (chain: Chain) => chain is "bitcoin" | "bitcoin_testnet" | "bitcoin_regtest";
|
|
68
71
|
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" | "bera" | "monad_testnet" | "hyperliquid_testnet" | "hyperliquid" | "unichain" | "corn" | "botanix" | "bnbchain" | "bnbchain_testnet";
|
|
69
72
|
export declare const isSolana: (chain: Chain) => chain is "solana" | "solana_testnet" | "solana_localnet";
|
|
70
73
|
export declare const isStarknet: (chain: Chain) => chain is "starknet" | "starknet_sepolia" | "starknet_devnet";
|
|
74
|
+
export declare const isSui: (chain: Chain) => chain is "sui" | "sui_testnet";
|
|
71
75
|
export declare const getBlockchainType: (chain: Chain) => BlockchainType;
|
|
72
76
|
export declare const NativeTokenAddress = "0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE";
|
|
73
77
|
export declare const isEvmNativeToken: (chain: Chain, tokenAddress: string) => boolean;
|
|
@@ -212,6 +212,7 @@ export type CreateOrder = CreateOrderRequestWithAdditionalData & {
|
|
|
212
212
|
deleted_at: string | null;
|
|
213
213
|
create_id: string;
|
|
214
214
|
block_number: string;
|
|
215
|
+
user_id: string;
|
|
215
216
|
};
|
|
216
217
|
export type Swap = {
|
|
217
218
|
created_at: string;
|
|
@@ -220,6 +221,8 @@ export type Swap = {
|
|
|
220
221
|
swap_id: string;
|
|
221
222
|
chain: Chain;
|
|
222
223
|
asset: string;
|
|
224
|
+
htlc_address: string;
|
|
225
|
+
token_address: string;
|
|
223
226
|
initiator: string;
|
|
224
227
|
redeemer: string;
|
|
225
228
|
timelock: number;
|
|
@@ -234,6 +237,10 @@ export type Swap = {
|
|
|
234
237
|
redeem_block_number: string | null;
|
|
235
238
|
refund_block_number: string | null;
|
|
236
239
|
required_confirmations: number;
|
|
240
|
+
current_confirmations: number;
|
|
241
|
+
initiate_timestamp: string | null;
|
|
242
|
+
redeem_timestamp: string | null;
|
|
243
|
+
refund_timestamp: string | null;
|
|
237
244
|
};
|
|
238
245
|
export type MatchedOrder = {
|
|
239
246
|
created_at: string;
|