@omnisat/lasereyes 0.0.80 → 0.0.82
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/README.md +66 -40
- package/dist/index.d.ts +3 -228
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +30460 -3034
- package/dist/index.umd.cjs +86 -0
- package/package.json +30 -28
- package/dist/index.mjs +0 -3103
package/dist/index.mjs
DELETED
|
@@ -1,3103 +0,0 @@
|
|
|
1
|
-
var __defProp = Object.defineProperty;
|
|
2
|
-
var __defProps = Object.defineProperties;
|
|
3
|
-
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
4
|
-
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
5
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
-
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
7
|
-
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
8
|
-
var __spreadValues = (a, b) => {
|
|
9
|
-
for (var prop in b || (b = {}))
|
|
10
|
-
if (__hasOwnProp.call(b, prop))
|
|
11
|
-
__defNormalProp(a, prop, b[prop]);
|
|
12
|
-
if (__getOwnPropSymbols)
|
|
13
|
-
for (var prop of __getOwnPropSymbols(b)) {
|
|
14
|
-
if (__propIsEnum.call(b, prop))
|
|
15
|
-
__defNormalProp(a, prop, b[prop]);
|
|
16
|
-
}
|
|
17
|
-
return a;
|
|
18
|
-
};
|
|
19
|
-
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
20
|
-
var __objRest = (source, exclude) => {
|
|
21
|
-
var target = {};
|
|
22
|
-
for (var prop in source)
|
|
23
|
-
if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)
|
|
24
|
-
target[prop] = source[prop];
|
|
25
|
-
if (source != null && __getOwnPropSymbols)
|
|
26
|
-
for (var prop of __getOwnPropSymbols(source)) {
|
|
27
|
-
if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop))
|
|
28
|
-
target[prop] = source[prop];
|
|
29
|
-
}
|
|
30
|
-
return target;
|
|
31
|
-
};
|
|
32
|
-
var __async = (__this, __arguments, generator) => {
|
|
33
|
-
return new Promise((resolve, reject) => {
|
|
34
|
-
var fulfilled = (value) => {
|
|
35
|
-
try {
|
|
36
|
-
step(generator.next(value));
|
|
37
|
-
} catch (e) {
|
|
38
|
-
reject(e);
|
|
39
|
-
}
|
|
40
|
-
};
|
|
41
|
-
var rejected = (value) => {
|
|
42
|
-
try {
|
|
43
|
-
step(generator.throw(value));
|
|
44
|
-
} catch (e) {
|
|
45
|
-
reject(e);
|
|
46
|
-
}
|
|
47
|
-
};
|
|
48
|
-
var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
|
|
49
|
-
step((generator = generator.apply(__this, __arguments)).next());
|
|
50
|
-
});
|
|
51
|
-
};
|
|
52
|
-
var __forAwait = (obj, it, method) => {
|
|
53
|
-
it = obj[Symbol.asyncIterator];
|
|
54
|
-
method = (key, fn) => (fn = obj[key]) && (it[key] = (arg) => new Promise((resolve, reject, done) => {
|
|
55
|
-
arg = fn.call(obj, arg);
|
|
56
|
-
done = arg.done;
|
|
57
|
-
return Promise.resolve(arg.value).then((value) => resolve({ value, done }), reject);
|
|
58
|
-
}));
|
|
59
|
-
return it ? it.call(obj) : (obj = obj[Symbol.iterator](), it = {}, method("next"), method("return"), it);
|
|
60
|
-
};
|
|
61
|
-
|
|
62
|
-
// src/consts/networks.ts
|
|
63
|
-
var XVERSE_NETWORK = "Mainnet";
|
|
64
|
-
var UNISAT_MAINNET = "BITCOIN_MAINNET";
|
|
65
|
-
var UNISAT_TESTNET = "BITCOIN_TESTNET";
|
|
66
|
-
var UNISAT_TESTNET4 = "BITCOIN_TESTNET4";
|
|
67
|
-
var UNISAT_SIGNET = "BITCOIN_SIGNET";
|
|
68
|
-
var UNISAT_FRACTAL_MAINNET = "FRACTAL_BITCOIN_MAINNET";
|
|
69
|
-
var UNISAT_FRACTAL_TESTNET = "FRACTAL_BITCOIN_TESTNET";
|
|
70
|
-
var OP_WALLET_MAINNET = "livenet";
|
|
71
|
-
var OP_WALLET_TESTNET = "testnet";
|
|
72
|
-
var XVERSE_MAINNET = "Mainnet";
|
|
73
|
-
var XVERSE_TESTNET = "Testnet";
|
|
74
|
-
var XVERSE_SIGNET = "Signet";
|
|
75
|
-
var OKX_MAINNET = "livenet";
|
|
76
|
-
var OKX_TESTNET = "testnet";
|
|
77
|
-
var WIZZ_MAINNET = "livenet";
|
|
78
|
-
var WIZZ_TESTNET = "testnet";
|
|
79
|
-
var WIZZ_TESTNET4 = "testnet4";
|
|
80
|
-
var WIZZ_SIGNET = "signet";
|
|
81
|
-
var ORANGE_MAINNET = "Mainnet";
|
|
82
|
-
var ORANGE_TESTNET = "Testnet";
|
|
83
|
-
var LEATHER_MAINNET = "mainnet";
|
|
84
|
-
var LEATHER_TESTNET = "testnet";
|
|
85
|
-
var MAINNET = "mainnet";
|
|
86
|
-
var SIGNET = "signet";
|
|
87
|
-
var TESTNET = "testnet";
|
|
88
|
-
var TESTNET4 = "testnet4";
|
|
89
|
-
var FRACTAL_MAINNET = "fractal mainnet";
|
|
90
|
-
var FRACTAL_TESTNET = "fractal testnet";
|
|
91
|
-
var REGTEST = "regtest";
|
|
92
|
-
var getXverseNetwork = (network) => {
|
|
93
|
-
if (network === MAINNET)
|
|
94
|
-
return XVERSE_MAINNET;
|
|
95
|
-
if (network === TESTNET)
|
|
96
|
-
return XVERSE_TESTNET;
|
|
97
|
-
if (network === SIGNET)
|
|
98
|
-
return XVERSE_SIGNET;
|
|
99
|
-
return XVERSE_MAINNET;
|
|
100
|
-
};
|
|
101
|
-
var getOrangeNetwork = (network) => {
|
|
102
|
-
if (network === MAINNET)
|
|
103
|
-
return ORANGE_MAINNET;
|
|
104
|
-
if (network === TESTNET)
|
|
105
|
-
return ORANGE_TESTNET;
|
|
106
|
-
return ORANGE_MAINNET;
|
|
107
|
-
};
|
|
108
|
-
var getLeatherNetwork = (network) => {
|
|
109
|
-
if (network === MAINNET)
|
|
110
|
-
return LEATHER_MAINNET;
|
|
111
|
-
if (network === TESTNET)
|
|
112
|
-
return LEATHER_TESTNET;
|
|
113
|
-
return LEATHER_MAINNET;
|
|
114
|
-
};
|
|
115
|
-
var getUnisatNetwork = (network) => {
|
|
116
|
-
if (network === MAINNET)
|
|
117
|
-
return UNISAT_MAINNET;
|
|
118
|
-
if (network === TESTNET)
|
|
119
|
-
return UNISAT_TESTNET;
|
|
120
|
-
if (network === TESTNET4)
|
|
121
|
-
return UNISAT_TESTNET4;
|
|
122
|
-
if (network === SIGNET)
|
|
123
|
-
return UNISAT_SIGNET;
|
|
124
|
-
if (network === FRACTAL_MAINNET)
|
|
125
|
-
return UNISAT_FRACTAL_MAINNET;
|
|
126
|
-
if (network === FRACTAL_TESTNET)
|
|
127
|
-
return UNISAT_FRACTAL_TESTNET;
|
|
128
|
-
return UNISAT_MAINNET;
|
|
129
|
-
};
|
|
130
|
-
var getWizzNetwork = (network) => {
|
|
131
|
-
if (network === MAINNET)
|
|
132
|
-
return WIZZ_MAINNET;
|
|
133
|
-
if (network === TESTNET)
|
|
134
|
-
return WIZZ_TESTNET;
|
|
135
|
-
if (network === TESTNET4)
|
|
136
|
-
return WIZZ_TESTNET4;
|
|
137
|
-
if (network === SIGNET)
|
|
138
|
-
return WIZZ_SIGNET;
|
|
139
|
-
if (network === FRACTAL_TESTNET)
|
|
140
|
-
return WIZZ_TESTNET;
|
|
141
|
-
if (network === FRACTAL_MAINNET)
|
|
142
|
-
return WIZZ_MAINNET;
|
|
143
|
-
return WIZZ_MAINNET;
|
|
144
|
-
};
|
|
145
|
-
var getNetworkForUnisat = (network) => {
|
|
146
|
-
if (network === UNISAT_MAINNET)
|
|
147
|
-
return MAINNET;
|
|
148
|
-
if (network === UNISAT_TESTNET)
|
|
149
|
-
return TESTNET;
|
|
150
|
-
if (network === UNISAT_TESTNET4)
|
|
151
|
-
return TESTNET4;
|
|
152
|
-
if (network === UNISAT_SIGNET)
|
|
153
|
-
return SIGNET;
|
|
154
|
-
if (network === UNISAT_FRACTAL_MAINNET)
|
|
155
|
-
return FRACTAL_MAINNET;
|
|
156
|
-
if (network === UNISAT_FRACTAL_TESTNET)
|
|
157
|
-
return FRACTAL_TESTNET;
|
|
158
|
-
return MAINNET;
|
|
159
|
-
};
|
|
160
|
-
var getNetworkForXverse = (network) => {
|
|
161
|
-
if (network === XVERSE_MAINNET)
|
|
162
|
-
return MAINNET;
|
|
163
|
-
if (network === XVERSE_TESTNET)
|
|
164
|
-
return TESTNET;
|
|
165
|
-
return MAINNET;
|
|
166
|
-
};
|
|
167
|
-
var getNetworkForLeather = (network) => {
|
|
168
|
-
if (network === LEATHER_MAINNET)
|
|
169
|
-
return MAINNET;
|
|
170
|
-
if (network === LEATHER_TESTNET)
|
|
171
|
-
return TESTNET;
|
|
172
|
-
return MAINNET;
|
|
173
|
-
};
|
|
174
|
-
var getNetworkForOkx = (network) => {
|
|
175
|
-
if (network === OKX_MAINNET)
|
|
176
|
-
return MAINNET;
|
|
177
|
-
if (network === OKX_TESTNET)
|
|
178
|
-
return TESTNET;
|
|
179
|
-
return MAINNET;
|
|
180
|
-
};
|
|
181
|
-
var getNetworkForWizz = (network) => {
|
|
182
|
-
if (network === WIZZ_MAINNET)
|
|
183
|
-
return MAINNET;
|
|
184
|
-
if (network === WIZZ_TESTNET)
|
|
185
|
-
return TESTNET;
|
|
186
|
-
if (network === WIZZ_TESTNET4)
|
|
187
|
-
return TESTNET4;
|
|
188
|
-
if (network === WIZZ_SIGNET)
|
|
189
|
-
return SIGNET;
|
|
190
|
-
if (network === FRACTAL_TESTNET)
|
|
191
|
-
return TESTNET;
|
|
192
|
-
if (network === FRACTAL_MAINNET)
|
|
193
|
-
return MAINNET;
|
|
194
|
-
return MAINNET;
|
|
195
|
-
};
|
|
196
|
-
var MEMPOOL_SPACE_URL = "https://mempool.space";
|
|
197
|
-
var MEMPOOL_SPACE_TESTNET_URL = "https://mempool.space/testnet";
|
|
198
|
-
var MEMPOOL_SPACE_SIGNET_URL = "https://mempool.space/signet";
|
|
199
|
-
var getMempoolSpaceUrl = (network) => network === TESTNET ? MEMPOOL_SPACE_TESTNET_URL : network === SIGNET ? MEMPOOL_SPACE_SIGNET_URL : MEMPOOL_SPACE_URL;
|
|
200
|
-
|
|
201
|
-
// src/consts/wallets.ts
|
|
202
|
-
var OYL = "oyl";
|
|
203
|
-
var UNISAT = "unisat";
|
|
204
|
-
var XVERSE = "xverse";
|
|
205
|
-
var PHANTOM = "phantom";
|
|
206
|
-
var LEATHER = "leather";
|
|
207
|
-
var MAGIC_EDEN = "magic-eden";
|
|
208
|
-
var OKX = "okx";
|
|
209
|
-
var WIZZ = "wizz";
|
|
210
|
-
var ORANGE = "orange";
|
|
211
|
-
var P2TR = "p2tr";
|
|
212
|
-
var P2PKH = "p2pkh";
|
|
213
|
-
var P2WPKH = "p2wpkh";
|
|
214
|
-
var P2PSH = "p2psh";
|
|
215
|
-
var P2WSH = "p2wsh";
|
|
216
|
-
var P2SH = "p2sh";
|
|
217
|
-
var WALLETS = {
|
|
218
|
-
oyl: {
|
|
219
|
-
name: OYL,
|
|
220
|
-
icon: "data:image/svg+xml,%3Csvg%20width%3D%2296%22%20height%3D%2216%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M17.27.318c2.947%200%205.72.26%208.32.78%202.6.507%204.714%201.307%206.34%202.4%201.64%201.094%202.46%202.467%202.46%204.12%200%201.654-.82%203.047-2.46%204.18-1.64%201.12-3.766%201.954-6.38%202.5-2.6.547-5.36.82-8.28.82-2.946%200-5.72-.253-8.32-.76-2.6-.52-4.72-1.326-6.36-2.42C.964%2010.845.15%209.472.15%207.818c0-1.653.82-3.04%202.46-4.16%201.64-1.133%203.76-1.973%206.36-2.52%202.614-.546%205.38-.82%208.3-.82Zm.04%2011.96c1.4%200%202.8-.146%204.2-.44%201.414-.293%202.6-.78%203.56-1.46.96-.68%201.44-1.566%201.44-2.66%200-1.093-.48-1.98-1.44-2.66-.96-.68-2.146-1.166-3.56-1.46-1.4-.293-2.8-.44-4.2-.44h-.08c-1.4%200-2.806.147-4.22.44-1.4.294-2.58.78-3.54%201.46-.96.68-1.44%201.567-1.44%202.66%200%201.094.48%201.98%201.44%202.66.96.68%202.14%201.167%203.54%201.46%201.414.294%202.82.44%204.22.44h.08ZM61.293.758c.08-.026.14-.04.18-.04h8.24c.12%200%20.214.04.28.12.08.08.12.174.12.28%200%20.147-.066.26-.2.34l-14%207.7c-.133.067-.2.18-.2.34v4.82c0%20.107-.04.2-.12.28a.384.384%200%200%201-.28.12h-6.94c-.106%200-.2-.04-.28-.12a.384.384%200%200%201-.12-.28v-4.82c0-.16-.066-.273-.2-.34l-13.98-7.7a.376.376%200%200%201-.2-.34c0-.106.034-.2.1-.28.067-.08.16-.12.28-.12h8.24c.054%200%20.12.014.2.04l9.24%205.1c.08.027.147.04.2.04.04%200%20.1-.013.18-.04l9.26-5.1Zm11.232.36c0-.106.033-.2.1-.28.08-.08.173-.12.28-.12h6.84c.106%200%20.193.04.26.12.08.08.12.174.12.28v10.32c0%20.107.04.2.12.28.08.08.173.12.28.12h14.46c.106%200%20.193.04.26.12.08.08.12.174.12.28v2.08c0%20.107-.04.2-.12.28a.322.322%200%200%201-.26.12h-22.08c-.107%200-.2-.04-.28-.12a.424.424%200%200%201-.1-.28v-13.2Z%22%20fill%3D%22%23fff%22%2F%3E%3C%2Fsvg%3E",
|
|
221
|
-
site: "https://oyl.io/",
|
|
222
|
-
disabled: false
|
|
223
|
-
},
|
|
224
|
-
unisat: {
|
|
225
|
-
name: UNISAT,
|
|
226
|
-
icon: "/wallet-logos/unisat_logo.png",
|
|
227
|
-
site: "https://unisat.io/",
|
|
228
|
-
disabled: false
|
|
229
|
-
},
|
|
230
|
-
xverse: {
|
|
231
|
-
name: XVERSE,
|
|
232
|
-
icon: "/wallet-logos/xverse_logo.png",
|
|
233
|
-
site: "https://www.xverse.app/",
|
|
234
|
-
config: () => {
|
|
235
|
-
},
|
|
236
|
-
disabled: false
|
|
237
|
-
},
|
|
238
|
-
leather: {
|
|
239
|
-
name: LEATHER,
|
|
240
|
-
icon: "/wallet-logos/leather_logo.png",
|
|
241
|
-
site: "https://leather.io/",
|
|
242
|
-
config: () => {
|
|
243
|
-
},
|
|
244
|
-
disabled: true
|
|
245
|
-
}
|
|
246
|
-
};
|
|
247
|
-
|
|
248
|
-
// src/config/createConfig.ts
|
|
249
|
-
var createConfig = (config) => {
|
|
250
|
-
return __spreadValues({}, config);
|
|
251
|
-
};
|
|
252
|
-
|
|
253
|
-
// src/providers/LaserEyesProvider.tsx
|
|
254
|
-
import {
|
|
255
|
-
createContext,
|
|
256
|
-
useCallback,
|
|
257
|
-
useContext,
|
|
258
|
-
useEffect,
|
|
259
|
-
useRef,
|
|
260
|
-
useState
|
|
261
|
-
} from "react";
|
|
262
|
-
import * as bitcoin2 from "bitcoinjs-lib";
|
|
263
|
-
|
|
264
|
-
// src/consts/settings.ts
|
|
265
|
-
var LOCAL_STORAGE_DEFAULT_WALLET = "defaultWallet";
|
|
266
|
-
var initialWalletContext = {
|
|
267
|
-
hasUnisat: false,
|
|
268
|
-
hasXverse: false,
|
|
269
|
-
hasOyl: false,
|
|
270
|
-
hasMagicEden: false,
|
|
271
|
-
hasOkx: false,
|
|
272
|
-
hasLeather: false,
|
|
273
|
-
hasPhantom: false,
|
|
274
|
-
hasWizz: false,
|
|
275
|
-
hasOrange: false,
|
|
276
|
-
isInitializing: true,
|
|
277
|
-
connected: false,
|
|
278
|
-
isConnecting: false,
|
|
279
|
-
publicKey: "",
|
|
280
|
-
address: "",
|
|
281
|
-
paymentAddress: "",
|
|
282
|
-
paymentPublicKey: "",
|
|
283
|
-
balance: void 0,
|
|
284
|
-
network: MAINNET,
|
|
285
|
-
library: null,
|
|
286
|
-
provider: null,
|
|
287
|
-
accounts: [],
|
|
288
|
-
connect: (walletName) => __async(void 0, null, function* () {
|
|
289
|
-
}),
|
|
290
|
-
disconnect: () => {
|
|
291
|
-
},
|
|
292
|
-
requestAccounts: () => __async(void 0, null, function* () {
|
|
293
|
-
return [];
|
|
294
|
-
}),
|
|
295
|
-
getNetwork: () => __async(void 0, null, function* () {
|
|
296
|
-
return MAINNET;
|
|
297
|
-
}),
|
|
298
|
-
switchNetwork: (network) => __async(void 0, null, function* () {
|
|
299
|
-
}),
|
|
300
|
-
getPublicKey: () => __async(void 0, null, function* () {
|
|
301
|
-
return "";
|
|
302
|
-
}),
|
|
303
|
-
getBalance: () => __async(void 0, null, function* () {
|
|
304
|
-
return "";
|
|
305
|
-
}),
|
|
306
|
-
getInscriptions: () => __async(void 0, null, function* () {
|
|
307
|
-
return [];
|
|
308
|
-
}),
|
|
309
|
-
sendBTC: (to, amount) => __async(void 0, null, function* () {
|
|
310
|
-
return "";
|
|
311
|
-
}),
|
|
312
|
-
signMessage: (message) => __async(void 0, null, function* () {
|
|
313
|
-
return "";
|
|
314
|
-
}),
|
|
315
|
-
signPsbt: (tx) => __async(void 0, null, function* () {
|
|
316
|
-
return {
|
|
317
|
-
signedPsbtHex: "",
|
|
318
|
-
signedPsbtBase64: "",
|
|
319
|
-
txId: ""
|
|
320
|
-
};
|
|
321
|
-
}),
|
|
322
|
-
pushPsbt: (tx) => __async(void 0, null, function* () {
|
|
323
|
-
return "";
|
|
324
|
-
}),
|
|
325
|
-
inscribe: (content) => __async(void 0, null, function* () {
|
|
326
|
-
return "";
|
|
327
|
-
}),
|
|
328
|
-
isCreatingCommit: false,
|
|
329
|
-
isInscribing: false
|
|
330
|
-
};
|
|
331
|
-
|
|
332
|
-
// src/providers/LaserEyesProvider.tsx
|
|
333
|
-
import { useLocalStorage } from "usehooks-ts";
|
|
334
|
-
|
|
335
|
-
// src/lib/helpers.ts
|
|
336
|
-
import * as bitcoin from "bitcoinjs-lib";
|
|
337
|
-
import axios from "axios";
|
|
338
|
-
|
|
339
|
-
// src/lib/urls.ts
|
|
340
|
-
var MEMPOOL_SPACE_URL2 = "https://mempool.space";
|
|
341
|
-
var MEMPOOL_SPACE_TESTNET_URL2 = "https://mempool.space/testnet";
|
|
342
|
-
var MEMPOOL_SPACE_TESTNET4_URL = "https://mempool.space/testnet4";
|
|
343
|
-
var MEMPOOL_SPACE_SIGNET_URL2 = "https://mempool.space/signet";
|
|
344
|
-
var MEMPOOL_SPACE_FRACTAL_MAINNET_URL = "https://mempool.fractalbitcoin.io";
|
|
345
|
-
var MEMPOOL_SPACE_FRACTAL_TESTNET_URL = "https://mempool-testnet.fractalbitcoin.io";
|
|
346
|
-
var getMempoolSpaceUrl2 = (network) => network === TESTNET ? MEMPOOL_SPACE_TESTNET_URL2 : network === TESTNET4 ? MEMPOOL_SPACE_TESTNET4_URL : network === SIGNET ? MEMPOOL_SPACE_SIGNET_URL2 : network === FRACTAL_MAINNET ? MEMPOOL_SPACE_FRACTAL_MAINNET_URL : network === FRACTAL_TESTNET ? MEMPOOL_SPACE_FRACTAL_TESTNET_URL : MEMPOOL_SPACE_URL2;
|
|
347
|
-
|
|
348
|
-
// src/lib/helpers.ts
|
|
349
|
-
import * as ecc from "@bitcoinerlab/secp256k1";
|
|
350
|
-
bitcoin.initEccLib(ecc);
|
|
351
|
-
var getBitcoinNetwork = (network) => {
|
|
352
|
-
if (network === TESTNET || network === TESTNET4 || network === SIGNET) {
|
|
353
|
-
return bitcoin.networks.testnet;
|
|
354
|
-
} else {
|
|
355
|
-
return bitcoin.networks.bitcoin;
|
|
356
|
-
}
|
|
357
|
-
};
|
|
358
|
-
var findOrdinalsAddress = (addresses) => {
|
|
359
|
-
return addresses.find(
|
|
360
|
-
({ purpose }) => purpose === "ordinals"
|
|
361
|
-
);
|
|
362
|
-
};
|
|
363
|
-
var findPaymentAddress = (addresses) => {
|
|
364
|
-
return addresses.find(
|
|
365
|
-
({ purpose }) => purpose === "payment"
|
|
366
|
-
);
|
|
367
|
-
};
|
|
368
|
-
var getBTCBalance = (address2, network) => __async(void 0, null, function* () {
|
|
369
|
-
try {
|
|
370
|
-
const utxos = yield getAddressUtxos(
|
|
371
|
-
address2,
|
|
372
|
-
network
|
|
373
|
-
);
|
|
374
|
-
if (!utxos)
|
|
375
|
-
return 0;
|
|
376
|
-
return utxos.reduce((acc, utxo) => acc + utxo.value, 0);
|
|
377
|
-
} catch (error) {
|
|
378
|
-
console.error("Error fetching BTC balance:", error);
|
|
379
|
-
throw new Error("Failed to fetch BTC balance");
|
|
380
|
-
}
|
|
381
|
-
});
|
|
382
|
-
var satoshisToBTC = (satoshis) => {
|
|
383
|
-
if (Number.isNaN(satoshis) || satoshis === void 0)
|
|
384
|
-
return "--";
|
|
385
|
-
const btcValue = satoshis / 1e8;
|
|
386
|
-
return btcValue.toFixed(8);
|
|
387
|
-
};
|
|
388
|
-
var isBase64 = (str) => {
|
|
389
|
-
const base64Regex = /^(?:[A-Za-z0-9+\/]{4})*?(?:[A-Za-z0-9+\/]{2}==|[A-Za-z0-9+\/]{3}=)?$/;
|
|
390
|
-
return base64Regex.test(str);
|
|
391
|
-
};
|
|
392
|
-
var isHex = (str) => {
|
|
393
|
-
const hexRegex = /^[a-fA-F0-9]+$/;
|
|
394
|
-
return hexRegex.test(str);
|
|
395
|
-
};
|
|
396
|
-
function estimateTxSize(taprootInputCount, nonTaprootInputCount, outputCount) {
|
|
397
|
-
const baseTxSize = 10;
|
|
398
|
-
const taprootInputSize = 57;
|
|
399
|
-
const nonTaprootInputSize = 41;
|
|
400
|
-
const outputSize = 34;
|
|
401
|
-
const totalInputSize = taprootInputCount * taprootInputSize + nonTaprootInputCount * nonTaprootInputSize;
|
|
402
|
-
const totalOutputSize = outputCount * outputSize;
|
|
403
|
-
return baseTxSize + totalInputSize + totalOutputSize;
|
|
404
|
-
}
|
|
405
|
-
function getAddressUtxos(address2, network) {
|
|
406
|
-
return __async(this, null, function* () {
|
|
407
|
-
if (address2.startsWith("t")) {
|
|
408
|
-
if (network === MAINNET) {
|
|
409
|
-
return [];
|
|
410
|
-
}
|
|
411
|
-
if (network === FRACTAL_MAINNET) {
|
|
412
|
-
return [];
|
|
413
|
-
}
|
|
414
|
-
if (network === FRACTAL_TESTNET) {
|
|
415
|
-
return [];
|
|
416
|
-
}
|
|
417
|
-
}
|
|
418
|
-
return yield axios.get(`${getMempoolSpaceUrl2(network)}/api/address/${address2}/utxo`).then((response) => response.data);
|
|
419
|
-
});
|
|
420
|
-
}
|
|
421
|
-
function createSendBtcPsbt(address2, paymentAddress, recipientAddress, amount, paymentPublicKey, network, feeRate = 7) {
|
|
422
|
-
return __async(this, null, function* () {
|
|
423
|
-
const isTaprootOnly = address2 === paymentAddress;
|
|
424
|
-
const utxos = yield getAddressUtxos(
|
|
425
|
-
paymentAddress,
|
|
426
|
-
network
|
|
427
|
-
);
|
|
428
|
-
if (!utxos) {
|
|
429
|
-
throw new Error("No UTXOs found");
|
|
430
|
-
}
|
|
431
|
-
const sortedUtxos = utxos.sort(
|
|
432
|
-
(a, b) => b.value - a.value
|
|
433
|
-
);
|
|
434
|
-
const psbt = new bitcoin.Psbt({ network: getBitcoinNetwork(network) });
|
|
435
|
-
const estTxSize = estimateTxSize(1, 0, 2);
|
|
436
|
-
const satsNeeded = Math.floor(estTxSize * feeRate) + amount;
|
|
437
|
-
let amountGathered = 0;
|
|
438
|
-
let counter = 0;
|
|
439
|
-
try {
|
|
440
|
-
for (var iter = __forAwait(sortedUtxos), more, temp, error; more = !(temp = yield iter.next()).done; more = false) {
|
|
441
|
-
let utxo = temp.value;
|
|
442
|
-
const { txid, vout, value } = utxo;
|
|
443
|
-
const script = bitcoin.address.toOutputScript(
|
|
444
|
-
paymentAddress,
|
|
445
|
-
getBitcoinNetwork(network)
|
|
446
|
-
);
|
|
447
|
-
psbt.addInput({
|
|
448
|
-
hash: txid,
|
|
449
|
-
index: vout,
|
|
450
|
-
witnessUtxo: {
|
|
451
|
-
script,
|
|
452
|
-
value
|
|
453
|
-
}
|
|
454
|
-
});
|
|
455
|
-
if (!isTaprootOnly) {
|
|
456
|
-
const redeemScript = getRedeemScript(paymentPublicKey, network);
|
|
457
|
-
psbt.updateInput(counter, { redeemScript });
|
|
458
|
-
}
|
|
459
|
-
amountGathered += value;
|
|
460
|
-
if (amountGathered >= satsNeeded) {
|
|
461
|
-
break;
|
|
462
|
-
}
|
|
463
|
-
}
|
|
464
|
-
} catch (temp) {
|
|
465
|
-
error = [temp];
|
|
466
|
-
} finally {
|
|
467
|
-
try {
|
|
468
|
-
more && (temp = iter.return) && (yield temp.call(iter));
|
|
469
|
-
} finally {
|
|
470
|
-
if (error)
|
|
471
|
-
throw error[0];
|
|
472
|
-
}
|
|
473
|
-
}
|
|
474
|
-
if (amountGathered < satsNeeded) {
|
|
475
|
-
throw new Error("Insufficient funds");
|
|
476
|
-
}
|
|
477
|
-
psbt.addOutput({
|
|
478
|
-
address: recipientAddress,
|
|
479
|
-
value: amount
|
|
480
|
-
});
|
|
481
|
-
if (amountGathered > satsNeeded) {
|
|
482
|
-
psbt.addOutput({
|
|
483
|
-
address: paymentAddress,
|
|
484
|
-
value: amountGathered - satsNeeded - amount
|
|
485
|
-
});
|
|
486
|
-
}
|
|
487
|
-
return {
|
|
488
|
-
psbtBase64: psbt.toBase64(),
|
|
489
|
-
psbtHex: psbt.toHex()
|
|
490
|
-
};
|
|
491
|
-
});
|
|
492
|
-
}
|
|
493
|
-
function getRedeemScript(paymentPublicKey, network) {
|
|
494
|
-
var _a;
|
|
495
|
-
const p2wpkh = bitcoin.payments.p2wpkh({
|
|
496
|
-
pubkey: Buffer.from(paymentPublicKey, "hex"),
|
|
497
|
-
network: getBitcoinNetwork(network)
|
|
498
|
-
});
|
|
499
|
-
const p2sh = bitcoin.payments.p2sh({
|
|
500
|
-
redeem: p2wpkh,
|
|
501
|
-
network: getBitcoinNetwork(network)
|
|
502
|
-
});
|
|
503
|
-
return (_a = p2sh == null ? void 0 : p2sh.redeem) == null ? void 0 : _a.output;
|
|
504
|
-
}
|
|
505
|
-
function delay(ms) {
|
|
506
|
-
return new Promise((resolve) => setTimeout(resolve, ms));
|
|
507
|
-
}
|
|
508
|
-
|
|
509
|
-
// src/providers/LaserEyesProvider.tsx
|
|
510
|
-
import {
|
|
511
|
-
BitcoinNetworkType,
|
|
512
|
-
getAddress,
|
|
513
|
-
MessageSigningProtocols,
|
|
514
|
-
request,
|
|
515
|
-
RpcErrorCode,
|
|
516
|
-
sendBtcTransaction,
|
|
517
|
-
signMessage as signMessageSatsConnect,
|
|
518
|
-
signTransaction
|
|
519
|
-
} from "sats-connect";
|
|
520
|
-
import orange from "@orangecrypto/orange-connect";
|
|
521
|
-
import { fromOutputScript } from "bitcoinjs-lib/src/address";
|
|
522
|
-
import axios2 from "axios";
|
|
523
|
-
import { jsx } from "react/jsx-runtime";
|
|
524
|
-
var {
|
|
525
|
-
getAddress: getAddressOrange,
|
|
526
|
-
signMessage: signMessageOrange,
|
|
527
|
-
sendBtcTransaction: sendBtcTxOrange,
|
|
528
|
-
signTransaction: signPsbtOrange
|
|
529
|
-
} = orange;
|
|
530
|
-
var LaserEyesContext = createContext(initialWalletContext);
|
|
531
|
-
var useLaserEyes = () => {
|
|
532
|
-
return useContext(LaserEyesContext);
|
|
533
|
-
};
|
|
534
|
-
var LaserEyesProvider = ({
|
|
535
|
-
children,
|
|
536
|
-
config
|
|
537
|
-
}) => {
|
|
538
|
-
const selfRef = useRef({
|
|
539
|
-
accounts: []
|
|
540
|
-
});
|
|
541
|
-
const self = selfRef.current;
|
|
542
|
-
const [library, setLibrary] = useLocalStorage("library", {});
|
|
543
|
-
const [provider, setProvider] = useLocalStorage("provider", void 0);
|
|
544
|
-
const [isInitializing, setIsInitializing] = useState(true);
|
|
545
|
-
const [connected, setConnected] = useLocalStorage("connected", false);
|
|
546
|
-
const [isConnecting, setIsConnecting] = useState(false);
|
|
547
|
-
const [accounts, setAccounts] = useState([]);
|
|
548
|
-
const [publicKey, setPublicKey] = useLocalStorage("publicKey", "");
|
|
549
|
-
const [paymentPublicKey, setPaymentPublicKey] = useLocalStorage(
|
|
550
|
-
"paymentPublicKey",
|
|
551
|
-
""
|
|
552
|
-
);
|
|
553
|
-
const [address2, setAddress] = useLocalStorage("address", "");
|
|
554
|
-
const [paymentAddress, setPaymentAddress] = useLocalStorage(
|
|
555
|
-
"paymentAddress",
|
|
556
|
-
""
|
|
557
|
-
);
|
|
558
|
-
const [balance, setBalance] = useState();
|
|
559
|
-
const [hasUnisat, setHasUnisat] = useState(false);
|
|
560
|
-
const [hasXverse, setHasXverse] = useState(false);
|
|
561
|
-
const [hasOyl, setHasOyl] = useState(false);
|
|
562
|
-
const [hasMagicEden, setHasMagicEden] = useState(false);
|
|
563
|
-
const [hasOkx, setHasOkx] = useState(false);
|
|
564
|
-
const [hasLeather, setHasLeather] = useState(false);
|
|
565
|
-
const [hasPhantom, setHasPhantom] = useState(false);
|
|
566
|
-
const [hasWizz, setHasWizz] = useState(false);
|
|
567
|
-
const [hasOrange, setHasOrange] = useState(false);
|
|
568
|
-
const [network, setNetwork] = useLocalStorage("network", (config == null ? void 0 : config.network) || MAINNET);
|
|
569
|
-
useEffect(() => {
|
|
570
|
-
if (config && config.network && library) {
|
|
571
|
-
setNetwork(config.network);
|
|
572
|
-
getNetwork().then((foundNetwork) => {
|
|
573
|
-
try {
|
|
574
|
-
if (config.network !== foundNetwork) {
|
|
575
|
-
if (provider !== XVERSE) {
|
|
576
|
-
switchNetwork(network);
|
|
577
|
-
}
|
|
578
|
-
}
|
|
579
|
-
} catch (e) {
|
|
580
|
-
disconnect();
|
|
581
|
-
}
|
|
582
|
-
});
|
|
583
|
-
}
|
|
584
|
-
}, [config, library]);
|
|
585
|
-
const checkInitializationComplete = () => {
|
|
586
|
-
if (hasUnisat !== void 0 && hasXverse !== void 0 && hasOyl !== void 0 && hasMagicEden !== void 0 && hasOkx !== void 0 && hasLeather !== void 0 && hasPhantom !== void 0 && hasWizz !== void 0 && hasOrange !== void 0) {
|
|
587
|
-
setIsInitializing(false);
|
|
588
|
-
}
|
|
589
|
-
};
|
|
590
|
-
useEffect(() => {
|
|
591
|
-
const observer = new MutationObserver(() => {
|
|
592
|
-
const unisatLib = window == null ? void 0 : window.unisat;
|
|
593
|
-
if (unisatLib) {
|
|
594
|
-
setHasUnisat(true);
|
|
595
|
-
observer.disconnect();
|
|
596
|
-
}
|
|
597
|
-
});
|
|
598
|
-
observer.observe(document, { childList: true, subtree: true });
|
|
599
|
-
return () => {
|
|
600
|
-
observer.disconnect();
|
|
601
|
-
};
|
|
602
|
-
}, []);
|
|
603
|
-
useEffect(() => {
|
|
604
|
-
const observer = new MutationObserver(() => {
|
|
605
|
-
var _a;
|
|
606
|
-
const xverseLib = (_a = window == null ? void 0 : window.XverseProviders) == null ? void 0 : _a.BitcoinProvider;
|
|
607
|
-
if (xverseLib) {
|
|
608
|
-
setHasXverse(true);
|
|
609
|
-
observer.disconnect();
|
|
610
|
-
}
|
|
611
|
-
});
|
|
612
|
-
observer.observe(document, { childList: true, subtree: true });
|
|
613
|
-
return () => {
|
|
614
|
-
observer.disconnect();
|
|
615
|
-
};
|
|
616
|
-
}, []);
|
|
617
|
-
useEffect(() => {
|
|
618
|
-
const observer = new MutationObserver(() => {
|
|
619
|
-
const oylLib = window == null ? void 0 : window.oyl;
|
|
620
|
-
if (oylLib) {
|
|
621
|
-
setHasOyl(true);
|
|
622
|
-
observer.disconnect();
|
|
623
|
-
}
|
|
624
|
-
});
|
|
625
|
-
observer.observe(document, { childList: true, subtree: true });
|
|
626
|
-
return () => {
|
|
627
|
-
observer.disconnect();
|
|
628
|
-
};
|
|
629
|
-
}, []);
|
|
630
|
-
useEffect(() => {
|
|
631
|
-
const observer = new MutationObserver(() => {
|
|
632
|
-
const magicEdenLib = window == null ? void 0 : window.magicEden;
|
|
633
|
-
if (magicEdenLib) {
|
|
634
|
-
setHasMagicEden(true);
|
|
635
|
-
observer.disconnect();
|
|
636
|
-
}
|
|
637
|
-
});
|
|
638
|
-
observer.observe(document, { childList: true, subtree: true });
|
|
639
|
-
return () => {
|
|
640
|
-
observer.disconnect();
|
|
641
|
-
};
|
|
642
|
-
}, []);
|
|
643
|
-
useEffect(() => {
|
|
644
|
-
const observer = new MutationObserver(() => {
|
|
645
|
-
var _a, _b;
|
|
646
|
-
let foundOkx;
|
|
647
|
-
if (network === TESTNET || network === TESTNET4 || network === SIGNET || network === FRACTAL_TESTNET) {
|
|
648
|
-
foundOkx = (_a = window == null ? void 0 : window.okxwallet) == null ? void 0 : _a.bitcoinTestnet;
|
|
649
|
-
} else if (network === MAINNET || network === FRACTAL_MAINNET) {
|
|
650
|
-
foundOkx = (_b = window == null ? void 0 : window.okxwallet) == null ? void 0 : _b.bitcoin;
|
|
651
|
-
}
|
|
652
|
-
if (foundOkx) {
|
|
653
|
-
setHasOkx(true);
|
|
654
|
-
observer.disconnect();
|
|
655
|
-
}
|
|
656
|
-
});
|
|
657
|
-
observer.observe(document, { childList: true, subtree: true });
|
|
658
|
-
return () => {
|
|
659
|
-
observer.disconnect();
|
|
660
|
-
};
|
|
661
|
-
}, [network]);
|
|
662
|
-
useEffect(() => {
|
|
663
|
-
const observer = new MutationObserver(() => {
|
|
664
|
-
const leatherLib = window == null ? void 0 : window.LeatherProvider;
|
|
665
|
-
if (leatherLib) {
|
|
666
|
-
setHasLeather(true);
|
|
667
|
-
observer.disconnect();
|
|
668
|
-
}
|
|
669
|
-
});
|
|
670
|
-
observer.observe(document, { childList: true, subtree: true });
|
|
671
|
-
return () => {
|
|
672
|
-
observer.disconnect();
|
|
673
|
-
};
|
|
674
|
-
}, []);
|
|
675
|
-
useEffect(() => {
|
|
676
|
-
const observer = new MutationObserver(() => {
|
|
677
|
-
var _a;
|
|
678
|
-
const phantomLib = (_a = window == null ? void 0 : window.phantom) == null ? void 0 : _a.bitcoin;
|
|
679
|
-
if (phantomLib && phantomLib.isPhantom) {
|
|
680
|
-
setHasPhantom(true);
|
|
681
|
-
observer.disconnect();
|
|
682
|
-
} else {
|
|
683
|
-
setHasPhantom(false);
|
|
684
|
-
observer.disconnect();
|
|
685
|
-
}
|
|
686
|
-
});
|
|
687
|
-
observer.observe(document, { childList: true, subtree: true });
|
|
688
|
-
return () => {
|
|
689
|
-
observer.disconnect();
|
|
690
|
-
};
|
|
691
|
-
}, []);
|
|
692
|
-
useEffect(() => {
|
|
693
|
-
const observer = new MutationObserver(() => {
|
|
694
|
-
const orangeLib = window == null ? void 0 : window.OrangeWalletProviders;
|
|
695
|
-
if (orangeLib) {
|
|
696
|
-
setHasOrange(true);
|
|
697
|
-
observer.disconnect();
|
|
698
|
-
}
|
|
699
|
-
});
|
|
700
|
-
observer.observe(document, { childList: true, subtree: true });
|
|
701
|
-
return () => {
|
|
702
|
-
observer.disconnect();
|
|
703
|
-
};
|
|
704
|
-
}, []);
|
|
705
|
-
useEffect(() => {
|
|
706
|
-
const observer = new MutationObserver(() => {
|
|
707
|
-
const wizzLib = window == null ? void 0 : window.wizz;
|
|
708
|
-
if (wizzLib) {
|
|
709
|
-
setHasWizz(true);
|
|
710
|
-
observer.disconnect();
|
|
711
|
-
}
|
|
712
|
-
});
|
|
713
|
-
observer.observe(document, { childList: true, subtree: true });
|
|
714
|
-
return () => {
|
|
715
|
-
observer.disconnect();
|
|
716
|
-
};
|
|
717
|
-
}, []);
|
|
718
|
-
useEffect(() => {
|
|
719
|
-
checkInitializationComplete();
|
|
720
|
-
}, [
|
|
721
|
-
hasUnisat,
|
|
722
|
-
hasXverse,
|
|
723
|
-
hasOyl,
|
|
724
|
-
hasMagicEden,
|
|
725
|
-
hasOkx,
|
|
726
|
-
hasLeather,
|
|
727
|
-
hasPhantom,
|
|
728
|
-
hasWizz,
|
|
729
|
-
hasOrange
|
|
730
|
-
]);
|
|
731
|
-
useEffect(() => {
|
|
732
|
-
setBalance(void 0);
|
|
733
|
-
}, [network]);
|
|
734
|
-
useEffect(() => {
|
|
735
|
-
if (provider !== UNISAT && provider !== WIZZ && !library) {
|
|
736
|
-
return;
|
|
737
|
-
}
|
|
738
|
-
const lib = provider === WIZZ ? window.wizz : window.unisat;
|
|
739
|
-
if (!lib)
|
|
740
|
-
return;
|
|
741
|
-
lib == null ? void 0 : lib.getAccounts().then((accounts2) => {
|
|
742
|
-
handleAccountsChanged(accounts2);
|
|
743
|
-
});
|
|
744
|
-
lib.on("accountsChanged", handleAccountsChanged);
|
|
745
|
-
lib.on("networkChanged", handleNetworkChanged);
|
|
746
|
-
return () => {
|
|
747
|
-
lib.removeListener("accountsChanged", handleAccountsChanged);
|
|
748
|
-
lib.removeListener("networkChanged", handleNetworkChanged);
|
|
749
|
-
};
|
|
750
|
-
}, [provider, address2]);
|
|
751
|
-
useEffect(() => {
|
|
752
|
-
if (!isInitializing) {
|
|
753
|
-
const defaultWallet = localStorage == null ? void 0 : localStorage.getItem(
|
|
754
|
-
LOCAL_STORAGE_DEFAULT_WALLET
|
|
755
|
-
);
|
|
756
|
-
if (defaultWallet && !address2) {
|
|
757
|
-
setProvider(defaultWallet);
|
|
758
|
-
connect(defaultWallet);
|
|
759
|
-
}
|
|
760
|
-
}
|
|
761
|
-
}, [isInitializing, address2]);
|
|
762
|
-
const connectUnisat = useCallback(() => __async(void 0, null, function* () {
|
|
763
|
-
try {
|
|
764
|
-
localStorage == null ? void 0 : localStorage.setItem(LOCAL_STORAGE_DEFAULT_WALLET, UNISAT);
|
|
765
|
-
const lib = window.unisat;
|
|
766
|
-
setLibrary(lib);
|
|
767
|
-
const unisatAccounts = yield lib.requestAccounts();
|
|
768
|
-
if (!unisatAccounts)
|
|
769
|
-
throw new Error("No accounts found");
|
|
770
|
-
const unisatPubKey = yield lib.getPublicKey();
|
|
771
|
-
if (!unisatPubKey)
|
|
772
|
-
throw new Error("No public key found");
|
|
773
|
-
setAccounts(unisatAccounts);
|
|
774
|
-
setAddress(unisatAccounts[0]);
|
|
775
|
-
setPaymentAddress(unisatAccounts[0]);
|
|
776
|
-
setPublicKey(unisatPubKey);
|
|
777
|
-
setPaymentPublicKey(unisatPubKey);
|
|
778
|
-
yield getNetwork().then((network2) => {
|
|
779
|
-
if (config.network !== network2) {
|
|
780
|
-
switchNetwork(network2);
|
|
781
|
-
}
|
|
782
|
-
});
|
|
783
|
-
getBTCBalance(unisatAccounts[0], network).then((totalBalance) => {
|
|
784
|
-
setBalance(totalBalance);
|
|
785
|
-
});
|
|
786
|
-
setProvider(UNISAT);
|
|
787
|
-
setConnected(true);
|
|
788
|
-
const balance2 = yield lib == null ? void 0 : lib.getBalance();
|
|
789
|
-
setBalance(balance2 == null ? void 0 : balance2.total);
|
|
790
|
-
} catch (error) {
|
|
791
|
-
throw error;
|
|
792
|
-
}
|
|
793
|
-
}), [hasUnisat, network]);
|
|
794
|
-
const connectXverse = useCallback(() => __async(void 0, null, function* () {
|
|
795
|
-
try {
|
|
796
|
-
localStorage == null ? void 0 : localStorage.setItem(LOCAL_STORAGE_DEFAULT_WALLET, XVERSE);
|
|
797
|
-
let xverseNetwork = getXverseNetwork((config == null ? void 0 : config.network) || MAINNET);
|
|
798
|
-
const getAddressOptions = {
|
|
799
|
-
payload: {
|
|
800
|
-
purposes: ["ordinals", "payment"],
|
|
801
|
-
message: "Address for receiving Ordinals and payments",
|
|
802
|
-
network: {
|
|
803
|
-
type: xverseNetwork
|
|
804
|
-
}
|
|
805
|
-
},
|
|
806
|
-
onFinish: (response) => {
|
|
807
|
-
setPublicKey(String(response.addresses[0].publicKey));
|
|
808
|
-
setPaymentPublicKey(String(response.addresses[1].publicKey));
|
|
809
|
-
const foundAddress = findOrdinalsAddress(response.addresses);
|
|
810
|
-
const foundPaymentAddress = findPaymentAddress(response.addresses);
|
|
811
|
-
if (foundAddress && foundPaymentAddress) {
|
|
812
|
-
setAddress(foundAddress.address);
|
|
813
|
-
setPaymentAddress(foundPaymentAddress.address);
|
|
814
|
-
setProvider(XVERSE);
|
|
815
|
-
setLibrary(window.BitcoinProvider);
|
|
816
|
-
}
|
|
817
|
-
getBTCBalance(foundPaymentAddress.address, network).then(
|
|
818
|
-
(totalBalance) => {
|
|
819
|
-
setBalance(totalBalance);
|
|
820
|
-
}
|
|
821
|
-
);
|
|
822
|
-
},
|
|
823
|
-
onCancel: () => {
|
|
824
|
-
throw new Error(`User canceled lasereyes to ${XVERSE} wallet`);
|
|
825
|
-
},
|
|
826
|
-
onError: (error) => {
|
|
827
|
-
throw new Error(`Can't lasereyes to ${XVERSE} wallet`);
|
|
828
|
-
}
|
|
829
|
-
};
|
|
830
|
-
yield getAddress(getAddressOptions);
|
|
831
|
-
setConnected(true);
|
|
832
|
-
} catch (error) {
|
|
833
|
-
throw error;
|
|
834
|
-
}
|
|
835
|
-
}), [hasXverse]);
|
|
836
|
-
const connectOyl = () => __async(void 0, null, function* () {
|
|
837
|
-
try {
|
|
838
|
-
localStorage == null ? void 0 : localStorage.setItem(LOCAL_STORAGE_DEFAULT_WALLET, OYL);
|
|
839
|
-
const lib = window.oyl;
|
|
840
|
-
console.log({ lib });
|
|
841
|
-
const { nativeSegwit, taproot } = yield lib.getAddresses();
|
|
842
|
-
setAddress(taproot.address);
|
|
843
|
-
setPublicKey(taproot.publicKey);
|
|
844
|
-
setPaymentPublicKey(nativeSegwit.publicKey);
|
|
845
|
-
setPaymentAddress(nativeSegwit.address);
|
|
846
|
-
setLibrary(lib);
|
|
847
|
-
setProvider(OYL);
|
|
848
|
-
setConnected(true);
|
|
849
|
-
const balance2 = yield lib == null ? void 0 : lib.getBalance();
|
|
850
|
-
setBalance(balance2 == null ? void 0 : balance2.total);
|
|
851
|
-
} catch (error) {
|
|
852
|
-
throw new Error(`Can't lasereyes to ${OYL} wallet`);
|
|
853
|
-
}
|
|
854
|
-
});
|
|
855
|
-
const connectMagicEden = () => __async(void 0, null, function* () {
|
|
856
|
-
try {
|
|
857
|
-
localStorage == null ? void 0 : localStorage.setItem(LOCAL_STORAGE_DEFAULT_WALLET, MAGIC_EDEN);
|
|
858
|
-
let xverseNetwork = getXverseNetwork((config == null ? void 0 : config.network) || MAINNET);
|
|
859
|
-
const getAddressOptions = {
|
|
860
|
-
getProvider: () => __async(void 0, null, function* () {
|
|
861
|
-
return window.magicEden.bitcoin;
|
|
862
|
-
}),
|
|
863
|
-
payload: {
|
|
864
|
-
purposes: ["ordinals", "payment"],
|
|
865
|
-
message: "Address for receiving Ordinals and payments",
|
|
866
|
-
network: {
|
|
867
|
-
type: xverseNetwork
|
|
868
|
-
}
|
|
869
|
-
},
|
|
870
|
-
onFinish: (response) => {
|
|
871
|
-
setPublicKey(String(response.addresses[0].publicKey));
|
|
872
|
-
setPaymentPublicKey(String(response.addresses[1].publicKey));
|
|
873
|
-
const foundAddress = findOrdinalsAddress(response.addresses);
|
|
874
|
-
const foundPaymentAddress = findPaymentAddress(response.addresses);
|
|
875
|
-
if (foundAddress && foundPaymentAddress) {
|
|
876
|
-
setAddress(foundAddress.address);
|
|
877
|
-
setPaymentAddress(foundPaymentAddress.address);
|
|
878
|
-
setProvider(MAGIC_EDEN);
|
|
879
|
-
setLibrary(window.magicEden.bitcoin);
|
|
880
|
-
}
|
|
881
|
-
getBTCBalance(foundPaymentAddress.address, network).then(
|
|
882
|
-
(totalBalance) => {
|
|
883
|
-
setBalance(totalBalance);
|
|
884
|
-
}
|
|
885
|
-
);
|
|
886
|
-
},
|
|
887
|
-
onCancel: () => {
|
|
888
|
-
throw new Error(`User canceled lasereyes to ${MAGIC_EDEN} wallet`);
|
|
889
|
-
},
|
|
890
|
-
onError: (error) => {
|
|
891
|
-
throw new Error(`Can't lasereyes to ${MAGIC_EDEN} wallet`);
|
|
892
|
-
}
|
|
893
|
-
};
|
|
894
|
-
yield getAddress(getAddressOptions);
|
|
895
|
-
setConnected(true);
|
|
896
|
-
} catch (error) {
|
|
897
|
-
console.log("error", error);
|
|
898
|
-
throw error;
|
|
899
|
-
}
|
|
900
|
-
});
|
|
901
|
-
const getOkxLibrary = useCallback(() => {
|
|
902
|
-
var _a, _b;
|
|
903
|
-
let foundOkx;
|
|
904
|
-
if (network === TESTNET || network === TESTNET4 || network === SIGNET || network === FRACTAL_TESTNET) {
|
|
905
|
-
foundOkx = (_a = window == null ? void 0 : window.okxwallet) == null ? void 0 : _a.bitcoinTestnet;
|
|
906
|
-
} else if (network === MAINNET || network === FRACTAL_MAINNET) {
|
|
907
|
-
foundOkx = (_b = window == null ? void 0 : window.okxwallet) == null ? void 0 : _b.bitcoin;
|
|
908
|
-
}
|
|
909
|
-
return foundOkx;
|
|
910
|
-
}, []);
|
|
911
|
-
const connectOkx = useCallback(() => __async(void 0, null, function* () {
|
|
912
|
-
var _a;
|
|
913
|
-
try {
|
|
914
|
-
localStorage == null ? void 0 : localStorage.setItem(LOCAL_STORAGE_DEFAULT_WALLET, OKX);
|
|
915
|
-
const lib = getOkxLibrary();
|
|
916
|
-
const okxAccounts = yield lib.connect();
|
|
917
|
-
if (!okxAccounts)
|
|
918
|
-
throw new Error("No accounts found");
|
|
919
|
-
setAccounts([okxAccounts]);
|
|
920
|
-
setAddress(okxAccounts.address);
|
|
921
|
-
if (((_a = String(okxAccounts.address)) == null ? void 0 : _a.startsWith("tb")) && network !== TESTNET && network !== TESTNET4 && network !== SIGNET) {
|
|
922
|
-
console.log("err");
|
|
923
|
-
throw new Error(
|
|
924
|
-
`Please switch networks to ${network} in the wallet settings.`
|
|
925
|
-
);
|
|
926
|
-
}
|
|
927
|
-
setPaymentAddress(okxAccounts.address);
|
|
928
|
-
setPublicKey(okxAccounts.publicKey);
|
|
929
|
-
setPaymentPublicKey(okxAccounts.publicKey);
|
|
930
|
-
setLibrary(lib);
|
|
931
|
-
setProvider(OKX);
|
|
932
|
-
setConnected(true);
|
|
933
|
-
const balance2 = yield lib == null ? void 0 : lib.getBalance();
|
|
934
|
-
setBalance(balance2 == null ? void 0 : balance2.total);
|
|
935
|
-
} catch (error) {
|
|
936
|
-
console.log("error", error);
|
|
937
|
-
throw error;
|
|
938
|
-
}
|
|
939
|
-
}), [hasOkx, network]);
|
|
940
|
-
const connectLeather = useCallback(() => __async(void 0, null, function* () {
|
|
941
|
-
var _a;
|
|
942
|
-
try {
|
|
943
|
-
localStorage == null ? void 0 : localStorage.setItem(LOCAL_STORAGE_DEFAULT_WALLET, LEATHER);
|
|
944
|
-
const lib = window.LeatherProvider;
|
|
945
|
-
const getAddressesResponse = yield lib.request(
|
|
946
|
-
"getAddresses"
|
|
947
|
-
);
|
|
948
|
-
const addressesResponse = getAddressesResponse.result;
|
|
949
|
-
const addresses = addressesResponse.addresses;
|
|
950
|
-
const leatherAccountsParsed = addresses.map(
|
|
951
|
-
(address3) => address3.address
|
|
952
|
-
);
|
|
953
|
-
const taprootAddress = addresses.find(
|
|
954
|
-
(address3) => address3.type === P2TR
|
|
955
|
-
);
|
|
956
|
-
const segwitAddress = addresses.find(
|
|
957
|
-
(address3) => address3.type === P2WPKH
|
|
958
|
-
);
|
|
959
|
-
if (((_a = String(taprootAddress == null ? void 0 : taprootAddress.address)) == null ? void 0 : _a.startsWith("tb")) && network !== TESTNET && network !== TESTNET4 && network !== SIGNET) {
|
|
960
|
-
throw new Error(
|
|
961
|
-
`Please switch networks to ${network} in the wallet settings.`
|
|
962
|
-
);
|
|
963
|
-
}
|
|
964
|
-
setAccounts(leatherAccountsParsed);
|
|
965
|
-
setAddress(String(taprootAddress == null ? void 0 : taprootAddress.address));
|
|
966
|
-
setPublicKey(String(taprootAddress == null ? void 0 : taprootAddress.publicKey));
|
|
967
|
-
setPaymentAddress(String(segwitAddress == null ? void 0 : segwitAddress.address));
|
|
968
|
-
setPaymentPublicKey(String(segwitAddress == null ? void 0 : segwitAddress.publicKey));
|
|
969
|
-
setLibrary(lib);
|
|
970
|
-
setProvider(LEATHER);
|
|
971
|
-
const balance2 = yield getBTCBalance(
|
|
972
|
-
String(segwitAddress == null ? void 0 : segwitAddress.address),
|
|
973
|
-
network
|
|
974
|
-
);
|
|
975
|
-
setBalance(balance2);
|
|
976
|
-
handleAccountsChanged(leatherAccountsParsed);
|
|
977
|
-
setConnected(true);
|
|
978
|
-
yield getNetwork().then((network2) => {
|
|
979
|
-
});
|
|
980
|
-
setConnected(true);
|
|
981
|
-
} catch (error) {
|
|
982
|
-
throw error;
|
|
983
|
-
}
|
|
984
|
-
}), [hasLeather]);
|
|
985
|
-
const connectPhantom = () => __async(void 0, null, function* () {
|
|
986
|
-
try {
|
|
987
|
-
localStorage == null ? void 0 : localStorage.setItem(LOCAL_STORAGE_DEFAULT_WALLET, PHANTOM);
|
|
988
|
-
const lib = window.phantom.bitcoin;
|
|
989
|
-
const phantomAccounts = yield lib.requestAccounts();
|
|
990
|
-
const phantomAccountsParsed = phantomAccounts.map(
|
|
991
|
-
(account) => account.address
|
|
992
|
-
);
|
|
993
|
-
setAccounts(phantomAccountsParsed);
|
|
994
|
-
const ordinalsAccount = phantomAccounts.find(
|
|
995
|
-
(account) => account.purpose === "ordinals"
|
|
996
|
-
);
|
|
997
|
-
const paymentAccount = phantomAccounts.find(
|
|
998
|
-
(account) => account.purpose === "payment"
|
|
999
|
-
);
|
|
1000
|
-
setAddress(ordinalsAccount == null ? void 0 : ordinalsAccount.address);
|
|
1001
|
-
setPublicKey(ordinalsAccount == null ? void 0 : ordinalsAccount.publicKey);
|
|
1002
|
-
setPaymentAddress(paymentAccount == null ? void 0 : paymentAccount.address);
|
|
1003
|
-
setPaymentPublicKey(paymentAccount == null ? void 0 : paymentAccount.publicKey);
|
|
1004
|
-
setLibrary(lib);
|
|
1005
|
-
setProvider(PHANTOM);
|
|
1006
|
-
const balance2 = yield getBTCBalance(
|
|
1007
|
-
String(paymentAccount == null ? void 0 : paymentAccount.address),
|
|
1008
|
-
network
|
|
1009
|
-
);
|
|
1010
|
-
setBalance(balance2);
|
|
1011
|
-
setConnected(true);
|
|
1012
|
-
} catch (error) {
|
|
1013
|
-
throw new Error(`Can't lasereyes to ${PHANTOM} wallet`);
|
|
1014
|
-
}
|
|
1015
|
-
});
|
|
1016
|
-
const connectWizz = () => __async(void 0, null, function* () {
|
|
1017
|
-
try {
|
|
1018
|
-
localStorage == null ? void 0 : localStorage.setItem(LOCAL_STORAGE_DEFAULT_WALLET, WIZZ);
|
|
1019
|
-
const lib = window.wizz;
|
|
1020
|
-
const wizzAccounts = yield lib.requestAccounts();
|
|
1021
|
-
if (!wizzAccounts)
|
|
1022
|
-
throw new Error("No accounts found");
|
|
1023
|
-
const wizzPubKey = yield lib.getPublicKey();
|
|
1024
|
-
if (!wizzPubKey)
|
|
1025
|
-
throw new Error("No public key found");
|
|
1026
|
-
setAccounts(wizzAccounts);
|
|
1027
|
-
setAddress(wizzAccounts[0]);
|
|
1028
|
-
setPaymentAddress(wizzAccounts[0]);
|
|
1029
|
-
setPublicKey(wizzPubKey);
|
|
1030
|
-
setPaymentPublicKey(wizzPubKey);
|
|
1031
|
-
setLibrary(lib);
|
|
1032
|
-
setProvider(WIZZ);
|
|
1033
|
-
yield getNetwork().then((network2) => {
|
|
1034
|
-
if (config.network !== network2) {
|
|
1035
|
-
switchNetwork(network2);
|
|
1036
|
-
}
|
|
1037
|
-
});
|
|
1038
|
-
const balance2 = yield getBTCBalance(String(wizzAccounts[0]), network);
|
|
1039
|
-
setBalance(balance2);
|
|
1040
|
-
setConnected(true);
|
|
1041
|
-
} catch (error) {
|
|
1042
|
-
throw error;
|
|
1043
|
-
}
|
|
1044
|
-
});
|
|
1045
|
-
const connectOrange = () => __async(void 0, null, function* () {
|
|
1046
|
-
try {
|
|
1047
|
-
localStorage == null ? void 0 : localStorage.setItem(LOCAL_STORAGE_DEFAULT_WALLET, ORANGE);
|
|
1048
|
-
let orangeNetwork = getOrangeNetwork((config == null ? void 0 : config.network) || MAINNET);
|
|
1049
|
-
const getAddressOptions = {
|
|
1050
|
-
payload: {
|
|
1051
|
-
purposes: ["ordinals", "payment"],
|
|
1052
|
-
message: "Address for receiving Ordinals and payments",
|
|
1053
|
-
network: {
|
|
1054
|
-
type: orangeNetwork
|
|
1055
|
-
}
|
|
1056
|
-
},
|
|
1057
|
-
onFinish: (response) => {
|
|
1058
|
-
setPublicKey(String(response.addresses[0].publicKey));
|
|
1059
|
-
setPaymentPublicKey(String(response.addresses[1].publicKey));
|
|
1060
|
-
const foundAddress = findOrdinalsAddress(response.addresses);
|
|
1061
|
-
const foundPaymentAddress = findPaymentAddress(response.addresses);
|
|
1062
|
-
if (foundAddress && foundPaymentAddress) {
|
|
1063
|
-
setAddress(foundAddress.address);
|
|
1064
|
-
setPaymentAddress(foundPaymentAddress.address);
|
|
1065
|
-
setProvider(ORANGE);
|
|
1066
|
-
setLibrary(window.OrangeBitcoinProvider);
|
|
1067
|
-
}
|
|
1068
|
-
getBTCBalance(foundPaymentAddress.address, network).then(
|
|
1069
|
-
(totalBalance) => {
|
|
1070
|
-
setBalance(totalBalance);
|
|
1071
|
-
}
|
|
1072
|
-
);
|
|
1073
|
-
},
|
|
1074
|
-
onCancel: () => {
|
|
1075
|
-
throw new Error(`User canceled lasereyes to ${ORANGE} wallet`);
|
|
1076
|
-
}
|
|
1077
|
-
};
|
|
1078
|
-
yield getAddressOrange(getAddressOptions);
|
|
1079
|
-
setConnected(true);
|
|
1080
|
-
} catch (e) {
|
|
1081
|
-
throw e;
|
|
1082
|
-
}
|
|
1083
|
-
});
|
|
1084
|
-
const connect = (walletName) => __async(void 0, null, function* () {
|
|
1085
|
-
setIsConnecting(true);
|
|
1086
|
-
try {
|
|
1087
|
-
if (!walletName)
|
|
1088
|
-
throw new Error("No wallet provided");
|
|
1089
|
-
if (walletName === UNISAT) {
|
|
1090
|
-
yield connectUnisat();
|
|
1091
|
-
} else if (walletName === XVERSE) {
|
|
1092
|
-
yield connectXverse();
|
|
1093
|
-
} else if (walletName === OYL) {
|
|
1094
|
-
yield connectOyl();
|
|
1095
|
-
} else if (walletName === MAGIC_EDEN) {
|
|
1096
|
-
yield connectMagicEden();
|
|
1097
|
-
} else if (walletName === OKX) {
|
|
1098
|
-
yield connectOkx();
|
|
1099
|
-
} else if (walletName === LEATHER) {
|
|
1100
|
-
yield connectLeather();
|
|
1101
|
-
} else if (walletName === PHANTOM) {
|
|
1102
|
-
yield connectPhantom();
|
|
1103
|
-
} else if (walletName === WIZZ) {
|
|
1104
|
-
yield connectWizz();
|
|
1105
|
-
} else if (walletName === ORANGE) {
|
|
1106
|
-
yield connectOrange();
|
|
1107
|
-
} else {
|
|
1108
|
-
throw new Error("Unsupported wallet..");
|
|
1109
|
-
}
|
|
1110
|
-
setConnected(true);
|
|
1111
|
-
} catch (error) {
|
|
1112
|
-
setIsConnecting(false);
|
|
1113
|
-
disconnect();
|
|
1114
|
-
console.log("e", error == null ? void 0 : error.message);
|
|
1115
|
-
throw error;
|
|
1116
|
-
} finally {
|
|
1117
|
-
setIsConnecting(false);
|
|
1118
|
-
}
|
|
1119
|
-
});
|
|
1120
|
-
const disconnect = () => {
|
|
1121
|
-
setAddress("");
|
|
1122
|
-
setPaymentAddress("");
|
|
1123
|
-
setPublicKey("");
|
|
1124
|
-
setPaymentPublicKey("");
|
|
1125
|
-
setAccounts([]);
|
|
1126
|
-
setProvider(void 0);
|
|
1127
|
-
setLibrary({});
|
|
1128
|
-
setConnected(false);
|
|
1129
|
-
setBalance(void 0);
|
|
1130
|
-
localStorage == null ? void 0 : localStorage.removeItem(LOCAL_STORAGE_DEFAULT_WALLET);
|
|
1131
|
-
};
|
|
1132
|
-
const handleAccountsChanged = (_accounts) => {
|
|
1133
|
-
if (provider !== UNISAT)
|
|
1134
|
-
return;
|
|
1135
|
-
if (!_accounts.length) {
|
|
1136
|
-
disconnect();
|
|
1137
|
-
return;
|
|
1138
|
-
}
|
|
1139
|
-
if (self.accounts[0] === _accounts[0]) {
|
|
1140
|
-
return;
|
|
1141
|
-
}
|
|
1142
|
-
self.accounts = _accounts;
|
|
1143
|
-
if (_accounts.length > 0) {
|
|
1144
|
-
connect(UNISAT);
|
|
1145
|
-
} else {
|
|
1146
|
-
setConnected(false);
|
|
1147
|
-
}
|
|
1148
|
-
};
|
|
1149
|
-
const handleNetworkChanged = (network2) => {
|
|
1150
|
-
try {
|
|
1151
|
-
let foundNetwork;
|
|
1152
|
-
if (provider === UNISAT) {
|
|
1153
|
-
foundNetwork = getNetworkForUnisat(network2);
|
|
1154
|
-
setNetwork(foundNetwork);
|
|
1155
|
-
connect(provider);
|
|
1156
|
-
} else if (provider === XVERSE) {
|
|
1157
|
-
throw new Error("Not implemented");
|
|
1158
|
-
} else if (provider === WIZZ) {
|
|
1159
|
-
foundNetwork = getNetworkForWizz(network2);
|
|
1160
|
-
connect(provider);
|
|
1161
|
-
} else {
|
|
1162
|
-
disconnect();
|
|
1163
|
-
throw new Error(
|
|
1164
|
-
"The connected wallet doesn't support programmatic network changes.."
|
|
1165
|
-
);
|
|
1166
|
-
}
|
|
1167
|
-
} catch (error) {
|
|
1168
|
-
throw error;
|
|
1169
|
-
}
|
|
1170
|
-
};
|
|
1171
|
-
const requestAccounts = () => __async(void 0, null, function* () {
|
|
1172
|
-
try {
|
|
1173
|
-
if (!library)
|
|
1174
|
-
throw new Error("No wallet connected");
|
|
1175
|
-
if (provider === UNISAT) {
|
|
1176
|
-
const lib = window.unisat;
|
|
1177
|
-
return yield lib.requestAccounts();
|
|
1178
|
-
} else if (provider === XVERSE) {
|
|
1179
|
-
const getAddressOptions = {
|
|
1180
|
-
payload: {
|
|
1181
|
-
// @ts-ignore
|
|
1182
|
-
purposes: ["ordinals", "payment"],
|
|
1183
|
-
message: "Address for receiving Ordinals and payments",
|
|
1184
|
-
network: {
|
|
1185
|
-
type: XVERSE_NETWORK
|
|
1186
|
-
}
|
|
1187
|
-
},
|
|
1188
|
-
onFinish: (response) => __async(void 0, null, function* () {
|
|
1189
|
-
const foundAddress = findOrdinalsAddress(response.addresses);
|
|
1190
|
-
setAddress(foundAddress.address);
|
|
1191
|
-
const foundPaymentAddress = findPaymentAddress(response.addresses);
|
|
1192
|
-
setPaymentAddress(foundPaymentAddress);
|
|
1193
|
-
setPublicKey(String(response.addresses[0].publicKey));
|
|
1194
|
-
setPaymentPublicKey(String(response.addresses[1].publicKey));
|
|
1195
|
-
}),
|
|
1196
|
-
onCancel: () => {
|
|
1197
|
-
console.log("CANCELLED");
|
|
1198
|
-
}
|
|
1199
|
-
};
|
|
1200
|
-
return [address2];
|
|
1201
|
-
} else if (provider === OYL) {
|
|
1202
|
-
return yield library.requestAccounts();
|
|
1203
|
-
} else if (provider === OKX) {
|
|
1204
|
-
if (network === TESTNET || network === TESTNET4 || network === FRACTAL_TESTNET) {
|
|
1205
|
-
return yield library.connect();
|
|
1206
|
-
}
|
|
1207
|
-
return yield library.requestAccounts();
|
|
1208
|
-
} else if (provider === LEATHER) {
|
|
1209
|
-
localStorage == null ? void 0 : localStorage.setItem(LOCAL_STORAGE_DEFAULT_WALLET, LEATHER);
|
|
1210
|
-
const lib = window.LeatherProvider;
|
|
1211
|
-
const getAddressesResponse = yield lib.request(
|
|
1212
|
-
"getAddresses"
|
|
1213
|
-
);
|
|
1214
|
-
const addressesResponse = getAddressesResponse.result;
|
|
1215
|
-
const addresses = addressesResponse.addresses;
|
|
1216
|
-
const leatherAccountsParsed = addresses.map(
|
|
1217
|
-
(address3) => address3.address
|
|
1218
|
-
);
|
|
1219
|
-
const taprootAddress = addresses.find(
|
|
1220
|
-
(address3) => address3.type === P2TR
|
|
1221
|
-
);
|
|
1222
|
-
const segwitAddress = addresses.find(
|
|
1223
|
-
(address3) => address3.type === P2WPKH
|
|
1224
|
-
);
|
|
1225
|
-
setAccounts(leatherAccountsParsed);
|
|
1226
|
-
setAddress(String(taprootAddress == null ? void 0 : taprootAddress.address));
|
|
1227
|
-
setPaymentAddress(String(segwitAddress == null ? void 0 : segwitAddress.address));
|
|
1228
|
-
setLibrary(lib);
|
|
1229
|
-
setProvider(LEATHER);
|
|
1230
|
-
handleAccountsChanged(leatherAccountsParsed);
|
|
1231
|
-
setConnected(true);
|
|
1232
|
-
const balance2 = yield getBTCBalance(
|
|
1233
|
-
String(segwitAddress == null ? void 0 : segwitAddress.address),
|
|
1234
|
-
network
|
|
1235
|
-
);
|
|
1236
|
-
setBalance(balance2);
|
|
1237
|
-
yield getNetwork().then((network2) => {
|
|
1238
|
-
if (!network2) {
|
|
1239
|
-
setNetwork(MAINNET);
|
|
1240
|
-
} else {
|
|
1241
|
-
setNetwork(network2);
|
|
1242
|
-
}
|
|
1243
|
-
});
|
|
1244
|
-
setConnected(true);
|
|
1245
|
-
} else if (provider === PHANTOM) {
|
|
1246
|
-
const phantomAccounts = yield library.requestAccounts();
|
|
1247
|
-
const phantomAccountsParsed = phantomAccounts.map(
|
|
1248
|
-
(account) => account.address
|
|
1249
|
-
);
|
|
1250
|
-
return phantomAccountsParsed;
|
|
1251
|
-
} else if (provider === WIZZ) {
|
|
1252
|
-
const lib = window.wizz;
|
|
1253
|
-
return yield lib.requestAccounts();
|
|
1254
|
-
} else {
|
|
1255
|
-
throw new Error("The connected wallet doesn't support this method..");
|
|
1256
|
-
}
|
|
1257
|
-
} catch (error) {
|
|
1258
|
-
throw error;
|
|
1259
|
-
}
|
|
1260
|
-
});
|
|
1261
|
-
const getNetwork = useCallback(() => __async(void 0, null, function* () {
|
|
1262
|
-
var _a, _b;
|
|
1263
|
-
try {
|
|
1264
|
-
if (provider === UNISAT) {
|
|
1265
|
-
const lib = window.unisat;
|
|
1266
|
-
const unisatNetwork = yield lib == null ? void 0 : lib.getChain();
|
|
1267
|
-
if (!unisatNetwork) {
|
|
1268
|
-
return (_a = config == null ? void 0 : config.network) != null ? _a : MAINNET;
|
|
1269
|
-
}
|
|
1270
|
-
return getNetworkForUnisat(unisatNetwork.enum);
|
|
1271
|
-
} else if (provider === XVERSE) {
|
|
1272
|
-
if (address2.slice(0, 1) === "t") {
|
|
1273
|
-
if (network === TESTNET) {
|
|
1274
|
-
return TESTNET;
|
|
1275
|
-
} else if (network === TESTNET4) {
|
|
1276
|
-
return TESTNET4;
|
|
1277
|
-
} else if (network === SIGNET) {
|
|
1278
|
-
return SIGNET;
|
|
1279
|
-
} else if (network === FRACTAL_TESTNET) {
|
|
1280
|
-
return FRACTAL_TESTNET;
|
|
1281
|
-
}
|
|
1282
|
-
}
|
|
1283
|
-
return MAINNET;
|
|
1284
|
-
} else if (provider === OYL) {
|
|
1285
|
-
if (address2.slice(0, 1) === "t") {
|
|
1286
|
-
return TESTNET;
|
|
1287
|
-
}
|
|
1288
|
-
return MAINNET;
|
|
1289
|
-
} else if (provider === MAGIC_EDEN) {
|
|
1290
|
-
if (address2.slice(0, 1) === "t") {
|
|
1291
|
-
return TESTNET;
|
|
1292
|
-
}
|
|
1293
|
-
return MAINNET;
|
|
1294
|
-
} else if (provider === OKX) {
|
|
1295
|
-
if (address2.slice(0, 1) === "t") {
|
|
1296
|
-
if (network === TESTNET) {
|
|
1297
|
-
return TESTNET;
|
|
1298
|
-
} else if (network === TESTNET4) {
|
|
1299
|
-
return TESTNET4;
|
|
1300
|
-
} else if (network === SIGNET) {
|
|
1301
|
-
return SIGNET;
|
|
1302
|
-
} else if (network === FRACTAL_TESTNET) {
|
|
1303
|
-
return FRACTAL_TESTNET;
|
|
1304
|
-
}
|
|
1305
|
-
return TESTNET;
|
|
1306
|
-
}
|
|
1307
|
-
const okxNetwork = yield library == null ? void 0 : library.getNetwork();
|
|
1308
|
-
const foundNetwork = getNetworkForOkx(okxNetwork);
|
|
1309
|
-
setNetwork(foundNetwork);
|
|
1310
|
-
} else if (provider === LEATHER) {
|
|
1311
|
-
if (address2.slice(0, 1) === "t") {
|
|
1312
|
-
if (network === TESTNET) {
|
|
1313
|
-
return TESTNET;
|
|
1314
|
-
} else if (network === TESTNET4) {
|
|
1315
|
-
return TESTNET4;
|
|
1316
|
-
} else if (network === SIGNET) {
|
|
1317
|
-
return SIGNET;
|
|
1318
|
-
} else if (network === FRACTAL_TESTNET) {
|
|
1319
|
-
return FRACTAL_TESTNET;
|
|
1320
|
-
}
|
|
1321
|
-
}
|
|
1322
|
-
return MAINNET;
|
|
1323
|
-
} else if (provider === PHANTOM) {
|
|
1324
|
-
if (address2.slice(0, 1) === "t") {
|
|
1325
|
-
return TESTNET;
|
|
1326
|
-
}
|
|
1327
|
-
return MAINNET;
|
|
1328
|
-
} else if (provider === WIZZ) {
|
|
1329
|
-
const lib = window.wizz;
|
|
1330
|
-
const wizzNetwork = yield lib == null ? void 0 : lib.getNetwork();
|
|
1331
|
-
return getNetworkForWizz(wizzNetwork);
|
|
1332
|
-
} else if (provider === ORANGE) {
|
|
1333
|
-
if (address2.slice(0, 1) === "t") {
|
|
1334
|
-
if (network === TESTNET) {
|
|
1335
|
-
return TESTNET;
|
|
1336
|
-
} else if (network === TESTNET4) {
|
|
1337
|
-
return TESTNET4;
|
|
1338
|
-
} else if (network === SIGNET) {
|
|
1339
|
-
return SIGNET;
|
|
1340
|
-
} else if (network === FRACTAL_TESTNET) {
|
|
1341
|
-
return FRACTAL_TESTNET;
|
|
1342
|
-
}
|
|
1343
|
-
}
|
|
1344
|
-
return MAINNET;
|
|
1345
|
-
}
|
|
1346
|
-
return (_b = config == null ? void 0 : config.network) != null ? _b : MAINNET;
|
|
1347
|
-
} catch (error) {
|
|
1348
|
-
throw error;
|
|
1349
|
-
}
|
|
1350
|
-
}), [address2, provider, library]);
|
|
1351
|
-
const switchNetwork = (network2) => __async(void 0, null, function* () {
|
|
1352
|
-
try {
|
|
1353
|
-
if (!library)
|
|
1354
|
-
return;
|
|
1355
|
-
if (provider === UNISAT) {
|
|
1356
|
-
const lib = window.unisat;
|
|
1357
|
-
const wantedNetwork = getUnisatNetwork(network2);
|
|
1358
|
-
console.log("wantedNetwork", wantedNetwork);
|
|
1359
|
-
yield lib == null ? void 0 : lib.switchChain(wantedNetwork);
|
|
1360
|
-
setNetwork(network2);
|
|
1361
|
-
yield getBalance();
|
|
1362
|
-
} else if (provider === WIZZ) {
|
|
1363
|
-
const lib = window.wizz;
|
|
1364
|
-
if (network2 === FRACTAL_TESTNET || network2 === FRACTAL_MAINNET) {
|
|
1365
|
-
return yield lib.switchNetwork(WIZZ_MAINNET);
|
|
1366
|
-
}
|
|
1367
|
-
const wantedNetwork = getNetworkForWizz(network2);
|
|
1368
|
-
yield lib == null ? void 0 : lib.switchNetwork(wantedNetwork);
|
|
1369
|
-
setNetwork(network2);
|
|
1370
|
-
yield getBalance();
|
|
1371
|
-
} else {
|
|
1372
|
-
disconnect();
|
|
1373
|
-
throw new Error(
|
|
1374
|
-
"The connected wallet doesn't support programmatic network changes.."
|
|
1375
|
-
);
|
|
1376
|
-
}
|
|
1377
|
-
} catch (error) {
|
|
1378
|
-
throw error;
|
|
1379
|
-
}
|
|
1380
|
-
});
|
|
1381
|
-
const getPublicKey = () => __async(void 0, null, function* () {
|
|
1382
|
-
try {
|
|
1383
|
-
if (!library)
|
|
1384
|
-
return;
|
|
1385
|
-
if (provider === UNISAT) {
|
|
1386
|
-
return yield library == null ? void 0 : library.getPublicKey();
|
|
1387
|
-
} else if (provider === OYL) {
|
|
1388
|
-
return yield library == null ? void 0 : library.getPublicKey();
|
|
1389
|
-
} else if (provider === OKX) {
|
|
1390
|
-
return yield library == null ? void 0 : library.getPublicKey();
|
|
1391
|
-
} else if (provider === WIZZ) {
|
|
1392
|
-
const lib = window.wizz;
|
|
1393
|
-
return yield lib == null ? void 0 : lib.getPublicKey();
|
|
1394
|
-
} else {
|
|
1395
|
-
throw new Error("The connected wallet doesn't support this method..");
|
|
1396
|
-
}
|
|
1397
|
-
} catch (error) {
|
|
1398
|
-
throw error;
|
|
1399
|
-
}
|
|
1400
|
-
});
|
|
1401
|
-
const getBalance = useCallback(() => __async(void 0, null, function* () {
|
|
1402
|
-
try {
|
|
1403
|
-
if (!library)
|
|
1404
|
-
return;
|
|
1405
|
-
if (provider === UNISAT) {
|
|
1406
|
-
const lib = window.unisat;
|
|
1407
|
-
const bal = yield lib.getBalance();
|
|
1408
|
-
setBalance(bal.total);
|
|
1409
|
-
return bal.total;
|
|
1410
|
-
} else if (provider === XVERSE) {
|
|
1411
|
-
const bal = yield getBTCBalance(paymentAddress, network);
|
|
1412
|
-
setBalance(bal);
|
|
1413
|
-
return bal;
|
|
1414
|
-
} else if (provider === OYL) {
|
|
1415
|
-
const lib = window == null ? void 0 : window.oyl;
|
|
1416
|
-
const bal = yield lib.getBalance();
|
|
1417
|
-
setBalance(bal.total);
|
|
1418
|
-
return bal.total;
|
|
1419
|
-
} else if (provider === MAGIC_EDEN) {
|
|
1420
|
-
const bal = yield getBTCBalance(paymentAddress, network);
|
|
1421
|
-
setBalance(bal);
|
|
1422
|
-
return bal;
|
|
1423
|
-
} else if (provider === OKX) {
|
|
1424
|
-
const bal = yield getBTCBalance(paymentAddress, network);
|
|
1425
|
-
setBalance(bal);
|
|
1426
|
-
return bal;
|
|
1427
|
-
} else if (provider === LEATHER) {
|
|
1428
|
-
const bal = yield getBTCBalance(paymentAddress, network);
|
|
1429
|
-
setBalance(bal);
|
|
1430
|
-
return bal;
|
|
1431
|
-
} else if (provider === PHANTOM) {
|
|
1432
|
-
const bal = yield getBTCBalance(paymentAddress, network);
|
|
1433
|
-
setBalance(bal);
|
|
1434
|
-
return bal;
|
|
1435
|
-
} else if (provider === WIZZ) {
|
|
1436
|
-
const lib = window.wizz;
|
|
1437
|
-
const balanceResponse = yield lib.getBalance();
|
|
1438
|
-
const bal = balanceResponse.total;
|
|
1439
|
-
setBalance(bal);
|
|
1440
|
-
return bal;
|
|
1441
|
-
}
|
|
1442
|
-
} catch (error) {
|
|
1443
|
-
throw error;
|
|
1444
|
-
}
|
|
1445
|
-
}), [provider, library, paymentAddress, network]);
|
|
1446
|
-
const getInscriptions = () => __async(void 0, null, function* () {
|
|
1447
|
-
try {
|
|
1448
|
-
if (!library)
|
|
1449
|
-
return;
|
|
1450
|
-
if (provider === UNISAT) {
|
|
1451
|
-
return yield library.getInscriptions(0, 10);
|
|
1452
|
-
} else if (provider === OYL) {
|
|
1453
|
-
return yield library.getInscriptions(0, 10);
|
|
1454
|
-
} else if (provider === OKX) {
|
|
1455
|
-
return yield library.getInscriptions(0, 10);
|
|
1456
|
-
} else if (provider === WIZZ) {
|
|
1457
|
-
const lib = window.wizz;
|
|
1458
|
-
return yield lib.getInscriptions(0, 10);
|
|
1459
|
-
} else {
|
|
1460
|
-
throw new Error("The connected wallet doesn't support this method..");
|
|
1461
|
-
}
|
|
1462
|
-
} catch (error) {
|
|
1463
|
-
throw error;
|
|
1464
|
-
}
|
|
1465
|
-
});
|
|
1466
|
-
const sendBTC = (to, amount) => __async(void 0, null, function* () {
|
|
1467
|
-
var _a;
|
|
1468
|
-
try {
|
|
1469
|
-
if (amount <= 0)
|
|
1470
|
-
throw new Error("Amount must be greater than 0");
|
|
1471
|
-
if (!Number.isInteger(amount))
|
|
1472
|
-
throw new Error("Amount must be an integer");
|
|
1473
|
-
if (!library)
|
|
1474
|
-
throw new Error("Library not found");
|
|
1475
|
-
if (provider === UNISAT) {
|
|
1476
|
-
const lib = window.unisat;
|
|
1477
|
-
const txId = yield lib == null ? void 0 : lib.sendBitcoin(to, amount);
|
|
1478
|
-
if (!txId)
|
|
1479
|
-
throw new Error("Transaction failed");
|
|
1480
|
-
return txId;
|
|
1481
|
-
} else if (provider === XVERSE) {
|
|
1482
|
-
const response = yield request("sendTransfer", {
|
|
1483
|
-
recipients: [
|
|
1484
|
-
{
|
|
1485
|
-
address: to,
|
|
1486
|
-
amount
|
|
1487
|
-
}
|
|
1488
|
-
]
|
|
1489
|
-
});
|
|
1490
|
-
if (response.status === "success") {
|
|
1491
|
-
return response.result.txid;
|
|
1492
|
-
} else {
|
|
1493
|
-
if (response.error.code === RpcErrorCode.USER_REJECTION) {
|
|
1494
|
-
throw new Error("User rejected the request");
|
|
1495
|
-
} else {
|
|
1496
|
-
throw new Error("Error sending BTC: " + response.error.message);
|
|
1497
|
-
}
|
|
1498
|
-
}
|
|
1499
|
-
} else if (provider === OYL) {
|
|
1500
|
-
const { psbtHex } = yield createSendBtcPsbt(
|
|
1501
|
-
address2,
|
|
1502
|
-
paymentAddress,
|
|
1503
|
-
to,
|
|
1504
|
-
amount,
|
|
1505
|
-
paymentPublicKey,
|
|
1506
|
-
//@ts-ignore
|
|
1507
|
-
network,
|
|
1508
|
-
7
|
|
1509
|
-
);
|
|
1510
|
-
const psbt = yield signPsbt(psbtHex, true, true);
|
|
1511
|
-
if (!psbt)
|
|
1512
|
-
throw new Error("Error sending BTC");
|
|
1513
|
-
return psbt.txId;
|
|
1514
|
-
} else if (provider === MAGIC_EDEN) {
|
|
1515
|
-
let sendResponse;
|
|
1516
|
-
yield sendBtcTransaction({
|
|
1517
|
-
getProvider: () => __async(void 0, null, function* () {
|
|
1518
|
-
return library;
|
|
1519
|
-
}),
|
|
1520
|
-
payload: {
|
|
1521
|
-
network: {
|
|
1522
|
-
type: getXverseNetwork(network)
|
|
1523
|
-
},
|
|
1524
|
-
recipients: [
|
|
1525
|
-
{
|
|
1526
|
-
address: to,
|
|
1527
|
-
amountSats: BigInt(amount)
|
|
1528
|
-
}
|
|
1529
|
-
],
|
|
1530
|
-
senderAddress: paymentAddress
|
|
1531
|
-
},
|
|
1532
|
-
onFinish: (response) => {
|
|
1533
|
-
sendResponse = response;
|
|
1534
|
-
},
|
|
1535
|
-
onCancel: () => alert("Canceled")
|
|
1536
|
-
});
|
|
1537
|
-
if (!sendResponse)
|
|
1538
|
-
throw new Error("Error sending BTC");
|
|
1539
|
-
return sendResponse.txid;
|
|
1540
|
-
} else if (provider === OKX) {
|
|
1541
|
-
const lib = getOkxLibrary();
|
|
1542
|
-
setLibrary(lib);
|
|
1543
|
-
const txId = yield lib == null ? void 0 : lib.sendBitcoin(to, amount);
|
|
1544
|
-
if (!txId)
|
|
1545
|
-
throw new Error("Transaction failed");
|
|
1546
|
-
return txId;
|
|
1547
|
-
} else if (provider === LEATHER) {
|
|
1548
|
-
const lib = window.LeatherProvider;
|
|
1549
|
-
if (!lib)
|
|
1550
|
-
throw new Error("Library not found");
|
|
1551
|
-
setLibrary(lib);
|
|
1552
|
-
const response = yield lib == null ? void 0 : lib.request("sendTransfer", {
|
|
1553
|
-
recipients: [
|
|
1554
|
-
{
|
|
1555
|
-
address: to,
|
|
1556
|
-
amount
|
|
1557
|
-
}
|
|
1558
|
-
]
|
|
1559
|
-
});
|
|
1560
|
-
if ((_a = response == null ? void 0 : response.result) == null ? void 0 : _a.txid) {
|
|
1561
|
-
return response.result.txid;
|
|
1562
|
-
} else {
|
|
1563
|
-
if (response.error.code === RpcErrorCode.USER_REJECTION) {
|
|
1564
|
-
throw new Error("User rejected the request");
|
|
1565
|
-
} else {
|
|
1566
|
-
throw new Error("Error sending BTC: " + response.error.message);
|
|
1567
|
-
}
|
|
1568
|
-
}
|
|
1569
|
-
} else if (provider === WIZZ) {
|
|
1570
|
-
const lib = window.unisat;
|
|
1571
|
-
const txId = yield lib == null ? void 0 : lib.sendBitcoin(to, amount);
|
|
1572
|
-
if (txId) {
|
|
1573
|
-
return txId;
|
|
1574
|
-
} else {
|
|
1575
|
-
throw new Error("Error sending BTC");
|
|
1576
|
-
}
|
|
1577
|
-
} else if (provider === ORANGE) {
|
|
1578
|
-
let txId = "";
|
|
1579
|
-
const sendBtcOptions = {
|
|
1580
|
-
payload: {
|
|
1581
|
-
network: {
|
|
1582
|
-
type: getOrangeNetwork(network)
|
|
1583
|
-
},
|
|
1584
|
-
recipients: [
|
|
1585
|
-
{
|
|
1586
|
-
address: to,
|
|
1587
|
-
amountSats: BigInt(amount)
|
|
1588
|
-
}
|
|
1589
|
-
],
|
|
1590
|
-
senderAddress: paymentAddress
|
|
1591
|
-
},
|
|
1592
|
-
onFinish: (response) => {
|
|
1593
|
-
console.log(response);
|
|
1594
|
-
txId = response;
|
|
1595
|
-
},
|
|
1596
|
-
onCancel: () => {
|
|
1597
|
-
throw new Error("User canceled the request");
|
|
1598
|
-
}
|
|
1599
|
-
};
|
|
1600
|
-
yield sendBtcTxOrange(sendBtcOptions);
|
|
1601
|
-
return txId;
|
|
1602
|
-
}
|
|
1603
|
-
} catch (error) {
|
|
1604
|
-
throw error;
|
|
1605
|
-
}
|
|
1606
|
-
});
|
|
1607
|
-
const signMessage = useCallback(
|
|
1608
|
-
(message, toSignAddress) => __async(void 0, null, function* () {
|
|
1609
|
-
var _a;
|
|
1610
|
-
try {
|
|
1611
|
-
if (!library)
|
|
1612
|
-
return;
|
|
1613
|
-
if (provider === UNISAT) {
|
|
1614
|
-
const lib = window.unisat;
|
|
1615
|
-
return yield lib == null ? void 0 : lib.signMessage(message);
|
|
1616
|
-
} else if (provider === XVERSE) {
|
|
1617
|
-
const tempAddy = toSignAddress || paymentAddress;
|
|
1618
|
-
const response = yield request("signMessage", {
|
|
1619
|
-
address: tempAddy,
|
|
1620
|
-
message
|
|
1621
|
-
});
|
|
1622
|
-
if (response.status === "success") {
|
|
1623
|
-
return response.result.signature;
|
|
1624
|
-
} else {
|
|
1625
|
-
if (response.error.code === RpcErrorCode.USER_REJECTION) {
|
|
1626
|
-
throw new Error("User rejected the request");
|
|
1627
|
-
} else {
|
|
1628
|
-
throw new Error(
|
|
1629
|
-
"Error signing message: " + response.error.message
|
|
1630
|
-
);
|
|
1631
|
-
}
|
|
1632
|
-
}
|
|
1633
|
-
} else if (provider === OYL) {
|
|
1634
|
-
const lib = window == null ? void 0 : window.oyl;
|
|
1635
|
-
const tempAddy = toSignAddress || paymentAddress;
|
|
1636
|
-
const response = yield lib == null ? void 0 : lib.signMessage({
|
|
1637
|
-
address: tempAddy,
|
|
1638
|
-
message
|
|
1639
|
-
});
|
|
1640
|
-
return response.signature;
|
|
1641
|
-
} else if (provider === MAGIC_EDEN) {
|
|
1642
|
-
const tempAddy = toSignAddress || paymentAddress;
|
|
1643
|
-
let signedMessage;
|
|
1644
|
-
yield signMessageSatsConnect({
|
|
1645
|
-
getProvider: () => __async(void 0, null, function* () {
|
|
1646
|
-
return window.magicEden.bitcoin;
|
|
1647
|
-
}),
|
|
1648
|
-
payload: {
|
|
1649
|
-
network: {
|
|
1650
|
-
type: BitcoinNetworkType.Mainnet
|
|
1651
|
-
},
|
|
1652
|
-
address: tempAddy,
|
|
1653
|
-
message,
|
|
1654
|
-
protocol: MessageSigningProtocols.BIP322
|
|
1655
|
-
},
|
|
1656
|
-
onFinish: (response) => {
|
|
1657
|
-
signedMessage = response;
|
|
1658
|
-
},
|
|
1659
|
-
onCancel: () => {
|
|
1660
|
-
alert("Request canceled");
|
|
1661
|
-
}
|
|
1662
|
-
});
|
|
1663
|
-
return signedMessage;
|
|
1664
|
-
} else if (provider === OKX) {
|
|
1665
|
-
const lib = getOkxLibrary();
|
|
1666
|
-
return yield lib == null ? void 0 : lib.signMessage(message);
|
|
1667
|
-
} else if (provider === LEATHER) {
|
|
1668
|
-
const lib = window.LeatherProvider;
|
|
1669
|
-
setLibrary(lib);
|
|
1670
|
-
const paymentType = toSignAddress === address2 ? P2TR : P2WPKH;
|
|
1671
|
-
if (toSignAddress !== address2 && toSignAddress !== paymentAddress) {
|
|
1672
|
-
throw new Error("Invalid address to sign message");
|
|
1673
|
-
}
|
|
1674
|
-
const signed = yield lib == null ? void 0 : lib.request("signMessage", {
|
|
1675
|
-
message,
|
|
1676
|
-
paymentType
|
|
1677
|
-
});
|
|
1678
|
-
return (_a = signed == null ? void 0 : signed.result) == null ? void 0 : _a.signature;
|
|
1679
|
-
} else if (provider === PHANTOM) {
|
|
1680
|
-
const utf8Bytes = new TextEncoder().encode(message);
|
|
1681
|
-
const uintArray = new Uint8Array(utf8Bytes);
|
|
1682
|
-
const response = yield library == null ? void 0 : library.signMessage(address2, uintArray);
|
|
1683
|
-
const binaryString = String.fromCharCode(...response.signature);
|
|
1684
|
-
return btoa(binaryString);
|
|
1685
|
-
} else if (provider === WIZZ) {
|
|
1686
|
-
const lib = window.wizz;
|
|
1687
|
-
return yield lib == null ? void 0 : lib.signMessage(message);
|
|
1688
|
-
} else if (provider === ORANGE) {
|
|
1689
|
-
let signature = "";
|
|
1690
|
-
const tempAddy = toSignAddress || paymentAddress;
|
|
1691
|
-
const signMessageOptions = {
|
|
1692
|
-
payload: {
|
|
1693
|
-
network: {
|
|
1694
|
-
type: getOrangeNetwork(network)
|
|
1695
|
-
},
|
|
1696
|
-
address: tempAddy,
|
|
1697
|
-
message
|
|
1698
|
-
},
|
|
1699
|
-
onFinish: (response) => {
|
|
1700
|
-
signature = response;
|
|
1701
|
-
},
|
|
1702
|
-
onCancel: () => alert("Signature request canceled")
|
|
1703
|
-
};
|
|
1704
|
-
yield signMessageOrange(signMessageOptions);
|
|
1705
|
-
return signature;
|
|
1706
|
-
} else {
|
|
1707
|
-
throw new Error("The connected wallet doesn't support this method..");
|
|
1708
|
-
}
|
|
1709
|
-
} catch (error) {
|
|
1710
|
-
throw error;
|
|
1711
|
-
}
|
|
1712
|
-
}),
|
|
1713
|
-
[library, address2, paymentAddress]
|
|
1714
|
-
);
|
|
1715
|
-
const signPsbt = (psbt, finalize = false, broadcast = false) => __async(void 0, null, function* () {
|
|
1716
|
-
try {
|
|
1717
|
-
let psbtHex, psbtBase64;
|
|
1718
|
-
if (!library)
|
|
1719
|
-
return;
|
|
1720
|
-
if (!psbt)
|
|
1721
|
-
throw new Error("No PSBT provided");
|
|
1722
|
-
if (isHex(psbt)) {
|
|
1723
|
-
psbtBase64 = bitcoin2.Psbt.fromHex(psbt).toBase64();
|
|
1724
|
-
psbtHex = psbt;
|
|
1725
|
-
} else if (isBase64(psbt)) {
|
|
1726
|
-
psbtBase64 = psbt;
|
|
1727
|
-
psbtHex = bitcoin2.Psbt.fromBase64(psbt).toHex();
|
|
1728
|
-
} else {
|
|
1729
|
-
throw new Error("Invalid PSBT format");
|
|
1730
|
-
}
|
|
1731
|
-
if (provider === UNISAT) {
|
|
1732
|
-
const lib = window.unisat;
|
|
1733
|
-
const signedPsbt = yield lib == null ? void 0 : lib.signPsbt(psbtHex, {
|
|
1734
|
-
autoFinalized: finalize
|
|
1735
|
-
});
|
|
1736
|
-
const psbtSignedPsbt = bitcoin2.Psbt.fromHex(signedPsbt);
|
|
1737
|
-
if (finalize && broadcast) {
|
|
1738
|
-
const txId = yield pushPsbt(signedPsbt);
|
|
1739
|
-
return {
|
|
1740
|
-
signedPsbtHex: psbtSignedPsbt.toHex(),
|
|
1741
|
-
signedPsbtBase64: psbtSignedPsbt.toBase64(),
|
|
1742
|
-
txId
|
|
1743
|
-
};
|
|
1744
|
-
}
|
|
1745
|
-
return {
|
|
1746
|
-
signedPsbtHex: psbtSignedPsbt.toHex(),
|
|
1747
|
-
signedPsbtBase64: psbtSignedPsbt.toBase64(),
|
|
1748
|
-
txId: void 0
|
|
1749
|
-
};
|
|
1750
|
-
} else if (provider === XVERSE) {
|
|
1751
|
-
const toSignPsbt = bitcoin2.Psbt.fromBase64(String(psbtBase64), {
|
|
1752
|
-
network: getBitcoinNetwork(network)
|
|
1753
|
-
});
|
|
1754
|
-
const inputs = toSignPsbt.data.inputs;
|
|
1755
|
-
const inputsToSign = [];
|
|
1756
|
-
const ordinalAddressData = {
|
|
1757
|
-
address: address2,
|
|
1758
|
-
signingIndexes: []
|
|
1759
|
-
};
|
|
1760
|
-
const paymentsAddressData = {
|
|
1761
|
-
address: paymentAddress,
|
|
1762
|
-
signingIndexes: []
|
|
1763
|
-
};
|
|
1764
|
-
let counter = 0;
|
|
1765
|
-
try {
|
|
1766
|
-
for (var iter = __forAwait(inputs), more, temp, error; more = !(temp = yield iter.next()).done; more = false) {
|
|
1767
|
-
let input = temp.value;
|
|
1768
|
-
if (input.witnessUtxo === void 0) {
|
|
1769
|
-
paymentsAddressData.signingIndexes.push(Number(counter));
|
|
1770
|
-
} else {
|
|
1771
|
-
const { script } = input.witnessUtxo;
|
|
1772
|
-
const addressFromScript = fromOutputScript(
|
|
1773
|
-
script,
|
|
1774
|
-
getBitcoinNetwork(network)
|
|
1775
|
-
);
|
|
1776
|
-
if (addressFromScript === paymentAddress) {
|
|
1777
|
-
paymentsAddressData.signingIndexes.push(Number(counter));
|
|
1778
|
-
} else if (addressFromScript === address2) {
|
|
1779
|
-
ordinalAddressData.signingIndexes.push(Number(counter));
|
|
1780
|
-
}
|
|
1781
|
-
}
|
|
1782
|
-
counter++;
|
|
1783
|
-
}
|
|
1784
|
-
} catch (temp) {
|
|
1785
|
-
error = [temp];
|
|
1786
|
-
} finally {
|
|
1787
|
-
try {
|
|
1788
|
-
more && (temp = iter.return) && (yield temp.call(iter));
|
|
1789
|
-
} finally {
|
|
1790
|
-
if (error)
|
|
1791
|
-
throw error[0];
|
|
1792
|
-
}
|
|
1793
|
-
}
|
|
1794
|
-
if (ordinalAddressData.signingIndexes.length > 0) {
|
|
1795
|
-
inputsToSign.push(ordinalAddressData);
|
|
1796
|
-
}
|
|
1797
|
-
if (paymentsAddressData.signingIndexes.length > 0) {
|
|
1798
|
-
inputsToSign.push(paymentsAddressData);
|
|
1799
|
-
}
|
|
1800
|
-
let txId, signedPsbtHex, signedPsbtBase64;
|
|
1801
|
-
const xverseNetwork = getXverseNetwork(network);
|
|
1802
|
-
const signPsbtOptions = {
|
|
1803
|
-
payload: {
|
|
1804
|
-
network: {
|
|
1805
|
-
type: xverseNetwork
|
|
1806
|
-
},
|
|
1807
|
-
message: "Sign Transaction",
|
|
1808
|
-
psbtBase64: toSignPsbt.toBase64(),
|
|
1809
|
-
broadcast,
|
|
1810
|
-
inputsToSign
|
|
1811
|
-
},
|
|
1812
|
-
onFinish: (response) => {
|
|
1813
|
-
if (response.txId) {
|
|
1814
|
-
txId = response.txId;
|
|
1815
|
-
} else if (response.psbtBase64) {
|
|
1816
|
-
const signedPsbt = bitcoin2.Psbt.fromBase64(
|
|
1817
|
-
String(response.psbtBase64),
|
|
1818
|
-
{
|
|
1819
|
-
network: getBitcoinNetwork(network)
|
|
1820
|
-
}
|
|
1821
|
-
);
|
|
1822
|
-
signedPsbtHex = signedPsbt.toHex();
|
|
1823
|
-
signedPsbtBase64 = signedPsbt.toBase64();
|
|
1824
|
-
}
|
|
1825
|
-
},
|
|
1826
|
-
onCancel: () => console.log("Canceled")
|
|
1827
|
-
};
|
|
1828
|
-
yield signTransaction(signPsbtOptions);
|
|
1829
|
-
return {
|
|
1830
|
-
signedPsbtHex,
|
|
1831
|
-
signedPsbtBase64,
|
|
1832
|
-
txId
|
|
1833
|
-
};
|
|
1834
|
-
} else if (provider === OYL) {
|
|
1835
|
-
const lib = window == null ? void 0 : window.oyl;
|
|
1836
|
-
const { psbt: psbt2, txid } = yield lib == null ? void 0 : lib.signPsbt({
|
|
1837
|
-
psbt: psbtHex,
|
|
1838
|
-
finalize,
|
|
1839
|
-
broadcast
|
|
1840
|
-
});
|
|
1841
|
-
const psbtSignedPsbt = bitcoin2.Psbt.fromHex(psbt2);
|
|
1842
|
-
return {
|
|
1843
|
-
signedPsbtHex: psbtSignedPsbt.toHex(),
|
|
1844
|
-
signedPsbtBase64: psbtSignedPsbt.toBase64(),
|
|
1845
|
-
txId: txid
|
|
1846
|
-
};
|
|
1847
|
-
} else if (provider === MAGIC_EDEN) {
|
|
1848
|
-
const toSignPsbt = bitcoin2.Psbt.fromBase64(String(psbtBase64), {
|
|
1849
|
-
network: getBitcoinNetwork(network)
|
|
1850
|
-
});
|
|
1851
|
-
const inputs = toSignPsbt.data.inputs;
|
|
1852
|
-
const inputsToSign = [];
|
|
1853
|
-
const ordinalAddressData = {
|
|
1854
|
-
address: address2,
|
|
1855
|
-
signingIndexes: []
|
|
1856
|
-
};
|
|
1857
|
-
const paymentsAddressData = {
|
|
1858
|
-
address: paymentAddress,
|
|
1859
|
-
signingIndexes: []
|
|
1860
|
-
};
|
|
1861
|
-
let counter = 0;
|
|
1862
|
-
try {
|
|
1863
|
-
for (var iter2 = __forAwait(inputs), more2, temp2, error2; more2 = !(temp2 = yield iter2.next()).done; more2 = false) {
|
|
1864
|
-
let input = temp2.value;
|
|
1865
|
-
const { script } = input.witnessUtxo;
|
|
1866
|
-
const addressFromScript = fromOutputScript(
|
|
1867
|
-
script,
|
|
1868
|
-
getBitcoinNetwork(network)
|
|
1869
|
-
);
|
|
1870
|
-
if (addressFromScript === paymentAddress) {
|
|
1871
|
-
paymentsAddressData.signingIndexes.push(Number(counter));
|
|
1872
|
-
} else if (addressFromScript === address2) {
|
|
1873
|
-
ordinalAddressData.signingIndexes.push(Number(counter));
|
|
1874
|
-
}
|
|
1875
|
-
counter++;
|
|
1876
|
-
}
|
|
1877
|
-
} catch (temp2) {
|
|
1878
|
-
error2 = [temp2];
|
|
1879
|
-
} finally {
|
|
1880
|
-
try {
|
|
1881
|
-
more2 && (temp2 = iter2.return) && (yield temp2.call(iter2));
|
|
1882
|
-
} finally {
|
|
1883
|
-
if (error2)
|
|
1884
|
-
throw error2[0];
|
|
1885
|
-
}
|
|
1886
|
-
}
|
|
1887
|
-
if (ordinalAddressData.signingIndexes.length > 0) {
|
|
1888
|
-
inputsToSign.push(ordinalAddressData);
|
|
1889
|
-
}
|
|
1890
|
-
if (paymentsAddressData.signingIndexes.length > 0) {
|
|
1891
|
-
inputsToSign.push(paymentsAddressData);
|
|
1892
|
-
}
|
|
1893
|
-
let txId, signedPsbtHex, signedPsbtBase64;
|
|
1894
|
-
const magicEdenNetwork = getXverseNetwork(network);
|
|
1895
|
-
const signPsbtOptions = {
|
|
1896
|
-
getProvider: () => __async(void 0, null, function* () {
|
|
1897
|
-
return library;
|
|
1898
|
-
}),
|
|
1899
|
-
payload: {
|
|
1900
|
-
network: {
|
|
1901
|
-
type: magicEdenNetwork
|
|
1902
|
-
},
|
|
1903
|
-
message: "Sign Transaction",
|
|
1904
|
-
psbtBase64: toSignPsbt.toBase64(),
|
|
1905
|
-
broadcast,
|
|
1906
|
-
inputsToSign
|
|
1907
|
-
},
|
|
1908
|
-
onFinish: (response) => {
|
|
1909
|
-
if (response.psbtBase64) {
|
|
1910
|
-
const signedPsbt = bitcoin2.Psbt.fromBase64(
|
|
1911
|
-
String(response.psbtBase64),
|
|
1912
|
-
{
|
|
1913
|
-
network: getBitcoinNetwork(network)
|
|
1914
|
-
}
|
|
1915
|
-
);
|
|
1916
|
-
signedPsbtHex = signedPsbt.toHex();
|
|
1917
|
-
signedPsbtBase64 = signedPsbt.toBase64();
|
|
1918
|
-
}
|
|
1919
|
-
},
|
|
1920
|
-
onCancel: () => {
|
|
1921
|
-
console.log("Canceled");
|
|
1922
|
-
throw new Error("User canceled the request");
|
|
1923
|
-
},
|
|
1924
|
-
onError: (error4) => {
|
|
1925
|
-
console.log("error", error4);
|
|
1926
|
-
throw error4;
|
|
1927
|
-
}
|
|
1928
|
-
};
|
|
1929
|
-
yield signTransaction(signPsbtOptions);
|
|
1930
|
-
if (broadcast) {
|
|
1931
|
-
const signed = bitcoin2.Psbt.fromBase64(String(signedPsbtBase64));
|
|
1932
|
-
const finalized = signed.finalizeAllInputs();
|
|
1933
|
-
const extracted = finalized.extractTransaction();
|
|
1934
|
-
const txId2 = yield pushPsbt(extracted.toHex());
|
|
1935
|
-
return {
|
|
1936
|
-
signedPsbtHex: extracted.toHex(),
|
|
1937
|
-
signedPsbtBase64: "test",
|
|
1938
|
-
txId: txId2
|
|
1939
|
-
};
|
|
1940
|
-
} else {
|
|
1941
|
-
return {
|
|
1942
|
-
signedPsbtHex,
|
|
1943
|
-
signedPsbtBase64,
|
|
1944
|
-
txId
|
|
1945
|
-
};
|
|
1946
|
-
}
|
|
1947
|
-
} else if (provider === OKX) {
|
|
1948
|
-
const lib = getOkxLibrary();
|
|
1949
|
-
const signedPsbt = yield lib == null ? void 0 : lib.signPsbt(psbtHex, {
|
|
1950
|
-
autoFinalized: finalize
|
|
1951
|
-
});
|
|
1952
|
-
const psbtSignedPsbt = bitcoin2.Psbt.fromHex(signedPsbt);
|
|
1953
|
-
if (finalize && broadcast) {
|
|
1954
|
-
const txId = yield pushPsbt(signedPsbt);
|
|
1955
|
-
return {
|
|
1956
|
-
signedPsbtHex: psbtSignedPsbt.toHex(),
|
|
1957
|
-
signedPsbtBase64: psbtSignedPsbt.toBase64(),
|
|
1958
|
-
txId
|
|
1959
|
-
};
|
|
1960
|
-
}
|
|
1961
|
-
return {
|
|
1962
|
-
signedPsbtHex: psbtSignedPsbt.toHex(),
|
|
1963
|
-
signedPsbtBase64: psbtSignedPsbt.toBase64(),
|
|
1964
|
-
txId: void 0
|
|
1965
|
-
};
|
|
1966
|
-
} else if (provider === LEATHER) {
|
|
1967
|
-
const requestParams = {
|
|
1968
|
-
hex: psbtHex,
|
|
1969
|
-
broadcast: false,
|
|
1970
|
-
network
|
|
1971
|
-
};
|
|
1972
|
-
const lib = window.LeatherProvider;
|
|
1973
|
-
setLibrary(lib);
|
|
1974
|
-
const response = yield lib == null ? void 0 : lib.request(
|
|
1975
|
-
"signPsbt",
|
|
1976
|
-
requestParams
|
|
1977
|
-
);
|
|
1978
|
-
const leatherHexResult = response.result;
|
|
1979
|
-
const signedTx = leatherHexResult.hex;
|
|
1980
|
-
const signed = bitcoin2.Psbt.fromHex(String(signedTx));
|
|
1981
|
-
if (finalize && broadcast) {
|
|
1982
|
-
const finalized = signed.finalizeAllInputs();
|
|
1983
|
-
const txId = yield pushPsbt(finalized.toHex());
|
|
1984
|
-
return {
|
|
1985
|
-
signedPsbtHex: signed.toHex(),
|
|
1986
|
-
signedPsbtBase64: signed.toBase64(),
|
|
1987
|
-
txId
|
|
1988
|
-
};
|
|
1989
|
-
} else if (finalize) {
|
|
1990
|
-
const finalized = signed.finalizeAllInputs();
|
|
1991
|
-
return {
|
|
1992
|
-
signedPsbtHex: finalized.toHex(),
|
|
1993
|
-
signedPsbtBase64: finalized.toBase64(),
|
|
1994
|
-
txId: void 0
|
|
1995
|
-
};
|
|
1996
|
-
} else {
|
|
1997
|
-
return {
|
|
1998
|
-
signedPsbtHex: signed.toHex(),
|
|
1999
|
-
signedPsbtBase64: signed.toBase64(),
|
|
2000
|
-
txId: void 0
|
|
2001
|
-
};
|
|
2002
|
-
}
|
|
2003
|
-
} else if (provider === WIZZ) {
|
|
2004
|
-
const lib = window.wizz;
|
|
2005
|
-
const signedPsbt = yield lib == null ? void 0 : lib.signPsbt(psbtHex, {
|
|
2006
|
-
autoFinalized: finalize,
|
|
2007
|
-
broadcast: false
|
|
2008
|
-
});
|
|
2009
|
-
const psbtSignedPsbt = bitcoin2.Psbt.fromHex(signedPsbt);
|
|
2010
|
-
if (finalize && broadcast) {
|
|
2011
|
-
const txId = yield pushPsbt(signedPsbt);
|
|
2012
|
-
return {
|
|
2013
|
-
signedPsbtHex: psbtSignedPsbt.toHex(),
|
|
2014
|
-
signedPsbtBase64: psbtSignedPsbt.toBase64(),
|
|
2015
|
-
txId
|
|
2016
|
-
};
|
|
2017
|
-
}
|
|
2018
|
-
return {
|
|
2019
|
-
signedPsbtHex: psbtSignedPsbt.toHex(),
|
|
2020
|
-
signedPsbtBase64: psbtSignedPsbt.toBase64(),
|
|
2021
|
-
txId: void 0
|
|
2022
|
-
};
|
|
2023
|
-
} else if (provider === ORANGE) {
|
|
2024
|
-
const toSignPsbt = bitcoin2.Psbt.fromBase64(String(psbtBase64), {
|
|
2025
|
-
network: getBitcoinNetwork(network)
|
|
2026
|
-
});
|
|
2027
|
-
const inputs = toSignPsbt.data.inputs;
|
|
2028
|
-
const inputsToSign = [];
|
|
2029
|
-
const ordinalAddressData = {
|
|
2030
|
-
address: address2,
|
|
2031
|
-
signingIndexes: []
|
|
2032
|
-
};
|
|
2033
|
-
const paymentsAddressData = {
|
|
2034
|
-
address: paymentAddress,
|
|
2035
|
-
signingIndexes: []
|
|
2036
|
-
};
|
|
2037
|
-
let counter = 0;
|
|
2038
|
-
try {
|
|
2039
|
-
for (var iter3 = __forAwait(inputs), more3, temp3, error3; more3 = !(temp3 = yield iter3.next()).done; more3 = false) {
|
|
2040
|
-
let input = temp3.value;
|
|
2041
|
-
if (input.witnessUtxo === void 0) {
|
|
2042
|
-
paymentsAddressData.signingIndexes.push(Number(counter));
|
|
2043
|
-
} else {
|
|
2044
|
-
const { script } = input.witnessUtxo;
|
|
2045
|
-
const addressFromScript = fromOutputScript(
|
|
2046
|
-
script,
|
|
2047
|
-
getBitcoinNetwork(network)
|
|
2048
|
-
);
|
|
2049
|
-
if (addressFromScript === paymentAddress) {
|
|
2050
|
-
paymentsAddressData.signingIndexes.push(Number(counter));
|
|
2051
|
-
} else if (addressFromScript === address2) {
|
|
2052
|
-
ordinalAddressData.signingIndexes.push(Number(counter));
|
|
2053
|
-
}
|
|
2054
|
-
}
|
|
2055
|
-
counter++;
|
|
2056
|
-
}
|
|
2057
|
-
} catch (temp3) {
|
|
2058
|
-
error3 = [temp3];
|
|
2059
|
-
} finally {
|
|
2060
|
-
try {
|
|
2061
|
-
more3 && (temp3 = iter3.return) && (yield temp3.call(iter3));
|
|
2062
|
-
} finally {
|
|
2063
|
-
if (error3)
|
|
2064
|
-
throw error3[0];
|
|
2065
|
-
}
|
|
2066
|
-
}
|
|
2067
|
-
if (ordinalAddressData.signingIndexes.length > 0) {
|
|
2068
|
-
inputsToSign.push(ordinalAddressData);
|
|
2069
|
-
}
|
|
2070
|
-
if (paymentsAddressData.signingIndexes.length > 0) {
|
|
2071
|
-
inputsToSign.push(paymentsAddressData);
|
|
2072
|
-
}
|
|
2073
|
-
let txId, signedPsbtHex, signedPsbtBase64;
|
|
2074
|
-
const signPsbtOptions = {
|
|
2075
|
-
payload: {
|
|
2076
|
-
network: {
|
|
2077
|
-
type: getOrangeNetwork(network)
|
|
2078
|
-
},
|
|
2079
|
-
psbtBase64: toSignPsbt.toBase64(),
|
|
2080
|
-
broadcast,
|
|
2081
|
-
inputsToSign
|
|
2082
|
-
},
|
|
2083
|
-
onFinish: (response) => {
|
|
2084
|
-
console.log(response);
|
|
2085
|
-
if (response.txId) {
|
|
2086
|
-
txId = response.txId;
|
|
2087
|
-
} else if (response.psbtBase64) {
|
|
2088
|
-
const signedPsbt = bitcoin2.Psbt.fromBase64(
|
|
2089
|
-
String(response.psbtBase64),
|
|
2090
|
-
{
|
|
2091
|
-
network: getBitcoinNetwork(network)
|
|
2092
|
-
}
|
|
2093
|
-
);
|
|
2094
|
-
signedPsbtHex = signedPsbt.toHex();
|
|
2095
|
-
signedPsbtBase64 = signedPsbt.toBase64();
|
|
2096
|
-
}
|
|
2097
|
-
},
|
|
2098
|
-
onCancel: () => console.log("Canceled")
|
|
2099
|
-
};
|
|
2100
|
-
yield signPsbtOrange(signPsbtOptions);
|
|
2101
|
-
return {
|
|
2102
|
-
signedPsbtHex,
|
|
2103
|
-
signedPsbtBase64,
|
|
2104
|
-
txId
|
|
2105
|
-
};
|
|
2106
|
-
} else {
|
|
2107
|
-
throw new Error("The connected wallet doesn't support this method..");
|
|
2108
|
-
}
|
|
2109
|
-
} catch (error4) {
|
|
2110
|
-
throw error4;
|
|
2111
|
-
}
|
|
2112
|
-
});
|
|
2113
|
-
const pushPsbt = (psbt) => __async(void 0, null, function* () {
|
|
2114
|
-
try {
|
|
2115
|
-
if (!library)
|
|
2116
|
-
return;
|
|
2117
|
-
if (provider === UNISAT) {
|
|
2118
|
-
return yield axios2.post(`${getMempoolSpaceUrl2(network)}/api/tx`, psbt).then((res) => res.data);
|
|
2119
|
-
} else if (provider === OYL) {
|
|
2120
|
-
const oylLib = window == null ? void 0 : window.oyl;
|
|
2121
|
-
const response = yield oylLib.pushPsbt({ psbt });
|
|
2122
|
-
return response.txid;
|
|
2123
|
-
} else if (provider === OKX) {
|
|
2124
|
-
return yield axios2.post(`${getMempoolSpaceUrl2(network)}/api/tx`, psbt).then((res) => res.data);
|
|
2125
|
-
} else if (provider === MAGIC_EDEN) {
|
|
2126
|
-
return yield axios2.post(`${getMempoolSpaceUrl2(network)}/api/tx`, psbt).then((res) => res.data);
|
|
2127
|
-
} else if (provider === LEATHER) {
|
|
2128
|
-
const decoded = bitcoin2.Psbt.fromHex(psbt);
|
|
2129
|
-
const extracted = decoded.extractTransaction();
|
|
2130
|
-
return yield axios2.post(`${getMempoolSpaceUrl2(network)}/api/tx`, extracted.toHex()).then((res) => res.data);
|
|
2131
|
-
} else if (provider === WIZZ) {
|
|
2132
|
-
return yield axios2.post(`${getMempoolSpaceUrl2(network)}/api/tx`, psbt).then((res) => res.data);
|
|
2133
|
-
} else if (provider === ORANGE) {
|
|
2134
|
-
let payload = psbt;
|
|
2135
|
-
if (!psbt.startsWith("02")) {
|
|
2136
|
-
const psbtObj = bitcoin2.Psbt.fromHex(psbt);
|
|
2137
|
-
psbtObj.finalizeAllInputs();
|
|
2138
|
-
payload = psbtObj.extractTransaction().toHex();
|
|
2139
|
-
}
|
|
2140
|
-
return yield axios2.post(`${getMempoolSpaceUrl2(network)}/api/tx`, payload).then((res) => res.data);
|
|
2141
|
-
} else {
|
|
2142
|
-
throw new Error("The connected wallet doesn't support this method..");
|
|
2143
|
-
}
|
|
2144
|
-
} catch (error) {
|
|
2145
|
-
throw error;
|
|
2146
|
-
}
|
|
2147
|
-
});
|
|
2148
|
-
return /* @__PURE__ */ jsx(
|
|
2149
|
-
LaserEyesContext.Provider,
|
|
2150
|
-
{
|
|
2151
|
-
value: {
|
|
2152
|
-
library,
|
|
2153
|
-
accounts,
|
|
2154
|
-
publicKey,
|
|
2155
|
-
address: address2,
|
|
2156
|
-
paymentAddress,
|
|
2157
|
-
paymentPublicKey,
|
|
2158
|
-
provider,
|
|
2159
|
-
balance,
|
|
2160
|
-
network,
|
|
2161
|
-
isInitializing,
|
|
2162
|
-
connected,
|
|
2163
|
-
isConnecting,
|
|
2164
|
-
hasUnisat,
|
|
2165
|
-
hasXverse,
|
|
2166
|
-
hasOyl,
|
|
2167
|
-
hasMagicEden,
|
|
2168
|
-
hasOkx,
|
|
2169
|
-
hasLeather,
|
|
2170
|
-
hasPhantom,
|
|
2171
|
-
hasWizz,
|
|
2172
|
-
hasOrange,
|
|
2173
|
-
// functions
|
|
2174
|
-
connect,
|
|
2175
|
-
disconnect,
|
|
2176
|
-
requestAccounts,
|
|
2177
|
-
getNetwork,
|
|
2178
|
-
switchNetwork,
|
|
2179
|
-
getPublicKey,
|
|
2180
|
-
getBalance,
|
|
2181
|
-
getInscriptions,
|
|
2182
|
-
sendBTC,
|
|
2183
|
-
signPsbt,
|
|
2184
|
-
pushPsbt,
|
|
2185
|
-
signMessage
|
|
2186
|
-
},
|
|
2187
|
-
children
|
|
2188
|
-
}
|
|
2189
|
-
);
|
|
2190
|
-
};
|
|
2191
|
-
|
|
2192
|
-
// src/icons/oyl.tsx
|
|
2193
|
-
import { jsx as jsx2, jsxs } from "react/jsx-runtime";
|
|
2194
|
-
var OylLogo = (_a) => {
|
|
2195
|
-
var _b = _a, {
|
|
2196
|
-
size = 42,
|
|
2197
|
-
variant = "first",
|
|
2198
|
-
className
|
|
2199
|
-
} = _b, props = __objRest(_b, [
|
|
2200
|
-
"size",
|
|
2201
|
-
"variant",
|
|
2202
|
-
"className"
|
|
2203
|
-
]);
|
|
2204
|
-
if (variant === "first") {
|
|
2205
|
-
return /* @__PURE__ */ jsxs(
|
|
2206
|
-
"svg",
|
|
2207
|
-
__spreadProps(__spreadValues({
|
|
2208
|
-
className,
|
|
2209
|
-
width: size,
|
|
2210
|
-
height: size,
|
|
2211
|
-
viewBox: "0 0 42 42",
|
|
2212
|
-
fill: "none",
|
|
2213
|
-
xmlns: "http://www.w3.org/2000/svg"
|
|
2214
|
-
}, props), {
|
|
2215
|
-
children: [
|
|
2216
|
-
/* @__PURE__ */ jsx2(
|
|
2217
|
-
"rect",
|
|
2218
|
-
{
|
|
2219
|
-
width: "42",
|
|
2220
|
-
height: "42",
|
|
2221
|
-
rx: "10",
|
|
2222
|
-
fill: "#090A0C",
|
|
2223
|
-
style: { fill: "#090A0C", fillOpacity: 1 }
|
|
2224
|
-
}
|
|
2225
|
-
),
|
|
2226
|
-
/* @__PURE__ */ jsx2(
|
|
2227
|
-
"path",
|
|
2228
|
-
{
|
|
2229
|
-
d: "M21 14C29.222 14 38 15.9676 38 20.9054C38 25.8622 29.222 28 21 28C12.778 28 4 26.0324 4 21.0946C4 16.1378 12.778 14 21 14ZM21.0397 25.3135C24.6939 25.3135 30.1752 24.3297 30.1752 21C30.1752 17.6703 24.6939 16.6865 21.0397 16.6865H20.9603C17.3061 16.6865 11.8248 17.6703 11.8248 21C11.8248 24.3297 17.3061 25.3135 20.9603 25.3135H21.0397Z",
|
|
2230
|
-
fill: "white",
|
|
2231
|
-
style: { fill: "white", fillOpacity: 1 }
|
|
2232
|
-
}
|
|
2233
|
-
)
|
|
2234
|
-
]
|
|
2235
|
-
})
|
|
2236
|
-
);
|
|
2237
|
-
}
|
|
2238
|
-
return /* @__PURE__ */ jsxs(
|
|
2239
|
-
"svg",
|
|
2240
|
-
__spreadProps(__spreadValues({
|
|
2241
|
-
className,
|
|
2242
|
-
width: size,
|
|
2243
|
-
height: size,
|
|
2244
|
-
viewBox: "0 0 42 42",
|
|
2245
|
-
fill: "none",
|
|
2246
|
-
xmlns: "http://www.w3.org/2000/svg"
|
|
2247
|
-
}, props), {
|
|
2248
|
-
children: [
|
|
2249
|
-
/* @__PURE__ */ jsx2(
|
|
2250
|
-
"rect",
|
|
2251
|
-
{
|
|
2252
|
-
width: "42",
|
|
2253
|
-
height: "42",
|
|
2254
|
-
rx: "10",
|
|
2255
|
-
fill: "white",
|
|
2256
|
-
style: { fill: "white", fillOpacity: 1 }
|
|
2257
|
-
}
|
|
2258
|
-
),
|
|
2259
|
-
/* @__PURE__ */ jsx2(
|
|
2260
|
-
"path",
|
|
2261
|
-
{
|
|
2262
|
-
d: "M21 14C29.222 14 38 15.9676 38 20.9054C38 25.8622 29.222 28 21 28C12.778 28 4 26.0324 4 21.0946C4 16.1378 12.778 14 21 14ZM21.0397 25.3135C24.6939 25.3135 30.1752 24.3297 30.1752 21C30.1752 17.6703 24.6939 16.6865 21.0397 16.6865H20.9603C17.3061 16.6865 11.8248 17.6703 11.8248 21C11.8248 24.3297 17.3061 25.3135 20.9603 25.3135H21.0397Z",
|
|
2263
|
-
fill: "#090A0C",
|
|
2264
|
-
style: { fill: "#090A0C", fillOpacity: 1 }
|
|
2265
|
-
}
|
|
2266
|
-
)
|
|
2267
|
-
]
|
|
2268
|
-
})
|
|
2269
|
-
);
|
|
2270
|
-
};
|
|
2271
|
-
|
|
2272
|
-
// src/icons/leather.tsx
|
|
2273
|
-
import { jsx as jsx3, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
2274
|
-
var LeatherLogo = (_a) => {
|
|
2275
|
-
var _b = _a, {
|
|
2276
|
-
size = 42,
|
|
2277
|
-
variant = "first",
|
|
2278
|
-
className
|
|
2279
|
-
} = _b, props = __objRest(_b, [
|
|
2280
|
-
"size",
|
|
2281
|
-
"variant",
|
|
2282
|
-
"className"
|
|
2283
|
-
]);
|
|
2284
|
-
if (variant === "first") {
|
|
2285
|
-
return /* @__PURE__ */ jsxs2(
|
|
2286
|
-
"svg",
|
|
2287
|
-
__spreadProps(__spreadValues({
|
|
2288
|
-
className,
|
|
2289
|
-
width: size,
|
|
2290
|
-
height: size,
|
|
2291
|
-
viewBox: "0 0 128 128",
|
|
2292
|
-
fill: "none",
|
|
2293
|
-
xmlns: "http://www.w3.org/2000/svg"
|
|
2294
|
-
}, props), {
|
|
2295
|
-
children: [
|
|
2296
|
-
/* @__PURE__ */ jsx3("rect", { width: "128", height: "128", rx: "26.8387", fill: "#12100F" }),
|
|
2297
|
-
/* @__PURE__ */ jsx3(
|
|
2298
|
-
"path",
|
|
2299
|
-
{
|
|
2300
|
-
d: "M74.9171 52.7114C82.4766 51.5408 93.4087 43.5804 93.4087 37.3761C93.4087 35.5031 91.8968 34.2154 89.6871 34.2154C85.5004 34.2154 78.4061 40.5368 74.9171 52.7114ZM39.911 83.4991C30.0256 83.4991 29.2115 93.3324 39.0969 93.3324C43.5163 93.3324 48.8661 91.5764 51.6573 88.4157C47.5868 84.9038 44.2141 83.4991 39.911 83.4991ZM102.829 79.2848C103.41 95.7907 95.0369 105.039 80.8484 105.039C72.4748 105.039 68.2881 101.878 59.333 96.0249C54.681 101.176 45.8423 105.039 38.5154 105.039C13.2785 105.039 14.3252 72.8463 40.0273 72.8463C45.3771 72.8463 49.9128 74.2511 55.7277 77.88L59.5656 64.4177C43.7489 60.0864 35.8405 47.9118 43.6326 30.4693H56.1929C49.215 42.0586 53.9832 51.6578 62.822 52.7114C67.5903 35.7372 77.8246 22.509 91.4316 22.509C99.1074 22.509 105.155 27.5428 105.155 36.6737C105.155 51.3066 86.0819 63.2471 71.6607 64.4177L65.7295 85.3721C72.4748 93.2153 91.199 100.824 91.199 79.2848H102.829Z",
|
|
2301
|
-
fill: "#F5F1ED"
|
|
2302
|
-
}
|
|
2303
|
-
)
|
|
2304
|
-
]
|
|
2305
|
-
})
|
|
2306
|
-
);
|
|
2307
|
-
}
|
|
2308
|
-
return /* @__PURE__ */ jsxs2(
|
|
2309
|
-
"svg",
|
|
2310
|
-
__spreadProps(__spreadValues({
|
|
2311
|
-
className,
|
|
2312
|
-
width: size,
|
|
2313
|
-
height: size,
|
|
2314
|
-
viewBox: "0 0 128 128",
|
|
2315
|
-
fill: "none",
|
|
2316
|
-
xmlns: "http://www.w3.org/2000/svg"
|
|
2317
|
-
}, props), {
|
|
2318
|
-
children: [
|
|
2319
|
-
/* @__PURE__ */ jsx3("rect", { width: "128", height: "128", rx: "26.8387", fill: "#F5F1ED" }),
|
|
2320
|
-
/* @__PURE__ */ jsx3(
|
|
2321
|
-
"path",
|
|
2322
|
-
{
|
|
2323
|
-
d: "M74.9171 52.7115C82.4766 51.5409 93.4087 43.5806 93.4087 37.3762C93.4087 35.5032 91.8968 34.2155 89.6871 34.2155C85.5004 34.2155 78.4061 40.5369 74.9171 52.7115ZM39.911 83.4992C30.0256 83.4992 29.2115 93.3325 39.0969 93.3325C43.5163 93.3325 48.8661 91.5766 51.6573 88.4159C47.5868 84.904 44.2141 83.4992 39.911 83.4992ZM102.829 79.2849C103.41 95.7908 95.0369 105.039 80.8484 105.039C72.4748 105.039 68.2881 101.878 59.333 96.025C54.681 101.176 45.8423 105.039 38.5154 105.039C13.2785 105.039 14.3252 72.8464 40.0273 72.8464C45.3771 72.8464 49.9128 74.2512 55.7277 77.8801L59.5656 64.4179C43.7489 60.0865 35.8405 47.9119 43.6326 30.4695H56.1929C49.215 42.0587 53.9832 51.6579 62.822 52.7115C67.5903 35.7373 77.8246 22.5092 91.4316 22.5092C99.1074 22.5092 105.155 27.5429 105.155 36.6738C105.155 51.3068 86.0819 63.2472 71.6607 64.4179L65.7295 85.3722C72.4748 93.2155 91.199 100.825 91.199 79.2849H102.829Z",
|
|
2324
|
-
fill: "#12100F"
|
|
2325
|
-
}
|
|
2326
|
-
)
|
|
2327
|
-
]
|
|
2328
|
-
})
|
|
2329
|
-
);
|
|
2330
|
-
};
|
|
2331
|
-
|
|
2332
|
-
// src/icons/phantom.tsx
|
|
2333
|
-
import { jsx as jsx4, jsxs as jsxs3 } from "react/jsx-runtime";
|
|
2334
|
-
var PhantomLogo = (_a) => {
|
|
2335
|
-
var _b = _a, {
|
|
2336
|
-
size = 42,
|
|
2337
|
-
variant = "first",
|
|
2338
|
-
className
|
|
2339
|
-
} = _b, props = __objRest(_b, [
|
|
2340
|
-
"size",
|
|
2341
|
-
"variant",
|
|
2342
|
-
"className"
|
|
2343
|
-
]);
|
|
2344
|
-
if (variant === "first") {
|
|
2345
|
-
return /* @__PURE__ */ jsxs3(
|
|
2346
|
-
"svg",
|
|
2347
|
-
__spreadProps(__spreadValues({
|
|
2348
|
-
className,
|
|
2349
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
2350
|
-
width: size,
|
|
2351
|
-
height: size,
|
|
2352
|
-
viewBox: "0 0 42 42",
|
|
2353
|
-
fill: "none"
|
|
2354
|
-
}, props), {
|
|
2355
|
-
children: [
|
|
2356
|
-
/* @__PURE__ */ jsxs3("g", { clipPath: "url(#a)", children: [
|
|
2357
|
-
/* @__PURE__ */ jsx4(
|
|
2358
|
-
"path",
|
|
2359
|
-
{
|
|
2360
|
-
fill: "#AB9FF2",
|
|
2361
|
-
d: "M32 0H10C4.477 0 0 4.477 0 10v22c0 5.523 4.477 10 10 10h22c5.523 0 10-4.477 10-10V10c0-5.523-4.477-10-10-10Z"
|
|
2362
|
-
}
|
|
2363
|
-
),
|
|
2364
|
-
/* @__PURE__ */ jsx4(
|
|
2365
|
-
"path",
|
|
2366
|
-
{
|
|
2367
|
-
fill: "#FFFDF8",
|
|
2368
|
-
fillRule: "evenodd",
|
|
2369
|
-
d: "M17.686 27.567c-1.676 2.569-4.484 5.819-8.22 5.819-1.767 0-3.466-.728-3.466-3.887C6 21.454 16.984 9 27.176 9c5.798 0 8.108 4.023 8.108 8.59 0 5.864-3.805 12.568-7.587 12.568-1.2 0-1.79-.659-1.79-1.704 0-.273.046-.568.137-.887-1.291 2.205-3.783 4.25-6.116 4.25-1.698 0-2.559-1.068-2.559-2.568 0-.545.114-1.113.317-1.681Zm8.78-10.135c0 1.331-.786 1.997-1.664 1.997-.892 0-1.664-.666-1.664-1.997s.772-1.996 1.664-1.996c.878 0 1.663.665 1.663 1.996Zm4.99 0c0 1.331-.785 1.997-1.663 1.997-.892 0-1.664-.666-1.664-1.997 0-1.33.772-1.996 1.664-1.996.878 0 1.664.665 1.664 1.996Z",
|
|
2370
|
-
clipRule: "evenodd"
|
|
2371
|
-
}
|
|
2372
|
-
)
|
|
2373
|
-
] }),
|
|
2374
|
-
/* @__PURE__ */ jsx4("defs", { children: /* @__PURE__ */ jsx4("clipPath", { id: "a", children: /* @__PURE__ */ jsx4("path", { fill: "#fff", d: "M0 0h42v42H0z" }) }) })
|
|
2375
|
-
]
|
|
2376
|
-
})
|
|
2377
|
-
);
|
|
2378
|
-
}
|
|
2379
|
-
return /* @__PURE__ */ jsxs3(
|
|
2380
|
-
"svg",
|
|
2381
|
-
__spreadProps(__spreadValues({
|
|
2382
|
-
className,
|
|
2383
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
2384
|
-
width: size,
|
|
2385
|
-
height: size,
|
|
2386
|
-
viewBox: "0 0 42 42",
|
|
2387
|
-
fill: "none"
|
|
2388
|
-
}, props), {
|
|
2389
|
-
children: [
|
|
2390
|
-
/* @__PURE__ */ jsxs3("g", { clipPath: "url(#a)", children: [
|
|
2391
|
-
/* @__PURE__ */ jsx4(
|
|
2392
|
-
"path",
|
|
2393
|
-
{
|
|
2394
|
-
fill: "#FFFDF8",
|
|
2395
|
-
d: "M32 0H10C4.477 0 0 4.477 0 10v22c0 5.523 4.477 10 10 10h22c5.523 0 10-4.477 10-10V10c0-5.523-4.477-10-10-10Z"
|
|
2396
|
-
}
|
|
2397
|
-
),
|
|
2398
|
-
/* @__PURE__ */ jsx4(
|
|
2399
|
-
"path",
|
|
2400
|
-
{
|
|
2401
|
-
fill: "#AB9FF2",
|
|
2402
|
-
fillRule: "evenodd",
|
|
2403
|
-
d: "M17.686 27.567c-1.676 2.569-4.484 5.819-8.22 5.819-1.767 0-3.466-.728-3.466-3.887C6 21.454 16.984 9 27.176 9c5.798 0 8.108 4.023 8.108 8.59 0 5.864-3.805 12.568-7.587 12.568-1.2 0-1.79-.659-1.79-1.704 0-.273.046-.568.137-.887-1.291 2.205-3.783 4.25-6.116 4.25-1.698 0-2.559-1.068-2.559-2.568 0-.545.114-1.113.317-1.681Zm8.78-10.135c0 1.331-.786 1.997-1.664 1.997-.892 0-1.664-.666-1.664-1.997s.772-1.996 1.664-1.996c.878 0 1.663.665 1.663 1.996Zm4.99 0c0 1.331-.785 1.997-1.663 1.997-.892 0-1.664-.666-1.664-1.997 0-1.33.772-1.996 1.664-1.996.878 0 1.664.665 1.664 1.996Z",
|
|
2404
|
-
clipRule: "evenodd"
|
|
2405
|
-
}
|
|
2406
|
-
)
|
|
2407
|
-
] }),
|
|
2408
|
-
/* @__PURE__ */ jsx4("defs", { children: /* @__PURE__ */ jsx4("clipPath", { id: "a", children: /* @__PURE__ */ jsx4("path", { fill: "#fff", d: "M0 0h42v42H0z" }) }) })
|
|
2409
|
-
]
|
|
2410
|
-
})
|
|
2411
|
-
);
|
|
2412
|
-
};
|
|
2413
|
-
|
|
2414
|
-
// src/icons/xverse.tsx
|
|
2415
|
-
import { jsx as jsx5, jsxs as jsxs4 } from "react/jsx-runtime";
|
|
2416
|
-
var XverseLogo = (_a) => {
|
|
2417
|
-
var _b = _a, {
|
|
2418
|
-
size = 42,
|
|
2419
|
-
variant = "first",
|
|
2420
|
-
className
|
|
2421
|
-
} = _b, props = __objRest(_b, [
|
|
2422
|
-
"size",
|
|
2423
|
-
"variant",
|
|
2424
|
-
"className"
|
|
2425
|
-
]);
|
|
2426
|
-
return /* @__PURE__ */ jsxs4(
|
|
2427
|
-
"svg",
|
|
2428
|
-
__spreadProps(__spreadValues({
|
|
2429
|
-
className,
|
|
2430
|
-
width: size,
|
|
2431
|
-
height: size,
|
|
2432
|
-
viewBox: "0 0 42 42",
|
|
2433
|
-
fill: "none",
|
|
2434
|
-
xmlns: "http://www.w3.org/2000/svg"
|
|
2435
|
-
}, props), {
|
|
2436
|
-
children: [
|
|
2437
|
-
/* @__PURE__ */ jsxs4("g", { clipPath: "url(#clip0_3_53)", children: [
|
|
2438
|
-
/* @__PURE__ */ jsx5(
|
|
2439
|
-
"path",
|
|
2440
|
-
{
|
|
2441
|
-
d: "M32 0H10C4.47715 0 0 4.47715 0 10V32C0 37.5228 4.47715 42 10 42H32C37.5228 42 42 37.5228 42 32V10C42 4.47715 37.5228 0 32 0Z",
|
|
2442
|
-
fill: "#181818"
|
|
2443
|
-
}
|
|
2444
|
-
),
|
|
2445
|
-
/* @__PURE__ */ jsx5(
|
|
2446
|
-
"path",
|
|
2447
|
-
{
|
|
2448
|
-
d: "M32 31.6745V27.6829C32 27.5233 31.9203 27.3636 31.8406 27.2438L14.8225 10.1597C14.7029 10.0399 14.5435 10 14.3841 10H10.3986C10.1993 10 10.0399 10.1597 10.0399 10.3592V14.0715C10.0399 14.2311 10.1196 14.3908 10.1993 14.5105L16.2971 20.6177C16.4565 20.7774 16.4565 20.977 16.2971 21.1366L10.1196 27.3237C10.0399 27.4035 10 27.4834 10 27.5632V31.6346C10 31.8342 10.1594 31.9939 10.3587 31.9939H17.0544C17.2536 31.9939 17.413 31.8342 17.413 31.6346V29.2396C17.413 29.1598 17.4529 29.0401 17.5326 29.0002L20.8406 25.6871C21 25.5275 21.1993 25.5275 21.3587 25.6871L27.4964 31.8342C27.6159 31.954 27.7753 31.9939 27.9348 31.9939H31.6413C31.8406 32.0337 32 31.8741 32 31.6745Z",
|
|
2449
|
-
fill: "white"
|
|
2450
|
-
}
|
|
2451
|
-
),
|
|
2452
|
-
/* @__PURE__ */ jsx5(
|
|
2453
|
-
"path",
|
|
2454
|
-
{
|
|
2455
|
-
d: "M23.3406 15.0793H26.5592C26.7507 15.0793 26.9039 15.2333 26.9039 15.4257V18.658C26.9039 18.9658 27.2871 19.1197 27.4788 18.8888L31.8851 14.4637C31.9617 14.3867 32 14.3097 32 14.2328V10.3463C32 10.1539 31.8468 10 31.6552 10H27.7469C27.6703 10 27.5554 10.0385 27.5171 10.1154L23.1107 14.5021C22.8808 14.6945 23.0341 15.0793 23.3406 15.0793Z",
|
|
2456
|
-
fill: "#EE7A30"
|
|
2457
|
-
}
|
|
2458
|
-
)
|
|
2459
|
-
] }),
|
|
2460
|
-
/* @__PURE__ */ jsx5("defs", { children: /* @__PURE__ */ jsx5("clipPath", { id: "clip0_3_53", children: /* @__PURE__ */ jsx5("rect", { width: "42", height: "42", fill: "white" }) }) })
|
|
2461
|
-
]
|
|
2462
|
-
})
|
|
2463
|
-
);
|
|
2464
|
-
};
|
|
2465
|
-
|
|
2466
|
-
// src/icons/unisat.tsx
|
|
2467
|
-
import { jsx as jsx6, jsxs as jsxs5 } from "react/jsx-runtime";
|
|
2468
|
-
var UnisatLogo = (_a) => {
|
|
2469
|
-
var _b = _a, {
|
|
2470
|
-
size = 42,
|
|
2471
|
-
variant = "first",
|
|
2472
|
-
className
|
|
2473
|
-
} = _b, props = __objRest(_b, [
|
|
2474
|
-
"size",
|
|
2475
|
-
"variant",
|
|
2476
|
-
"className"
|
|
2477
|
-
]);
|
|
2478
|
-
return /* @__PURE__ */ jsxs5(
|
|
2479
|
-
"svg",
|
|
2480
|
-
__spreadProps(__spreadValues({
|
|
2481
|
-
className,
|
|
2482
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
2483
|
-
width: size,
|
|
2484
|
-
height: size,
|
|
2485
|
-
viewBox: "0 0 42 42",
|
|
2486
|
-
fill: "none"
|
|
2487
|
-
}, props), {
|
|
2488
|
-
children: [
|
|
2489
|
-
/* @__PURE__ */ jsxs5("g", { clipPath: "url(#a)", children: [
|
|
2490
|
-
/* @__PURE__ */ jsx6(
|
|
2491
|
-
"path",
|
|
2492
|
-
{
|
|
2493
|
-
fill: "#000",
|
|
2494
|
-
d: "M32 0H10C4.477 0 0 4.477 0 10v22c0 5.523 4.477 10 10 10h22c5.523 0 10-4.477 10-10V10c0-5.523-4.477-10-10-10Z"
|
|
2495
|
-
}
|
|
2496
|
-
),
|
|
2497
|
-
/* @__PURE__ */ jsx6(
|
|
2498
|
-
"path",
|
|
2499
|
-
{
|
|
2500
|
-
fill: "url(#b)",
|
|
2501
|
-
d: "m25.517 9.483 5.759 5.611c.49.477.731.959.724 1.445-.008.486-.219.929-.631 1.33-.431.421-.897.634-1.395.644-.497.007-.992-.228-1.482-.705l-5.89-5.738c-.669-.652-1.315-1.114-1.936-1.385a2.873 2.873 0 0 0-1.96-.127c-.685.185-1.42.662-2.21 1.428-1.086 1.06-1.605 2.054-1.552 2.983.053.929.593 1.893 1.617 2.89l5.938 5.786c.496.482.74.964.732 1.443-.008.48-.22.923-.64 1.332-.419.408-.88.62-1.382.638-.502.016-1.001-.217-1.495-.7l-5.76-5.61c-.936-.912-1.613-1.776-2.029-2.59-.416-.815-.572-1.737-.464-2.765.097-.88.384-1.732.863-2.558.477-.827 1.161-1.671 2.048-2.537C15.43 9.268 16.438 8.48 17.4 7.93c.96-.55 1.889-.854 2.786-.917.899-.064 1.784.112 2.66.527.876.415 1.765 1.061 2.67 1.943h.002Z"
|
|
2502
|
-
}
|
|
2503
|
-
),
|
|
2504
|
-
/* @__PURE__ */ jsx6(
|
|
2505
|
-
"path",
|
|
2506
|
-
{
|
|
2507
|
-
fill: "url(#c)",
|
|
2508
|
-
d: "m16.482 32.123-5.758-5.611c-.49-.479-.731-.959-.724-1.445.008-.486.219-.929.631-1.33.431-.421.897-.634 1.395-.644.498-.007.992.227 1.482.705l5.888 5.738c.671.652 1.315 1.114 1.936 1.385.622.27 1.276.312 1.962.127.685-.185 1.42-.662 2.21-1.43 1.086-1.06 1.605-2.054 1.552-2.983-.053-.929-.593-1.893-1.617-2.891l-3.164-3.056c-.496-.482-.74-.964-.732-1.443.008-.48.22-.923.64-1.332.419-.408.88-.62 1.382-.638.502-.016 1.002.217 1.496.7l2.983 2.88c.936.912 1.613 1.775 2.03 2.59.415.815.571 1.736.463 2.764a6.477 6.477 0 0 1-.863 2.559c-.477.826-1.16 1.67-2.048 2.536-1.057 1.03-2.066 1.819-3.027 2.368-.962.55-1.89.856-2.79.92-.898.063-1.784-.113-2.66-.527-.876-.415-1.765-1.062-2.67-1.944l.003.002Z"
|
|
2509
|
-
}
|
|
2510
|
-
),
|
|
2511
|
-
/* @__PURE__ */ jsx6(
|
|
2512
|
-
"path",
|
|
2513
|
-
{
|
|
2514
|
-
fill: "url(#d)",
|
|
2515
|
-
d: "M20.073 17.645c1.168 0 2.115-.93 2.115-2.08 0-1.149-.947-2.08-2.115-2.08-1.168 0-2.115.931-2.115 2.08 0 1.15.947 2.08 2.115 2.08Z"
|
|
2516
|
-
}
|
|
2517
|
-
)
|
|
2518
|
-
] }),
|
|
2519
|
-
/* @__PURE__ */ jsxs5("defs", { children: [
|
|
2520
|
-
/* @__PURE__ */ jsxs5(
|
|
2521
|
-
"linearGradient",
|
|
2522
|
-
{
|
|
2523
|
-
id: "b",
|
|
2524
|
-
x1: 30.329,
|
|
2525
|
-
x2: 12.579,
|
|
2526
|
-
y1: 12.752,
|
|
2527
|
-
y2: 20.772,
|
|
2528
|
-
gradientUnits: "userSpaceOnUse",
|
|
2529
|
-
children: [
|
|
2530
|
-
/* @__PURE__ */ jsx6("stop", { stopColor: "#201C1B" }),
|
|
2531
|
-
/* @__PURE__ */ jsx6("stop", { offset: 0.36, stopColor: "#77390D" }),
|
|
2532
|
-
/* @__PURE__ */ jsx6("stop", { offset: 0.67, stopColor: "#EA8101" }),
|
|
2533
|
-
/* @__PURE__ */ jsx6("stop", { offset: 1, stopColor: "#F4B852" })
|
|
2534
|
-
]
|
|
2535
|
-
}
|
|
2536
|
-
),
|
|
2537
|
-
/* @__PURE__ */ jsxs5(
|
|
2538
|
-
"linearGradient",
|
|
2539
|
-
{
|
|
2540
|
-
id: "c",
|
|
2541
|
-
x1: 12.163,
|
|
2542
|
-
x2: 32.789,
|
|
2543
|
-
y1: 29.085,
|
|
2544
|
-
y2: 22.844,
|
|
2545
|
-
gradientUnits: "userSpaceOnUse",
|
|
2546
|
-
children: [
|
|
2547
|
-
/* @__PURE__ */ jsx6("stop", { stopColor: "#1F1D1C" }),
|
|
2548
|
-
/* @__PURE__ */ jsx6("stop", { offset: 0.37, stopColor: "#77390D" }),
|
|
2549
|
-
/* @__PURE__ */ jsx6("stop", { offset: 0.67, stopColor: "#EA8101" }),
|
|
2550
|
-
/* @__PURE__ */ jsx6("stop", { offset: 1, stopColor: "#F4FB52" })
|
|
2551
|
-
]
|
|
2552
|
-
}
|
|
2553
|
-
),
|
|
2554
|
-
/* @__PURE__ */ jsxs5(
|
|
2555
|
-
"radialGradient",
|
|
2556
|
-
{
|
|
2557
|
-
id: "d",
|
|
2558
|
-
cx: 0,
|
|
2559
|
-
cy: 0,
|
|
2560
|
-
r: 1,
|
|
2561
|
-
gradientTransform: "matrix(2.11484 0 0 2.08019 20.073 15.567)",
|
|
2562
|
-
gradientUnits: "userSpaceOnUse",
|
|
2563
|
-
children: [
|
|
2564
|
-
/* @__PURE__ */ jsx6("stop", { stopColor: "#F4B852" }),
|
|
2565
|
-
/* @__PURE__ */ jsx6("stop", { offset: 0.33, stopColor: "#EA8101" }),
|
|
2566
|
-
/* @__PURE__ */ jsx6("stop", { offset: 0.64, stopColor: "#77390D" }),
|
|
2567
|
-
/* @__PURE__ */ jsx6("stop", { offset: 1, stopColor: "#211C1D" })
|
|
2568
|
-
]
|
|
2569
|
-
}
|
|
2570
|
-
),
|
|
2571
|
-
/* @__PURE__ */ jsx6("clipPath", { id: "a", children: /* @__PURE__ */ jsx6("path", { fill: "#fff", d: "M0 0h42v42H0z" }) })
|
|
2572
|
-
] })
|
|
2573
|
-
]
|
|
2574
|
-
})
|
|
2575
|
-
);
|
|
2576
|
-
};
|
|
2577
|
-
|
|
2578
|
-
// src/icons/wizz.tsx
|
|
2579
|
-
import { jsx as jsx7, jsxs as jsxs6 } from "react/jsx-runtime";
|
|
2580
|
-
var WizzLogo = (_a) => {
|
|
2581
|
-
var _b = _a, {
|
|
2582
|
-
size = 42,
|
|
2583
|
-
variant = "first",
|
|
2584
|
-
className
|
|
2585
|
-
} = _b, props = __objRest(_b, [
|
|
2586
|
-
"size",
|
|
2587
|
-
"variant",
|
|
2588
|
-
"className"
|
|
2589
|
-
]);
|
|
2590
|
-
return /* @__PURE__ */ jsxs6(
|
|
2591
|
-
"svg",
|
|
2592
|
-
__spreadProps(__spreadValues({
|
|
2593
|
-
className,
|
|
2594
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
2595
|
-
width: size,
|
|
2596
|
-
height: size,
|
|
2597
|
-
viewBox: "0 0 42 42",
|
|
2598
|
-
fill: "none"
|
|
2599
|
-
}, props), {
|
|
2600
|
-
children: [
|
|
2601
|
-
/* @__PURE__ */ jsxs6("g", { clipPath: "url(#a)", children: [
|
|
2602
|
-
/* @__PURE__ */ jsx7(
|
|
2603
|
-
"path",
|
|
2604
|
-
{
|
|
2605
|
-
fill: "#000",
|
|
2606
|
-
d: "M32 0H10C4.477 0 0 4.477 0 10v22c0 5.523 4.477 10 10 10h22c5.523 0 10-4.477 10-10V10c0-5.523-4.477-10-10-10Z"
|
|
2607
|
-
}
|
|
2608
|
-
),
|
|
2609
|
-
/* @__PURE__ */ jsxs6("g", { fillRule: "evenodd", clipPath: "url(#b)", clipRule: "evenodd", children: [
|
|
2610
|
-
/* @__PURE__ */ jsx7(
|
|
2611
|
-
"path",
|
|
2612
|
-
{
|
|
2613
|
-
fill: "#FFD815",
|
|
2614
|
-
d: "m26.507 17.74-1.623-1.623-1.624 1.623 1.623 1.623 1.624 1.624 1.623-1.624-1.623-1.623Z"
|
|
2615
|
-
}
|
|
2616
|
-
),
|
|
2617
|
-
/* @__PURE__ */ jsx7(
|
|
2618
|
-
"path",
|
|
2619
|
-
{
|
|
2620
|
-
fill: "#FF9813",
|
|
2621
|
-
d: "m26.507 8-1.624 1.623 1.624 1.624 1.623-1.624L26.507 8ZM33 14.493l-1.623-1.623-1.624 1.623 1.624 1.623L33 14.493ZM23.26 27.48l1.623 1.623 1.624-1.623-1.623-1.624-1.624 1.624ZM11.897 16.117l1.623 1.623 1.623-1.623-1.623-1.624-1.623 1.624ZM20.014 8 18.39 9.623l1.624 1.624 1.623-1.624L20.014 8ZM13.52 11.247l1.624 1.623 1.623-1.623-1.623-1.624-1.624 1.624ZM31.377 19.363l-1.624 1.623 1.624 1.624L33 20.987l-1.623-1.624ZM28.13 25.856l1.623 1.624 1.624-1.624-1.624-1.623-1.623 1.623Z"
|
|
2622
|
-
}
|
|
2623
|
-
),
|
|
2624
|
-
/* @__PURE__ */ jsx7(
|
|
2625
|
-
"path",
|
|
2626
|
-
{
|
|
2627
|
-
fill: "#5B5B72",
|
|
2628
|
-
d: "m26.507 20.986-1.624-1.623-1.623 1.623-1.623-1.623-1.623-1.623 1.623-1.624-1.623-1.623-1.624-1.623-1.623 1.623 1.623 1.623-1.623 1.624 1.623 1.623-1.623 1.623-.812-.811-1.623 1.623 1.623 1.623-1.623 1.624-1.543 1.542-1.542 1.543-1.624 1.623L8 31.377 9.623 33l1.624-1.623 1.623-1.624 1.543-1.542.08-.08 1.462-1.463.08-.08 1.544-1.543 1.623 1.623 1.623-1.623-.811-.812 1.623-1.623 1.623 1.623 1.623-1.623 1.624 1.623 1.623-1.623-1.623-1.624Z"
|
|
2629
|
-
}
|
|
2630
|
-
),
|
|
2631
|
-
/* @__PURE__ */ jsx7(
|
|
2632
|
-
"path",
|
|
2633
|
-
{
|
|
2634
|
-
fill: "#FF9813",
|
|
2635
|
-
d: "m26.507 14.493-1.624-1.623-1.623 1.623-1.623-1.623-1.623 1.623 1.623 1.623-1.623 1.624 1.623 1.623 1.623 1.623 1.623-1.623-1.623-1.623 1.623-1.623 1.624 1.623 1.623-1.623-1.623-1.624Z"
|
|
2636
|
-
}
|
|
2637
|
-
)
|
|
2638
|
-
] })
|
|
2639
|
-
] }),
|
|
2640
|
-
/* @__PURE__ */ jsxs6("defs", { children: [
|
|
2641
|
-
/* @__PURE__ */ jsx7("clipPath", { id: "a", children: /* @__PURE__ */ jsx7("path", { fill: "#fff", d: "M0 0h42v42H0z" }) }),
|
|
2642
|
-
/* @__PURE__ */ jsx7("clipPath", { id: "b", children: /* @__PURE__ */ jsx7("path", { fill: "#fff", d: "M8 8h25v25H8z" }) })
|
|
2643
|
-
] })
|
|
2644
|
-
]
|
|
2645
|
-
})
|
|
2646
|
-
);
|
|
2647
|
-
};
|
|
2648
|
-
|
|
2649
|
-
// src/icons/okx.tsx
|
|
2650
|
-
import { jsx as jsx8, jsxs as jsxs7 } from "react/jsx-runtime";
|
|
2651
|
-
var OkxLogo = (_a) => {
|
|
2652
|
-
var _b = _a, {
|
|
2653
|
-
size = 42,
|
|
2654
|
-
variant = "first",
|
|
2655
|
-
className
|
|
2656
|
-
} = _b, props = __objRest(_b, [
|
|
2657
|
-
"size",
|
|
2658
|
-
"variant",
|
|
2659
|
-
"className"
|
|
2660
|
-
]);
|
|
2661
|
-
return /* @__PURE__ */ jsxs7(
|
|
2662
|
-
"svg",
|
|
2663
|
-
__spreadProps(__spreadValues({
|
|
2664
|
-
className,
|
|
2665
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
2666
|
-
width: size,
|
|
2667
|
-
height: size,
|
|
2668
|
-
viewBox: "0 0 42 42",
|
|
2669
|
-
fill: "none"
|
|
2670
|
-
}, props), {
|
|
2671
|
-
children: [
|
|
2672
|
-
/* @__PURE__ */ jsxs7("g", { clipPath: "url(#a)", children: [
|
|
2673
|
-
/* @__PURE__ */ jsx8(
|
|
2674
|
-
"path",
|
|
2675
|
-
{
|
|
2676
|
-
fill: "#000",
|
|
2677
|
-
d: "M32 0H10C4.477 0 0 4.477 0 10v22c0 5.523 4.477 10 10 10h22c5.523 0 10-4.477 10-10V10c0-5.523-4.477-10-10-10Z"
|
|
2678
|
-
}
|
|
2679
|
-
),
|
|
2680
|
-
/* @__PURE__ */ jsx8("g", { fill: "#fff", clipPath: "url(#b)", children: /* @__PURE__ */ jsx8("path", { d: "M24.578 17.052h-6.787a.523.523 0 0 0-.52.52v6.788c0 .286.235.52.52.52h6.787c.286 0 .521-.234.521-.52v-6.787a.523.523 0 0 0-.52-.521ZM16.733 9.223H9.946a.523.523 0 0 0-.521.521v6.787c0 .286.235.521.52.521h6.788c.285 0 .52-.235.52-.52V9.743a.523.523 0 0 0-.52-.52ZM32.424 9.223h-6.787a.523.523 0 0 0-.521.521v6.787c0 .286.235.521.52.521h6.788c.286 0 .52-.235.52-.52V9.743a.523.523 0 0 0-.52-.52ZM16.733 24.898H9.946a.523.523 0 0 0-.521.52v6.788c0 .285.235.52.52.52h6.788c.285 0 .52-.235.52-.52v-6.788a.523.523 0 0 0-.52-.52ZM32.424 24.898h-6.787a.523.523 0 0 0-.521.52v6.788c0 .285.235.52.52.52h6.788c.286 0 .52-.235.52-.52v-6.788a.523.523 0 0 0-.52-.52Z" }) })
|
|
2681
|
-
] }),
|
|
2682
|
-
/* @__PURE__ */ jsxs7("defs", { children: [
|
|
2683
|
-
/* @__PURE__ */ jsx8("clipPath", { id: "a", children: /* @__PURE__ */ jsx8("path", { fill: "#fff", d: "M0 0h42v42H0z" }) }),
|
|
2684
|
-
/* @__PURE__ */ jsx8("clipPath", { id: "b", children: /* @__PURE__ */ jsx8("path", { fill: "#fff", d: "M0 0h42v42H0z" }) })
|
|
2685
|
-
] })
|
|
2686
|
-
]
|
|
2687
|
-
})
|
|
2688
|
-
);
|
|
2689
|
-
};
|
|
2690
|
-
|
|
2691
|
-
// src/icons/magiceden.tsx
|
|
2692
|
-
import { jsx as jsx9, jsxs as jsxs8 } from "react/jsx-runtime";
|
|
2693
|
-
var MagicEdenLogo = (_a) => {
|
|
2694
|
-
var _b = _a, {
|
|
2695
|
-
size = 42,
|
|
2696
|
-
variant = "first",
|
|
2697
|
-
className
|
|
2698
|
-
} = _b, props = __objRest(_b, [
|
|
2699
|
-
"size",
|
|
2700
|
-
"variant",
|
|
2701
|
-
"className"
|
|
2702
|
-
]);
|
|
2703
|
-
return /* @__PURE__ */ jsxs8(
|
|
2704
|
-
"svg",
|
|
2705
|
-
__spreadProps(__spreadValues({
|
|
2706
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
2707
|
-
width: size,
|
|
2708
|
-
height: size,
|
|
2709
|
-
className,
|
|
2710
|
-
viewBox: "0 0 42 42",
|
|
2711
|
-
fill: "none"
|
|
2712
|
-
}, props), {
|
|
2713
|
-
children: [
|
|
2714
|
-
/* @__PURE__ */ jsxs8("g", { clipPath: "url(#clip0_17_93)", children: [
|
|
2715
|
-
/* @__PURE__ */ jsx9(
|
|
2716
|
-
"path",
|
|
2717
|
-
{
|
|
2718
|
-
fill: "#070C34",
|
|
2719
|
-
d: "M32 0H10C4.477 0 0 4.477 0 10v22c0 5.523 4.477 10 10 10h22c5.523 0 10-4.477 10-10V10c0-5.523-4.477-10-10-10Z"
|
|
2720
|
-
}
|
|
2721
|
-
),
|
|
2722
|
-
/* @__PURE__ */ jsx9(
|
|
2723
|
-
"path",
|
|
2724
|
-
{
|
|
2725
|
-
fill: "url(#paint0_linear_17_93)",
|
|
2726
|
-
d: "m27.666 16.837 1.874 2.177c.215.245.404.446.483.562.56.55.874 1.293.874 2.07-.053.915-.657 1.54-1.213 2.205l-1.311 1.521-.685.79a.184.184 0 0 0 .046.281c.033.02.07.028.107.026h6.835c1.045 0 2.36.868 2.283 2.184 0 .597-.247 1.171-.68 1.595a2.36 2.36 0 0 1-1.637.664H23.936c-.704 0-2.598.076-3.128-1.521a1.841 1.841 0 0 1-.043-1.035 4.5 4.5 0 0 1 .72-1.404 65.543 65.543 0 0 1 1.695-2.343c.741-1.002 1.503-1.971 2.251-2.992a.19.19 0 0 0 .04-.116.19.19 0 0 0-.04-.116l-2.72-3.156a.192.192 0 0 0-.153-.073.192.192 0 0 0-.152.073c-.728.96-3.917 5.203-4.598 6.063-.68.86-2.355.907-3.283 0l-4.255-4.161a.197.197 0 0 0-.1-.053.195.195 0 0 0-.2.082.192.192 0 0 0-.032.106v8a2.678 2.678 0 0 1-.494 1.594c-.33.466-.804.823-1.352 1.014a2.375 2.375 0 0 1-2.111-.293 2.271 2.271 0 0 1-.72-.805A2.22 2.22 0 0 1 5 28.736V14.349a2.416 2.416 0 0 1 .548-1.422c.33-.406.785-.7 1.298-.841a2.632 2.632 0 0 1 2.502.664l6.54 6.381c.019.02.043.034.07.043a.197.197 0 0 0 .161-.013.188.188 0 0 0 .061-.054l4.646-6.27c.215-.254.485-.46.79-.601.304-.142.636-.217.976-.221H34.68c.33 0 .657.07.959.204a2.31 2.31 0 0 1 1.263 1.409c.096.309.122.633.079.952a2.288 2.288 0 0 1-.813 1.42c-.439.364-.996.56-1.572.551h-6.768a.188.188 0 0 0-.163.099.187.187 0 0 0-.022.095c0 .032.013.065.032.093h-.008Z"
|
|
2727
|
-
}
|
|
2728
|
-
)
|
|
2729
|
-
] }),
|
|
2730
|
-
/* @__PURE__ */ jsxs8("defs", { children: [
|
|
2731
|
-
/* @__PURE__ */ jsxs8(
|
|
2732
|
-
"linearGradient",
|
|
2733
|
-
{
|
|
2734
|
-
id: "paint0_linear_17_93",
|
|
2735
|
-
x1: "-0.315",
|
|
2736
|
-
x2: "35.366",
|
|
2737
|
-
y1: "9.343",
|
|
2738
|
-
y2: "30.176",
|
|
2739
|
-
gradientUnits: "userSpaceOnUse",
|
|
2740
|
-
children: [
|
|
2741
|
-
/* @__PURE__ */ jsx9("stop", { offset: "0.23", stopColor: "#FF0074" }),
|
|
2742
|
-
/* @__PURE__ */ jsx9("stop", { offset: "0.26", stopColor: "#FF0068" }),
|
|
2743
|
-
/* @__PURE__ */ jsx9("stop", { offset: "0.32", stopColor: "#FF0048" }),
|
|
2744
|
-
/* @__PURE__ */ jsx9("stop", { offset: "0.39", stopColor: "#FF0015" }),
|
|
2745
|
-
/* @__PURE__ */ jsx9("stop", { offset: "0.41", stopColor: "#FF0009" }),
|
|
2746
|
-
/* @__PURE__ */ jsx9("stop", { offset: "0.43", stopColor: "#FF0908" }),
|
|
2747
|
-
/* @__PURE__ */ jsx9("stop", { offset: "0.54", stopColor: "#FF4003" }),
|
|
2748
|
-
/* @__PURE__ */ jsx9("stop", { offset: "0.62", stopColor: "#FF6201" }),
|
|
2749
|
-
/* @__PURE__ */ jsx9("stop", { offset: "0.66", stopColor: "#FF6F00" }),
|
|
2750
|
-
/* @__PURE__ */ jsx9("stop", { offset: "0.72", stopColor: "#FF8700" }),
|
|
2751
|
-
/* @__PURE__ */ jsx9("stop", { offset: "0.83", stopColor: "#FFAB00" }),
|
|
2752
|
-
/* @__PURE__ */ jsx9("stop", { offset: "0.92", stopColor: "#FFC100" }),
|
|
2753
|
-
/* @__PURE__ */ jsx9("stop", { offset: "0.98", stopColor: "#FFCA00" })
|
|
2754
|
-
]
|
|
2755
|
-
}
|
|
2756
|
-
),
|
|
2757
|
-
/* @__PURE__ */ jsx9("clipPath", { id: "clip0_17_93", children: /* @__PURE__ */ jsx9("path", { fill: "#fff", d: "M0 0h42v42H0z" }) })
|
|
2758
|
-
] })
|
|
2759
|
-
]
|
|
2760
|
-
})
|
|
2761
|
-
);
|
|
2762
|
-
};
|
|
2763
|
-
|
|
2764
|
-
// src/icons/orange.tsx
|
|
2765
|
-
import { jsx as jsx10, jsxs as jsxs9 } from "react/jsx-runtime";
|
|
2766
|
-
var OrangeLogo = (_a) => {
|
|
2767
|
-
var _b = _a, {
|
|
2768
|
-
size = 42,
|
|
2769
|
-
variant = "first",
|
|
2770
|
-
className
|
|
2771
|
-
} = _b, props = __objRest(_b, [
|
|
2772
|
-
"size",
|
|
2773
|
-
"variant",
|
|
2774
|
-
"className"
|
|
2775
|
-
]);
|
|
2776
|
-
return /* @__PURE__ */ jsxs9(
|
|
2777
|
-
"svg",
|
|
2778
|
-
__spreadProps(__spreadValues({
|
|
2779
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
2780
|
-
xmlnsXlink: "http://www.w3.org/1999/xlink",
|
|
2781
|
-
width: "42px",
|
|
2782
|
-
height: "42px",
|
|
2783
|
-
viewBox: "0 0 42 42"
|
|
2784
|
-
}, props), {
|
|
2785
|
-
children: [
|
|
2786
|
-
/* @__PURE__ */ jsxs9("defs", { children: [
|
|
2787
|
-
/* @__PURE__ */ jsx10("clipPath", { id: "clip1", children: /* @__PURE__ */ jsx10("path", { d: "M 9.433594 0 L 32.566406 0 C 37.777344 0 42 4.222656 42 9.433594 L 42 32.566406 C 42 37.777344 37.777344 42 32.566406 42 L 9.433594 42 C 4.222656 42 0 37.777344 0 32.566406 L 0 9.433594 C 0 4.222656 4.222656 0 9.433594 0 Z M 9.433594 0 " }) }),
|
|
2788
|
-
/* @__PURE__ */ jsxs9(
|
|
2789
|
-
"radialGradient",
|
|
2790
|
-
{
|
|
2791
|
-
id: "radial0",
|
|
2792
|
-
gradientUnits: "userSpaceOnUse",
|
|
2793
|
-
cx: 0,
|
|
2794
|
-
cy: 0,
|
|
2795
|
-
fx: 0,
|
|
2796
|
-
fy: 0,
|
|
2797
|
-
r: 1,
|
|
2798
|
-
gradientTransform: "matrix(0.000000000000001938,31.643555,-31.643555,0.000000000000001938,21,5.578125)",
|
|
2799
|
-
children: [
|
|
2800
|
-
/* @__PURE__ */ jsx10(
|
|
2801
|
-
"stop",
|
|
2802
|
-
{
|
|
2803
|
-
offset: 0,
|
|
2804
|
-
style: {
|
|
2805
|
-
stopColor: "rgb(5.098039%,5.490196%,7.058824%)",
|
|
2806
|
-
stopOpacity: 1
|
|
2807
|
-
}
|
|
2808
|
-
}
|
|
2809
|
-
),
|
|
2810
|
-
/* @__PURE__ */ jsx10(
|
|
2811
|
-
"stop",
|
|
2812
|
-
{
|
|
2813
|
-
offset: 1,
|
|
2814
|
-
style: {
|
|
2815
|
-
stopColor: "rgb(0%,0%,0%)",
|
|
2816
|
-
stopOpacity: 1
|
|
2817
|
-
}
|
|
2818
|
-
}
|
|
2819
|
-
)
|
|
2820
|
-
]
|
|
2821
|
-
}
|
|
2822
|
-
),
|
|
2823
|
-
/* @__PURE__ */ jsx10(
|
|
2824
|
-
"image",
|
|
2825
|
-
{
|
|
2826
|
-
id: "image91",
|
|
2827
|
-
width: 42,
|
|
2828
|
-
height: 42,
|
|
2829
|
-
xlinkHref: "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACoAAAAqCAYAAADFw8lbAAAABmJLR0QA/wD/AP+gvaeTAAAIOUlEQVRYhe2YW4jcVx3HP+fyv8785z+XveUm040xaWraitaHFmkfpKCI6LMgLWq9IUUpiA9CwRdfiqBPtbbWy5MKhRbxnuZFRUSMxhBr2nR6Sdrd2ezOzs7szP9yzvFhdus2TEzWJD7l+zQw53/Oh+/vcjg/uKmbuqmbuqlrkbhB+8o2+CFUUoj6EEWgAQ/Ah2IMpQcbS5C9CkMg/3+Cyjb4GpIE4gLSCsROkyKJLCilAEHpWwbS0M8LNvrQG0KvAxngbiTo2wBzaISahpGknqTxxGE1RLoPSCkWcIwN7p9hYX/54Asc0YKLOuPNElYL6P0J+jcCVLQhKCFOoQo0Ak3NSGaUZPbJI2qolXvECXHnlG83TemeeOxf9jcvlXh+zvk+LC9B9wJsXk9Qrw2VBsQWGnriYAvJ7FOH6ChfPSIE91/pDGF57tNnzO8Cy8tRxusZLGdw8Y8wulZQeRgqGioGalWol4pZJ5n77iKnKon6jIVPAuHVbmgL99jDZ+252PCyzni1AW8uwvBRGL916G4A2xC+E1oRtBTsjTW3FB6HF2PUj2+TrShRz1p4aDeQANITn/pWmxdKzXwY0ahCDISnwd9eo69iH9HeysPKVh4qTVNK5oxg9odH1UUh3TecELfvBu4S1YUv3++UHStHWvjUKj7ZiQHl821k0sJcCVQuQpJCRUBqoYnPjJPMf+8Q5zxfPegE94O45u4h4BCWV0pN4kHse4RH6+TeALHBf3fU2w+JDzULc2I7D2/hVCVRH7aObztBcK2Ab4EKAqEIlCASkghDMLJ4PeBjUFwO1HsHVJtQk7BgfPYeDBl//aDcJ6X4poW5631VGMuKAO05VAAq9FAzErWi4LfruKmg+0HLSagXrE/7+0c47/nqMeCu64s3kXMUFPaMZ2kriUsDpK/xuhnBLGSHUsTUqs8gDaFlFXuevJVz2lc/uFGQAM7y+6+8xj2BoKhpjK9xkUMuhojcw39hk2AqaAoVH1KjWQi0+pqAW24UJM69bo15JpYM6ophYskrAtP0EP0YX1nkYnwZR0tIjKLxs8P8A8FHbhikdWeKsf3OV1/mfVXJeiLpJyGjhocFSD1EWIdzGj01R32olpJ6oeSt8up67a7kHD1n3XOPv277ZzPuqCuWZwQrDUV/XrM5F5LrEreaIRohbHqoqRAStIVQKnHg+hKSO2uP58Yd//JL3BspaGi6s4qlpsdaXdGvK8ZNR+4iysEIt33FTQV1IAVojSvK69OHnLXur6a0z37hJe6OFXc1PN6oC1Ybkm7dY63hc3HWsZEKRmODnSsxmcD1AJddpj0BTkgsjrPXymmte8VYnvn8WXssktzRUlxINOtVyWoq6DV91usevaZjY49g5DvyekzZHeH2B+QXMhziMo7mYHxLMSrsSc9T6wjSXRM61p11P3/8Nds/NeJgy+N8LOinirUU1hKf/oxgPQgYzVoGM5KRceR7fcbnR7h9AdmFDOfJSWFN9esgvNdTvKsQvPund8hEC/GlXQDmztrj49I9//A57qsq1iqKfl2ylkCv7rOeKjbSkEHdMYgtxYJi2DeYGUeWCdzMDsh2SNEdgpp2VgqpllSlJPzbqjv/waasIK/YSx2WvxSlefJzL3LgxDozDc1KU9KdlSzNKJZnQ7rzMavzgn7VMJqHYaoZeZBXLIWRGOnIhxa7GJMXGbZbQCZwU0FjiJRDe4JwxdL+eOCekr6QUoojTEsX614sS55+6KxNjq9TTxUXm5qVumKppVieDViZ16w0fQZzJcMFGLY8htKjqOdkQzCxIyvAlAo7YykubAFmY+xRTT419A1IF2DOwn5f0baKtpXs/dERfq2Q9wopDipBaKy9WFpx5osv2veEgmGsGMSCjZpmvQ69xKdfE6zXAsbzgmFLMKpCtiGxiaUsS8y+kHFnDEphZg1FF7ACl4+wx0KKHtDpXCZH2xCOoNaA+QjmpWKfUewVihaCVAgCZVFK4gJJEQpGFcFmRdBvSjZqIesVwaAZMW5YhrGjmFcMNkpsVVEGhtJITGgphhLbsuTbgGYTl4wpjMD1etADhmCnVn0HsvugfxrkASi1wcSKgRDMCEcqJaH2UNpCJCgriix1jFKPfkMxjAKyBclAG0wDxqEm146iBWbksB7kpcO1KmR2CF2gGGG3AZfWcUvgMnAJuHugvGyXdCCOQLU+eb/Uqh71miIpJUkoCYXDqypcoBBVQdHyGDcjxg1N5hlMXTD2FIUwmKqlGEnsnE/+5iVh3gm40ns74F1QdoBT4K7UzsV9UGmDthE1rYlSjR8pvMwQxwEqFbhEYGcEpe9jW4rCCRyWMjGUmcDtD8gul4cHxhSdHnTBbYDdBjwBbOyYmlzVvfMohBF4pkqofIKaRYceXsUhIx9RGHTFh5ai9H3IczBbDo7HMJTYd0Tk3eFkyFSMsEcj8k4POr1JDvpgpwGubv2+6gvyNPjLILsQHAKxXMXfHyHXSvy4jhAjRBhOkj9k8iBXCgMwrZpPdiZrV8Fsu/jcFMBdOfoW7G348RD59w6eraOCEM8ZVJvJW7pSgXMZej6gXMrQSUkJb3dxu910JyBmZx5eCrlnt6HfqZ/chj88jXygDb/o4++xyDvr8Ac1GRYoO9lTOoQVk4N29sSTnUmoE3C3Q3GC/4R6p4vbkJ+FAnY3KQFgMcS9AvbpDnyoRv6GxJ7swdGE/O6EPFdYI3GFwuYj7GFHdiycFMyfO7gh2E9AXtuCnKZLIeF/HJI9Dl4G8hiIB9rwqwHeG1VUfev/+iXrOz0oBW5zDftRKDrANuSlbk6DBPg3vtO3svqbCX0AAAAASUVORK5CYII="
|
|
2830
|
-
}
|
|
2831
|
-
),
|
|
2832
|
-
/* @__PURE__ */ jsx10(
|
|
2833
|
-
"filter",
|
|
2834
|
-
{
|
|
2835
|
-
id: "alpha",
|
|
2836
|
-
filterUnits: "objectBoundingBox",
|
|
2837
|
-
x: "0%",
|
|
2838
|
-
y: "0%",
|
|
2839
|
-
width: "100%",
|
|
2840
|
-
height: "100%",
|
|
2841
|
-
children: /* @__PURE__ */ jsx10(
|
|
2842
|
-
"feColorMatrix",
|
|
2843
|
-
{
|
|
2844
|
-
type: "matrix",
|
|
2845
|
-
in: "SourceGraphic",
|
|
2846
|
-
values: "0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 1 0"
|
|
2847
|
-
}
|
|
2848
|
-
)
|
|
2849
|
-
}
|
|
2850
|
-
),
|
|
2851
|
-
/* @__PURE__ */ jsx10(
|
|
2852
|
-
"image",
|
|
2853
|
-
{
|
|
2854
|
-
id: "image170",
|
|
2855
|
-
width: 42,
|
|
2856
|
-
height: 42,
|
|
2857
|
-
xlinkHref: "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACoAAAAqCAYAAADFw8lbAAAABmJLR0QA/wD/AP+gvaeTAAACtklEQVRYhWNgGAWjYBSMglEwCkYcmGslLagZ26TedkTUMOD/H11nY2a5Sb+/sJBiBiOtHMfAwMCg73JCaNrNdN2kh/eF0eXKFXf+qZBhvfbqqMkdYsxior7zGBjUK65yXtwsbBq4/7wDNkcyMDAwdN53ZxE87KQX4tNtRIyZVA1Rc3M7ZpZn5eoNd1lVc1hCmInVJ7ov4fwRl0n38amhWoiyP3kmPbfVyfXNw0gNUhzJwMDA8D/3q1bnt2a8bqE4RFPWPhRMLPDTwxXFxIKtN84cUdFSe4VLnuwQhaVDmbBtjpQ6koGBgWHPo6d8+ORJKiIYGBDp0CgsQTXM4Dczw+9y8l2HBB4kJFEv6p2NmeVYi1m170ewcVLmLEzw6HHhye/yjU9xyRMV9XaXNnLcmHTA9slpbhNaONLtgvpfZV5TnOmTgYGIEP3LGciWdPSB/QmDu7zUcxoquNv66c6fWoZL+NQQDNFwZysdWjpS8mnzhzsL664RUoc3M9ld2sixVWiFvBz13IUC2HjqXtzv4z+jcCf/DyG1eKOeb66bnGTiCRPqOQ0Ccpjzvq3gTr5y9IviE2L14I163YZ8HsqdhQDP3hn9vf8m5tq3r+y7SHEkAwOBqH/ncPYvZU6DgEjWToYZ/8UefWbsusrwd9p3ckpevCEqdNL9E5lug4N58opvn6zy2v/iX/AZhr8nv5NrDl6H7vx0/ZXyhqBf5BisuOLXdxnTr2esH188OCdY/j15zkMAguUoX8haFclViXrEGvjsndHfn/+0bjbzSN4q56r9R5nzEICoKlQvzsrk54IreEspWDp8wdh1lZIoxgWIrusrJBTVpl6R15QSOofR1qzc+eH1kW+Pr1AjiqkCJv3+wuJszCwnwaeq23ZE1JC9Q0ktq+09/0C7axSMglEwCkbBKKA/AABq8ekilgplTAAAAABJRU5ErkJggg=="
|
|
2858
|
-
}
|
|
2859
|
-
),
|
|
2860
|
-
/* @__PURE__ */ jsx10("mask", { id: "mask0", children: /* @__PURE__ */ jsx10("g", { filter: "url(#alpha)", children: /* @__PURE__ */ jsx10("use", { xlinkHref: "#image170" }) }) }),
|
|
2861
|
-
/* @__PURE__ */ jsx10(
|
|
2862
|
-
"image",
|
|
2863
|
-
{
|
|
2864
|
-
id: "image125",
|
|
2865
|
-
width: 42,
|
|
2866
|
-
height: 42,
|
|
2867
|
-
xlinkHref: "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACoAAAAqCAYAAADFw8lbAAAABmJLR0QA/wD/AP+gvaeTAAAEF0lEQVRYhe2WTYscVRSGn3NvVXdPzySabwQN2SlGkQgjCC4EFWMU/A+CG925EhN0JSiof8BtxC8SSVZZiK7MRjRElPwEF8Ik0z3d9XXPOS6qJhM1pHucGXHRLxRFN9Sth/d977kFCy200EILLfR/kvwXL/n69NFvs6Y56MmGjUIlsU55TK9998eT866xp6DfvHTkcm9Snop1epBkqDuNQulCHWNT9Xq/s5FOv/7rxo1Za2V7AXjhzLEv+pPy5ODm+KSoSlQDdZI5GCQVCtdcKzuuw/5V4MCsNXfV0S9feeD8YKM4vlKVq5J0kJsR3Ajq4JAcygSjBOMkbEhEl3Ky+5dGb/6wdt+91t41Ry8+f+jS8tr6M3nTHNwEjO5EBxdwQFwIAcBxcxSjqY1Q6vKs9XcMevHMka+WxtPV/mh8IqiSWwcISJdXCIFkYIB5+5/jaHJSdIJa3DPQCy8f+3w4nj7auzl6PDYq0YzMncwcCYBDkIAByaAxaBxq2/pdG6iC2ez3bRv0dg/X1p8KSfu5GcGMgBMFEBAEFyG1ewg1qB3qBJVCqU6lLbDOCbEt0AvPHbyyf219Nd7Rw+BOJrQOGnjnYrfRW/e8A0zOVJ0iQaFQK7hu1WHHoJ+9ePTKynjy8HC0cSIzpff3HhpICLc7qNbu8Mah0TbmonEKc6YJxg1MGiikBWiH1g5Bz79w7Pul9Y3Hsro+nJkykLv38E4HN11sNmO21sVJgo0E0wSlQQpCiELMg+4Y1CfFQxTN4dyULBhBWhfv1sOmm5W1Qp2c0pxSaSEVyqaNfCqCBSH2I/kg03wQZ87ze4J++uzhn8NocsJUMTcQcAOTgPtfY07eRlwlpzYo7ujitLuXBjWCx0DWjwxX8rRvf+5vXV3r7Qg01WlfXVmM6m2sgAQB6SB9K+5aodqMWWHadIDWXgnBsoDkgf4g08Ew0+u/jT++DO/MgpwJqrUNK3OkcfIAwQR1QLbibiHbmKvOvYlCqVAZ1CZoDHge6PWi5ctZWh5mcvanW/15AOcCTU5UBVOQbozkAuCdm23MlbbRFtqe5UWCMggmAoNA7EUfLGVpaZhx7tr6tgDnArUQaFyoVUjm1Or0usPuzsgLawHL7rSpRPAQyHqRwXKWloaZvXt99K8A5wINecg0hFQgWZmEQpzYQOiiT9qC1d7GnOSfPfzlxviDS8Z7O4GEOT7z3n9i/6hcr/bV0wZJRugect8aRykIEgOSBXr9aPnwdg9n7uZdA3018MapR1Y+KTaaflMlUmrnknePexQkD/Ty6P1hloZLkXPX1ncNcG5QgI+ePlSMxrVURerVlYl3oCEIsRfo92MaDqKf3QPAbYFu6sPVA1XdKEk9OEgWxXt54O0fb+V7BbjQQgsttNBC/0/9CbvrotNPsOneAAAAAElFTkSuQmCC"
|
|
2868
|
-
}
|
|
2869
|
-
),
|
|
2870
|
-
/* @__PURE__ */ jsx10(
|
|
2871
|
-
"image",
|
|
2872
|
-
{
|
|
2873
|
-
id: "image142",
|
|
2874
|
-
width: 42,
|
|
2875
|
-
height: 42,
|
|
2876
|
-
xlinkHref: "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACoAAAAqCAYAAADFw8lbAAAABmJLR0QA/wD/AP+gvaeTAAAAmklEQVRYhe2U0QqAIBAE1/7/n+tFIaQyur21aAdEX4RhDgWMMemUul7BkciZ3JopMqKXGhWcJltOzldMkS3dfhe5bOTBSGWXwF3pjxARBYSyUVFAJMsQBQSyLNF0mKKpVdlF02R/OfpGStWsonTZX4++Qa3qohVaVRfdQanqoh3hqi7KRikaGr+LslGLPh6/i7KxKBuLsvmM6AZK+AVU/UCtAQAAAABJRU5ErkJggg=="
|
|
2877
|
-
}
|
|
2878
|
-
),
|
|
2879
|
-
/* @__PURE__ */ jsx10("mask", { id: "mask1", children: /* @__PURE__ */ jsx10("g", { filter: "url(#alpha)", children: /* @__PURE__ */ jsx10(
|
|
2880
|
-
"rect",
|
|
2881
|
-
{
|
|
2882
|
-
x: 0,
|
|
2883
|
-
y: 0,
|
|
2884
|
-
width: 42,
|
|
2885
|
-
height: 42,
|
|
2886
|
-
style: {
|
|
2887
|
-
fill: "rgb(0%,0%,0%)",
|
|
2888
|
-
fillOpacity: 0.6,
|
|
2889
|
-
stroke: "none"
|
|
2890
|
-
}
|
|
2891
|
-
}
|
|
2892
|
-
) }) }),
|
|
2893
|
-
/* @__PURE__ */ jsx10(
|
|
2894
|
-
"image",
|
|
2895
|
-
{
|
|
2896
|
-
id: "image148",
|
|
2897
|
-
width: 42,
|
|
2898
|
-
height: 42,
|
|
2899
|
-
xlinkHref: "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACoAAAAqCAYAAADFw8lbAAAABmJLR0QA/wD/AP+gvaeTAAAEI0lEQVRYhe3XTW4kuREF4I9kZqX+7B61gAFGR5CWPsucZ9zn6Sv4Ct5ZfQAv1IABuaftaUlVmWR4kZS6tPKitBjDegCRZBaT9RA/Lxi84Q1veMMbDkF6msTTPPChz28kP+NTX99+3/+MSwGuhI+47utfhETS169BNEgvCF5JPkluJZeSO8lF/+3rHtl3ncSdcCHcCpfCjXAtXpPs8ILkjeRa8kVyJ7uUkE0SknvJuz2idzgWJg3hUkNzLlxpPiBEJOlQsilI/txJnu+RI7tXJPl5TJKtZJaMwiRshdCE5lhF8141aT4LNL+IlA4jml+QnGRfFQwejE6Mso1qMplwpDl2tj6POTKZVJNs49GIwd8NPituJVfSc0gdgAFcd9d+lb1T/GpwrPhmlAyKwaKoiiy7lxTxsNX626paDDJmZ9At/hd80Q4lmt30pCErsgdFMUg2Tm1kR5IjyYlwKpwa+zOcSk40xzbdst9sMLhXDD2Ufj6UJsOe/GRniq3BHwxmG4uNbFKMFhvJICua1L+omA3mHsfJpsflieY3zZ32LG8HEf0keS/5Z0+gSTEbVWNfTZpJ6cRDUSRNqKowS7bmrh5VM/dwyKqLZ48dSPR2T3pWCsXOIPdEaibVUSe9urVKslAsmkHuKlBVG7MHA93Kt3KXrQOJ/gnfJA/dootiUIRBMqg2hp75q2WH7vjAIssDbVlUYbE1SP2cU0k93Jor0c/doqw2mCRNlrtMMQijbBRGYUDWRElSJRYWydzTsXhUjJLHfu7d4WTz8+xYspEsUo/B78KvOzo6kbyGSE2KppT9fbV/v3StuH8di+b/vuX3ge9EH4SdMAhVyF1mnsYabVXrI9QSa2bX/X2lfz8Ij8LJ69yesp+EP/bDRmHutbuqWDzFXzMXdpoZO9murlV/HWHp9WmVplk46udevMLtyV+td8roFhlUO1W2CItit+a2VJNQ1C74a9aHnWRnsFN7mZi79R+Ef4leUg8keim8F/4h/KiiShbVjNKTg6RZVHlP8Jsqm4WtpRN+tGiq0ndcam5fw6JXwifhx27RrWoy00siqxgtandz2RP8JptVs9HWbKeYHVlQewmN5y7gIKIfcd4vvb+piuTfXU/HnhBh0SxjUebaLVp7smXLJsy7MCt2dmajxb2qai6Eq9cguvY4659WyZnqV0kI30SX/8Fonmu/SDdPJaIJdRe95ofFqRmLE9Vd99LHQ2k+ydNN73cWzVfVD6sFLXaKrerR4MHkXnP/4jl4UD0abTU7T0qxhlF77p8OxP9QK8La2l6LfhNvflLdqU7Mjs0WO5Ote1uTrTOPJlt3/f1i57i7nMXfNOf9rN6JHoohWbtEIXwA4Vzq7W9yqdlKziQnXrbLT0K+Fc722uUvXUleubd/wxve8IY3/B/gP+5/MI8x65+AAAAAAElFTkSuQmCC"
|
|
2900
|
-
}
|
|
2901
|
-
),
|
|
2902
|
-
/* @__PURE__ */ jsx10("mask", { id: "mask2", children: /* @__PURE__ */ jsx10("g", { filter: "url(#alpha)", children: /* @__PURE__ */ jsx10(
|
|
2903
|
-
"rect",
|
|
2904
|
-
{
|
|
2905
|
-
x: 0,
|
|
2906
|
-
y: 0,
|
|
2907
|
-
width: 42,
|
|
2908
|
-
height: 42,
|
|
2909
|
-
style: {
|
|
2910
|
-
fill: "rgb(0%,0%,0%)",
|
|
2911
|
-
fillOpacity: 0.701961,
|
|
2912
|
-
stroke: "none"
|
|
2913
|
-
}
|
|
2914
|
-
}
|
|
2915
|
-
) }) }),
|
|
2916
|
-
/* @__PURE__ */ jsx10(
|
|
2917
|
-
"image",
|
|
2918
|
-
{
|
|
2919
|
-
id: "image154",
|
|
2920
|
-
width: 42,
|
|
2921
|
-
height: 42,
|
|
2922
|
-
xlinkHref: "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACoAAAAqCAYAAADFw8lbAAAABmJLR0QA/wD/AP+gvaeTAAAA/ElEQVRYhe2VwW7DIAxAn9M0qcSN///G3JDaFEIPwRvqoUHdWKXJT/IhMokeNiZgGIZhGIZh/EPkVTLnLGWNxvD0Ti6xAVlEtk6eDA1rBDgBZ2ACZu/9DMzleSz5lm+9zVFFh0pyrELYK5m89/dlWSIQRWT9lOipiE1VnCvRCKwaInLtJXrULj2Xdesn4EJpvXPuT1o/NqxR2Vp4YB+gLYSgki+781PeqUL+dYsGWkT1+tmAxH4uNZJzLpVc1w0ctV4lE3Dne4i+himEEEu+2x0KxxV9Fr0B1ypu3vuVvbpdRVv+TDpEGvXmdBMJ2EQkdvI0DMMwDMMwjI/yAInrT4nWGUiJAAAAAElFTkSuQmCC"
|
|
2923
|
-
}
|
|
2924
|
-
),
|
|
2925
|
-
/* @__PURE__ */ jsx10(
|
|
2926
|
-
"image",
|
|
2927
|
-
{
|
|
2928
|
-
id: "image160",
|
|
2929
|
-
width: 42,
|
|
2930
|
-
height: 42,
|
|
2931
|
-
xlinkHref: "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACoAAAAqCAYAAADFw8lbAAAABmJLR0QA/wD/AP+gvaeTAAACY0lEQVRYhe2W227iQBBEj7mFcAkbZf3/HxjtLUtCAtjeh6laN9YSDCHSPkxLrZE92BzXVPcM5MiRI0eOj0RxzZc1TeP3FcBAoxOgCWOtsSmKouFEjD4JcNgZBx3ASlmH688FFWQEHAJj5Uhp0ArYA7uQvv85oAGw6ABOgClwoxwLtBbkG/CqhNYO1wUNy+wl7QLeAjPlNIBWgnzRM9Bz2c8CPeJDL/GNAOfAIuSt5gG2AbImLfuW1hYfBz3iw4kApyT1FsBSeafraQDb6P8q0rKPNder87wL2sOHBlwIzrnU3ESvsnJb2iKL7ety0H+oOOoAzgW0HA6Hd1VVrXS90NxEz+5JBdNtUXG8HDRClmU5fnx8dKFEBVfAqqoqqzjXhxiyInnR1e7c6r576VVADWkFV8ovSvvxluRZ+24PvA0Gg+e6rn8DzjXJr1v9phfoexVnX45JKs0FdQ98BUqN97o/04c3AlwDP+u6/g58U/4Q7AvwWpblri/oUSM3TeO2MyMpeQ88CO6BpOZSH2FAL/ELSbkn4JfySfkXFKlaFMX+FGifpXcRuVc6b8Lz7okb4FkwT51cC3Cjj7F3r+JRwxrYhwz0B1vawogqRvUi4GsAdCFdbQv1i7zd7Wj36SFtA19zqOSapK4V7FZ6DdDniHcKtKHtdTv92YZUXA1JJTS34bCqnzn0oQErzjiDngPqE4/95y1wQ7s1Rm9GwK4P60sA+4LGpfZRzft0EeattgHdIw98eCnkOaDQqudjm+/5IOzCioBn+fAjoPZnhPZhwqD2XlfBi5c5R44cOXLkyJHjv40/gQUmD3HnzocAAAAASUVORK5CYII="
|
|
2932
|
-
}
|
|
2933
|
-
),
|
|
2934
|
-
/* @__PURE__ */ jsx10("mask", { id: "mask3", children: /* @__PURE__ */ jsx10("g", { filter: "url(#alpha)", children: /* @__PURE__ */ jsx10(
|
|
2935
|
-
"rect",
|
|
2936
|
-
{
|
|
2937
|
-
x: 0,
|
|
2938
|
-
y: 0,
|
|
2939
|
-
width: 42,
|
|
2940
|
-
height: 42,
|
|
2941
|
-
style: {
|
|
2942
|
-
fill: "rgb(0%,0%,0%)",
|
|
2943
|
-
fillOpacity: 0.2,
|
|
2944
|
-
stroke: "none"
|
|
2945
|
-
}
|
|
2946
|
-
}
|
|
2947
|
-
) }) }),
|
|
2948
|
-
/* @__PURE__ */ jsx10(
|
|
2949
|
-
"image",
|
|
2950
|
-
{
|
|
2951
|
-
id: "image166",
|
|
2952
|
-
width: 42,
|
|
2953
|
-
height: 42,
|
|
2954
|
-
xlinkHref: "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACoAAAAqCAYAAADFw8lbAAAABmJLR0QA/wD/AP+gvaeTAAACY0lEQVRYhe2W227iQBBEj7mFcAkbZf3/HxjtLUtCAtjeh6laN9YSDCHSPkxLrZE92BzXVPcM5MiRI0eOj0RxzZc1TeP3FcBAoxOgCWOtsSmKouFEjD4JcNgZBx3ASlmH688FFWQEHAJj5Uhp0ArYA7uQvv85oAGw6ABOgClwoxwLtBbkG/CqhNYO1wUNy+wl7QLeAjPlNIBWgnzRM9Bz2c8CPeJDL/GNAOfAIuSt5gG2AbImLfuW1hYfBz3iw4kApyT1FsBSeafraQDb6P8q0rKPNder87wL2sOHBlwIzrnU3ESvsnJb2iKL7ety0H+oOOoAzgW0HA6Hd1VVrXS90NxEz+5JBdNtUXG8HDRClmU5fnx8dKFEBVfAqqoqqzjXhxiyInnR1e7c6r576VVADWkFV8ovSvvxluRZ+24PvA0Gg+e6rn8DzjXJr1v9phfoexVnX45JKs0FdQ98BUqN97o/04c3AlwDP+u6/g58U/4Q7AvwWpblri/oUSM3TeO2MyMpeQ88CO6BpOZSH2FAL/ELSbkn4JfySfkXFKlaFMX+FGifpXcRuVc6b8Lz7okb4FkwT51cC3Cjj7F3r+JRwxrYhwz0B1vawogqRvUi4GsAdCFdbQv1i7zd7Wj36SFtA19zqOSapK4V7FZ6DdDniHcKtKHtdTv92YZUXA1JJTS34bCqnzn0oQErzjiDngPqE4/95y1wQ7s1Rm9GwK4P60sA+4LGpfZRzft0EeattgHdIw98eCnkOaDQqudjm+/5IOzCioBn+fAjoPZnhPZhwqD2XlfBi5c5R44cOXLkyJHjv40/gQUmD3HnzocAAAAASUVORK5CYII="
|
|
2955
|
-
}
|
|
2956
|
-
),
|
|
2957
|
-
/* @__PURE__ */ jsx10("clipPath", { id: "clip2", children: /* @__PURE__ */ jsx10("rect", { x: 0, y: 0, width: 42, height: 42 }) }),
|
|
2958
|
-
/* @__PURE__ */ jsxs9("g", { id: "surface169", clipPath: "url(#clip2)", children: [
|
|
2959
|
-
/* @__PURE__ */ jsx10("use", { xlinkHref: "#image125" }),
|
|
2960
|
-
/* @__PURE__ */ jsx10("use", { xlinkHref: "#image142" }),
|
|
2961
|
-
/* @__PURE__ */ jsx10("use", { xlinkHref: "#image148", mask: "url(#mask1)" }),
|
|
2962
|
-
/* @__PURE__ */ jsx10("use", { xlinkHref: "#image154", mask: "url(#mask2)" }),
|
|
2963
|
-
/* @__PURE__ */ jsx10("use", { xlinkHref: "#image160" }),
|
|
2964
|
-
/* @__PURE__ */ jsx10("use", { xlinkHref: "#image166", mask: "url(#mask3)" })
|
|
2965
|
-
] })
|
|
2966
|
-
] }),
|
|
2967
|
-
/* @__PURE__ */ jsx10("g", { id: "surface1", children: /* @__PURE__ */ jsxs9("g", { clipPath: "url(#clip1)", clipRule: "nonzero", children: [
|
|
2968
|
-
/* @__PURE__ */ jsx10(
|
|
2969
|
-
"path",
|
|
2970
|
-
{
|
|
2971
|
-
style: {
|
|
2972
|
-
stroke: "none",
|
|
2973
|
-
fillRule: "nonzero",
|
|
2974
|
-
fill: "url(#radial0)"
|
|
2975
|
-
},
|
|
2976
|
-
d: "M 9.433594 0 L 32.566406 0 C 37.777344 0 42 4.222656 42 9.433594 L 42 32.566406 C 42 37.777344 37.777344 42 32.566406 42 L 9.433594 42 C 4.222656 42 0 37.777344 0 32.566406 L 0 9.433594 C 0 4.222656 4.222656 0 9.433594 0 Z M 9.433594 0 "
|
|
2977
|
-
}
|
|
2978
|
-
),
|
|
2979
|
-
/* @__PURE__ */ jsx10("use", { xlinkHref: "#image42" }),
|
|
2980
|
-
/* @__PURE__ */ jsx10("use", { xlinkHref: "#image91" }),
|
|
2981
|
-
/* @__PURE__ */ jsx10("use", { xlinkHref: "#surface169", mask: "url(#mask0)" })
|
|
2982
|
-
] }) })
|
|
2983
|
-
]
|
|
2984
|
-
})
|
|
2985
|
-
);
|
|
2986
|
-
};
|
|
2987
|
-
var orange_default = OrangeLogo;
|
|
2988
|
-
|
|
2989
|
-
// src/icons/walletIcon.tsx
|
|
2990
|
-
import { jsx as jsx11 } from "react/jsx-runtime";
|
|
2991
|
-
var WalletIcon = ({
|
|
2992
|
-
size,
|
|
2993
|
-
className,
|
|
2994
|
-
variant,
|
|
2995
|
-
walletName
|
|
2996
|
-
}) => {
|
|
2997
|
-
if (walletName === XVERSE) {
|
|
2998
|
-
return /* @__PURE__ */ jsx11(XverseLogo, { size, className, variant });
|
|
2999
|
-
} else if (walletName === WIZZ) {
|
|
3000
|
-
return /* @__PURE__ */ jsx11(WizzLogo, { size, className, variant });
|
|
3001
|
-
} else if (walletName === LEATHER) {
|
|
3002
|
-
return /* @__PURE__ */ jsx11(LeatherLogo, { size, className, variant });
|
|
3003
|
-
} else if (walletName === MAGIC_EDEN) {
|
|
3004
|
-
return /* @__PURE__ */ jsx11(MagicEdenLogo, { size, className, variant });
|
|
3005
|
-
} else if (walletName === OKX) {
|
|
3006
|
-
return /* @__PURE__ */ jsx11(OkxLogo, { size, className, variant });
|
|
3007
|
-
} else if (walletName === PHANTOM) {
|
|
3008
|
-
return /* @__PURE__ */ jsx11(PhantomLogo, { size, className, variant });
|
|
3009
|
-
} else if (walletName === UNISAT) {
|
|
3010
|
-
return /* @__PURE__ */ jsx11(UnisatLogo, { size, className, variant });
|
|
3011
|
-
} else if (walletName === OYL) {
|
|
3012
|
-
return /* @__PURE__ */ jsx11(OylLogo, { size, className, variant });
|
|
3013
|
-
} else if (walletName === ORANGE) {
|
|
3014
|
-
return /* @__PURE__ */ jsx11(orange_default, { size, className, variant });
|
|
3015
|
-
} else {
|
|
3016
|
-
return /* @__PURE__ */ jsx11(LeatherLogo, { size, className, variant });
|
|
3017
|
-
}
|
|
3018
|
-
};
|
|
3019
|
-
export {
|
|
3020
|
-
FRACTAL_MAINNET,
|
|
3021
|
-
FRACTAL_TESTNET,
|
|
3022
|
-
LEATHER,
|
|
3023
|
-
LEATHER_MAINNET,
|
|
3024
|
-
LEATHER_TESTNET,
|
|
3025
|
-
LaserEyesProvider,
|
|
3026
|
-
LeatherLogo,
|
|
3027
|
-
MAGIC_EDEN,
|
|
3028
|
-
MAINNET,
|
|
3029
|
-
MEMPOOL_SPACE_SIGNET_URL,
|
|
3030
|
-
MEMPOOL_SPACE_TESTNET_URL,
|
|
3031
|
-
MEMPOOL_SPACE_URL,
|
|
3032
|
-
MagicEdenLogo,
|
|
3033
|
-
OKX,
|
|
3034
|
-
OKX_MAINNET,
|
|
3035
|
-
OKX_TESTNET,
|
|
3036
|
-
OP_WALLET_MAINNET,
|
|
3037
|
-
OP_WALLET_TESTNET,
|
|
3038
|
-
ORANGE,
|
|
3039
|
-
ORANGE_MAINNET,
|
|
3040
|
-
ORANGE_TESTNET,
|
|
3041
|
-
OYL,
|
|
3042
|
-
OkxLogo,
|
|
3043
|
-
OylLogo,
|
|
3044
|
-
P2PKH,
|
|
3045
|
-
P2PSH,
|
|
3046
|
-
P2SH,
|
|
3047
|
-
P2TR,
|
|
3048
|
-
P2WPKH,
|
|
3049
|
-
P2WSH,
|
|
3050
|
-
PHANTOM,
|
|
3051
|
-
PhantomLogo,
|
|
3052
|
-
REGTEST,
|
|
3053
|
-
SIGNET,
|
|
3054
|
-
TESTNET,
|
|
3055
|
-
TESTNET4,
|
|
3056
|
-
UNISAT,
|
|
3057
|
-
UNISAT_FRACTAL_MAINNET,
|
|
3058
|
-
UNISAT_FRACTAL_TESTNET,
|
|
3059
|
-
UNISAT_MAINNET,
|
|
3060
|
-
UNISAT_SIGNET,
|
|
3061
|
-
UNISAT_TESTNET,
|
|
3062
|
-
UNISAT_TESTNET4,
|
|
3063
|
-
UnisatLogo,
|
|
3064
|
-
WALLETS,
|
|
3065
|
-
WIZZ,
|
|
3066
|
-
WIZZ_MAINNET,
|
|
3067
|
-
WIZZ_SIGNET,
|
|
3068
|
-
WIZZ_TESTNET,
|
|
3069
|
-
WIZZ_TESTNET4,
|
|
3070
|
-
WalletIcon,
|
|
3071
|
-
WizzLogo,
|
|
3072
|
-
XVERSE,
|
|
3073
|
-
XVERSE_MAINNET,
|
|
3074
|
-
XVERSE_NETWORK,
|
|
3075
|
-
XVERSE_SIGNET,
|
|
3076
|
-
XVERSE_TESTNET,
|
|
3077
|
-
XverseLogo,
|
|
3078
|
-
createConfig,
|
|
3079
|
-
createSendBtcPsbt,
|
|
3080
|
-
delay,
|
|
3081
|
-
estimateTxSize,
|
|
3082
|
-
findOrdinalsAddress,
|
|
3083
|
-
findPaymentAddress,
|
|
3084
|
-
getAddressUtxos,
|
|
3085
|
-
getBTCBalance,
|
|
3086
|
-
getBitcoinNetwork,
|
|
3087
|
-
getLeatherNetwork,
|
|
3088
|
-
getMempoolSpaceUrl,
|
|
3089
|
-
getNetworkForLeather,
|
|
3090
|
-
getNetworkForOkx,
|
|
3091
|
-
getNetworkForUnisat,
|
|
3092
|
-
getNetworkForWizz,
|
|
3093
|
-
getNetworkForXverse,
|
|
3094
|
-
getOrangeNetwork,
|
|
3095
|
-
getRedeemScript,
|
|
3096
|
-
getUnisatNetwork,
|
|
3097
|
-
getWizzNetwork,
|
|
3098
|
-
getXverseNetwork,
|
|
3099
|
-
isBase64,
|
|
3100
|
-
isHex,
|
|
3101
|
-
satoshisToBTC,
|
|
3102
|
-
useLaserEyes
|
|
3103
|
-
};
|