@gardenfi/orderbook 0.1.4 → 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 +60 -6
- package/dist/index5.cjs +1 -1
- package/dist/index5.js +6 -0
- package/dist/index8.js +2 -4
- package/dist/src/lib/asset.d.ts +36 -2
- package/dist/src/lib/auth/siwe.d.ts +5 -4
- package/dist/src/lib/orderbook.d.ts +2 -1
- package/dist/src/lib/orderbook.types.d.ts +5 -4
- package/dist/src/lib/orderpair.d.ts +1 -0
- package/dist/src/lib/ordersSocket.d.ts +2 -1
- package/dist/src/lib/pws/index.d.ts +3 -3
- package/dist/src/lib/pws/interface.d.ts +2 -1
- package/dist/src/lib/pws/service.d.ts +5 -4
- package/dist/src/lib/pws/utils.d.ts +3 -2
- package/dist/src/lib/store/memoryStorage.d.ts +1 -0
- package/dist/src/lib/url/index.d.ts +1 -1
- package/dist/src/lib/utils.d.ts +2 -1
- package/package.json +2 -2
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}},ethereum_arbitrum:{WBTC:{name:"Wrapped Bitcoin",symbol:"WBTC",decimals:8,chain:e.ethereum_arbitrum,isToken:!0,thumbnail:"https://cryptologos.cc/logos/
|
|
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",
|
|
@@ -48,6 +72,16 @@ const e = {
|
|
|
48
72
|
isToken: !1
|
|
49
73
|
}
|
|
50
74
|
},
|
|
75
|
+
bitcoin_regtest: {
|
|
76
|
+
BTC: {
|
|
77
|
+
name: "Bitcoin Regtest",
|
|
78
|
+
symbol: "BTC",
|
|
79
|
+
decimals: 8,
|
|
80
|
+
thumbnail: "https://cryptologos.cc/logos/bitcoin-btc-logo.svg",
|
|
81
|
+
chain: e.bitcoin_regtest,
|
|
82
|
+
isToken: !1
|
|
83
|
+
}
|
|
84
|
+
},
|
|
51
85
|
ethereum_arbitrum: {
|
|
52
86
|
WBTC: {
|
|
53
87
|
name: "Wrapped Bitcoin",
|
|
@@ -55,11 +89,11 @@ const e = {
|
|
|
55
89
|
decimals: 8,
|
|
56
90
|
chain: e.ethereum_arbitrum,
|
|
57
91
|
isToken: !0,
|
|
58
|
-
thumbnail: "https://cryptologos.cc/logos/
|
|
92
|
+
thumbnail: "https://cryptologos.cc/logos/bitcoin-btc-logo.svg",
|
|
59
93
|
address: "0x2f2a2543B76A4166549F7aaB2e75Bef0aefC5B0f"
|
|
60
94
|
}
|
|
61
95
|
}
|
|
62
|
-
},
|
|
96
|
+
}, s = {
|
|
63
97
|
bitcoin: {
|
|
64
98
|
nativeAsset: o.bitcoin.BTC
|
|
65
99
|
},
|
|
@@ -105,11 +139,31 @@ const e = {
|
|
|
105
139
|
isToken: !1,
|
|
106
140
|
thumbnail: "https://cryptologos.cc/logos/arbitrum-arb-logo.svg"
|
|
107
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
|
+
}
|
|
108
162
|
}
|
|
109
|
-
},
|
|
163
|
+
}, i = (t) => !(t === e.ethereum_sepolia || t === e.bitcoin_testnet || t === e.bitcoin_regtest || t === e.ethereum_arbitrumlocalnet || t === e.ethereum_localnet);
|
|
110
164
|
export {
|
|
111
165
|
o as Assets,
|
|
112
166
|
e as Chains,
|
|
113
|
-
|
|
114
|
-
|
|
167
|
+
s as ChainsData,
|
|
168
|
+
i as isMainnet
|
|
115
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/index8.js
CHANGED
|
@@ -10,8 +10,7 @@ class v {
|
|
|
10
10
|
}
|
|
11
11
|
verifyToken(e, r) {
|
|
12
12
|
const t = f(e);
|
|
13
|
-
if (!t)
|
|
14
|
-
return !1;
|
|
13
|
+
if (!t) return !1;
|
|
15
14
|
try {
|
|
16
15
|
const i = Math.floor(Date.now() / 1e3) + 120;
|
|
17
16
|
return t.exp > i && t.userWallet.toLowerCase() === r.toLowerCase();
|
|
@@ -57,8 +56,7 @@ class v {
|
|
|
57
56
|
}
|
|
58
57
|
const f = (s) => {
|
|
59
58
|
try {
|
|
60
|
-
if (s.split(".").length < 3)
|
|
61
|
-
return;
|
|
59
|
+
if (s.split(".").length < 3) return;
|
|
62
60
|
const e = s.split(".")[1];
|
|
63
61
|
return e ? JSON.parse(Buffer.from(e, "base64").toString("latin1")) : void 0;
|
|
64
62
|
} catch {
|
package/dist/src/lib/asset.d.ts
CHANGED
|
@@ -5,9 +5,11 @@ 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
|
-
export type EvmChain = keyof Omit<typeof Chains,
|
|
12
|
+
export type EvmChain = keyof Omit<typeof Chains, "bitcoin" | "bitcoin_testnet" | "bitcoin_regtest">;
|
|
11
13
|
export type AssetCommon = {
|
|
12
14
|
name: string;
|
|
13
15
|
symbol: string;
|
|
@@ -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;
|
|
@@ -65,6 +89,16 @@ export declare const Assets: {
|
|
|
65
89
|
isToken: boolean;
|
|
66
90
|
};
|
|
67
91
|
};
|
|
92
|
+
bitcoin_regtest: {
|
|
93
|
+
BTC: {
|
|
94
|
+
name: string;
|
|
95
|
+
symbol: string;
|
|
96
|
+
decimals: number;
|
|
97
|
+
thumbnail: string;
|
|
98
|
+
chain: "bitcoin_regtest";
|
|
99
|
+
isToken: boolean;
|
|
100
|
+
};
|
|
101
|
+
};
|
|
68
102
|
ethereum_arbitrum: {
|
|
69
103
|
WBTC: {
|
|
70
104
|
name: string;
|
|
@@ -81,4 +115,4 @@ export type ChainData = {
|
|
|
81
115
|
nativeAsset: Asset;
|
|
82
116
|
};
|
|
83
117
|
export declare const ChainsData: Record<Chain, ChainData>;
|
|
84
|
-
export declare const isMainnet: (chain: Chain) =>
|
|
118
|
+
export declare const isMainnet: (chain: Chain) => chain is "ethereum" | "bitcoin" | "ethereum_arbitrum";
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import { JsonRpcSigner, Wallet } from
|
|
2
|
-
import { IAuth } from
|
|
3
|
-
import { OrderbookOpts } from
|
|
4
|
-
import { Url } from
|
|
1
|
+
import { JsonRpcSigner, Wallet } from 'ethers';
|
|
2
|
+
import { IAuth } from './auth.interface';
|
|
3
|
+
import { OrderbookOpts } from '../orderbook.types';
|
|
4
|
+
import { Url } from '../url';
|
|
5
|
+
|
|
5
6
|
export declare class Siwe implements IAuth {
|
|
6
7
|
private readonly url;
|
|
7
8
|
private store;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { CreateOrderConfig, IOrderbook, Order, OrderConfig, OrderNonVerbose, OrderbookConfig } from
|
|
1
|
+
import { CreateOrderConfig, IOrderbook, Order, OrderConfig, OrderNonVerbose, OrderbookConfig } from './orderbook.types';
|
|
2
|
+
|
|
2
3
|
/**
|
|
3
4
|
* A class that allows you to create and manage orders with the backend url.
|
|
4
5
|
*
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import { MarkNonNullable } from
|
|
2
|
-
import { Asset } from
|
|
3
|
-
import { JsonRpcSigner, Wallet } from
|
|
4
|
-
import { IStore } from
|
|
1
|
+
import { MarkNonNullable } from '@catalogfi/utils';
|
|
2
|
+
import { Asset } from './asset';
|
|
3
|
+
import { JsonRpcSigner, Wallet } from 'ethers';
|
|
4
|
+
import { IStore } from './store/store.interface';
|
|
5
|
+
|
|
5
6
|
/**
|
|
6
7
|
* Configuration for the orders you want to receive
|
|
7
8
|
*
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export { PaymentChannelService } from
|
|
2
|
-
export { IPaymentChannelService } from
|
|
3
|
-
export type { PaymentChannelState } from
|
|
1
|
+
export { PaymentChannelService } from './service';
|
|
2
|
+
export { IPaymentChannelService } from './interface';
|
|
3
|
+
export type { PaymentChannelState } from './interface';
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import { JsonRpcSigner, Wallet } from
|
|
2
|
-
import { ConditionalPaymentFinalRequest, ConditionalPaymentInitialRequest, IPaymentChannelService as IPaymentChannelService, PaymentChannelState } from
|
|
3
|
-
import { AsyncResult } from
|
|
4
|
-
import { IAuth } from
|
|
1
|
+
import { JsonRpcSigner, Wallet } from 'ethers';
|
|
2
|
+
import { ConditionalPaymentFinalRequest, ConditionalPaymentInitialRequest, IPaymentChannelService as IPaymentChannelService, PaymentChannelState } from './interface';
|
|
3
|
+
import { AsyncResult } from '@catalogfi/utils';
|
|
4
|
+
import { IAuth } from '../auth/auth.interface';
|
|
5
|
+
|
|
5
6
|
export declare class PaymentChannelService implements IPaymentChannelService {
|
|
6
7
|
private api;
|
|
7
8
|
private signer;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import { JsonRpcApiProvider, JsonRpcSigner, Wallet } from
|
|
2
|
-
import { ConditionalPaymentInitialRequest, PaymentChannelState } from
|
|
1
|
+
import { JsonRpcApiProvider, JsonRpcSigner, Wallet } from 'ethers';
|
|
2
|
+
import { ConditionalPaymentInitialRequest, PaymentChannelState } from './interface';
|
|
3
|
+
|
|
3
4
|
export declare function getTimelock(provider: JsonRpcApiProvider): Promise<number>;
|
|
4
5
|
export declare const parseError: (error: unknown) => string;
|
|
5
6
|
export declare const getProviderOrThrow: (signer: JsonRpcSigner | Wallet) => JsonRpcApiProvider;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export * from
|
|
1
|
+
export * from './Url';
|
package/dist/src/lib/utils.d.ts
CHANGED
package/package.json
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gardenfi/orderbook",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.6",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"dependencies": {
|
|
6
6
|
"@catalogfi/utils": "^0.1.6",
|
|
7
|
-
"@catalogfi/wallets": "0.2.
|
|
7
|
+
"@catalogfi/wallets": "0.2.43",
|
|
8
8
|
"bufferutil": "^4.0.8",
|
|
9
9
|
"ethers": "6.8.0",
|
|
10
10
|
"siwe": "^2.1.4",
|