@gardenfi/orderbook 0.1.5 → 0.1.6
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/index3.cjs +1 -1
- package/dist/index3.js +17 -15
- package/dist/index4.cjs +1 -1
- package/dist/index4.js +49 -5
- package/dist/index5.cjs +1 -1
- package/dist/index5.js +6 -0
- package/dist/src/lib/asset.d.ts +24 -0
- package/package.json +1 -1
package/dist/index3.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("./index4.cjs"),c=require("./index5.cjs"),o=require("./index9.cjs"),h=(e,n)=>{if(e.chain===n.chain)throw new Error(o.OrderpairErrors.SAME_ASSET);if(e.chain===i.Chains.bitcoin||e.chain===i.Chains.bitcoin_testnet||e.chain===i.Chains.bitcoin_regtest){const t=r[n.chain];return`${i.Chains[e.chain]}-${i.Chains[n.chain]}:${c.CONTRACT_ADDRESS[t].AtomicSwap}`}else{const t=r[e.chain];return`${i.Chains[e.chain]}:${c.CONTRACT_ADDRESS[t].AtomicSwap}-${i.Chains[n.chain]}`}},r={ethereum:1,ethereum_sepolia:11155111,ethereum_arbitrum:42161,ethereum_arbitrumlocalnet:31338,ethereum_localnet:31337},s=Object.entries(r).reduce((e,[n,a])=>(e[a]=n,e),{});exports.chainToId=r;exports.idToChain=s;exports.orderPairGenerator=h;
|
package/dist/index3.js
CHANGED
|
@@ -1,25 +1,27 @@
|
|
|
1
|
-
import { Chains as
|
|
1
|
+
import { Chains as e } from "./index4.js";
|
|
2
2
|
import { CONTRACT_ADDRESS as a } from "./index5.js";
|
|
3
3
|
import { OrderpairErrors as o } from "./index9.js";
|
|
4
|
-
const u = (i,
|
|
5
|
-
if (i.chain ===
|
|
4
|
+
const u = (i, n) => {
|
|
5
|
+
if (i.chain === n.chain)
|
|
6
6
|
throw new Error(o.SAME_ASSET);
|
|
7
|
-
if (i.chain ===
|
|
8
|
-
const
|
|
9
|
-
return `${
|
|
7
|
+
if (i.chain === e.bitcoin || i.chain === e.bitcoin_testnet || i.chain === e.bitcoin_regtest) {
|
|
8
|
+
const r = t[n.chain];
|
|
9
|
+
return `${e[i.chain]}-${e[n.chain]}:${a[r].AtomicSwap}`;
|
|
10
10
|
} else {
|
|
11
|
-
const
|
|
12
|
-
return `${
|
|
11
|
+
const r = t[i.chain];
|
|
12
|
+
return `${e[i.chain]}:${a[r].AtomicSwap}-${e[n.chain]}`;
|
|
13
13
|
}
|
|
14
|
-
},
|
|
14
|
+
}, t = {
|
|
15
15
|
ethereum: 1,
|
|
16
16
|
ethereum_sepolia: 11155111,
|
|
17
|
-
ethereum_arbitrum: 42161
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
17
|
+
ethereum_arbitrum: 42161,
|
|
18
|
+
ethereum_arbitrumlocalnet: 31338,
|
|
19
|
+
ethereum_localnet: 31337
|
|
20
|
+
}, _ = Object.entries(
|
|
21
|
+
t
|
|
22
|
+
).reduce((i, [n, c]) => (i[c] = n, i), {});
|
|
21
23
|
export {
|
|
22
|
-
|
|
23
|
-
|
|
24
|
+
t as chainToId,
|
|
25
|
+
_ as idToChain,
|
|
24
26
|
u as orderPairGenerator
|
|
25
27
|
};
|
package/dist/index4.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e={ethereum_sepolia:"ethereum_sepolia",ethereum:"ethereum",bitcoin:"bitcoin",bitcoin_testnet:"bitcoin_testnet",bitcoin_regtest:"bitcoin_regtest",ethereum_arbitrum:"ethereum_arbitrum"},o={ethereum:{WBTC:{name:"Wrapped Bitcoin",symbol:"WBTC",decimals:8,chain:e.ethereum,isToken:!0,thumbnail:"https://cryptologos.cc/logos/wrapped-bitcoin-wbtc-logo.svg?v=029",address:"0x2260fac5e5542a773aa44fbcfedf7c193bc2c599"}},ethereum_sepolia:{WBTC:{name:"Wrapped Bitcoin",symbol:"WBTC",decimals:8,chain:e.ethereum_sepolia,isToken:!0,thumbnail:"https://cryptologos.cc/logos/wrapped-bitcoin-wbtc-logo.svg",address:"0x3D1e56247033FE191DC789b5838E366dC04b1b73"}},bitcoin:{BTC:{name:"Bitcoin",symbol:"BTC",decimals:8,thumbnail:"https://cryptologos.cc/logos/bitcoin-btc-logo.svg",chain:e.bitcoin,isToken:!1}},bitcoin_testnet:{BTC:{name:"Bitcoin Testnet",symbol:"BTC",decimals:8,thumbnail:"https://cryptologos.cc/logos/bitcoin-btc-logo.svg",chain:e.bitcoin_testnet,isToken:!1}},bitcoin_regtest:{BTC:{name:"Bitcoin Regtest",symbol:"BTC",decimals:8,thumbnail:"https://cryptologos.cc/logos/bitcoin-btc-logo.svg",chain:e.bitcoin_regtest,isToken:!1}},ethereum_arbitrum:{WBTC:{name:"Wrapped Bitcoin",symbol:"WBTC",decimals:8,chain:e.ethereum_arbitrum,isToken:!0,thumbnail:"https://cryptologos.cc/logos/bitcoin-btc-logo.svg",address:"0x2f2a2543B76A4166549F7aaB2e75Bef0aefC5B0f"}}},
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e={ethereum_sepolia:"ethereum_sepolia",ethereum:"ethereum",bitcoin:"bitcoin",bitcoin_testnet:"bitcoin_testnet",bitcoin_regtest:"bitcoin_regtest",ethereum_arbitrum:"ethereum_arbitrum",ethereum_arbitrumlocalnet:"ethereum_arbitrumlocalnet",ethereum_localnet:"ethereum_localnet"},o={ethereum:{WBTC:{name:"Wrapped Bitcoin",symbol:"WBTC",decimals:8,chain:e.ethereum,isToken:!0,thumbnail:"https://cryptologos.cc/logos/wrapped-bitcoin-wbtc-logo.svg?v=029",address:"0x2260fac5e5542a773aa44fbcfedf7c193bc2c599"}},ethereum_sepolia:{WBTC:{name:"Wrapped Bitcoin",symbol:"WBTC",decimals:8,chain:e.ethereum_sepolia,isToken:!0,thumbnail:"https://cryptologos.cc/logos/wrapped-bitcoin-wbtc-logo.svg",address:"0x3D1e56247033FE191DC789b5838E366dC04b1b73"}},ethereum_arb_localnet:{WBTC:{name:"Wrapped Bitcoin",symbol:"WBTC",decimals:8,chain:e.ethereum_arbitrum,isToken:!0,thumbnail:"https://cryptologos.cc/logos/wrapped-bitcoin-wbtc-logo.svg",address:"0xe7f1725E7734CE288F8367e1Bb143E90bb3F0512"}},ethereum_localnet:{WBTC:{name:"Wrapped Bitcoin",symbol:"WBTC",decimals:8,chain:e.ethereum_localnet,isToken:!0,thumbnail:"https://cryptologos.cc/logos/wrapped-bitcoin-wbtc-logo.svg",address:"0x5FbDB2315678afecb367f032d93F642f64180aa3"}},bitcoin:{BTC:{name:"Bitcoin",symbol:"BTC",decimals:8,thumbnail:"https://cryptologos.cc/logos/bitcoin-btc-logo.svg",chain:e.bitcoin,isToken:!1}},bitcoin_testnet:{BTC:{name:"Bitcoin Testnet",symbol:"BTC",decimals:8,thumbnail:"https://cryptologos.cc/logos/bitcoin-btc-logo.svg",chain:e.bitcoin_testnet,isToken:!1}},bitcoin_regtest:{BTC:{name:"Bitcoin Regtest",symbol:"BTC",decimals:8,thumbnail:"https://cryptologos.cc/logos/bitcoin-btc-logo.svg",chain:e.bitcoin_regtest,isToken:!1}},ethereum_arbitrum:{WBTC:{name:"Wrapped Bitcoin",symbol:"WBTC",decimals:8,chain:e.ethereum_arbitrum,isToken:!0,thumbnail:"https://cryptologos.cc/logos/bitcoin-btc-logo.svg",address:"0x2f2a2543B76A4166549F7aaB2e75Bef0aefC5B0f"}}},s={bitcoin:{nativeAsset:o.bitcoin.BTC},bitcoin_testnet:{nativeAsset:o.bitcoin_testnet.BTC},bitcoin_regtest:{nativeAsset:{name:"Bitcoin Regtest",symbol:"rBTC",decimals:8,chain:e.bitcoin_regtest,isToken:!1,thumbnail:"https://cryptologos.cc/logos/bitcoin-btc-logo.svg"}},ethereum:{nativeAsset:{name:"Ethereum",symbol:"ETH",decimals:18,chain:e.ethereum,isToken:!1,thumbnail:"https://cryptologos.cc/logos/ethereum-eth-logo.svg"}},ethereum_sepolia:{nativeAsset:{name:"Ethereum",symbol:"ETH",decimals:18,chain:e.ethereum_sepolia,isToken:!1,thumbnail:"https://cryptologos.cc/logos/ethereum-eth-logo.svg"}},ethereum_arbitrum:{nativeAsset:{name:"Ethereum",symbol:"ETH",decimals:18,chain:e.ethereum_arbitrum,isToken:!1,thumbnail:"https://cryptologos.cc/logos/arbitrum-arb-logo.svg"}},ethereum_arbitrumlocalnet:{nativeAsset:{name:"Ethereum",symbol:"ETH",decimals:18,chain:e.ethereum_arbitrumlocalnet,isToken:!1,thumbnail:"https://cryptologos.cc/logos/arbitrum-arb-logo.svg"}},ethereum_localnet:{nativeAsset:{name:"Ethereum",symbol:"ETH",decimals:18,chain:e.ethereum_localnet,isToken:!1,thumbnail:"https://cryptologos.cc/logos/ethereum-eth-logo.svg"}}},i=t=>!(t===e.ethereum_sepolia||t===e.bitcoin_testnet||t===e.bitcoin_regtest||t===e.ethereum_arbitrumlocalnet||t===e.ethereum_localnet);exports.Assets=o;exports.Chains=e;exports.ChainsData=s;exports.isMainnet=i;
|
package/dist/index4.js
CHANGED
|
@@ -4,7 +4,9 @@ const e = {
|
|
|
4
4
|
bitcoin: "bitcoin",
|
|
5
5
|
bitcoin_testnet: "bitcoin_testnet",
|
|
6
6
|
bitcoin_regtest: "bitcoin_regtest",
|
|
7
|
-
ethereum_arbitrum: "ethereum_arbitrum"
|
|
7
|
+
ethereum_arbitrum: "ethereum_arbitrum",
|
|
8
|
+
ethereum_arbitrumlocalnet: "ethereum_arbitrumlocalnet",
|
|
9
|
+
ethereum_localnet: "ethereum_localnet"
|
|
8
10
|
}, o = {
|
|
9
11
|
ethereum: {
|
|
10
12
|
WBTC: {
|
|
@@ -28,6 +30,28 @@ const e = {
|
|
|
28
30
|
address: "0x3D1e56247033FE191DC789b5838E366dC04b1b73"
|
|
29
31
|
}
|
|
30
32
|
},
|
|
33
|
+
ethereum_arb_localnet: {
|
|
34
|
+
WBTC: {
|
|
35
|
+
name: "Wrapped Bitcoin",
|
|
36
|
+
symbol: "WBTC",
|
|
37
|
+
decimals: 8,
|
|
38
|
+
chain: e.ethereum_arbitrum,
|
|
39
|
+
isToken: !0,
|
|
40
|
+
thumbnail: "https://cryptologos.cc/logos/wrapped-bitcoin-wbtc-logo.svg",
|
|
41
|
+
address: "0xe7f1725E7734CE288F8367e1Bb143E90bb3F0512"
|
|
42
|
+
}
|
|
43
|
+
},
|
|
44
|
+
ethereum_localnet: {
|
|
45
|
+
WBTC: {
|
|
46
|
+
name: "Wrapped Bitcoin",
|
|
47
|
+
symbol: "WBTC",
|
|
48
|
+
decimals: 8,
|
|
49
|
+
chain: e.ethereum_localnet,
|
|
50
|
+
isToken: !0,
|
|
51
|
+
thumbnail: "https://cryptologos.cc/logos/wrapped-bitcoin-wbtc-logo.svg",
|
|
52
|
+
address: "0x5FbDB2315678afecb367f032d93F642f64180aa3"
|
|
53
|
+
}
|
|
54
|
+
},
|
|
31
55
|
bitcoin: {
|
|
32
56
|
BTC: {
|
|
33
57
|
name: "Bitcoin",
|
|
@@ -69,7 +93,7 @@ const e = {
|
|
|
69
93
|
address: "0x2f2a2543B76A4166549F7aaB2e75Bef0aefC5B0f"
|
|
70
94
|
}
|
|
71
95
|
}
|
|
72
|
-
},
|
|
96
|
+
}, s = {
|
|
73
97
|
bitcoin: {
|
|
74
98
|
nativeAsset: o.bitcoin.BTC
|
|
75
99
|
},
|
|
@@ -115,11 +139,31 @@ const e = {
|
|
|
115
139
|
isToken: !1,
|
|
116
140
|
thumbnail: "https://cryptologos.cc/logos/arbitrum-arb-logo.svg"
|
|
117
141
|
}
|
|
142
|
+
},
|
|
143
|
+
ethereum_arbitrumlocalnet: {
|
|
144
|
+
nativeAsset: {
|
|
145
|
+
name: "Ethereum",
|
|
146
|
+
symbol: "ETH",
|
|
147
|
+
decimals: 18,
|
|
148
|
+
chain: e.ethereum_arbitrumlocalnet,
|
|
149
|
+
isToken: !1,
|
|
150
|
+
thumbnail: "https://cryptologos.cc/logos/arbitrum-arb-logo.svg"
|
|
151
|
+
}
|
|
152
|
+
},
|
|
153
|
+
ethereum_localnet: {
|
|
154
|
+
nativeAsset: {
|
|
155
|
+
name: "Ethereum",
|
|
156
|
+
symbol: "ETH",
|
|
157
|
+
decimals: 18,
|
|
158
|
+
chain: e.ethereum_localnet,
|
|
159
|
+
isToken: !1,
|
|
160
|
+
thumbnail: "https://cryptologos.cc/logos/ethereum-eth-logo.svg"
|
|
161
|
+
}
|
|
118
162
|
}
|
|
119
|
-
},
|
|
163
|
+
}, i = (t) => !(t === e.ethereum_sepolia || t === e.bitcoin_testnet || t === e.bitcoin_regtest || t === e.ethereum_arbitrumlocalnet || t === e.ethereum_localnet);
|
|
120
164
|
export {
|
|
121
165
|
o as Assets,
|
|
122
166
|
e as Chains,
|
|
123
|
-
|
|
124
|
-
|
|
167
|
+
s as ChainsData,
|
|
168
|
+
i as isMainnet
|
|
125
169
|
};
|
package/dist/index5.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const A={1:{AtomicSwap:"0xA5E38d098b54C00F10e32E51647086232a9A0afD"},11155111:{AtomicSwap:"0x9ceD08aeE17Fbc333BB7741Ec5eB2907b0CA4241"},42161:{AtomicSwap:"0x203DAC25763aE783Ad532A035FfF33d8df9437eE"}};exports.CONTRACT_ADDRESS=A;
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const A={1:{AtomicSwap:"0xA5E38d098b54C00F10e32E51647086232a9A0afD"},11155111:{AtomicSwap:"0x9ceD08aeE17Fbc333BB7741Ec5eB2907b0CA4241"},42161:{AtomicSwap:"0x203DAC25763aE783Ad532A035FfF33d8df9437eE"},31337:{AtomicSwap:"0xe7f1725E7734CE288F8367e1Bb143E90bb3F0512"},31338:{AtomicSwap:"0xDc64a140Aa3E981100a9becA4E685f962f0cF6C9"}};exports.CONTRACT_ADDRESS=A;
|
package/dist/index5.js
CHANGED
|
@@ -7,6 +7,12 @@ const A = {
|
|
|
7
7
|
},
|
|
8
8
|
42161: {
|
|
9
9
|
AtomicSwap: "0x203DAC25763aE783Ad532A035FfF33d8df9437eE"
|
|
10
|
+
},
|
|
11
|
+
31337: {
|
|
12
|
+
AtomicSwap: "0xe7f1725E7734CE288F8367e1Bb143E90bb3F0512"
|
|
13
|
+
},
|
|
14
|
+
31338: {
|
|
15
|
+
AtomicSwap: "0xDc64a140Aa3E981100a9becA4E685f962f0cF6C9"
|
|
10
16
|
}
|
|
11
17
|
};
|
|
12
18
|
export {
|
package/dist/src/lib/asset.d.ts
CHANGED
|
@@ -5,6 +5,8 @@ export declare const Chains: {
|
|
|
5
5
|
readonly bitcoin_testnet: "bitcoin_testnet";
|
|
6
6
|
readonly bitcoin_regtest: "bitcoin_regtest";
|
|
7
7
|
readonly ethereum_arbitrum: "ethereum_arbitrum";
|
|
8
|
+
readonly ethereum_arbitrumlocalnet: "ethereum_arbitrumlocalnet";
|
|
9
|
+
readonly ethereum_localnet: "ethereum_localnet";
|
|
8
10
|
};
|
|
9
11
|
export type Chain = keyof typeof Chains;
|
|
10
12
|
export type EvmChain = keyof Omit<typeof Chains, "bitcoin" | "bitcoin_testnet" | "bitcoin_regtest">;
|
|
@@ -45,6 +47,28 @@ export declare const Assets: {
|
|
|
45
47
|
address: string;
|
|
46
48
|
};
|
|
47
49
|
};
|
|
50
|
+
ethereum_arb_localnet: {
|
|
51
|
+
WBTC: {
|
|
52
|
+
name: string;
|
|
53
|
+
symbol: string;
|
|
54
|
+
decimals: number;
|
|
55
|
+
chain: "ethereum_arbitrum";
|
|
56
|
+
isToken: boolean;
|
|
57
|
+
thumbnail: string;
|
|
58
|
+
address: string;
|
|
59
|
+
};
|
|
60
|
+
};
|
|
61
|
+
ethereum_localnet: {
|
|
62
|
+
WBTC: {
|
|
63
|
+
name: string;
|
|
64
|
+
symbol: string;
|
|
65
|
+
decimals: number;
|
|
66
|
+
chain: "ethereum_localnet";
|
|
67
|
+
isToken: boolean;
|
|
68
|
+
thumbnail: string;
|
|
69
|
+
address: string;
|
|
70
|
+
};
|
|
71
|
+
};
|
|
48
72
|
bitcoin: {
|
|
49
73
|
BTC: {
|
|
50
74
|
name: string;
|