@sats-connect/core 0.16.0-bc211a0 → 0.16.0-c18e93a

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.cjs ADDED
@@ -0,0 +1,2643 @@
1
+ //#region rolldown:runtime
2
+ var __create = Object.create;
3
+ var __defProp = Object.defineProperty;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __getProtoOf = Object.getPrototypeOf;
7
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
8
+ var __copyProps = (to, from, except, desc) => {
9
+ if (from && typeof from === "object" || typeof from === "function") {
10
+ for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
11
+ key = keys[i];
12
+ if (!__hasOwnProp.call(to, key) && key !== except) {
13
+ __defProp(to, key, {
14
+ get: ((k) => from[k]).bind(null, key),
15
+ enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
16
+ });
17
+ }
18
+ }
19
+ }
20
+ return to;
21
+ };
22
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
23
+ value: mod,
24
+ enumerable: true
25
+ }) : target, mod));
26
+
27
+ //#endregion
28
+ let valibot = require("valibot");
29
+ valibot = __toESM(valibot);
30
+ let jsontokens = require("jsontokens");
31
+ let axios = require("axios");
32
+ axios = __toESM(axios);
33
+ let bitcoin_address_validation = require("bitcoin-address-validation");
34
+ let buffer = require("buffer");
35
+
36
+ //#region src/request/types/common.ts
37
+ const walletTypes = [
38
+ "software",
39
+ "ledger",
40
+ "keystone"
41
+ ];
42
+ const walletTypeSchema = valibot.picklist(walletTypes);
43
+
44
+ //#endregion
45
+ //#region src/addresses/types.ts
46
+ let AddressPurpose = /* @__PURE__ */ function(AddressPurpose$1) {
47
+ AddressPurpose$1["Ordinals"] = "ordinals";
48
+ AddressPurpose$1["Payment"] = "payment";
49
+ AddressPurpose$1["Stacks"] = "stacks";
50
+ AddressPurpose$1["Starknet"] = "starknet";
51
+ AddressPurpose$1["Spark"] = "spark";
52
+ return AddressPurpose$1;
53
+ }({});
54
+ let AddressType = /* @__PURE__ */ function(AddressType$2) {
55
+ AddressType$2["p2pkh"] = "p2pkh";
56
+ AddressType$2["p2sh"] = "p2sh";
57
+ AddressType$2["p2wpkh"] = "p2wpkh";
58
+ AddressType$2["p2wsh"] = "p2wsh";
59
+ AddressType$2["p2tr"] = "p2tr";
60
+ AddressType$2["stacks"] = "stacks";
61
+ AddressType$2["starknet"] = "starknet";
62
+ AddressType$2["spark"] = "spark";
63
+ return AddressType$2;
64
+ }({});
65
+ const addressSchema = valibot.object({
66
+ address: valibot.string(),
67
+ publicKey: valibot.string(),
68
+ purpose: valibot.enum(AddressPurpose),
69
+ addressType: valibot.enum(AddressType),
70
+ walletType: walletTypeSchema
71
+ });
72
+
73
+ //#endregion
74
+ //#region src/addresses/index.ts
75
+ /**
76
+ * @deprecated Use `request()` instead
77
+ */
78
+ const getAddress = async (options) => {
79
+ const provider = await getProviderOrThrow(options.getProvider);
80
+ const { purposes } = options.payload;
81
+ if (!purposes) throw new Error("Address purposes are required");
82
+ try {
83
+ const request$1 = (0, jsontokens.createUnsecuredToken)(options.payload);
84
+ const response = await provider.connect(request$1);
85
+ options.onFinish?.(response);
86
+ } catch (error) {
87
+ console.error("[Connect] Error during address request", error);
88
+ options.onCancel?.();
89
+ }
90
+ };
91
+
92
+ //#endregion
93
+ //#region src/request/types/walletMethods/utils.ts
94
+ const commonNetworkSchema = valibot.object({
95
+ id: valibot.string(),
96
+ name: valibot.string(),
97
+ mode: valibot.picklist([]),
98
+ blockExplorerUrl: valibot.optional(valibot.pipe(valibot.string(), valibot.url()))
99
+ });
100
+ const bitcoinChainModeSchema = valibot.picklist([
101
+ "mainnet",
102
+ "testnet",
103
+ "testnet4",
104
+ "signet",
105
+ "regtest"
106
+ ]);
107
+ const bitcoinNetworkSchema = valibot.object({
108
+ chain: valibot.literal("bitcoin"),
109
+ ...commonNetworkSchema.entries,
110
+ mode: bitcoinChainModeSchema,
111
+ xverseApiUrl: valibot.string(),
112
+ electrsApiUrl: valibot.string()
113
+ });
114
+ const sparkChainModeSchema = valibot.picklist(["mainnet", "regtest"]);
115
+ const sparkNetworkSchema = valibot.object({
116
+ chain: valibot.literal("spark"),
117
+ ...commonNetworkSchema.entries,
118
+ mode: sparkChainModeSchema,
119
+ electrsApiUrl: valibot.string()
120
+ });
121
+ const stacksChainModeSchema = valibot.picklist([
122
+ "mainnet",
123
+ "testnet",
124
+ "devnet",
125
+ "mocknet"
126
+ ]);
127
+ const stacksNetworkSchema = valibot.object({
128
+ chain: valibot.literal("stacks"),
129
+ ...commonNetworkSchema.entries,
130
+ mode: stacksChainModeSchema,
131
+ stacksApiUrl: valibot.string(),
132
+ xverseApiUrl: valibot.string()
133
+ });
134
+ const starknetChainModeSchema = valibot.picklist(["mainnet", "sepolia"]);
135
+ const starknetNetworkSchema = valibot.object({
136
+ chain: valibot.literal("starknet"),
137
+ ...commonNetworkSchema.entries,
138
+ mode: starknetChainModeSchema,
139
+ rpcApiUrl: valibot.string(),
140
+ xverseApiUrl: valibot.string()
141
+ });
142
+ const networkSchema = valibot.variant("chain", [
143
+ bitcoinNetworkSchema,
144
+ sparkNetworkSchema,
145
+ stacksNetworkSchema,
146
+ starknetNetworkSchema
147
+ ]);
148
+
149
+ //#endregion
150
+ //#region src/provider/types.ts
151
+ const accountChangeEventName = "accountChange";
152
+ const accountChangeSchema = valibot.object({
153
+ type: valibot.literal(accountChangeEventName),
154
+ addresses: valibot.optional(valibot.array(addressSchema))
155
+ });
156
+ const networkChangeEventName = "networkChange";
157
+ const networkChangeSchema = valibot.object({
158
+ type: valibot.literal(networkChangeEventName),
159
+ networks: valibot.object({
160
+ bitcoin: bitcoinNetworkSchema,
161
+ spark: sparkNetworkSchema,
162
+ stacks: stacksNetworkSchema,
163
+ starknet: starknetNetworkSchema
164
+ }),
165
+ addresses: valibot.optional(valibot.array(addressSchema))
166
+ });
167
+ const disconnectEventName = "disconnect";
168
+ const disconnectSchema = valibot.object({ type: valibot.literal(disconnectEventName) });
169
+ const walletEventSchema = valibot.variant("type", [
170
+ accountChangeSchema,
171
+ networkChangeSchema,
172
+ disconnectSchema
173
+ ]);
174
+
175
+ //#endregion
176
+ //#region src/provider/index.ts
177
+ async function getProviderOrThrow(getProvider) {
178
+ const provider = await getProvider?.() || window.XverseProviders?.BitcoinProvider || window.BitcoinProvider;
179
+ if (!provider) throw new Error("No Bitcoin wallet installed");
180
+ return provider;
181
+ }
182
+ function getProviders() {
183
+ if (!window.btc_providers) window.btc_providers = [];
184
+ return window.btc_providers;
185
+ }
186
+ function getProviderById(providerId) {
187
+ return providerId?.split(".").reduce((acc, part) => acc?.[part], window);
188
+ }
189
+ function isProviderInstalled(providerId) {
190
+ return !!getProviderById(providerId);
191
+ }
192
+ function setDefaultProvider(providerId) {
193
+ localStorage.setItem("sats-connect_defaultProvider", providerId);
194
+ }
195
+ function getDefaultProvider() {
196
+ return localStorage.getItem("sats-connect_defaultProvider");
197
+ }
198
+ function removeDefaultProvider() {
199
+ localStorage.removeItem("sats-connect_defaultProvider");
200
+ }
201
+ function getSupportedWallets() {
202
+ return Object.values(DefaultAdaptersInfo).map((provider) => {
203
+ return {
204
+ ...provider,
205
+ isInstalled: isProviderInstalled(provider.id)
206
+ };
207
+ });
208
+ }
209
+
210
+ //#endregion
211
+ //#region src/types.ts
212
+ let BitcoinNetworkType = /* @__PURE__ */ function(BitcoinNetworkType$1) {
213
+ BitcoinNetworkType$1["Mainnet"] = "Mainnet";
214
+ BitcoinNetworkType$1["Testnet"] = "Testnet";
215
+ BitcoinNetworkType$1["Testnet4"] = "Testnet4";
216
+ BitcoinNetworkType$1["Signet"] = "Signet";
217
+ BitcoinNetworkType$1["Regtest"] = "Regtest";
218
+ return BitcoinNetworkType$1;
219
+ }({});
220
+ let StacksNetworkType = /* @__PURE__ */ function(StacksNetworkType$1) {
221
+ StacksNetworkType$1["Mainnet"] = "mainnet";
222
+ StacksNetworkType$1["Testnet"] = "testnet";
223
+ return StacksNetworkType$1;
224
+ }({});
225
+ let StarknetNetworkType = /* @__PURE__ */ function(StarknetNetworkType$1) {
226
+ StarknetNetworkType$1["Mainnet"] = "mainnet";
227
+ StarknetNetworkType$1["Sepolia"] = "sepolia";
228
+ return StarknetNetworkType$1;
229
+ }({});
230
+ let SparkNetworkType = /* @__PURE__ */ function(SparkNetworkType$1) {
231
+ SparkNetworkType$1["Mainnet"] = "mainnet";
232
+ SparkNetworkType$1["Regtest"] = "regtest";
233
+ return SparkNetworkType$1;
234
+ }({});
235
+ const RpcIdSchema = valibot.optional(valibot.union([
236
+ valibot.string(),
237
+ valibot.number(),
238
+ valibot.null()
239
+ ]));
240
+ const rpcRequestMessageSchema = valibot.object({
241
+ jsonrpc: valibot.literal("2.0"),
242
+ method: valibot.string(),
243
+ params: valibot.optional(valibot.union([
244
+ valibot.array(valibot.unknown()),
245
+ valibot.looseObject({}),
246
+ valibot.null()
247
+ ])),
248
+ id: valibot.unwrap(RpcIdSchema)
249
+ });
250
+ /**
251
+ * @enum {number} RpcErrorCode
252
+ * @description JSON-RPC error codes
253
+ * @see https://www.jsonrpc.org/specification#error_object
254
+ */
255
+ let RpcErrorCode = /* @__PURE__ */ function(RpcErrorCode$1) {
256
+ /**
257
+ * Parse error Invalid JSON
258
+ **/
259
+ RpcErrorCode$1[RpcErrorCode$1["PARSE_ERROR"] = -32700] = "PARSE_ERROR";
260
+ /**
261
+ * The JSON sent is not a valid Request object.
262
+ **/
263
+ RpcErrorCode$1[RpcErrorCode$1["INVALID_REQUEST"] = -32600] = "INVALID_REQUEST";
264
+ /**
265
+ * The method does not exist/is not available.
266
+ **/
267
+ RpcErrorCode$1[RpcErrorCode$1["METHOD_NOT_FOUND"] = -32601] = "METHOD_NOT_FOUND";
268
+ /**
269
+ * Invalid method parameter(s).
270
+ */
271
+ RpcErrorCode$1[RpcErrorCode$1["INVALID_PARAMS"] = -32602] = "INVALID_PARAMS";
272
+ /**
273
+ * Internal JSON-RPC error.
274
+ * This is a generic error, used when the server encounters an error in performing the request.
275
+ **/
276
+ RpcErrorCode$1[RpcErrorCode$1["INTERNAL_ERROR"] = -32603] = "INTERNAL_ERROR";
277
+ /**
278
+ * user rejected/canceled the request
279
+ */
280
+ RpcErrorCode$1[RpcErrorCode$1["USER_REJECTION"] = -32e3] = "USER_REJECTION";
281
+ /**
282
+ * method is not supported for the address provided
283
+ */
284
+ RpcErrorCode$1[RpcErrorCode$1["METHOD_NOT_SUPPORTED"] = -32001] = "METHOD_NOT_SUPPORTED";
285
+ /**
286
+ * The client does not have permission to access the requested resource.
287
+ */
288
+ RpcErrorCode$1[RpcErrorCode$1["ACCESS_DENIED"] = -32002] = "ACCESS_DENIED";
289
+ return RpcErrorCode$1;
290
+ }({});
291
+ const rpcSuccessResponseMessageSchema = valibot.object({
292
+ jsonrpc: valibot.literal("2.0"),
293
+ result: valibot.nonOptional(valibot.unknown()),
294
+ id: RpcIdSchema
295
+ });
296
+ const rpcErrorResponseMessageSchema = valibot.object({
297
+ jsonrpc: valibot.literal("2.0"),
298
+ error: valibot.nonOptional(valibot.unknown()),
299
+ id: RpcIdSchema
300
+ });
301
+ const rpcResponseMessageSchema = valibot.union([rpcSuccessResponseMessageSchema, rpcErrorResponseMessageSchema]);
302
+
303
+ //#endregion
304
+ //#region src/request/sanitizeRequest.ts
305
+ const sanitizeRequest = (method, params, providerInfo) => {
306
+ try {
307
+ const [major, minor, patch] = providerInfo.version.split(".").map((part) => parseInt(part, 10));
308
+ const platform = providerInfo.platform;
309
+ if (!platform || platform === ProviderPlatform.Web && major <= 1 && minor <= 4 || platform === ProviderPlatform.Mobile && major <= 1 && minor <= 54) {
310
+ const v1Sanitized = sanitizeAddressPurposeRequest(method, params);
311
+ method = v1Sanitized.method;
312
+ params = v1Sanitized.params;
313
+ }
314
+ } catch {}
315
+ return {
316
+ method,
317
+ params
318
+ };
319
+ };
320
+ const sanitizeAddressPurposeRequest = (method, params) => {
321
+ const filterPurposes = (purposes) => purposes?.filter((purpose) => purpose !== AddressPurpose.Spark && purpose !== AddressPurpose.Starknet);
322
+ if (method === "wallet_connect") {
323
+ const typedParams = params;
324
+ if (!typedParams) return {
325
+ method,
326
+ params
327
+ };
328
+ const { addresses, ...rest } = typedParams;
329
+ return {
330
+ method,
331
+ params: {
332
+ ...rest,
333
+ addresses: filterPurposes(addresses)
334
+ }
335
+ };
336
+ }
337
+ if (method === "getAccounts") {
338
+ const { purposes, ...rest } = params;
339
+ return {
340
+ method,
341
+ params: {
342
+ ...rest,
343
+ purposes: filterPurposes(purposes)
344
+ }
345
+ };
346
+ }
347
+ if (method === "getAddresses") {
348
+ const { purposes, ...rest } = params;
349
+ return {
350
+ method,
351
+ params: {
352
+ ...rest,
353
+ purposes: filterPurposes(purposes)
354
+ }
355
+ };
356
+ }
357
+ return {
358
+ method,
359
+ params
360
+ };
361
+ };
362
+
363
+ //#endregion
364
+ //#region src/request/types/btcMethods/common.ts
365
+ let MessageSigningProtocols = /* @__PURE__ */ function(MessageSigningProtocols$1) {
366
+ MessageSigningProtocols$1["ECDSA"] = "ECDSA";
367
+ MessageSigningProtocols$1["BIP322"] = "BIP322";
368
+ return MessageSigningProtocols$1;
369
+ }({});
370
+
371
+ //#endregion
372
+ //#region src/request/types/btcMethods/getAccounts.ts
373
+ const getAccountsMethodName = "getAccounts";
374
+ const getAccountsParamsSchema = valibot.object({
375
+ purposes: valibot.array(valibot.enum(AddressPurpose)),
376
+ message: valibot.optional(valibot.string())
377
+ });
378
+ const getAccountsResultSchema = valibot.array(valibot.object({
379
+ ...addressSchema.entries,
380
+ ...valibot.object({ walletType: walletTypeSchema }).entries
381
+ }));
382
+ const getAccountsRequestMessageSchema = valibot.object({
383
+ ...rpcRequestMessageSchema.entries,
384
+ ...valibot.object({
385
+ method: valibot.literal(getAccountsMethodName),
386
+ params: getAccountsParamsSchema,
387
+ id: valibot.string()
388
+ }).entries
389
+ });
390
+
391
+ //#endregion
392
+ //#region src/request/types/walletMethods/addNetwork.ts
393
+ const addNetworkMethodName = "wallet_addNetwork";
394
+ const bitcoinNetworkDefinitionSchema = valibot.omit(bitcoinNetworkSchema, ["id"]);
395
+ const sparkNetworkDefinitionSchema = valibot.omit(sparkNetworkSchema, ["id"]);
396
+ const stacksNetworkDefinitionSchema = valibot.omit(stacksNetworkSchema, ["id"]);
397
+ const starknetNetworkDefinitionSchema = valibot.omit(starknetNetworkSchema, ["id"]);
398
+ const newNetworkDefinitionSchema = valibot.variant("chain", [
399
+ bitcoinNetworkDefinitionSchema,
400
+ sparkNetworkDefinitionSchema,
401
+ stacksNetworkDefinitionSchema,
402
+ starknetNetworkDefinitionSchema
403
+ ]);
404
+ const addNetworkParamsSchema = valibot.object({
405
+ network: newNetworkDefinitionSchema,
406
+ isActive: valibot.optional(valibot.boolean())
407
+ });
408
+ const addNetworkRequestMessageSchema = valibot.object({
409
+ ...rpcRequestMessageSchema.entries,
410
+ ...valibot.object({
411
+ method: valibot.literal(addNetworkMethodName),
412
+ params: addNetworkParamsSchema,
413
+ id: valibot.string()
414
+ }).entries
415
+ });
416
+ const addNetworkResultSchema = valibot.object({ id: valibot.string() });
417
+
418
+ //#endregion
419
+ //#region src/request/types/walletMethods/changeNetwork.ts
420
+ const changeNetworkMethodName = "wallet_changeNetwork";
421
+ const changeNetworkParamsSchema = valibot.object({ name: valibot.enum(BitcoinNetworkType) });
422
+ const changeNetworkResultSchema = valibot.nullish(valibot.null());
423
+ const changeNetworkRequestMessageSchema = valibot.object({
424
+ ...rpcRequestMessageSchema.entries,
425
+ ...valibot.object({
426
+ method: valibot.literal(changeNetworkMethodName),
427
+ params: changeNetworkParamsSchema,
428
+ id: valibot.string()
429
+ }).entries
430
+ });
431
+
432
+ //#endregion
433
+ //#region src/request/types/walletMethods/changeNetworkById.ts
434
+ const changeNetworkByIdMethodName = "wallet_changeNetworkById";
435
+ const changeNetworkByIdParamsSchema = valibot.object({ id: valibot.string() });
436
+ const changeNetworkByIdResultSchema = valibot.nullish(valibot.null());
437
+ const changeNetworkByIdRequestMessageSchema = valibot.object({
438
+ ...rpcRequestMessageSchema.entries,
439
+ ...valibot.object({
440
+ method: valibot.literal(changeNetworkByIdMethodName),
441
+ params: changeNetworkByIdParamsSchema,
442
+ id: valibot.string()
443
+ }).entries
444
+ });
445
+
446
+ //#endregion
447
+ //#region src/request/types/walletMethods/common.ts
448
+ const accountActionsSchema = valibot.object({ read: valibot.optional(valibot.boolean()) });
449
+ const walletActionsSchema = valibot.object({ readNetwork: valibot.optional(valibot.boolean()) });
450
+ const accountPermissionSchema = valibot.object({
451
+ type: valibot.literal("account"),
452
+ resourceId: valibot.string(),
453
+ clientId: valibot.string(),
454
+ actions: accountActionsSchema
455
+ });
456
+ const walletPermissionSchema = valibot.object({
457
+ type: valibot.literal("wallet"),
458
+ resourceId: valibot.string(),
459
+ clientId: valibot.string(),
460
+ actions: walletActionsSchema
461
+ });
462
+ /**
463
+ * Permissions with the clientId field omitted and optional actions. Used for
464
+ * permission requests, since the wallet performs authentication based on the
465
+ * client's tab origin and should not rely on the client authenticating
466
+ * themselves.
467
+ */
468
+ const PermissionRequestParams = valibot.variant("type", [valibot.object({ ...valibot.omit(accountPermissionSchema, ["clientId"]).entries }), valibot.object({ ...valibot.omit(walletPermissionSchema, ["clientId"]).entries })]);
469
+ const permission = valibot.variant("type", [accountPermissionSchema, walletPermissionSchema]);
470
+
471
+ //#endregion
472
+ //#region src/request/types/walletMethods/getNetwork.ts
473
+ const getNetworkMethodName = "wallet_getNetwork";
474
+ const getNetworkParamsSchema = valibot.nullish(valibot.null());
475
+ const getNetworkResultSchema = valibot.object({
476
+ bitcoin: valibot.object({ name: valibot.enum(BitcoinNetworkType) }),
477
+ stacks: valibot.object({ name: valibot.enum(StacksNetworkType) }),
478
+ spark: valibot.object({ name: valibot.enum(SparkNetworkType) })
479
+ });
480
+ const getNetworkRequestMessageSchema = valibot.object({
481
+ ...rpcRequestMessageSchema.entries,
482
+ ...valibot.object({
483
+ method: valibot.literal(getNetworkMethodName),
484
+ params: getNetworkParamsSchema,
485
+ id: valibot.string()
486
+ }).entries
487
+ });
488
+
489
+ //#endregion
490
+ //#region src/request/types/walletMethods/connect.ts
491
+ const connectMethodName = "wallet_connect";
492
+ const connectParamsSchema = valibot.nullish(valibot.object({
493
+ permissions: valibot.optional(valibot.array(PermissionRequestParams)),
494
+ addresses: valibot.optional(valibot.array(valibot.enum(AddressPurpose))),
495
+ message: valibot.optional(valibot.pipe(valibot.string(), valibot.maxLength(80, "The message must not exceed 80 characters."))),
496
+ network: valibot.optional(valibot.enum(BitcoinNetworkType))
497
+ }));
498
+ const connectResultSchema = valibot.object({
499
+ id: valibot.string(),
500
+ addresses: valibot.array(addressSchema),
501
+ walletType: walletTypeSchema,
502
+ network: getNetworkResultSchema
503
+ });
504
+ const connectRequestMessageSchema = valibot.object({
505
+ ...rpcRequestMessageSchema.entries,
506
+ ...valibot.object({
507
+ method: valibot.literal(connectMethodName),
508
+ params: connectParamsSchema,
509
+ id: valibot.string()
510
+ }).entries
511
+ });
512
+
513
+ //#endregion
514
+ //#region src/request/types/walletMethods/disconnect.ts
515
+ const disconnectMethodName = "wallet_disconnect";
516
+ const disconnectParamsSchema = valibot.nullish(valibot.null());
517
+ const disconnectResultSchema = valibot.nullish(valibot.null());
518
+ const disconnectRequestMessageSchema = valibot.object({
519
+ ...rpcRequestMessageSchema.entries,
520
+ ...valibot.object({
521
+ method: valibot.literal(disconnectMethodName),
522
+ params: disconnectParamsSchema,
523
+ id: valibot.string()
524
+ }).entries
525
+ });
526
+
527
+ //#endregion
528
+ //#region src/request/types/walletMethods/getAccount.ts
529
+ const getAccountMethodName = "wallet_getAccount";
530
+ const getAccountParamsSchema = valibot.nullish(valibot.null());
531
+ const getAccountResultSchema = valibot.object({
532
+ id: valibot.string(),
533
+ addresses: valibot.array(addressSchema),
534
+ walletType: walletTypeSchema,
535
+ network: getNetworkResultSchema
536
+ });
537
+ const getAccountRequestMessageSchema = valibot.object({
538
+ ...rpcRequestMessageSchema.entries,
539
+ ...valibot.object({
540
+ method: valibot.literal(getAccountMethodName),
541
+ params: getAccountParamsSchema,
542
+ id: valibot.string()
543
+ }).entries
544
+ });
545
+
546
+ //#endregion
547
+ //#region src/request/types/walletMethods/getCurrentPermissions.ts
548
+ const getCurrentPermissionsMethodName = "wallet_getCurrentPermissions";
549
+ const getCurrentPermissionsParamsSchema = valibot.nullish(valibot.null());
550
+ const getCurrentPermissionsResultSchema = valibot.array(permission);
551
+ const getCurrentPermissionsRequestMessageSchema = valibot.object({
552
+ ...rpcRequestMessageSchema.entries,
553
+ ...valibot.object({
554
+ method: valibot.literal(getCurrentPermissionsMethodName),
555
+ params: getCurrentPermissionsParamsSchema,
556
+ id: valibot.string()
557
+ }).entries
558
+ });
559
+
560
+ //#endregion
561
+ //#region src/request/types/walletMethods/getNetworks.ts
562
+ const getNetworksMethodName = "wallet_getNetworks";
563
+ const getNetworksParamsSchema = valibot.nullish(valibot.null());
564
+ const getNetworksResultSchema = valibot.object({
565
+ active: valibot.object({
566
+ bitcoin: bitcoinNetworkSchema,
567
+ stacks: stacksNetworkSchema,
568
+ spark: sparkNetworkSchema,
569
+ starknet: starknetNetworkSchema
570
+ }),
571
+ builtin: valibot.object({
572
+ bitcoin: valibot.array(bitcoinNetworkSchema),
573
+ stacks: valibot.array(stacksNetworkSchema),
574
+ spark: valibot.array(sparkNetworkSchema),
575
+ starknet: valibot.array(starknetNetworkSchema)
576
+ }),
577
+ custom: valibot.object({
578
+ bitcoin: valibot.array(bitcoinNetworkSchema),
579
+ stacks: valibot.array(stacksNetworkSchema),
580
+ spark: valibot.array(sparkNetworkSchema),
581
+ starknet: valibot.array(starknetNetworkSchema)
582
+ })
583
+ });
584
+ const getNetworksRequestMessageSchema = valibot.object({
585
+ ...rpcRequestMessageSchema.entries,
586
+ ...valibot.object({
587
+ method: valibot.literal(getNetworksMethodName),
588
+ params: getNetworksParamsSchema,
589
+ id: valibot.string()
590
+ }).entries
591
+ });
592
+
593
+ //#endregion
594
+ //#region src/request/types/walletMethods/getWalletType.ts
595
+ const getWalletTypeMethodName = "wallet_getWalletType";
596
+ const getWalletTypeParamsSchema = valibot.nullish(valibot.null());
597
+ const getWalletTypeResultSchema = walletTypeSchema;
598
+ const getWalletTypeRequestMessageSchema = valibot.object({
599
+ ...rpcRequestMessageSchema.entries,
600
+ ...valibot.object({
601
+ method: valibot.literal(getWalletTypeMethodName),
602
+ params: getWalletTypeParamsSchema,
603
+ id: valibot.string()
604
+ }).entries
605
+ });
606
+
607
+ //#endregion
608
+ //#region src/request/types/walletMethods/openBridge.ts
609
+ const openBridgeMethodName = "wallet_openBridge";
610
+ const openBridgeParamsSchema = valibot.object({
611
+ fromAsset: valibot.string(),
612
+ toAsset: valibot.string()
613
+ });
614
+ const openBridgeResultSchema = valibot.nullish(valibot.null());
615
+ const openBridgeRequestMessageSchema = valibot.object({
616
+ ...rpcRequestMessageSchema.entries,
617
+ ...valibot.object({
618
+ method: valibot.literal(openBridgeMethodName),
619
+ params: openBridgeParamsSchema,
620
+ id: valibot.string()
621
+ }).entries
622
+ });
623
+
624
+ //#endregion
625
+ //#region src/request/types/walletMethods/openBuy.ts
626
+ const openBuyMethodName = "wallet_openBuy";
627
+ const openBuyParamsSchema = valibot.object({ asset: valibot.string() });
628
+ const openBuyResultSchema = valibot.nullish(valibot.null());
629
+ const openBuyRequestMessageSchema = valibot.object({
630
+ ...rpcRequestMessageSchema.entries,
631
+ ...valibot.object({
632
+ method: valibot.literal(openBuyMethodName),
633
+ params: openBuyParamsSchema,
634
+ id: valibot.string()
635
+ }).entries
636
+ });
637
+
638
+ //#endregion
639
+ //#region src/request/types/walletMethods/openReceive.ts
640
+ const openReceiveMethodName = "wallet_openReceive";
641
+ const openReceiveParamsSchema = valibot.object({ address: valibot.string() });
642
+ const openReceiveResultSchema = addressSchema;
643
+ const openReceiveRequestMessageSchema = valibot.object({
644
+ ...rpcRequestMessageSchema.entries,
645
+ ...valibot.object({
646
+ method: valibot.literal(openReceiveMethodName),
647
+ params: openReceiveParamsSchema,
648
+ id: valibot.string()
649
+ }).entries
650
+ });
651
+
652
+ //#endregion
653
+ //#region src/request/types/walletMethods/renouncePermissions.ts
654
+ const renouncePermissionsMethodName = "wallet_renouncePermissions";
655
+ const renouncePermissionsParamsSchema = valibot.nullish(valibot.null());
656
+ const renouncePermissionsResultSchema = valibot.nullish(valibot.null());
657
+ const renouncePermissionsRequestMessageSchema = valibot.object({
658
+ ...rpcRequestMessageSchema.entries,
659
+ ...valibot.object({
660
+ method: valibot.literal(renouncePermissionsMethodName),
661
+ params: renouncePermissionsParamsSchema,
662
+ id: valibot.string()
663
+ }).entries
664
+ });
665
+
666
+ //#endregion
667
+ //#region src/request/types/walletMethods/requestPermissions.ts
668
+ const requestPermissionsMethodName = "wallet_requestPermissions";
669
+ const requestPermissionsParamsSchema = valibot.nullish(valibot.array(PermissionRequestParams));
670
+ const requestPermissionsResultSchema = valibot.literal(true);
671
+ const requestPermissionsRequestMessageSchema = valibot.object({
672
+ ...rpcRequestMessageSchema.entries,
673
+ ...valibot.object({
674
+ method: valibot.literal(requestPermissionsMethodName),
675
+ params: requestPermissionsParamsSchema,
676
+ id: valibot.string()
677
+ }).entries
678
+ });
679
+
680
+ //#endregion
681
+ //#region src/request/types/btcMethods/getAddresses.ts
682
+ const getAddressesMethodName = "getAddresses";
683
+ const getAddressesParamsSchema = valibot.object({
684
+ purposes: valibot.array(valibot.enum(AddressPurpose)),
685
+ message: valibot.optional(valibot.string())
686
+ });
687
+ const getAddressesResultSchema = valibot.object({
688
+ addresses: valibot.array(addressSchema),
689
+ network: getNetworkResultSchema
690
+ });
691
+ const getAddressesRequestMessageSchema = valibot.object({
692
+ ...rpcRequestMessageSchema.entries,
693
+ ...valibot.object({
694
+ method: valibot.literal(getAddressesMethodName),
695
+ params: getAddressesParamsSchema,
696
+ id: valibot.string()
697
+ }).entries
698
+ });
699
+
700
+ //#endregion
701
+ //#region src/request/types/btcMethods/getBalance.ts
702
+ const getBalanceMethodName = "getBalance";
703
+ const getBalanceParamsSchema = valibot.nullish(valibot.null());
704
+ const getBalanceResultSchema = valibot.object({
705
+ confirmed: valibot.string(),
706
+ unconfirmed: valibot.string(),
707
+ total: valibot.string()
708
+ });
709
+ const getBalanceRequestMessageSchema = valibot.object({
710
+ ...rpcRequestMessageSchema.entries,
711
+ ...valibot.object({
712
+ method: valibot.literal(getBalanceMethodName),
713
+ id: valibot.string()
714
+ }).entries
715
+ });
716
+
717
+ //#endregion
718
+ //#region src/request/types/btcMethods/getInfo.ts
719
+ let ProviderPlatform = /* @__PURE__ */ function(ProviderPlatform$1) {
720
+ ProviderPlatform$1["Web"] = "web";
721
+ ProviderPlatform$1["Mobile"] = "mobile";
722
+ return ProviderPlatform$1;
723
+ }({});
724
+ const getInfoMethodName = "getInfo";
725
+ const getInfoParamsSchema = valibot.nullish(valibot.null());
726
+ const getInfoResultSchema = valibot.object({
727
+ version: valibot.string(),
728
+ platform: valibot.optional(valibot.enum(ProviderPlatform)),
729
+ methods: valibot.optional(valibot.array(valibot.string())),
730
+ supports: valibot.array(valibot.string())
731
+ });
732
+ const getInfoRequestMessageSchema = valibot.object({
733
+ ...rpcRequestMessageSchema.entries,
734
+ ...valibot.object({
735
+ method: valibot.literal(getInfoMethodName),
736
+ params: getInfoParamsSchema,
737
+ id: valibot.string()
738
+ }).entries
739
+ });
740
+
741
+ //#endregion
742
+ //#region src/request/types/btcMethods/sendTransfer.ts
743
+ const sendTransferMethodName = "sendTransfer";
744
+ const sendTransferParamsSchema = valibot.object({ recipients: valibot.array(valibot.object({
745
+ address: valibot.string(),
746
+ amount: valibot.number()
747
+ })) });
748
+ const sendTransferResultSchema = valibot.object({ txid: valibot.string() });
749
+ const sendTransferRequestMessageSchema = valibot.object({
750
+ ...rpcRequestMessageSchema.entries,
751
+ ...valibot.object({
752
+ method: valibot.literal(sendTransferMethodName),
753
+ params: sendTransferParamsSchema,
754
+ id: valibot.string()
755
+ }).entries
756
+ });
757
+
758
+ //#endregion
759
+ //#region src/request/types/btcMethods/signMessage.ts
760
+ const signMessageMethodName = "signMessage";
761
+ const signMessageParamsSchema = valibot.object({
762
+ address: valibot.string(),
763
+ message: valibot.string(),
764
+ protocol: valibot.optional(valibot.enum(MessageSigningProtocols))
765
+ });
766
+ const signMessageResultSchema = valibot.object({
767
+ signature: valibot.string(),
768
+ messageHash: valibot.string(),
769
+ address: valibot.string(),
770
+ protocol: valibot.enum(MessageSigningProtocols)
771
+ });
772
+ const signMessageRequestMessageSchema = valibot.object({
773
+ ...rpcRequestMessageSchema.entries,
774
+ ...valibot.object({
775
+ method: valibot.literal(signMessageMethodName),
776
+ params: signMessageParamsSchema,
777
+ id: valibot.string()
778
+ }).entries
779
+ });
780
+
781
+ //#endregion
782
+ //#region src/request/types/btcMethods/signMultipleMessages.ts
783
+ const signMultipleMessagesMethodName = "signMultipleMessages";
784
+ const signMultipleMessagesParamsSchema = valibot.array(valibot.object({
785
+ address: valibot.string(),
786
+ message: valibot.string(),
787
+ protocol: valibot.optional(valibot.enum(MessageSigningProtocols))
788
+ }));
789
+ const signMultipleMessagesResultSchema = valibot.array(valibot.object({
790
+ signature: valibot.string(),
791
+ message: valibot.string(),
792
+ messageHash: valibot.string(),
793
+ address: valibot.string(),
794
+ protocol: valibot.enum(MessageSigningProtocols)
795
+ }));
796
+ const signMultipleMessagesRequestMessageSchema = valibot.object({
797
+ ...rpcRequestMessageSchema.entries,
798
+ ...valibot.object({
799
+ method: valibot.literal(signMultipleMessagesMethodName),
800
+ params: signMultipleMessagesParamsSchema,
801
+ id: valibot.string()
802
+ }).entries
803
+ });
804
+
805
+ //#endregion
806
+ //#region src/request/types/btcMethods/signPSBT.ts
807
+ const signPsbtMethodName = "signPsbt";
808
+ const signPsbtParamsSchema = valibot.object({
809
+ psbt: valibot.string(),
810
+ signInputs: valibot.optional(valibot.record(valibot.string(), valibot.array(valibot.number()))),
811
+ broadcast: valibot.optional(valibot.boolean())
812
+ });
813
+ const signPsbtResultSchema = valibot.object({
814
+ psbt: valibot.string(),
815
+ txid: valibot.optional(valibot.string())
816
+ });
817
+ const signPsbtRequestMessageSchema = valibot.object({
818
+ ...rpcRequestMessageSchema.entries,
819
+ ...valibot.object({
820
+ method: valibot.literal(signPsbtMethodName),
821
+ params: signPsbtParamsSchema,
822
+ id: valibot.string()
823
+ }).entries
824
+ });
825
+
826
+ //#endregion
827
+ //#region src/request/types/ordinalsMethods.ts
828
+ const getInscriptionsMethodName = "ord_getInscriptions";
829
+ const getInscriptionsParamsSchema = valibot.object({
830
+ offset: valibot.number(),
831
+ limit: valibot.number()
832
+ });
833
+ const getInscriptionsResultSchema = valibot.object({
834
+ total: valibot.number(),
835
+ limit: valibot.number(),
836
+ offset: valibot.number(),
837
+ inscriptions: valibot.array(valibot.object({
838
+ inscriptionId: valibot.string(),
839
+ inscriptionNumber: valibot.string(),
840
+ address: valibot.string(),
841
+ collectionName: valibot.optional(valibot.string()),
842
+ postage: valibot.string(),
843
+ contentLength: valibot.string(),
844
+ contentType: valibot.string(),
845
+ timestamp: valibot.number(),
846
+ offset: valibot.number(),
847
+ genesisTransaction: valibot.string(),
848
+ output: valibot.string()
849
+ }))
850
+ });
851
+ const getInscriptionsRequestMessageSchema = valibot.object({
852
+ ...rpcRequestMessageSchema.entries,
853
+ ...valibot.object({
854
+ method: valibot.literal(getInscriptionsMethodName),
855
+ params: getInscriptionsParamsSchema,
856
+ id: valibot.string()
857
+ }).entries
858
+ });
859
+ const sendInscriptionsMethodName = "ord_sendInscriptions";
860
+ const sendInscriptionsParamsSchema = valibot.object({ transfers: valibot.array(valibot.object({
861
+ address: valibot.string(),
862
+ inscriptionId: valibot.string()
863
+ })) });
864
+ const sendInscriptionsResultSchema = valibot.object({ txid: valibot.string() });
865
+ const sendInscriptionsRequestMessageSchema = valibot.object({
866
+ ...rpcRequestMessageSchema.entries,
867
+ ...valibot.object({
868
+ method: valibot.literal(sendInscriptionsMethodName),
869
+ params: sendInscriptionsParamsSchema,
870
+ id: valibot.string()
871
+ }).entries
872
+ });
873
+
874
+ //#endregion
875
+ //#region src/request/types/runesMethods/etch.ts
876
+ const runesEtchMethodName = "runes_etch";
877
+ const etchTermsSchema = valibot.object({
878
+ amount: valibot.string(),
879
+ cap: valibot.string(),
880
+ heightStart: valibot.optional(valibot.string()),
881
+ heightEnd: valibot.optional(valibot.string()),
882
+ offsetStart: valibot.optional(valibot.string()),
883
+ offsetEnd: valibot.optional(valibot.string())
884
+ });
885
+ const inscriptionDetailsSchema = valibot.object({
886
+ contentType: valibot.string(),
887
+ contentBase64: valibot.string()
888
+ });
889
+ const runesEtchParamsSchema = valibot.object({
890
+ runeName: valibot.string(),
891
+ divisibility: valibot.optional(valibot.number()),
892
+ symbol: valibot.optional(valibot.string()),
893
+ premine: valibot.optional(valibot.string()),
894
+ isMintable: valibot.boolean(),
895
+ delegateInscriptionId: valibot.optional(valibot.string()),
896
+ destinationAddress: valibot.string(),
897
+ refundAddress: valibot.string(),
898
+ feeRate: valibot.number(),
899
+ appServiceFee: valibot.optional(valibot.number()),
900
+ appServiceFeeAddress: valibot.optional(valibot.string()),
901
+ terms: valibot.optional(etchTermsSchema),
902
+ inscriptionDetails: valibot.optional(inscriptionDetailsSchema),
903
+ network: valibot.optional(valibot.enum(BitcoinNetworkType))
904
+ });
905
+ const runesEtchResultSchema = valibot.object({
906
+ orderId: valibot.string(),
907
+ fundTransactionId: valibot.string(),
908
+ fundingAddress: valibot.string()
909
+ });
910
+ const runesEtchRequestMessageSchema = valibot.object({
911
+ ...rpcRequestMessageSchema.entries,
912
+ ...valibot.object({
913
+ method: valibot.literal(runesEtchMethodName),
914
+ params: runesEtchParamsSchema,
915
+ id: valibot.string()
916
+ }).entries
917
+ });
918
+
919
+ //#endregion
920
+ //#region src/request/types/runesMethods/getBalance.ts
921
+ const runesGetBalanceMethodName = "runes_getBalance";
922
+ const runesGetBalanceParamsSchema = valibot.nullish(valibot.null());
923
+ const runesGetBalanceResultSchema = valibot.object({ balances: valibot.array(valibot.object({
924
+ runeName: valibot.string(),
925
+ amount: valibot.string(),
926
+ divisibility: valibot.number(),
927
+ symbol: valibot.string(),
928
+ inscriptionId: valibot.nullish(valibot.string()),
929
+ spendableBalance: valibot.string()
930
+ })) });
931
+ const runesGetBalanceRequestMessageSchema = valibot.object({
932
+ ...rpcRequestMessageSchema.entries,
933
+ ...valibot.object({
934
+ method: valibot.literal(runesGetBalanceMethodName),
935
+ params: runesGetBalanceParamsSchema,
936
+ id: valibot.string()
937
+ }).entries
938
+ });
939
+
940
+ //#endregion
941
+ //#region src/request/types/runesMethods/mint.ts
942
+ const runesMintMethodName = "runes_mint";
943
+ const runesMintParamsSchema = valibot.object({
944
+ appServiceFee: valibot.optional(valibot.number()),
945
+ appServiceFeeAddress: valibot.optional(valibot.string()),
946
+ destinationAddress: valibot.string(),
947
+ feeRate: valibot.number(),
948
+ refundAddress: valibot.string(),
949
+ repeats: valibot.number(),
950
+ runeName: valibot.string(),
951
+ network: valibot.optional(valibot.enum(BitcoinNetworkType))
952
+ });
953
+ const runesMintResultSchema = valibot.object({
954
+ orderId: valibot.string(),
955
+ fundTransactionId: valibot.string(),
956
+ fundingAddress: valibot.string()
957
+ });
958
+ const runesMintRequestMessageSchema = valibot.object({
959
+ ...rpcRequestMessageSchema.entries,
960
+ ...valibot.object({
961
+ method: valibot.literal(runesMintMethodName),
962
+ params: runesMintParamsSchema,
963
+ id: valibot.string()
964
+ }).entries
965
+ });
966
+
967
+ //#endregion
968
+ //#region src/request/types/runesMethods/transfer.ts
969
+ const runesTransferMethodName = "runes_transfer";
970
+ const runesTransferParamsSchema = valibot.object({ recipients: valibot.array(valibot.object({
971
+ runeName: valibot.string(),
972
+ amount: valibot.string(),
973
+ address: valibot.string()
974
+ })) });
975
+ const runesTransferResultSchema = valibot.object({ txid: valibot.string() });
976
+ const runesTransferRequestMessageSchema = valibot.object({
977
+ ...rpcRequestMessageSchema.entries,
978
+ ...valibot.object({
979
+ method: valibot.literal(runesTransferMethodName),
980
+ params: runesTransferParamsSchema,
981
+ id: valibot.string()
982
+ }).entries
983
+ });
984
+
985
+ //#endregion
986
+ //#region src/request/types/sparkMethods/flashnetMethods/clawbackFunds.ts
987
+ const sparkFlashnetClawbackFundsMethodName = "spark_flashnet_clawbackFunds";
988
+ const sparkFlashnetClawbackFundsParamsSchema = valibot.object({
989
+ sparkTransferId: valibot.string(),
990
+ lpIdentityPublicKey: valibot.string()
991
+ });
992
+ const sparkFlashnetClawbackFundsResultSchema = valibot.object({
993
+ requestId: valibot.string(),
994
+ accepted: valibot.boolean(),
995
+ internalRequestId: valibot.optional(valibot.string()),
996
+ sparkStatusTrackingId: valibot.optional(valibot.string()),
997
+ error: valibot.optional(valibot.string())
998
+ });
999
+ const sparkFlashnetClawbackFundsRequestMessageSchema = valibot.object({
1000
+ ...rpcRequestMessageSchema.entries,
1001
+ ...valibot.object({
1002
+ method: valibot.literal(sparkFlashnetClawbackFundsMethodName),
1003
+ params: sparkFlashnetClawbackFundsParamsSchema,
1004
+ id: valibot.string()
1005
+ }).entries
1006
+ });
1007
+
1008
+ //#endregion
1009
+ //#region src/request/types/sparkMethods/flashnetMethods/executeRouteSwap.ts
1010
+ const sparkFlashnetExecuteRouteSwapMethodName = "spark_flashnet_executeRouteSwap";
1011
+ const sparkFlashnetExecuteRouteSwapParamsSchema = valibot.object({
1012
+ hops: valibot.array(valibot.object({
1013
+ poolId: valibot.string(),
1014
+ assetInAddress: valibot.string(),
1015
+ assetOutAddress: valibot.string(),
1016
+ hopIntegratorFeeRateBps: valibot.optional(valibot.number())
1017
+ })),
1018
+ initialAssetAddress: valibot.string(),
1019
+ inputAmount: valibot.string(),
1020
+ maxRouteSlippageBps: valibot.string(),
1021
+ minAmountOut: valibot.optional(valibot.string()),
1022
+ integratorFeeRateBps: valibot.optional(valibot.number()),
1023
+ integratorPublicKey: valibot.optional(valibot.string())
1024
+ });
1025
+ const sparkFlashnetExecuteRouteSwapResultSchema = valibot.object({
1026
+ requestId: valibot.string(),
1027
+ accepted: valibot.boolean(),
1028
+ outputAmount: valibot.string(),
1029
+ executionPrice: valibot.string(),
1030
+ finalOutboundTransferId: valibot.string(),
1031
+ error: valibot.optional(valibot.string())
1032
+ });
1033
+ const sparkFlashnetExecuteRouteSwapRequestMessageSchema = valibot.object({
1034
+ ...rpcRequestMessageSchema.entries,
1035
+ ...valibot.object({
1036
+ method: valibot.literal(sparkFlashnetExecuteRouteSwapMethodName),
1037
+ params: sparkFlashnetExecuteRouteSwapParamsSchema,
1038
+ id: valibot.string()
1039
+ }).entries
1040
+ });
1041
+
1042
+ //#endregion
1043
+ //#region src/request/types/sparkMethods/flashnetMethods/executeSwap.ts
1044
+ const sparkFlashnetExecuteSwapMethodName = "spark_flashnet_executeSwap";
1045
+ const sparkFlashnetExecuteSwapParamsSchema = valibot.object({
1046
+ poolId: valibot.string(),
1047
+ assetInAddress: valibot.string(),
1048
+ assetOutAddress: valibot.string(),
1049
+ amountIn: valibot.string(),
1050
+ maxSlippageBps: valibot.number(),
1051
+ minAmountOut: valibot.optional(valibot.string()),
1052
+ integratorFeeRateBps: valibot.optional(valibot.number()),
1053
+ integratorPublicKey: valibot.optional(valibot.string())
1054
+ });
1055
+ const sparkFlashnetExecuteSwapResultSchema = valibot.object({
1056
+ requestId: valibot.string(),
1057
+ accepted: valibot.boolean(),
1058
+ amountOut: valibot.optional(valibot.string()),
1059
+ feeAmount: valibot.optional(valibot.string()),
1060
+ executionPrice: valibot.optional(valibot.string()),
1061
+ assetOutAddress: valibot.optional(valibot.string()),
1062
+ assetInAddress: valibot.optional(valibot.string()),
1063
+ outboundTransferId: valibot.optional(valibot.string()),
1064
+ error: valibot.optional(valibot.string())
1065
+ });
1066
+ const sparkFlashnetExecuteSwapRequestMessageSchema = valibot.object({
1067
+ ...rpcRequestMessageSchema.entries,
1068
+ ...valibot.object({
1069
+ method: valibot.literal(sparkFlashnetExecuteSwapMethodName),
1070
+ params: sparkFlashnetExecuteSwapParamsSchema,
1071
+ id: valibot.string()
1072
+ }).entries
1073
+ });
1074
+
1075
+ //#endregion
1076
+ //#region src/request/types/sparkMethods/flashnetMethods/getClawbackEligibleTransfers.ts
1077
+ const sparkGetClawbackEligibleTransfersMethodName = "spark_flashnet_getClawbackEligibleTransfers";
1078
+ const sparkGetClawbackEligibleTransfersParamsSchema = valibot.nullish(valibot.null());
1079
+ const sparkGetClawbackEligibleTransfersResultSchema = valibot.object({ eligibleTransfers: valibot.array(valibot.object({
1080
+ txId: valibot.string(),
1081
+ createdAt: valibot.string(),
1082
+ lpIdentityPublicKey: valibot.string()
1083
+ })) });
1084
+ const sparkGetClawbackEligibleTransfersRequestMessageSchema = valibot.object({
1085
+ ...rpcRequestMessageSchema.entries,
1086
+ ...valibot.object({
1087
+ method: valibot.literal(sparkGetClawbackEligibleTransfersMethodName),
1088
+ params: sparkGetClawbackEligibleTransfersParamsSchema,
1089
+ id: valibot.string()
1090
+ }).entries
1091
+ });
1092
+
1093
+ //#endregion
1094
+ //#region src/request/types/sparkMethods/flashnetMethods/getJwt.ts
1095
+ const sparkFlashnetGetJwtMethodName = "spark_flashnet_getJwt";
1096
+ const sparkFlashnetGetJwtParamsSchema = valibot.null();
1097
+ const sparkFlashnetGetJwtResultSchema = valibot.object({ jwt: valibot.string() });
1098
+ const sparkFlashnetGetJwtRequestMessageSchema = valibot.object({
1099
+ ...rpcRequestMessageSchema.entries,
1100
+ ...valibot.object({
1101
+ method: valibot.literal(sparkFlashnetGetJwtMethodName),
1102
+ params: sparkFlashnetGetJwtParamsSchema,
1103
+ id: valibot.string()
1104
+ }).entries
1105
+ });
1106
+
1107
+ //#endregion
1108
+ //#region src/request/types/sparkMethods/flashnetMethods/intents/addLiquidity.ts
1109
+ const sparkFlashnetAddLiquidityIntentSchema = valibot.object({
1110
+ type: valibot.literal("addLiquidity"),
1111
+ data: valibot.object({
1112
+ userPublicKey: valibot.string(),
1113
+ poolId: valibot.string(),
1114
+ assetAAmount: valibot.string(),
1115
+ assetBAmount: valibot.string(),
1116
+ assetAMinAmountIn: valibot.string(),
1117
+ assetBMinAmountIn: valibot.string(),
1118
+ assetATransferId: valibot.string(),
1119
+ assetBTransferId: valibot.string(),
1120
+ nonce: valibot.string()
1121
+ })
1122
+ });
1123
+
1124
+ //#endregion
1125
+ //#region src/request/types/sparkMethods/flashnetMethods/intents/clawback.ts
1126
+ const sparkFlashnetClawbackIntentSchema = valibot.object({
1127
+ type: valibot.literal("clawback"),
1128
+ data: valibot.object({
1129
+ senderPublicKey: valibot.string(),
1130
+ sparkTransferId: valibot.string(),
1131
+ lpIdentityPublicKey: valibot.string(),
1132
+ nonce: valibot.string()
1133
+ })
1134
+ });
1135
+
1136
+ //#endregion
1137
+ //#region src/request/types/sparkMethods/flashnetMethods/intents/confirmInitialDeposit.ts
1138
+ const sparkFlashnetConfirmInitialDepositIntentSchema = valibot.object({
1139
+ type: valibot.literal("confirmInitialDeposit"),
1140
+ data: valibot.object({
1141
+ poolId: valibot.string(),
1142
+ assetASparkTransferId: valibot.string(),
1143
+ poolOwnerPublicKey: valibot.string(),
1144
+ nonce: valibot.string()
1145
+ })
1146
+ });
1147
+
1148
+ //#endregion
1149
+ //#region src/request/types/sparkMethods/flashnetMethods/intents/createConstantProductPool.ts
1150
+ const sparkFlashnetCreateConstantProductPoolIntentSchema = valibot.object({
1151
+ type: valibot.literal("createConstantProductPool"),
1152
+ data: valibot.object({
1153
+ poolOwnerPublicKey: valibot.string(),
1154
+ assetAAddress: valibot.string(),
1155
+ assetBAddress: valibot.string(),
1156
+ lpFeeRateBps: valibot.union([valibot.number(), valibot.string()]),
1157
+ totalHostFeeRateBps: valibot.union([valibot.number(), valibot.string()]),
1158
+ nonce: valibot.string()
1159
+ })
1160
+ });
1161
+
1162
+ //#endregion
1163
+ //#region src/request/types/sparkMethods/flashnetMethods/intents/createSingleSidedPool.ts
1164
+ const sparkFlashnetCreateSingleSidedPoolIntentSchema = valibot.object({
1165
+ type: valibot.literal("createSingleSidedPool"),
1166
+ data: valibot.object({
1167
+ assetAAddress: valibot.string(),
1168
+ assetBAddress: valibot.string(),
1169
+ assetAInitialReserve: valibot.string(),
1170
+ virtualReserveA: valibot.union([valibot.number(), valibot.string()]),
1171
+ virtualReserveB: valibot.union([valibot.number(), valibot.string()]),
1172
+ threshold: valibot.union([valibot.number(), valibot.string()]),
1173
+ lpFeeRateBps: valibot.union([valibot.number(), valibot.string()]),
1174
+ totalHostFeeRateBps: valibot.union([valibot.number(), valibot.string()]),
1175
+ poolOwnerPublicKey: valibot.string(),
1176
+ nonce: valibot.string()
1177
+ })
1178
+ });
1179
+
1180
+ //#endregion
1181
+ //#region src/request/types/sparkMethods/flashnetMethods/intents/removeLiquidity.ts
1182
+ const sparkFlashnetRemoveLiquidityIntentSchema = valibot.object({
1183
+ type: valibot.literal("removeLiquidity"),
1184
+ data: valibot.object({
1185
+ userPublicKey: valibot.string(),
1186
+ poolId: valibot.string(),
1187
+ lpTokensToRemove: valibot.string(),
1188
+ nonce: valibot.string()
1189
+ })
1190
+ });
1191
+
1192
+ //#endregion
1193
+ //#region src/request/types/sparkMethods/flashnetMethods/intents/routeSwap.ts
1194
+ const sparkFlashnetRouteSwapIntentSchema = valibot.object({
1195
+ type: valibot.literal("executeRouteSwap"),
1196
+ data: valibot.object({
1197
+ userPublicKey: valibot.string(),
1198
+ initialSparkTransferId: valibot.string(),
1199
+ hops: valibot.array(valibot.object({
1200
+ poolId: valibot.string(),
1201
+ inputAssetAddress: valibot.string(),
1202
+ outputAssetAddress: valibot.string(),
1203
+ hopIntegratorFeeRateBps: valibot.optional(valibot.union([valibot.number(), valibot.string()]))
1204
+ })),
1205
+ inputAmount: valibot.string(),
1206
+ maxRouteSlippageBps: valibot.union([valibot.number(), valibot.string()]),
1207
+ minAmountOut: valibot.string(),
1208
+ defaultIntegratorFeeRateBps: valibot.optional(valibot.union([valibot.number(), valibot.string()])),
1209
+ nonce: valibot.string()
1210
+ })
1211
+ });
1212
+
1213
+ //#endregion
1214
+ //#region src/request/types/sparkMethods/flashnetMethods/intents/swap.ts
1215
+ const sparkFlashnetSwapIntentSchema = valibot.object({
1216
+ type: valibot.literal("executeSwap"),
1217
+ data: valibot.object({
1218
+ userPublicKey: valibot.string(),
1219
+ poolId: valibot.string(),
1220
+ transferId: valibot.string(),
1221
+ assetInAddress: valibot.string(),
1222
+ assetOutAddress: valibot.string(),
1223
+ amountIn: valibot.string(),
1224
+ maxSlippageBps: valibot.union([valibot.number(), valibot.string()]),
1225
+ minAmountOut: valibot.string(),
1226
+ totalIntegratorFeeRateBps: valibot.optional(valibot.union([valibot.number(), valibot.string()])),
1227
+ nonce: valibot.string()
1228
+ })
1229
+ });
1230
+
1231
+ //#endregion
1232
+ //#region src/request/types/sparkMethods/flashnetMethods/signIntent.ts
1233
+ const sparkFlashnetSignIntentMethodName = "spark_flashnet_signIntent";
1234
+ const sparkFlashnetSignIntentParamsSchema = valibot.union([
1235
+ sparkFlashnetSwapIntentSchema,
1236
+ sparkFlashnetRouteSwapIntentSchema,
1237
+ sparkFlashnetAddLiquidityIntentSchema,
1238
+ sparkFlashnetClawbackIntentSchema,
1239
+ sparkFlashnetConfirmInitialDepositIntentSchema,
1240
+ sparkFlashnetCreateConstantProductPoolIntentSchema,
1241
+ sparkFlashnetCreateSingleSidedPoolIntentSchema,
1242
+ sparkFlashnetRemoveLiquidityIntentSchema
1243
+ ]);
1244
+ const sparkFlashnetSignIntentResultSchema = valibot.object({ signature: valibot.string() });
1245
+ const sparkFlashnetSignIntentRequestMessageSchema = valibot.object({
1246
+ ...rpcRequestMessageSchema.entries,
1247
+ ...valibot.object({
1248
+ method: valibot.literal(sparkFlashnetSignIntentMethodName),
1249
+ params: sparkFlashnetSignIntentParamsSchema,
1250
+ id: valibot.string()
1251
+ }).entries
1252
+ });
1253
+
1254
+ //#endregion
1255
+ //#region src/request/types/sparkMethods/flashnetMethods/signStructuredMessage.ts
1256
+ const sparkFlashnetSignStructuredMessageMethodName = "spark_flashnet_signStructuredMessage";
1257
+ const sparkFlashnetSignStructuredMessageParamsSchema = valibot.object({ message: valibot.string() });
1258
+ const sparkFlashnetSignStructuredMessageResultSchema = valibot.object({
1259
+ message: valibot.string(),
1260
+ signature: valibot.string()
1261
+ });
1262
+ const sparkFlashnetSignStructuredMessageRequestMessageSchema = valibot.object({
1263
+ ...rpcRequestMessageSchema.entries,
1264
+ ...valibot.object({
1265
+ method: valibot.literal(sparkFlashnetSignStructuredMessageMethodName),
1266
+ params: sparkFlashnetSignStructuredMessageParamsSchema,
1267
+ id: valibot.string()
1268
+ }).entries
1269
+ });
1270
+
1271
+ //#endregion
1272
+ //#region src/request/types/sparkMethods/getAddresses.ts
1273
+ const sparkGetAddressesMethodName = "spark_getAddresses";
1274
+ const sparkGetAddressesParamsSchema = valibot.nullish(valibot.object({ message: valibot.optional(valibot.string()) }));
1275
+ const sparkGetAddressesResultSchema = valibot.object({
1276
+ addresses: valibot.array(addressSchema),
1277
+ network: sparkNetworkSchema
1278
+ });
1279
+ const sparkGetAddressesRequestMessageSchema = valibot.object({
1280
+ ...rpcRequestMessageSchema.entries,
1281
+ ...valibot.object({
1282
+ method: valibot.literal(sparkGetAddressesMethodName),
1283
+ params: sparkGetAddressesParamsSchema,
1284
+ id: valibot.string()
1285
+ }).entries
1286
+ });
1287
+
1288
+ //#endregion
1289
+ //#region src/request/types/sparkMethods/getBalance.ts
1290
+ const sparkGetBalanceMethodName = "spark_getBalance";
1291
+ const sparkGetBalanceParamsSchema = valibot.nullish(valibot.null());
1292
+ const sparkGetBalanceResultSchema = valibot.object({
1293
+ balance: valibot.string(),
1294
+ tokenBalances: valibot.array(valibot.object({
1295
+ balance: valibot.string(),
1296
+ tokenMetadata: valibot.object({
1297
+ tokenIdentifier: valibot.string(),
1298
+ tokenName: valibot.string(),
1299
+ tokenTicker: valibot.string(),
1300
+ decimals: valibot.number(),
1301
+ maxSupply: valibot.string()
1302
+ })
1303
+ }))
1304
+ });
1305
+ const sparkGetBalanceRequestMessageSchema = valibot.object({
1306
+ ...rpcRequestMessageSchema.entries,
1307
+ ...valibot.object({
1308
+ method: valibot.literal(sparkGetBalanceMethodName),
1309
+ params: sparkGetBalanceParamsSchema,
1310
+ id: valibot.string()
1311
+ }).entries
1312
+ });
1313
+
1314
+ //#endregion
1315
+ //#region src/request/types/sparkMethods/signMessage.ts
1316
+ const sparkSignMessageMethodName = "spark_signMessage";
1317
+ const sparkSignMessageParamsSchema = valibot.object({ message: valibot.string() });
1318
+ const sparkSignMessageResultSchema = valibot.object({ signature: valibot.string() });
1319
+ const sparkSignMessageRequestMessageSchema = valibot.object({
1320
+ ...rpcRequestMessageSchema.entries,
1321
+ ...valibot.object({
1322
+ method: valibot.literal(sparkSignMessageMethodName),
1323
+ params: sparkSignMessageParamsSchema,
1324
+ id: valibot.string()
1325
+ }).entries
1326
+ });
1327
+
1328
+ //#endregion
1329
+ //#region src/request/types/sparkMethods/transfer.ts
1330
+ const sparkTransferMethodName = "spark_transfer";
1331
+ const sparkTransferParamsSchema = valibot.object({
1332
+ amountSats: valibot.union([valibot.number(), valibot.string()]),
1333
+ receiverSparkAddress: valibot.string()
1334
+ });
1335
+ const sparkTransferResultSchema = valibot.object({ id: valibot.string() });
1336
+ const sparkTransferRequestMessageSchema = valibot.object({
1337
+ ...rpcRequestMessageSchema.entries,
1338
+ ...valibot.object({
1339
+ method: valibot.literal(sparkTransferMethodName),
1340
+ params: sparkTransferParamsSchema,
1341
+ id: valibot.string()
1342
+ }).entries
1343
+ });
1344
+
1345
+ //#endregion
1346
+ //#region src/request/types/sparkMethods/transferToken.ts
1347
+ const sparkTransferTokenMethodName = "spark_transferToken";
1348
+ const sparkTransferTokenParamsSchema = valibot.object({
1349
+ tokenAmount: valibot.union([valibot.number(), valibot.string()]),
1350
+ tokenIdentifier: valibot.string(),
1351
+ receiverSparkAddress: valibot.string()
1352
+ });
1353
+ const sparkTransferTokenResultSchema = valibot.object({ id: valibot.string() });
1354
+ const sparkTransferTokenRequestMessageSchema = valibot.object({
1355
+ ...rpcRequestMessageSchema.entries,
1356
+ ...valibot.object({
1357
+ method: valibot.literal(sparkTransferTokenMethodName),
1358
+ params: sparkTransferTokenParamsSchema,
1359
+ id: valibot.string()
1360
+ }).entries
1361
+ });
1362
+
1363
+ //#endregion
1364
+ //#region src/request/types/stxMethods/callContract.ts
1365
+ const stxCallContractMethodName = "stx_callContract";
1366
+ const stxCallContractParamsSchema = valibot.object({
1367
+ contract: valibot.string(),
1368
+ functionName: valibot.string(),
1369
+ arguments: valibot.optional(valibot.array(valibot.string())),
1370
+ functionArgs: valibot.optional(valibot.array(valibot.string())),
1371
+ postConditions: valibot.optional(valibot.array(valibot.string())),
1372
+ postConditionMode: valibot.optional(valibot.union([valibot.literal("allow"), valibot.literal("deny")]))
1373
+ });
1374
+ const stxCallContractResultSchema = valibot.object({
1375
+ txid: valibot.string(),
1376
+ transaction: valibot.string()
1377
+ });
1378
+ const stxCallContractRequestMessageSchema = valibot.object({
1379
+ ...rpcRequestMessageSchema.entries,
1380
+ ...valibot.object({
1381
+ method: valibot.literal(stxCallContractMethodName),
1382
+ params: stxCallContractParamsSchema,
1383
+ id: valibot.string()
1384
+ }).entries
1385
+ });
1386
+
1387
+ //#endregion
1388
+ //#region src/request/types/stxMethods/deployContract.ts
1389
+ const stxDeployContractMethodName = "stx_deployContract";
1390
+ const stxDeployContractParamsSchema = valibot.object({
1391
+ name: valibot.string(),
1392
+ clarityCode: valibot.string(),
1393
+ clarityVersion: valibot.optional(valibot.number()),
1394
+ postConditions: valibot.optional(valibot.array(valibot.string())),
1395
+ postConditionMode: valibot.optional(valibot.union([valibot.literal("allow"), valibot.literal("deny")]))
1396
+ });
1397
+ const stxDeployContractResultSchema = valibot.object({
1398
+ txid: valibot.string(),
1399
+ transaction: valibot.string()
1400
+ });
1401
+ const stxDeployContractRequestMessageSchema = valibot.object({
1402
+ ...rpcRequestMessageSchema.entries,
1403
+ ...valibot.object({
1404
+ method: valibot.literal(stxDeployContractMethodName),
1405
+ params: stxDeployContractParamsSchema,
1406
+ id: valibot.string()
1407
+ }).entries
1408
+ });
1409
+
1410
+ //#endregion
1411
+ //#region src/request/types/stxMethods/getAccounts.ts
1412
+ const stxGetAccountsMethodName = "stx_getAccounts";
1413
+ const stxGetAccountsParamsSchema = valibot.nullish(valibot.null());
1414
+ const stxGetAccountsResultSchema = valibot.object({
1415
+ addresses: valibot.array(valibot.object({
1416
+ address: valibot.string(),
1417
+ publicKey: valibot.string(),
1418
+ gaiaHubUrl: valibot.string(),
1419
+ gaiaAppKey: valibot.string()
1420
+ })),
1421
+ network: getNetworkResultSchema
1422
+ });
1423
+ const stxGetAccountsRequestMessageSchema = valibot.object({
1424
+ ...rpcRequestMessageSchema.entries,
1425
+ ...valibot.object({
1426
+ method: valibot.literal(stxGetAccountsMethodName),
1427
+ params: stxGetAccountsParamsSchema,
1428
+ id: valibot.string()
1429
+ }).entries
1430
+ });
1431
+
1432
+ //#endregion
1433
+ //#region src/request/types/stxMethods/getAddresses.ts
1434
+ const stxGetAddressesMethodName = "stx_getAddresses";
1435
+ const stxGetAddressesParamsSchema = valibot.nullish(valibot.object({ message: valibot.optional(valibot.string()) }));
1436
+ const stxGetAddressesResultSchema = valibot.object({
1437
+ addresses: valibot.array(addressSchema),
1438
+ network: stacksNetworkSchema
1439
+ });
1440
+ const stxGetAddressesRequestMessageSchema = valibot.object({
1441
+ ...rpcRequestMessageSchema.entries,
1442
+ ...valibot.object({
1443
+ method: valibot.literal(stxGetAddressesMethodName),
1444
+ params: stxGetAddressesParamsSchema,
1445
+ id: valibot.string()
1446
+ }).entries
1447
+ });
1448
+
1449
+ //#endregion
1450
+ //#region src/request/types/stxMethods/signMessage.ts
1451
+ const stxSignMessageMethodName = "stx_signMessage";
1452
+ const stxSignMessageParamsSchema = valibot.object({ message: valibot.string() });
1453
+ const stxSignMessageResultSchema = valibot.object({
1454
+ signature: valibot.string(),
1455
+ publicKey: valibot.string()
1456
+ });
1457
+ const stxSignMessageRequestMessageSchema = valibot.object({
1458
+ ...rpcRequestMessageSchema.entries,
1459
+ ...valibot.object({
1460
+ method: valibot.literal(stxSignMessageMethodName),
1461
+ params: stxSignMessageParamsSchema,
1462
+ id: valibot.string()
1463
+ }).entries
1464
+ });
1465
+
1466
+ //#endregion
1467
+ //#region src/request/types/stxMethods/signStructuredMessage.ts
1468
+ const stxSignStructuredMessageMethodName = "stx_signStructuredMessage";
1469
+ const stxSignStructuredMessageParamsSchema = valibot.object({
1470
+ domain: valibot.string(),
1471
+ message: valibot.string(),
1472
+ publicKey: valibot.optional(valibot.string())
1473
+ });
1474
+ const stxSignStructuredMessageResultSchema = valibot.object({
1475
+ signature: valibot.string(),
1476
+ publicKey: valibot.string()
1477
+ });
1478
+ const stxSignStructuredMessageRequestMessageSchema = valibot.object({
1479
+ ...rpcRequestMessageSchema.entries,
1480
+ ...valibot.object({
1481
+ method: valibot.literal(stxSignStructuredMessageMethodName),
1482
+ params: stxSignStructuredMessageParamsSchema,
1483
+ id: valibot.string()
1484
+ }).entries
1485
+ });
1486
+
1487
+ //#endregion
1488
+ //#region src/request/types/stxMethods/signTransaction.ts
1489
+ const stxSignTransactionMethodName = "stx_signTransaction";
1490
+ const stxSignTransactionParamsSchema = valibot.object({
1491
+ transaction: valibot.string(),
1492
+ pubkey: valibot.optional(valibot.string()),
1493
+ broadcast: valibot.optional(valibot.boolean())
1494
+ });
1495
+ const stxSignTransactionResultSchema = valibot.object({ transaction: valibot.string() });
1496
+ const stxSignTransactionRequestMessageSchema = valibot.object({
1497
+ ...rpcRequestMessageSchema.entries,
1498
+ ...valibot.object({
1499
+ method: valibot.literal(stxSignTransactionMethodName),
1500
+ params: stxSignTransactionParamsSchema,
1501
+ id: valibot.string()
1502
+ }).entries
1503
+ });
1504
+
1505
+ //#endregion
1506
+ //#region src/request/types/stxMethods/signTransactions.ts
1507
+ const stxSignTransactionsMethodName = "stx_signTransactions";
1508
+ const stxSignTransactionsParamsSchema = valibot.object({
1509
+ transactions: valibot.pipe(valibot.array(valibot.pipe(valibot.string(), valibot.check((hex) => {
1510
+ return true;
1511
+ }, "Invalid hex-encoded Stacks transaction."))), valibot.minLength(1)),
1512
+ broadcast: valibot.optional(valibot.boolean())
1513
+ });
1514
+ const stxSignTransactionsResultSchema = valibot.object({ transactions: valibot.array(valibot.string()) });
1515
+ const stxSignTransactionsRequestMessageSchema = valibot.object({
1516
+ ...rpcRequestMessageSchema.entries,
1517
+ ...valibot.object({
1518
+ method: valibot.literal(stxSignTransactionsMethodName),
1519
+ params: stxSignTransactionsParamsSchema,
1520
+ id: valibot.string()
1521
+ }).entries
1522
+ });
1523
+
1524
+ //#endregion
1525
+ //#region src/request/types/stxMethods/transferStx.ts
1526
+ const stxTransferStxMethodName = "stx_transferStx";
1527
+ const stxTransferStxParamsSchema = valibot.object({
1528
+ amount: valibot.union([valibot.number(), valibot.string()]),
1529
+ recipient: valibot.string(),
1530
+ memo: valibot.optional(valibot.string()),
1531
+ version: valibot.optional(valibot.string()),
1532
+ postConditionMode: valibot.optional(valibot.number()),
1533
+ postConditions: valibot.optional(valibot.array(valibot.string())),
1534
+ pubkey: valibot.optional(valibot.string())
1535
+ });
1536
+ const stxTransferStxResultSchema = valibot.object({
1537
+ txid: valibot.string(),
1538
+ transaction: valibot.string()
1539
+ });
1540
+ const stxTransferStxRequestMessageSchema = valibot.object({
1541
+ ...rpcRequestMessageSchema.entries,
1542
+ ...valibot.object({
1543
+ method: valibot.literal(stxTransferStxMethodName),
1544
+ params: stxTransferStxParamsSchema,
1545
+ id: valibot.string()
1546
+ }).entries
1547
+ });
1548
+
1549
+ //#endregion
1550
+ //#region src/request/index.ts
1551
+ const cache = {};
1552
+ const requestInternal = async (provider, method, params) => {
1553
+ const response = await provider.request(method, params);
1554
+ if (valibot.is(rpcErrorResponseMessageSchema, response)) return {
1555
+ status: "error",
1556
+ error: response.error
1557
+ };
1558
+ if (valibot.is(rpcSuccessResponseMessageSchema, response)) return {
1559
+ status: "success",
1560
+ result: response.result
1561
+ };
1562
+ return {
1563
+ status: "error",
1564
+ error: {
1565
+ code: RpcErrorCode.INTERNAL_ERROR,
1566
+ message: "Received unknown response from provider.",
1567
+ data: response
1568
+ }
1569
+ };
1570
+ };
1571
+ const request = async (method, params, providerId) => {
1572
+ let provider = window.XverseProviders?.BitcoinProvider || window.BitcoinProvider;
1573
+ if (providerId) provider = await getProviderById(providerId);
1574
+ if (!provider) throw new Error("no wallet provider was found");
1575
+ if (!method) throw new Error("A wallet method is required");
1576
+ if (!cache.providerInfo) {
1577
+ const infoResult = await requestInternal(provider, "getInfo", null);
1578
+ if (infoResult.status === "success") cache.providerInfo = infoResult.result;
1579
+ }
1580
+ if (cache.providerInfo) {
1581
+ if (method === "getInfo") return {
1582
+ status: "success",
1583
+ result: cache.providerInfo
1584
+ };
1585
+ const sanitized = sanitizeRequest(method, params, cache.providerInfo);
1586
+ if (sanitized.overrideResponse) return sanitized.overrideResponse;
1587
+ method = sanitized.method;
1588
+ params = sanitized.params;
1589
+ }
1590
+ return requestInternal(provider, method, params);
1591
+ };
1592
+ /**
1593
+ * Adds an event listener.
1594
+ *
1595
+ * Currently expects 2 arguments, although is also capable of handling legacy
1596
+ * calls with 3 arguments consisting of:
1597
+ *
1598
+ * - event name (string)
1599
+ * - callback (function)
1600
+ * - provider ID (optional string)
1601
+ */
1602
+ const addListener = (...rawArgs) => {
1603
+ const [listenerInfo, providerId] = (() => {
1604
+ if (rawArgs.length === 1) return [rawArgs[0], void 0];
1605
+ if (rawArgs.length === 2) if (typeof rawArgs[1] === "function") return [{
1606
+ eventName: rawArgs[0],
1607
+ cb: rawArgs[1]
1608
+ }, void 0];
1609
+ else return rawArgs;
1610
+ if (rawArgs.length === 3) return [{
1611
+ eventName: rawArgs[0],
1612
+ cb: rawArgs[1]
1613
+ }, rawArgs[2]];
1614
+ throw new Error("Unexpected number of arguments. Expecting 2 (or 3 for legacy requests).", { cause: rawArgs });
1615
+ })();
1616
+ let provider = window.XverseProviders?.BitcoinProvider || window.BitcoinProvider;
1617
+ if (providerId) provider = getProviderById(providerId);
1618
+ if (!provider) throw new Error("no wallet provider was found");
1619
+ if (!provider.addListener) {
1620
+ console.error(`The wallet provider you are using does not support the addListener method. Please update your wallet provider.`);
1621
+ return () => {};
1622
+ }
1623
+ return provider.addListener(listenerInfo);
1624
+ };
1625
+
1626
+ //#endregion
1627
+ //#region src/runes/api.ts
1628
+ const urlNetworkSuffix = {
1629
+ [BitcoinNetworkType.Mainnet]: "",
1630
+ [BitcoinNetworkType.Testnet]: "-testnet",
1631
+ [BitcoinNetworkType.Testnet4]: "-testnet4",
1632
+ [BitcoinNetworkType.Signet]: "-signet"
1633
+ };
1634
+ const ORDINALS_API_BASE_URL = (network = BitcoinNetworkType.Mainnet) => {
1635
+ if (network === BitcoinNetworkType.Regtest) throw new Error(`Ordinals API does not support ${network} network`);
1636
+ return `https://ordinals${urlNetworkSuffix[network]}.xverse.app/v1`;
1637
+ };
1638
+ var RunesApi = class {
1639
+ client;
1640
+ constructor(network) {
1641
+ this.client = axios.default.create({ baseURL: ORDINALS_API_BASE_URL(network) });
1642
+ }
1643
+ parseError = (error) => {
1644
+ return {
1645
+ code: error.response?.status,
1646
+ message: JSON.stringify(error.response?.data)
1647
+ };
1648
+ };
1649
+ estimateMintCost = async (mintParams) => {
1650
+ try {
1651
+ return { data: (await this.client.post("/runes/mint/estimate", { ...mintParams })).data };
1652
+ } catch (error) {
1653
+ const err = error;
1654
+ return { error: this.parseError(err) };
1655
+ }
1656
+ };
1657
+ estimateEtchCost = async (etchParams) => {
1658
+ try {
1659
+ return { data: (await this.client.post("/runes/etch/estimate", { ...etchParams })).data };
1660
+ } catch (error) {
1661
+ const err = error;
1662
+ return { error: this.parseError(err) };
1663
+ }
1664
+ };
1665
+ createMintOrder = async (mintOrderParams) => {
1666
+ try {
1667
+ return { data: (await this.client.post("/runes/mint/orders", { ...mintOrderParams })).data };
1668
+ } catch (error) {
1669
+ const err = error;
1670
+ return { error: this.parseError(err) };
1671
+ }
1672
+ };
1673
+ createEtchOrder = async (etchOrderParams) => {
1674
+ try {
1675
+ return { data: (await this.client.post("/runes/etch/orders", { ...etchOrderParams })).data };
1676
+ } catch (error) {
1677
+ const err = error;
1678
+ return { error: this.parseError(err) };
1679
+ }
1680
+ };
1681
+ executeMint = async (orderId, fundTransactionId) => {
1682
+ try {
1683
+ return { data: (await this.client.post(`/runes/mint/orders/${orderId}/execute`, { fundTransactionId })).data };
1684
+ } catch (error) {
1685
+ const err = error;
1686
+ return { error: this.parseError(err) };
1687
+ }
1688
+ };
1689
+ executeEtch = async (orderId, fundTransactionId) => {
1690
+ try {
1691
+ return { data: (await this.client.post(`/runes/etch/orders/${orderId}/execute`, { fundTransactionId })).data };
1692
+ } catch (error) {
1693
+ const err = error;
1694
+ return { error: this.parseError(err) };
1695
+ }
1696
+ };
1697
+ getOrder = async (orderId) => {
1698
+ try {
1699
+ return { data: (await this.client.get(`/orders/${orderId}`)).data };
1700
+ } catch (error) {
1701
+ const err = error;
1702
+ return { error: this.parseError(err) };
1703
+ }
1704
+ };
1705
+ rbfOrder = async (rbfRequest) => {
1706
+ const { orderId, newFeeRate } = rbfRequest;
1707
+ try {
1708
+ return { data: (await this.client.post(`/orders/${orderId}/rbf-estimate`, { newFeeRate })).data };
1709
+ } catch (error) {
1710
+ const err = error;
1711
+ return { error: this.parseError(err) };
1712
+ }
1713
+ };
1714
+ };
1715
+ const clients = {};
1716
+ const getRunesApiClient = (network = BitcoinNetworkType.Mainnet) => {
1717
+ if (!clients[network]) clients[network] = new RunesApi(network);
1718
+ return clients[network];
1719
+ };
1720
+
1721
+ //#endregion
1722
+ //#region src/adapters/satsConnectAdapter.ts
1723
+ var SatsConnectAdapter = class {
1724
+ async mintRunes(params) {
1725
+ try {
1726
+ const walletInfo = await this.requestInternal("getInfo", null).catch(() => null);
1727
+ if (walletInfo && walletInfo.status === "success") {
1728
+ if (walletInfo.result.methods?.includes("runes_mint")) {
1729
+ const response = await this.requestInternal("runes_mint", params);
1730
+ if (response) {
1731
+ if (response.status === "success") return response;
1732
+ if (response.status === "error" && response.error.code !== RpcErrorCode.METHOD_NOT_FOUND) return response;
1733
+ }
1734
+ }
1735
+ }
1736
+ const mintRequest = {
1737
+ destinationAddress: params.destinationAddress,
1738
+ feeRate: params.feeRate,
1739
+ refundAddress: params.refundAddress,
1740
+ repeats: params.repeats,
1741
+ runeName: params.runeName,
1742
+ appServiceFee: params.appServiceFee,
1743
+ appServiceFeeAddress: params.appServiceFeeAddress
1744
+ };
1745
+ const orderResponse = await new RunesApi(params.network).createMintOrder(mintRequest);
1746
+ if (!orderResponse.data) return {
1747
+ status: "error",
1748
+ error: {
1749
+ code: orderResponse.error.code === 400 ? RpcErrorCode.INVALID_REQUEST : RpcErrorCode.INTERNAL_ERROR,
1750
+ message: orderResponse.error.message
1751
+ }
1752
+ };
1753
+ const paymentResponse = await this.requestInternal("sendTransfer", { recipients: [{
1754
+ address: orderResponse.data.fundAddress,
1755
+ amount: orderResponse.data.fundAmount
1756
+ }] });
1757
+ if (paymentResponse.status !== "success") return paymentResponse;
1758
+ await new RunesApi(params.network).executeMint(orderResponse.data.orderId, paymentResponse.result.txid);
1759
+ return {
1760
+ status: "success",
1761
+ result: {
1762
+ orderId: orderResponse.data.orderId,
1763
+ fundTransactionId: paymentResponse.result.txid,
1764
+ fundingAddress: orderResponse.data.fundAddress
1765
+ }
1766
+ };
1767
+ } catch (error) {
1768
+ return {
1769
+ status: "error",
1770
+ error: {
1771
+ code: RpcErrorCode.INTERNAL_ERROR,
1772
+ message: error.message
1773
+ }
1774
+ };
1775
+ }
1776
+ }
1777
+ async etchRunes(params) {
1778
+ const etchRequest = {
1779
+ destinationAddress: params.destinationAddress,
1780
+ refundAddress: params.refundAddress,
1781
+ feeRate: params.feeRate,
1782
+ runeName: params.runeName,
1783
+ divisibility: params.divisibility,
1784
+ symbol: params.symbol,
1785
+ premine: params.premine,
1786
+ isMintable: params.isMintable,
1787
+ terms: params.terms,
1788
+ inscriptionDetails: params.inscriptionDetails,
1789
+ delegateInscriptionId: params.delegateInscriptionId,
1790
+ appServiceFee: params.appServiceFee,
1791
+ appServiceFeeAddress: params.appServiceFeeAddress
1792
+ };
1793
+ try {
1794
+ const walletInfo = await this.requestInternal("getInfo", null).catch(() => null);
1795
+ if (walletInfo && walletInfo.status === "success") {
1796
+ if (walletInfo.result.methods?.includes("runes_etch")) {
1797
+ const response = await this.requestInternal("runes_etch", params);
1798
+ if (response) {
1799
+ if (response.status === "success") return response;
1800
+ if (response.status === "error" && response.error.code !== RpcErrorCode.METHOD_NOT_FOUND) return response;
1801
+ }
1802
+ }
1803
+ }
1804
+ const orderResponse = await new RunesApi(params.network).createEtchOrder(etchRequest);
1805
+ if (!orderResponse.data) return {
1806
+ status: "error",
1807
+ error: {
1808
+ code: orderResponse.error.code === 400 ? RpcErrorCode.INVALID_REQUEST : RpcErrorCode.INTERNAL_ERROR,
1809
+ message: orderResponse.error.message
1810
+ }
1811
+ };
1812
+ const paymentResponse = await this.requestInternal("sendTransfer", { recipients: [{
1813
+ address: orderResponse.data.fundAddress,
1814
+ amount: orderResponse.data.fundAmount
1815
+ }] });
1816
+ if (paymentResponse.status !== "success") return paymentResponse;
1817
+ await new RunesApi(params.network).executeEtch(orderResponse.data.orderId, paymentResponse.result.txid);
1818
+ return {
1819
+ status: "success",
1820
+ result: {
1821
+ orderId: orderResponse.data.orderId,
1822
+ fundTransactionId: paymentResponse.result.txid,
1823
+ fundingAddress: orderResponse.data.fundAddress
1824
+ }
1825
+ };
1826
+ } catch (error) {
1827
+ return {
1828
+ status: "error",
1829
+ error: {
1830
+ code: RpcErrorCode.INTERNAL_ERROR,
1831
+ message: error.message
1832
+ }
1833
+ };
1834
+ }
1835
+ }
1836
+ async estimateMint(params) {
1837
+ const estimateMintRequest = {
1838
+ destinationAddress: params.destinationAddress,
1839
+ feeRate: params.feeRate,
1840
+ repeats: params.repeats,
1841
+ runeName: params.runeName,
1842
+ appServiceFee: params.appServiceFee,
1843
+ appServiceFeeAddress: params.appServiceFeeAddress
1844
+ };
1845
+ const response = await getRunesApiClient(params.network).estimateMintCost(estimateMintRequest);
1846
+ if (response.data) return {
1847
+ status: "success",
1848
+ result: response.data
1849
+ };
1850
+ return {
1851
+ status: "error",
1852
+ error: {
1853
+ code: response.error.code === 400 ? RpcErrorCode.INVALID_REQUEST : RpcErrorCode.INTERNAL_ERROR,
1854
+ message: response.error.message
1855
+ }
1856
+ };
1857
+ }
1858
+ async estimateEtch(params) {
1859
+ const estimateEtchRequest = {
1860
+ destinationAddress: params.destinationAddress,
1861
+ feeRate: params.feeRate,
1862
+ runeName: params.runeName,
1863
+ divisibility: params.divisibility,
1864
+ symbol: params.symbol,
1865
+ premine: params.premine,
1866
+ isMintable: params.isMintable,
1867
+ terms: params.terms,
1868
+ inscriptionDetails: params.inscriptionDetails,
1869
+ delegateInscriptionId: params.delegateInscriptionId,
1870
+ appServiceFee: params.appServiceFee,
1871
+ appServiceFeeAddress: params.appServiceFeeAddress
1872
+ };
1873
+ const response = await getRunesApiClient(params.network).estimateEtchCost(estimateEtchRequest);
1874
+ if (response.data) return {
1875
+ status: "success",
1876
+ result: response.data
1877
+ };
1878
+ return {
1879
+ status: "error",
1880
+ error: {
1881
+ code: response.error.code === 400 ? RpcErrorCode.INVALID_REQUEST : RpcErrorCode.INTERNAL_ERROR,
1882
+ message: response.error.message
1883
+ }
1884
+ };
1885
+ }
1886
+ async getOrder(params) {
1887
+ const response = await getRunesApiClient(params.network).getOrder(params.id);
1888
+ if (response.data) return {
1889
+ status: "success",
1890
+ result: response.data
1891
+ };
1892
+ return {
1893
+ status: "error",
1894
+ error: {
1895
+ code: response.error.code === 400 || response.error.code === 404 ? RpcErrorCode.INVALID_REQUEST : RpcErrorCode.INTERNAL_ERROR,
1896
+ message: response.error.message
1897
+ }
1898
+ };
1899
+ }
1900
+ async estimateRbfOrder(params) {
1901
+ const rbfOrderRequest = {
1902
+ newFeeRate: params.newFeeRate,
1903
+ orderId: params.orderId
1904
+ };
1905
+ const response = await getRunesApiClient(params.network).rbfOrder(rbfOrderRequest);
1906
+ if (response.data) return {
1907
+ status: "success",
1908
+ result: {
1909
+ fundingAddress: response.data.fundingAddress,
1910
+ rbfCost: response.data.rbfCost
1911
+ }
1912
+ };
1913
+ return {
1914
+ status: "error",
1915
+ error: {
1916
+ code: response.error.code === 400 || response.error.code === 404 ? RpcErrorCode.INVALID_REQUEST : RpcErrorCode.INTERNAL_ERROR,
1917
+ message: response.error.message
1918
+ }
1919
+ };
1920
+ }
1921
+ async rbfOrder(params) {
1922
+ try {
1923
+ const rbfOrderRequest = {
1924
+ newFeeRate: params.newFeeRate,
1925
+ orderId: params.orderId
1926
+ };
1927
+ const orderResponse = await getRunesApiClient(params.network).rbfOrder(rbfOrderRequest);
1928
+ if (!orderResponse.data) return {
1929
+ status: "error",
1930
+ error: {
1931
+ code: orderResponse.error.code === 400 || orderResponse.error.code === 404 ? RpcErrorCode.INVALID_REQUEST : RpcErrorCode.INTERNAL_ERROR,
1932
+ message: orderResponse.error.message
1933
+ }
1934
+ };
1935
+ const paymentResponse = await this.requestInternal("sendTransfer", { recipients: [{
1936
+ address: orderResponse.data.fundingAddress,
1937
+ amount: orderResponse.data.rbfCost
1938
+ }] });
1939
+ if (paymentResponse.status !== "success") return paymentResponse;
1940
+ return {
1941
+ status: "success",
1942
+ result: {
1943
+ fundingAddress: orderResponse.data.fundingAddress,
1944
+ orderId: rbfOrderRequest.orderId,
1945
+ fundRBFTransactionId: paymentResponse.result.txid
1946
+ }
1947
+ };
1948
+ } catch (error) {
1949
+ return {
1950
+ status: "error",
1951
+ error: {
1952
+ code: RpcErrorCode.INTERNAL_ERROR,
1953
+ message: error.message
1954
+ }
1955
+ };
1956
+ }
1957
+ }
1958
+ async request(method, params) {
1959
+ switch (method) {
1960
+ case "runes_mint": return this.mintRunes(params);
1961
+ case "runes_etch": return this.etchRunes(params);
1962
+ case "runes_estimateMint": return this.estimateMint(params);
1963
+ case "runes_estimateEtch": return this.estimateEtch(params);
1964
+ case "runes_getOrder": return this.getOrder(params);
1965
+ case "runes_estimateRbfOrder": return this.estimateRbfOrder(params);
1966
+ case "runes_rbfOrder": return this.rbfOrder(params);
1967
+ default: return this.requestInternal(method, params);
1968
+ }
1969
+ }
1970
+ };
1971
+
1972
+ //#endregion
1973
+ //#region src/adapters/xverse.ts
1974
+ var XverseAdapter = class extends SatsConnectAdapter {
1975
+ id = DefaultAdaptersInfo.xverse.id;
1976
+ requestInternal = async (method, params) => {
1977
+ return request(method, params, this.id);
1978
+ };
1979
+ addListener = (listenerInfo) => {
1980
+ return addListener(listenerInfo, this.id);
1981
+ };
1982
+ };
1983
+
1984
+ //#endregion
1985
+ //#region src/adapters/unisat.ts
1986
+ function convertSignInputsToInputType(signInputs) {
1987
+ let result = [];
1988
+ if (!signInputs) return result;
1989
+ for (let address in signInputs) {
1990
+ let indexes = signInputs[address];
1991
+ for (let index of indexes) result.push({
1992
+ index,
1993
+ address
1994
+ });
1995
+ }
1996
+ return result;
1997
+ }
1998
+ var UnisatAdapter = class extends SatsConnectAdapter {
1999
+ id = DefaultAdaptersInfo.unisat.id;
2000
+ async getAccounts(params) {
2001
+ const { purposes } = params;
2002
+ if (purposes.includes(AddressPurpose.Stacks) || purposes.includes(AddressPurpose.Starknet) || purposes.includes(AddressPurpose.Spark)) throw new Error("Only bitcoin addresses are supported");
2003
+ const accounts = await window.unisat.requestAccounts();
2004
+ const publicKey = await window.unisat.getPublicKey();
2005
+ const address = accounts[0];
2006
+ const addressType = (0, bitcoin_address_validation.getAddressInfo)(accounts[0]).type;
2007
+ const pk = addressType === bitcoin_address_validation.AddressType.p2tr ? publicKey.slice(2) : publicKey;
2008
+ const paymentAddress = {
2009
+ address,
2010
+ publicKey: pk,
2011
+ addressType,
2012
+ purpose: AddressPurpose.Payment,
2013
+ walletType: "software"
2014
+ };
2015
+ const ordinalsAddress = {
2016
+ address,
2017
+ publicKey: pk,
2018
+ addressType,
2019
+ purpose: AddressPurpose.Ordinals,
2020
+ walletType: "software"
2021
+ };
2022
+ const response = [];
2023
+ if (purposes.includes(AddressPurpose.Payment)) response.push({
2024
+ ...paymentAddress,
2025
+ walletType: "software"
2026
+ });
2027
+ if (purposes.includes(AddressPurpose.Ordinals)) response.push({
2028
+ ...ordinalsAddress,
2029
+ walletType: "software"
2030
+ });
2031
+ return response;
2032
+ }
2033
+ async signMessage(params) {
2034
+ const { message, address } = params;
2035
+ const addressType = (0, bitcoin_address_validation.getAddressInfo)(address).type;
2036
+ if ([bitcoin_address_validation.AddressType.p2wpkh, bitcoin_address_validation.AddressType.p2tr].includes(addressType)) return {
2037
+ address,
2038
+ messageHash: "",
2039
+ signature: await window.unisat.signMessage(message, "bip322-simple"),
2040
+ protocol: MessageSigningProtocols.BIP322
2041
+ };
2042
+ return {
2043
+ address,
2044
+ messageHash: "",
2045
+ signature: await window.unisat.signMessage(message, "ecdsa"),
2046
+ protocol: MessageSigningProtocols.ECDSA
2047
+ };
2048
+ }
2049
+ async sendTransfer(params) {
2050
+ const { recipients } = params;
2051
+ if (recipients.length > 1) throw new Error("Only one recipient is supported by this wallet provider");
2052
+ return { txid: await window.unisat.sendBitcoin(recipients[0].address, recipients[0].amount) };
2053
+ }
2054
+ async signPsbt(params) {
2055
+ const { psbt, signInputs, broadcast } = params;
2056
+ const psbtHex = buffer.Buffer.from(psbt, "base64").toString("hex");
2057
+ const signedPsbt = await window.unisat.signPsbt(psbtHex, {
2058
+ autoFinalized: broadcast,
2059
+ toSignInputs: convertSignInputsToInputType(signInputs)
2060
+ });
2061
+ const signedPsbtBase64 = buffer.Buffer.from(signedPsbt, "hex").toString("base64");
2062
+ let txid;
2063
+ if (broadcast) txid = await window.unisat.pushPsbt(signedPsbt);
2064
+ return {
2065
+ psbt: signedPsbtBase64,
2066
+ txid
2067
+ };
2068
+ }
2069
+ requestInternal = async (method, params) => {
2070
+ try {
2071
+ switch (method) {
2072
+ case "getAccounts": return {
2073
+ status: "success",
2074
+ result: await this.getAccounts(params)
2075
+ };
2076
+ case "sendTransfer": return {
2077
+ status: "success",
2078
+ result: await this.sendTransfer(params)
2079
+ };
2080
+ case "signMessage": return {
2081
+ status: "success",
2082
+ result: await this.signMessage(params)
2083
+ };
2084
+ case "signPsbt": return {
2085
+ status: "success",
2086
+ result: await this.signPsbt(params)
2087
+ };
2088
+ default: {
2089
+ const error = {
2090
+ code: RpcErrorCode.METHOD_NOT_SUPPORTED,
2091
+ message: "Method not supported by the selected wallet"
2092
+ };
2093
+ console.error("Error calling the method", error);
2094
+ return {
2095
+ status: "error",
2096
+ error
2097
+ };
2098
+ }
2099
+ }
2100
+ } catch (error) {
2101
+ console.error("Error calling the method", error);
2102
+ return {
2103
+ status: "error",
2104
+ error: {
2105
+ code: error.code === 4001 ? RpcErrorCode.USER_REJECTION : RpcErrorCode.INTERNAL_ERROR,
2106
+ message: error.message ? error.message : "Wallet method call error",
2107
+ data: error
2108
+ }
2109
+ };
2110
+ }
2111
+ };
2112
+ addListener = ({ eventName, cb }) => {
2113
+ switch (eventName) {
2114
+ case "accountChange": {
2115
+ const handler = () => {
2116
+ cb({ type: "accountChange" });
2117
+ };
2118
+ window.unisat.on("accountsChanged", handler);
2119
+ return () => {
2120
+ window.unisat.removeListener("accountsChanged", handler);
2121
+ };
2122
+ }
2123
+ case "networkChange": {
2124
+ const handler = () => {
2125
+ cb({ type: "networkChange" });
2126
+ };
2127
+ window.unisat.on("networkChanged", handler);
2128
+ return () => {
2129
+ window.unisat.removeListener("networkChanged", handler);
2130
+ };
2131
+ }
2132
+ default:
2133
+ console.error("Event not supported by the selected wallet");
2134
+ return () => {};
2135
+ }
2136
+ };
2137
+ };
2138
+
2139
+ //#endregion
2140
+ //#region src/adapters/fordefi.ts
2141
+ var FordefiAdapter = class extends SatsConnectAdapter {
2142
+ id = DefaultAdaptersInfo.fordefi.id;
2143
+ requestInternal = async (method, params) => {
2144
+ const provider = getProviderById(this.id);
2145
+ if (!provider) throw new Error("no wallet provider was found");
2146
+ if (!method) throw new Error("A wallet method is required");
2147
+ return await provider.request(method, params);
2148
+ };
2149
+ addListener = ({ eventName, cb }) => {
2150
+ const provider = getProviderById(this.id);
2151
+ if (!provider) throw new Error("no wallet provider was found");
2152
+ if (!provider.addListener) {
2153
+ console.error(`The wallet provider you are using does not support the addListener method. Please update your wallet provider.`);
2154
+ return () => {};
2155
+ }
2156
+ return provider.addListener(eventName, cb);
2157
+ };
2158
+ };
2159
+
2160
+ //#endregion
2161
+ //#region src/adapters/BaseAdapter.ts
2162
+ var BaseAdapter = class extends SatsConnectAdapter {
2163
+ id = "";
2164
+ constructor(providerId) {
2165
+ super();
2166
+ this.id = providerId;
2167
+ }
2168
+ requestInternal = async (method, params) => {
2169
+ return request(method, params, this.id);
2170
+ };
2171
+ addListener = (..._args) => {
2172
+ throw new Error("Method not supported for `BaseAdapter`.");
2173
+ };
2174
+ };
2175
+
2176
+ //#endregion
2177
+ //#region src/adapters/index.ts
2178
+ const DefaultAdaptersInfo = {
2179
+ fordefi: {
2180
+ id: "FordefiProviders.UtxoProvider",
2181
+ name: "Fordefi",
2182
+ webUrl: "https://www.fordefi.com/",
2183
+ chromeWebStoreUrl: "https://chromewebstore.google.com/detail/fordefi/hcmehenccjdmfbojapcbcofkgdpbnlle",
2184
+ icon: "data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjQiIGhlaWdodD0iMjQiIHZpZXdCb3g9IjAgMCAyNCAyNCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPGcgY2xpcC1wYXRoPSJ1cmwoI2NsaXAwXzEzNDk0XzY2MjU0KSI+CjxwYXRoIGQ9Ik0xMC44NzY5IDE1LjYzNzhIMS41VjE4LjM5OUMxLjUgMTkuODAxMyAyLjYzNDQ3IDIwLjkzOCA0LjAzMzkyIDIwLjkzOEg4LjI0OTkyTDEwLjg3NjkgMTUuNjM3OFoiIGZpbGw9IiM3OTk0RkYiLz4KPHBhdGggZD0iTTEuNSA5Ljc3NTUxSDE5LjA1MTZMMTcuMDEzOSAxMy44NzExSDEuNVY5Ljc3NTUxWiIgZmlsbD0iIzQ4NkRGRiIvPgo8cGF0aCBkPSJNNy42NTk5NiAzSDEuNTI0NDFWOC4wMDcwNEgyMi40NjEyVjNIMTYuMzI1NlY2LjczOTQ0SDE1LjA2MDZWM0g4LjkyNTAyVjYuNzM5NDRINy42NTk5NlYzWiIgZmlsbD0iIzVDRDFGQSIvPgo8L2c+CjxkZWZzPgo8Y2xpcFBhdGggaWQ9ImNsaXAwXzEzNDk0XzY2MjU0Ij4KPHJlY3Qgd2lkdGg9IjIxIiBoZWlnaHQ9IjE4IiBmaWxsPSJ3aGl0ZSIgdHJhbnNmb3JtPSJ0cmFuc2xhdGUoMS41IDMpIi8+CjwvY2xpcFBhdGg+CjwvZGVmcz4KPC9zdmc+Cg=="
2185
+ },
2186
+ xverse: {
2187
+ id: "XverseProviders.BitcoinProvider",
2188
+ name: "Xverse",
2189
+ webUrl: "https://www.xverse.app/",
2190
+ googlePlayStoreUrl: "https://play.google.com/store/apps/details?id=com.secretkeylabs.xverse",
2191
+ iOSAppStoreUrl: "https://apps.apple.com/app/xverse-bitcoin-web3-wallet/id1552272513",
2192
+ chromeWebStoreUrl: "https://chromewebstore.google.com/detail/xverse-wallet/idnnbdplmphpflfnlkomgpfbpcgelopg",
2193
+ icon: "data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTAyIiBoZWlnaHQ9IjEwMiIgdmlld0JveD0iMCAwIDEwMiAxMDIiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+CjxnIGlkPSJJY29uX0FydCAoRWRpdCBNZSkiPgo8cmVjdCB3aWR0aD0iMTAyIiBoZWlnaHQ9IjEwMiIgZmlsbD0iIzE4MTgxOCIvPgo8ZyBpZD0iTG9nby9FbWJsZW0iIGNsaXAtcGF0aD0idXJsKCNjbGlwMF8yMF8xMjIzKSI+CjxwYXRoIGlkPSJWZWN0b3IiIGQ9Ik03NC42NTQyIDczLjg4ODNWNjUuMjMxMkM3NC42NTQyIDY0Ljg4OCA3NC41MTc3IDY0LjU2MDYgNzQuMjc0NSA2NC4zMTc0TDM3LjQzOTcgMjcuNDgyNUMzNy4xOTY1IDI3LjIzOTIgMzYuODY5MSAyNy4xMDI4IDM2LjUyNTggMjcuMTAyOEgyNy44NjlDMjcuNDQxNiAyNy4xMDI4IDI3LjA5MzggMjcuNDUwNiAyNy4wOTM4IDI3Ljg3OFYzNS45MjExQzI3LjA5MzggMzYuMjY0NCAyNy4yMzAyIDM2LjU5MTcgMjcuNDczNCAzNi44MzVMNDAuNjk1MiA1MC4wNTY3QzQwLjk5NzUgNTAuMzU5MSA0MC45OTc1IDUwLjg1MDEgNDAuNjk1MiA1MS4xNTI0TDI3LjMyMTEgNjQuNTI2NUMyNy4xNzU2IDY0LjY3MiAyNy4wOTM4IDY0Ljg2OTggMjcuMDkzOCA2NS4wNzQ0VjczLjg4ODNDMjcuMDkzOCA3NC4zMTUzIDI3LjQ0MTYgNzQuNjYzNSAyNy44NjkgNzQuNjYzNUg0Mi4zMzQyQzQyLjc2MTYgNzQuNjYzNSA0My4xMDk0IDc0LjMxNTMgNDMuMTA5NCA3My44ODgzVjY4LjY5NThDNDMuMTA5NCA2OC40OTEyIDQzLjE5MTIgNjguMjkzNSA0My4zMzY4IDY4LjE0NzlMNTAuNTExNCA2MC45NzMzQzUwLjgxMzggNjAuNjcwOSA1MS4zMDQ4IDYwLjY3MDkgNTEuNjA3MiA2MC45NzMzTDY0LjkxOTggNzQuMjg2MUM2NS4xNjMxIDc0LjUyOTMgNjUuNDkwNCA3NC42NjU4IDY1LjgzMzcgNzQuNjY1OEg3My44NzY3Qzc0LjMwNDIgNzQuNjY1OCA3NC42NTE5IDc0LjMxNzYgNzQuNjUxOSA3My44OTA2TDc0LjY1NDIgNzMuODg4M1oiIGZpbGw9IndoaXRlIi8+CjxwYXRoIGlkPSJWZWN0b3JfMiIgZD0iTTU1LjM1OCAzOC41NjcySDYyLjYwMzFDNjMuMDMyOCAzOC41NjcyIDYzLjM4MjkgMzguOTE3MyA2My4zODI5IDM5LjM0NjlWNDYuNTkyMUM2My4zODI5IDQ3LjI4NzcgNjQuMjI0IDQ3LjYzNTUgNjQuNzE1MSA0Ny4xNDIyTDc0LjY1NDEgMzcuMTg3M0M3NC43OTk0IDM3LjA0MTggNzQuODgxNiAzNi44NDQgNzQuODgxNiAzNi42MzcxVjI3LjkxODlDNzQuODgxNiAyNy40ODkyIDc0LjUzMzQgMjcuMTM5MSA3NC4xMDE3IDI3LjEzOTFMNjUuMjUzOCAyNy4xMjc3QzY1LjA0NyAyNy4xMjc3IDY0Ljg0OTIgMjcuMjA5NiA2NC43MDE0IDI3LjM1NTFMNTQuODA1NiAzNy4yMzVDNTQuMzE0NSAzNy43MjYgNTQuNjYyMyAzOC41NjcyIDU1LjM1NTcgMzguNTY3Mkg1NS4zNThaIiBmaWxsPSIjRUU3QTMwIi8+CjwvZz4KPC9nPgo8ZGVmcz4KPGNsaXBQYXRoIGlkPSJjbGlwMF8yMF8xMjIzIj4KPHJlY3Qgd2lkdGg9IjQ3LjgxMjUiIGhlaWdodD0iNDcuODEyNSIgZmlsbD0id2hpdGUiIHRyYW5zZm9ybT0idHJhbnNsYXRlKDI3LjA5MzggMjcuMDkzOCkiLz4KPC9jbGlwUGF0aD4KPC9kZWZzPgo8L3N2Zz4K"
2194
+ },
2195
+ unisat: {
2196
+ id: "unisat",
2197
+ name: "Unisat",
2198
+ webUrl: "https://unisat.io/",
2199
+ icon: "data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTgwIiBoZWlnaHQ9IjE4MCIgdmlld0JveD0iMCAwIDE4MCAxODAiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+CjxyZWN0IHdpZHRoPSIxODAiIGhlaWdodD0iMTgwIiBmaWxsPSJibGFjayIvPgo8ZyBjbGlwLXBhdGg9InVybCgjY2xpcDBfMTAwNTBfNDE3MSkiPgo8cGF0aCBkPSJNMTEzLjY2IDI5LjI4OTdMMTQzLjk3IDU5LjMwOTdDMTQ2LjU1IDYxLjg1OTcgMTQ3LjgyIDY0LjQzOTcgMTQ3Ljc4IDY3LjAzOTdDMTQ3Ljc0IDY5LjYzOTcgMTQ2LjYzIDcyLjAwOTcgMTQ0LjQ2IDc0LjE1OTdDMTQyLjE5IDc2LjQwOTcgMTM5Ljc0IDc3LjU0OTcgMTM3LjEyIDc3LjU5OTdDMTM0LjUgNzcuNjM5NyAxMzEuOSA3Ni4zNzk3IDEyOS4zMiA3My44Mjk3TDk4LjMxOTkgNDMuMTI5N0M5NC43OTk5IDM5LjYzOTcgOTEuMzk5OSAzNy4xNjk3IDg4LjEyOTkgMzUuNzE5N0M4NC44NTk5IDM0LjI2OTcgODEuNDE5OSAzNC4wMzk3IDc3LjgxOTkgMzUuMDM5N0M3NC4yMDk5IDM2LjAyOTcgNzAuMzM5OSAzOC41Nzk3IDY2LjE4OTkgNDIuNjc5N0M2MC40Njk5IDQ4LjM0OTcgNTcuNzM5OSA1My42Njk3IDU4LjAxOTkgNTguNjM5N0M1OC4yOTk5IDYzLjYwOTcgNjEuMTM5OSA2OC43Njk3IDY2LjUyOTkgNzQuMDk5N0w5Ny43Nzk5IDEwNS4wNkMxMDAuMzkgMTA3LjY0IDEwMS42NyAxMTAuMjIgMTAxLjYzIDExMi43OEMxMDEuNTkgMTE1LjM1IDEwMC40NyAxMTcuNzIgOTguMjU5OSAxMTkuOTFDOTYuMDU5OSAxMjIuMDkgOTMuNjI5OSAxMjMuMjMgOTAuOTg5OSAxMjMuMzJDODguMzQ5OSAxMjMuNDEgODUuNzE5OSAxMjIuMTYgODMuMTE5OSAxMTkuNThMNTIuODA5OSA4OS41NTk3QzQ3Ljg3OTkgODQuNjc5NyA0NC4zMTk5IDgwLjA1OTcgNDIuMTI5OSA3NS42OTk3QzM5LjkzOTkgNzEuMzM5NyAzOS4xMTk5IDY2LjQwOTcgMzkuNjg5OSA2MC45MDk3QzQwLjE5OTkgNTYuMTk5NyA0MS43MDk5IDUxLjYzOTcgNDQuMjI5OSA0Ny4yMTk3QzQ2LjczOTkgNDIuNzk5NyA1MC4zMzk5IDM4LjI3OTcgNTUuMDA5OSAzMy42NDk3QzYwLjU2OTkgMjguMTM5NyA2NS44Nzk5IDIzLjkxOTcgNzAuOTM5OSAyMC45Nzk3Qzc1Ljk4OTkgMTguMDM5NyA4MC44Nzk5IDE2LjQwOTcgODUuNTk5OSAxNi4wNjk3QzkwLjMyOTkgMTUuNzI5NyA5NC45ODk5IDE2LjY2OTcgOTkuNTk5OSAxOC44ODk3QzEwNC4yMSAyMS4xMDk3IDEwOC44OSAyNC41Njk3IDExMy42NSAyOS4yODk3SDExMy42NloiIGZpbGw9InVybCgjcGFpbnQwX2xpbmVhcl8xMDA1MF80MTcxKSIvPgo8cGF0aCBkPSJNNjYuMTA5OSAxNTAuNDJMMzUuODA5OSAxMjAuNEMzMy4yMjk5IDExNy44NCAzMS45NTk5IDExNS4yNyAzMS45OTk5IDExMi42N0MzMi4wMzk5IDExMC4wNyAzMy4xNDk5IDEwNy43IDM1LjMxOTkgMTA1LjU1QzM3LjU4OTkgMTAzLjMgNDAuMDM5OSAxMDIuMTYgNDIuNjU5OSAxMDIuMTFDNDUuMjc5OSAxMDIuMDcgNDcuODc5OSAxMDMuMzIgNTAuNDU5OSAxMDUuODhMODEuNDQ5OSAxMzYuNThDODQuOTc5OSAxNDAuMDcgODguMzY5OSAxNDIuNTQgOTEuNjM5OSAxNDMuOTlDOTQuOTA5OSAxNDUuNDQgOTguMzQ5OSAxNDUuNjYgMTAxLjk2IDE0NC42N0MxMDUuNTcgMTQzLjY4IDEwOS40NCAxNDEuMTMgMTEzLjU5IDEzNy4wMkMxMTkuMzEgMTMxLjM1IDEyMi4wNCAxMjYuMDMgMTIxLjc2IDEyMS4wNkMxMjEuNDggMTE2LjA5IDExOC42NCAxMTAuOTMgMTEzLjI1IDEwNS41OUw5Ni41OTk5IDg5LjI0MDFDOTMuOTg5OSA4Ni42NjAxIDkyLjcwOTkgODQuMDgwMSA5Mi43NDk5IDgxLjUyMDFDOTIuNzg5OSA3OC45NTAxIDkzLjkwOTkgNzYuNTgwMSA5Ni4xMTk5IDc0LjM5MDFDOTguMzE5OSA3Mi4yMTAxIDEwMC43NSA3MS4wNzAxIDEwMy4zOSA3MC45ODAxQzEwNi4wMyA3MC44OTAxIDEwOC42NiA3Mi4xNDAxIDExMS4yNiA3NC43MjAxTDEyNi45NiA5MC4xMzAxQzEzMS44OSA5NS4wMTAxIDEzNS40NSA5OS42MzAxIDEzNy42NCAxMDMuOTlDMTM5LjgzIDEwOC4zNSAxNDAuNjUgMTEzLjI4IDE0MC4wOCAxMTguNzhDMTM5LjU3IDEyMy40OSAxMzguMDYgMTI4LjA1IDEzNS41NCAxMzIuNDdDMTMzLjAzIDEzNi44OSAxMjkuNDMgMTQxLjQxIDEyNC43NiAxNDYuMDRDMTE5LjIgMTUxLjU1IDExMy44OSAxNTUuNzcgMTA4LjgzIDE1OC43MUMxMDMuNzcgMTYxLjY1IDk4Ljg3OTkgMTYzLjI5IDk0LjE0OTkgMTYzLjYzQzg5LjQxOTkgMTYzLjk3IDg0Ljc1OTkgMTYzLjAzIDgwLjE0OTkgMTYwLjgxQzc1LjUzOTkgMTU4LjU5IDcwLjg1OTkgMTU1LjEzIDY2LjA5OTkgMTUwLjQxTDY2LjEwOTkgMTUwLjQyWiIgZmlsbD0idXJsKCNwYWludDFfbGluZWFyXzEwMDUwXzQxNzEpIi8+CjxwYXRoIGQ9Ik04NS4wMDk5IDcyLjk1OTJDOTEuMTU2OCA3Mi45NTkyIDk2LjEzOTkgNjcuOTc2MSA5Ni4xMzk5IDYxLjgyOTJDOTYuMTM5OSA1NS42ODIzIDkxLjE1NjggNTAuNjk5MiA4NS4wMDk5IDUwLjY5OTJDNzguODYzIDUwLjY5OTIgNzMuODc5OSA1NS42ODIzIDczLjg3OTkgNjEuODI5MkM3My44Nzk5IDY3Ljk3NjEgNzguODYzIDcyLjk1OTIgODUuMDA5OSA3Mi45NTkyWiIgZmlsbD0idXJsKCNwYWludDJfcmFkaWFsXzEwMDUwXzQxNzEpIi8+CjwvZz4KPGRlZnM+CjxsaW5lYXJHcmFkaWVudCBpZD0icGFpbnQwX2xpbmVhcl8xMDA1MF80MTcxIiB4MT0iMTM4Ljk4NSIgeTE9IjQ2Ljc3OTUiIHgyPSI0NS4wNTI5IiB5Mj0iODguNTIzMyIgZ3JhZGllbnRVbml0cz0idXNlclNwYWNlT25Vc2UiPgo8c3RvcCBzdG9wLWNvbG9yPSIjMjAxQzFCIi8+CjxzdG9wIG9mZnNldD0iMC4zNiIgc3RvcC1jb2xvcj0iIzc3MzkwRCIvPgo8c3RvcCBvZmZzZXQ9IjAuNjciIHN0b3AtY29sb3I9IiNFQTgxMDEiLz4KPHN0b3Agb2Zmc2V0PSIxIiBzdG9wLWNvbG9yPSIjRjRCODUyIi8+CjwvbGluZWFyR3JhZGllbnQ+CjxsaW5lYXJHcmFkaWVudCBpZD0icGFpbnQxX2xpbmVhcl8xMDA1MF80MTcxIiB4MT0iNDMuMzgxMiIgeTE9IjEzNC4xNjciIHgyPSIxNTIuMjMxIiB5Mj0iMTAxLjc3MSIgZ3JhZGllbnRVbml0cz0idXNlclNwYWNlT25Vc2UiPgo8c3RvcCBzdG9wLWNvbG9yPSIjMUYxRDFDIi8+CjxzdG9wIG9mZnNldD0iMC4zNyIgc3RvcC1jb2xvcj0iIzc3MzkwRCIvPgo8c3RvcCBvZmZzZXQ9IjAuNjciIHN0b3AtY29sb3I9IiNFQTgxMDEiLz4KPHN0b3Agb2Zmc2V0PSIxIiBzdG9wLWNvbG9yPSIjRjRGQjUyIi8+CjwvbGluZWFyR3JhZGllbnQ+CjxyYWRpYWxHcmFkaWVudCBpZD0icGFpbnQyX3JhZGlhbF8xMDA1MF80MTcxIiBjeD0iMCIgY3k9IjAiIHI9IjEiIGdyYWRpZW50VW5pdHM9InVzZXJTcGFjZU9uVXNlIiBncmFkaWVudFRyYW5zZm9ybT0idHJhbnNsYXRlKDg1LjAwOTkgNjEuODM5Mikgc2NhbGUoMTEuMTMpIj4KPHN0b3Agc3RvcC1jb2xvcj0iI0Y0Qjg1MiIvPgo8c3RvcCBvZmZzZXQ9IjAuMzMiIHN0b3AtY29sb3I9IiNFQTgxMDEiLz4KPHN0b3Agb2Zmc2V0PSIwLjY0IiBzdG9wLWNvbG9yPSIjNzczOTBEIi8+CjxzdG9wIG9mZnNldD0iMSIgc3RvcC1jb2xvcj0iIzIxMUMxRCIvPgo8L3JhZGlhbEdyYWRpZW50Pgo8Y2xpcFBhdGggaWQ9ImNsaXAwXzEwMDUwXzQxNzEiPgo8cmVjdCB3aWR0aD0iMTE1Ljc3IiBoZWlnaHQ9IjE0Ny43IiBmaWxsPSJ3aGl0ZSIgdHJhbnNmb3JtPSJ0cmFuc2xhdGUoMzIgMTYpIi8+CjwvY2xpcFBhdGg+CjwvZGVmcz4KPC9zdmc+Cg=="
2200
+ }
2201
+ };
2202
+ const defaultAdapters = {
2203
+ [DefaultAdaptersInfo.fordefi.id]: FordefiAdapter,
2204
+ [DefaultAdaptersInfo.xverse.id]: XverseAdapter,
2205
+ [DefaultAdaptersInfo.unisat.id]: UnisatAdapter
2206
+ };
2207
+
2208
+ //#endregion
2209
+ //#region src/capabilities/index.ts
2210
+ const extractOrValidateCapabilities = (provider, reportedCapabilities) => {
2211
+ const validateCapability = (capability) => {
2212
+ if (!provider[capability]) return false;
2213
+ if (reportedCapabilities && !reportedCapabilities.has(capability)) return false;
2214
+ return true;
2215
+ };
2216
+ const capabilityMap = {
2217
+ request: validateCapability("request"),
2218
+ connect: validateCapability("connect"),
2219
+ signMessage: validateCapability("signMessage"),
2220
+ signTransaction: validateCapability("signTransaction"),
2221
+ sendBtcTransaction: validateCapability("sendBtcTransaction"),
2222
+ createInscription: validateCapability("createInscription"),
2223
+ createRepeatInscriptions: validateCapability("createRepeatInscriptions"),
2224
+ signMultipleTransactions: validateCapability("signMultipleTransactions"),
2225
+ addListener: validateCapability("addListener")
2226
+ };
2227
+ return Object.entries(capabilityMap).reduce((acc, [capability, value]) => {
2228
+ if (value) return [...acc, capability];
2229
+ return acc;
2230
+ }, []);
2231
+ };
2232
+ const getCapabilities = async (options) => {
2233
+ const provider = await getProviderOrThrow(options.getProvider);
2234
+ const request$1 = (0, jsontokens.createUnsecuredToken)(options.payload);
2235
+ if (provider.getCapabilities) try {
2236
+ const response = await provider.getCapabilities(request$1);
2237
+ options.onFinish?.(extractOrValidateCapabilities(provider, new Set(response)));
2238
+ } catch (error) {
2239
+ console.error("[Connect] Error during capabilities request", error);
2240
+ }
2241
+ try {
2242
+ const inferredCapabilities = extractOrValidateCapabilities(provider);
2243
+ options.onFinish?.(inferredCapabilities);
2244
+ } catch (error) {
2245
+ console.error("[Connect] Error during capabilities request", error);
2246
+ options.onCancel?.();
2247
+ }
2248
+ };
2249
+
2250
+ //#endregion
2251
+ //#region src/inscriptions/utils.ts
2252
+ const MAX_CONTENT_LENGTH_MAINNET = 4e5;
2253
+ const MAX_CONTENT_LENGTH_TESTNET = 6e4;
2254
+ const validateInscriptionPayload = (payload) => {
2255
+ const { contentType, content, payloadType, network, appFeeAddress, appFee } = payload;
2256
+ if (!/^[a-z]+\/[a-z0-9\-\.\+]+(?=;.*|$)/.test(contentType)) throw new Error("Invalid content type detected");
2257
+ if (!content || content.length === 0) throw new Error("Empty content not allowed");
2258
+ if (!payloadType || payloadType !== "BASE_64" && payloadType !== "PLAIN_TEXT") throw new Error("Empty invalid payloadType specified");
2259
+ if (content.length > (network.type === "Mainnet" ? MAX_CONTENT_LENGTH_MAINNET : MAX_CONTENT_LENGTH_TESTNET)) throw new Error("Content too large");
2260
+ if ((appFeeAddress?.length ?? 0) > 0 && (appFee ?? 0) <= 0) throw new Error("Invalid combination of app fee address and fee provided");
2261
+ };
2262
+
2263
+ //#endregion
2264
+ //#region src/inscriptions/createInscription.ts
2265
+ const createInscription = async (options) => {
2266
+ const { getProvider } = options;
2267
+ const provider = await getProviderOrThrow(getProvider);
2268
+ validateInscriptionPayload(options.payload);
2269
+ try {
2270
+ const request$1 = (0, jsontokens.createUnsecuredToken)(options.payload);
2271
+ const response = await provider.createInscription(request$1);
2272
+ options.onFinish?.(response);
2273
+ } catch (error) {
2274
+ console.error("[Connect] Error during create inscription", error);
2275
+ options.onCancel?.();
2276
+ }
2277
+ };
2278
+
2279
+ //#endregion
2280
+ //#region src/inscriptions/createRepeatInscriptions.ts
2281
+ const createRepeatInscriptions = async (options) => {
2282
+ const { getProvider } = options;
2283
+ const provider = await getProviderOrThrow(getProvider);
2284
+ validateInscriptionPayload(options.payload);
2285
+ try {
2286
+ const request$1 = (0, jsontokens.createUnsecuredToken)(options.payload);
2287
+ const response = await provider.createRepeatInscriptions(request$1);
2288
+ options.onFinish?.(response);
2289
+ } catch (error) {
2290
+ console.error("[Connect] Error during create repeat inscriptions", error);
2291
+ options.onCancel?.();
2292
+ }
2293
+ };
2294
+
2295
+ //#endregion
2296
+ //#region src/messages/index.ts
2297
+ const signMessage = async (options) => {
2298
+ const provider = await getProviderOrThrow(options.getProvider);
2299
+ const { address, message } = options.payload;
2300
+ if (!address) throw new Error("An address is required to sign a message");
2301
+ if (!message) throw new Error("A message to be signed is required");
2302
+ try {
2303
+ const request$1 = (0, jsontokens.createUnsecuredToken)(options.payload);
2304
+ const response = await provider.signMessage(request$1);
2305
+ options.onFinish?.(response);
2306
+ } catch (error) {
2307
+ console.error("[Connect] Error during sign message request", error);
2308
+ options.onCancel?.();
2309
+ }
2310
+ };
2311
+
2312
+ //#endregion
2313
+ //#region src/transactions/sendBtcTransaction.ts
2314
+ const serializer = (recipient) => {
2315
+ return recipient.map((value) => {
2316
+ const { address, amountSats } = value;
2317
+ return {
2318
+ address,
2319
+ amountSats: amountSats.toString()
2320
+ };
2321
+ });
2322
+ };
2323
+ const sendBtcTransaction = async (options) => {
2324
+ const provider = await getProviderOrThrow(options.getProvider);
2325
+ const { recipients, senderAddress, network, message } = options.payload;
2326
+ if (!recipients || recipients.length === 0) throw new Error("At least one recipient is required");
2327
+ if (recipients.some((item) => typeof item.address !== "string" || typeof item.amountSats !== "bigint")) throw new Error("Incorrect recipient format");
2328
+ if (!senderAddress) throw new Error("The sender address is required");
2329
+ try {
2330
+ const request$1 = (0, jsontokens.createUnsecuredToken)({
2331
+ network,
2332
+ senderAddress,
2333
+ message,
2334
+ recipients: serializer(recipients)
2335
+ });
2336
+ const response = await provider.sendBtcTransaction(request$1);
2337
+ options.onFinish?.(response);
2338
+ } catch (error) {
2339
+ console.error("[Connect] Error during send BTC transaction request", error);
2340
+ options.onCancel?.();
2341
+ }
2342
+ };
2343
+
2344
+ //#endregion
2345
+ //#region src/transactions/signTransaction.ts
2346
+ const signTransaction = async (options) => {
2347
+ const provider = await getProviderOrThrow(options.getProvider);
2348
+ const { psbtBase64, inputsToSign } = options.payload;
2349
+ if (!psbtBase64) throw new Error("A value for psbtBase64 representing the tx hash is required");
2350
+ if (!inputsToSign) throw new Error("An array specifying the inputs to be signed by the wallet is required");
2351
+ try {
2352
+ const request$1 = (0, jsontokens.createUnsecuredToken)(options.payload);
2353
+ const response = await provider.signTransaction(request$1);
2354
+ options.onFinish?.(response);
2355
+ } catch (error) {
2356
+ console.error("[Connect] Error during sign transaction request", error);
2357
+ options.onCancel?.();
2358
+ }
2359
+ };
2360
+
2361
+ //#endregion
2362
+ //#region src/transactions/signMultipleTransactions.ts
2363
+ const signMultipleTransactions = async (options) => {
2364
+ const provider = await getProviderOrThrow(options.getProvider);
2365
+ const { psbts } = options.payload;
2366
+ if (!psbts || !psbts.length) throw new Error("psbts array is required");
2367
+ if (psbts.length > 100) throw new Error("psbts array must contain less than 100 psbts");
2368
+ try {
2369
+ const request$1 = (0, jsontokens.createUnsecuredToken)(options.payload);
2370
+ const response = await provider.signMultipleTransactions(request$1);
2371
+ options.onFinish?.(response);
2372
+ } catch (error) {
2373
+ console.error("[Connect] Error during sign Multiple transactions request", error);
2374
+ options.onCancel?.();
2375
+ }
2376
+ };
2377
+
2378
+ //#endregion
2379
+ exports.AddressPurpose = AddressPurpose;
2380
+ exports.AddressType = AddressType;
2381
+ exports.BaseAdapter = BaseAdapter;
2382
+ exports.BitcoinNetworkType = BitcoinNetworkType;
2383
+ exports.DefaultAdaptersInfo = DefaultAdaptersInfo;
2384
+ exports.MessageSigningProtocols = MessageSigningProtocols;
2385
+ exports.PermissionRequestParams = PermissionRequestParams;
2386
+ exports.ProviderPlatform = ProviderPlatform;
2387
+ exports.RpcErrorCode = RpcErrorCode;
2388
+ exports.RpcIdSchema = RpcIdSchema;
2389
+ exports.SatsConnectAdapter = SatsConnectAdapter;
2390
+ exports.SparkNetworkType = SparkNetworkType;
2391
+ exports.StacksNetworkType = StacksNetworkType;
2392
+ exports.StarknetNetworkType = StarknetNetworkType;
2393
+ exports.accountActionsSchema = accountActionsSchema;
2394
+ exports.accountChangeEventName = accountChangeEventName;
2395
+ exports.accountChangeSchema = accountChangeSchema;
2396
+ exports.accountPermissionSchema = accountPermissionSchema;
2397
+ exports.addListener = addListener;
2398
+ exports.addNetworkMethodName = addNetworkMethodName;
2399
+ exports.addNetworkParamsSchema = addNetworkParamsSchema;
2400
+ exports.addNetworkRequestMessageSchema = addNetworkRequestMessageSchema;
2401
+ exports.addNetworkResultSchema = addNetworkResultSchema;
2402
+ exports.addressSchema = addressSchema;
2403
+ exports.bitcoinNetworkDefinitionSchema = bitcoinNetworkDefinitionSchema;
2404
+ exports.changeNetworkByIdMethodName = changeNetworkByIdMethodName;
2405
+ exports.changeNetworkByIdParamsSchema = changeNetworkByIdParamsSchema;
2406
+ exports.changeNetworkByIdRequestMessageSchema = changeNetworkByIdRequestMessageSchema;
2407
+ exports.changeNetworkByIdResultSchema = changeNetworkByIdResultSchema;
2408
+ exports.changeNetworkMethodName = changeNetworkMethodName;
2409
+ exports.changeNetworkParamsSchema = changeNetworkParamsSchema;
2410
+ exports.changeNetworkRequestMessageSchema = changeNetworkRequestMessageSchema;
2411
+ exports.changeNetworkResultSchema = changeNetworkResultSchema;
2412
+ exports.connectMethodName = connectMethodName;
2413
+ exports.connectParamsSchema = connectParamsSchema;
2414
+ exports.connectRequestMessageSchema = connectRequestMessageSchema;
2415
+ exports.connectResultSchema = connectResultSchema;
2416
+ exports.createInscription = createInscription;
2417
+ exports.createRepeatInscriptions = createRepeatInscriptions;
2418
+ exports.defaultAdapters = defaultAdapters;
2419
+ exports.disconnectEventName = disconnectEventName;
2420
+ exports.disconnectMethodName = disconnectMethodName;
2421
+ exports.disconnectParamsSchema = disconnectParamsSchema;
2422
+ exports.disconnectRequestMessageSchema = disconnectRequestMessageSchema;
2423
+ exports.disconnectResultSchema = disconnectResultSchema;
2424
+ exports.disconnectSchema = disconnectSchema;
2425
+ exports.getAccountMethodName = getAccountMethodName;
2426
+ exports.getAccountParamsSchema = getAccountParamsSchema;
2427
+ exports.getAccountRequestMessageSchema = getAccountRequestMessageSchema;
2428
+ exports.getAccountResultSchema = getAccountResultSchema;
2429
+ exports.getAccountsMethodName = getAccountsMethodName;
2430
+ exports.getAccountsParamsSchema = getAccountsParamsSchema;
2431
+ exports.getAccountsRequestMessageSchema = getAccountsRequestMessageSchema;
2432
+ exports.getAccountsResultSchema = getAccountsResultSchema;
2433
+ exports.getAddress = getAddress;
2434
+ exports.getAddressesMethodName = getAddressesMethodName;
2435
+ exports.getAddressesParamsSchema = getAddressesParamsSchema;
2436
+ exports.getAddressesRequestMessageSchema = getAddressesRequestMessageSchema;
2437
+ exports.getAddressesResultSchema = getAddressesResultSchema;
2438
+ exports.getBalanceMethodName = getBalanceMethodName;
2439
+ exports.getBalanceParamsSchema = getBalanceParamsSchema;
2440
+ exports.getBalanceRequestMessageSchema = getBalanceRequestMessageSchema;
2441
+ exports.getBalanceResultSchema = getBalanceResultSchema;
2442
+ exports.getCapabilities = getCapabilities;
2443
+ exports.getCurrentPermissionsMethodName = getCurrentPermissionsMethodName;
2444
+ exports.getCurrentPermissionsParamsSchema = getCurrentPermissionsParamsSchema;
2445
+ exports.getCurrentPermissionsRequestMessageSchema = getCurrentPermissionsRequestMessageSchema;
2446
+ exports.getCurrentPermissionsResultSchema = getCurrentPermissionsResultSchema;
2447
+ exports.getDefaultProvider = getDefaultProvider;
2448
+ exports.getInfoMethodName = getInfoMethodName;
2449
+ exports.getInfoParamsSchema = getInfoParamsSchema;
2450
+ exports.getInfoRequestMessageSchema = getInfoRequestMessageSchema;
2451
+ exports.getInfoResultSchema = getInfoResultSchema;
2452
+ exports.getInscriptionsMethodName = getInscriptionsMethodName;
2453
+ exports.getInscriptionsParamsSchema = getInscriptionsParamsSchema;
2454
+ exports.getInscriptionsRequestMessageSchema = getInscriptionsRequestMessageSchema;
2455
+ exports.getInscriptionsResultSchema = getInscriptionsResultSchema;
2456
+ exports.getNetworkMethodName = getNetworkMethodName;
2457
+ exports.getNetworkParamsSchema = getNetworkParamsSchema;
2458
+ exports.getNetworkRequestMessageSchema = getNetworkRequestMessageSchema;
2459
+ exports.getNetworkResultSchema = getNetworkResultSchema;
2460
+ exports.getNetworksMethodName = getNetworksMethodName;
2461
+ exports.getNetworksParamsSchema = getNetworksParamsSchema;
2462
+ exports.getNetworksRequestMessageSchema = getNetworksRequestMessageSchema;
2463
+ exports.getNetworksResultSchema = getNetworksResultSchema;
2464
+ exports.getProviderById = getProviderById;
2465
+ exports.getProviderOrThrow = getProviderOrThrow;
2466
+ exports.getProviders = getProviders;
2467
+ exports.getSupportedWallets = getSupportedWallets;
2468
+ exports.getWalletTypeMethodName = getWalletTypeMethodName;
2469
+ exports.getWalletTypeParamsSchema = getWalletTypeParamsSchema;
2470
+ exports.getWalletTypeRequestMessageSchema = getWalletTypeRequestMessageSchema;
2471
+ exports.getWalletTypeResultSchema = getWalletTypeResultSchema;
2472
+ exports.isProviderInstalled = isProviderInstalled;
2473
+ exports.networkChangeEventName = networkChangeEventName;
2474
+ exports.networkChangeSchema = networkChangeSchema;
2475
+ exports.newNetworkDefinitionSchema = newNetworkDefinitionSchema;
2476
+ exports.openBridgeMethodName = openBridgeMethodName;
2477
+ exports.openBridgeParamsSchema = openBridgeParamsSchema;
2478
+ exports.openBridgeRequestMessageSchema = openBridgeRequestMessageSchema;
2479
+ exports.openBridgeResultSchema = openBridgeResultSchema;
2480
+ exports.openBuyMethodName = openBuyMethodName;
2481
+ exports.openBuyParamsSchema = openBuyParamsSchema;
2482
+ exports.openBuyRequestMessageSchema = openBuyRequestMessageSchema;
2483
+ exports.openBuyResultSchema = openBuyResultSchema;
2484
+ exports.openReceiveMethodName = openReceiveMethodName;
2485
+ exports.openReceiveParamsSchema = openReceiveParamsSchema;
2486
+ exports.openReceiveRequestMessageSchema = openReceiveRequestMessageSchema;
2487
+ exports.openReceiveResultSchema = openReceiveResultSchema;
2488
+ exports.permission = permission;
2489
+ exports.removeDefaultProvider = removeDefaultProvider;
2490
+ exports.renouncePermissionsMethodName = renouncePermissionsMethodName;
2491
+ exports.renouncePermissionsParamsSchema = renouncePermissionsParamsSchema;
2492
+ exports.renouncePermissionsRequestMessageSchema = renouncePermissionsRequestMessageSchema;
2493
+ exports.renouncePermissionsResultSchema = renouncePermissionsResultSchema;
2494
+ exports.request = request;
2495
+ exports.requestPermissionsMethodName = requestPermissionsMethodName;
2496
+ exports.requestPermissionsParamsSchema = requestPermissionsParamsSchema;
2497
+ exports.requestPermissionsRequestMessageSchema = requestPermissionsRequestMessageSchema;
2498
+ exports.requestPermissionsResultSchema = requestPermissionsResultSchema;
2499
+ exports.rpcErrorResponseMessageSchema = rpcErrorResponseMessageSchema;
2500
+ exports.rpcRequestMessageSchema = rpcRequestMessageSchema;
2501
+ exports.rpcResponseMessageSchema = rpcResponseMessageSchema;
2502
+ exports.rpcSuccessResponseMessageSchema = rpcSuccessResponseMessageSchema;
2503
+ exports.runesEtchMethodName = runesEtchMethodName;
2504
+ exports.runesEtchParamsSchema = runesEtchParamsSchema;
2505
+ exports.runesEtchRequestMessageSchema = runesEtchRequestMessageSchema;
2506
+ exports.runesEtchResultSchema = runesEtchResultSchema;
2507
+ exports.runesGetBalanceMethodName = runesGetBalanceMethodName;
2508
+ exports.runesGetBalanceParamsSchema = runesGetBalanceParamsSchema;
2509
+ exports.runesGetBalanceRequestMessageSchema = runesGetBalanceRequestMessageSchema;
2510
+ exports.runesGetBalanceResultSchema = runesGetBalanceResultSchema;
2511
+ exports.runesMintMethodName = runesMintMethodName;
2512
+ exports.runesMintParamsSchema = runesMintParamsSchema;
2513
+ exports.runesMintRequestMessageSchema = runesMintRequestMessageSchema;
2514
+ exports.runesMintResultSchema = runesMintResultSchema;
2515
+ exports.runesTransferMethodName = runesTransferMethodName;
2516
+ exports.runesTransferParamsSchema = runesTransferParamsSchema;
2517
+ exports.runesTransferRequestMessageSchema = runesTransferRequestMessageSchema;
2518
+ exports.runesTransferResultSchema = runesTransferResultSchema;
2519
+ exports.sendBtcTransaction = sendBtcTransaction;
2520
+ exports.sendInscriptionsMethodName = sendInscriptionsMethodName;
2521
+ exports.sendInscriptionsParamsSchema = sendInscriptionsParamsSchema;
2522
+ exports.sendInscriptionsRequestMessageSchema = sendInscriptionsRequestMessageSchema;
2523
+ exports.sendInscriptionsResultSchema = sendInscriptionsResultSchema;
2524
+ exports.sendTransferMethodName = sendTransferMethodName;
2525
+ exports.sendTransferParamsSchema = sendTransferParamsSchema;
2526
+ exports.sendTransferRequestMessageSchema = sendTransferRequestMessageSchema;
2527
+ exports.sendTransferResultSchema = sendTransferResultSchema;
2528
+ exports.setDefaultProvider = setDefaultProvider;
2529
+ exports.signMessage = signMessage;
2530
+ exports.signMessageMethodName = signMessageMethodName;
2531
+ exports.signMessageParamsSchema = signMessageParamsSchema;
2532
+ exports.signMessageRequestMessageSchema = signMessageRequestMessageSchema;
2533
+ exports.signMessageResultSchema = signMessageResultSchema;
2534
+ exports.signMultipleMessagesMethodName = signMultipleMessagesMethodName;
2535
+ exports.signMultipleMessagesParamsSchema = signMultipleMessagesParamsSchema;
2536
+ exports.signMultipleMessagesRequestMessageSchema = signMultipleMessagesRequestMessageSchema;
2537
+ exports.signMultipleMessagesResultSchema = signMultipleMessagesResultSchema;
2538
+ exports.signMultipleTransactions = signMultipleTransactions;
2539
+ exports.signPsbtMethodName = signPsbtMethodName;
2540
+ exports.signPsbtParamsSchema = signPsbtParamsSchema;
2541
+ exports.signPsbtRequestMessageSchema = signPsbtRequestMessageSchema;
2542
+ exports.signPsbtResultSchema = signPsbtResultSchema;
2543
+ exports.signTransaction = signTransaction;
2544
+ exports.sparkFlashnetAddLiquidityIntentSchema = sparkFlashnetAddLiquidityIntentSchema;
2545
+ exports.sparkFlashnetClawbackFundsMethodName = sparkFlashnetClawbackFundsMethodName;
2546
+ exports.sparkFlashnetClawbackFundsParamsSchema = sparkFlashnetClawbackFundsParamsSchema;
2547
+ exports.sparkFlashnetClawbackFundsRequestMessageSchema = sparkFlashnetClawbackFundsRequestMessageSchema;
2548
+ exports.sparkFlashnetClawbackFundsResultSchema = sparkFlashnetClawbackFundsResultSchema;
2549
+ exports.sparkFlashnetClawbackIntentSchema = sparkFlashnetClawbackIntentSchema;
2550
+ exports.sparkFlashnetConfirmInitialDepositIntentSchema = sparkFlashnetConfirmInitialDepositIntentSchema;
2551
+ exports.sparkFlashnetCreateConstantProductPoolIntentSchema = sparkFlashnetCreateConstantProductPoolIntentSchema;
2552
+ exports.sparkFlashnetCreateSingleSidedPoolIntentSchema = sparkFlashnetCreateSingleSidedPoolIntentSchema;
2553
+ exports.sparkFlashnetExecuteRouteSwapMethodName = sparkFlashnetExecuteRouteSwapMethodName;
2554
+ exports.sparkFlashnetExecuteRouteSwapParamsSchema = sparkFlashnetExecuteRouteSwapParamsSchema;
2555
+ exports.sparkFlashnetExecuteRouteSwapRequestMessageSchema = sparkFlashnetExecuteRouteSwapRequestMessageSchema;
2556
+ exports.sparkFlashnetExecuteRouteSwapResultSchema = sparkFlashnetExecuteRouteSwapResultSchema;
2557
+ exports.sparkFlashnetExecuteSwapMethodName = sparkFlashnetExecuteSwapMethodName;
2558
+ exports.sparkFlashnetExecuteSwapParamsSchema = sparkFlashnetExecuteSwapParamsSchema;
2559
+ exports.sparkFlashnetExecuteSwapRequestMessageSchema = sparkFlashnetExecuteSwapRequestMessageSchema;
2560
+ exports.sparkFlashnetExecuteSwapResultSchema = sparkFlashnetExecuteSwapResultSchema;
2561
+ exports.sparkFlashnetGetJwtMethodName = sparkFlashnetGetJwtMethodName;
2562
+ exports.sparkFlashnetGetJwtParamsSchema = sparkFlashnetGetJwtParamsSchema;
2563
+ exports.sparkFlashnetGetJwtRequestMessageSchema = sparkFlashnetGetJwtRequestMessageSchema;
2564
+ exports.sparkFlashnetGetJwtResultSchema = sparkFlashnetGetJwtResultSchema;
2565
+ exports.sparkFlashnetRemoveLiquidityIntentSchema = sparkFlashnetRemoveLiquidityIntentSchema;
2566
+ exports.sparkFlashnetRouteSwapIntentSchema = sparkFlashnetRouteSwapIntentSchema;
2567
+ exports.sparkFlashnetSignIntentMethodName = sparkFlashnetSignIntentMethodName;
2568
+ exports.sparkFlashnetSignIntentParamsSchema = sparkFlashnetSignIntentParamsSchema;
2569
+ exports.sparkFlashnetSignIntentRequestMessageSchema = sparkFlashnetSignIntentRequestMessageSchema;
2570
+ exports.sparkFlashnetSignIntentResultSchema = sparkFlashnetSignIntentResultSchema;
2571
+ exports.sparkFlashnetSignStructuredMessageMethodName = sparkFlashnetSignStructuredMessageMethodName;
2572
+ exports.sparkFlashnetSignStructuredMessageParamsSchema = sparkFlashnetSignStructuredMessageParamsSchema;
2573
+ exports.sparkFlashnetSignStructuredMessageRequestMessageSchema = sparkFlashnetSignStructuredMessageRequestMessageSchema;
2574
+ exports.sparkFlashnetSignStructuredMessageResultSchema = sparkFlashnetSignStructuredMessageResultSchema;
2575
+ exports.sparkFlashnetSwapIntentSchema = sparkFlashnetSwapIntentSchema;
2576
+ exports.sparkGetAddressesMethodName = sparkGetAddressesMethodName;
2577
+ exports.sparkGetAddressesParamsSchema = sparkGetAddressesParamsSchema;
2578
+ exports.sparkGetAddressesRequestMessageSchema = sparkGetAddressesRequestMessageSchema;
2579
+ exports.sparkGetAddressesResultSchema = sparkGetAddressesResultSchema;
2580
+ exports.sparkGetBalanceMethodName = sparkGetBalanceMethodName;
2581
+ exports.sparkGetBalanceParamsSchema = sparkGetBalanceParamsSchema;
2582
+ exports.sparkGetBalanceRequestMessageSchema = sparkGetBalanceRequestMessageSchema;
2583
+ exports.sparkGetBalanceResultSchema = sparkGetBalanceResultSchema;
2584
+ exports.sparkGetClawbackEligibleTransfersMethodName = sparkGetClawbackEligibleTransfersMethodName;
2585
+ exports.sparkGetClawbackEligibleTransfersParamsSchema = sparkGetClawbackEligibleTransfersParamsSchema;
2586
+ exports.sparkGetClawbackEligibleTransfersRequestMessageSchema = sparkGetClawbackEligibleTransfersRequestMessageSchema;
2587
+ exports.sparkGetClawbackEligibleTransfersResultSchema = sparkGetClawbackEligibleTransfersResultSchema;
2588
+ exports.sparkNetworkDefinitionSchema = sparkNetworkDefinitionSchema;
2589
+ exports.sparkSignMessageMethodName = sparkSignMessageMethodName;
2590
+ exports.sparkSignMessageParamsSchema = sparkSignMessageParamsSchema;
2591
+ exports.sparkSignMessageRequestMessageSchema = sparkSignMessageRequestMessageSchema;
2592
+ exports.sparkSignMessageResultSchema = sparkSignMessageResultSchema;
2593
+ exports.sparkTransferMethodName = sparkTransferMethodName;
2594
+ exports.sparkTransferParamsSchema = sparkTransferParamsSchema;
2595
+ exports.sparkTransferRequestMessageSchema = sparkTransferRequestMessageSchema;
2596
+ exports.sparkTransferResultSchema = sparkTransferResultSchema;
2597
+ exports.sparkTransferTokenMethodName = sparkTransferTokenMethodName;
2598
+ exports.sparkTransferTokenParamsSchema = sparkTransferTokenParamsSchema;
2599
+ exports.sparkTransferTokenRequestMessageSchema = sparkTransferTokenRequestMessageSchema;
2600
+ exports.sparkTransferTokenResultSchema = sparkTransferTokenResultSchema;
2601
+ exports.stacksNetworkDefinitionSchema = stacksNetworkDefinitionSchema;
2602
+ exports.starknetNetworkDefinitionSchema = starknetNetworkDefinitionSchema;
2603
+ exports.stxCallContractMethodName = stxCallContractMethodName;
2604
+ exports.stxCallContractParamsSchema = stxCallContractParamsSchema;
2605
+ exports.stxCallContractRequestMessageSchema = stxCallContractRequestMessageSchema;
2606
+ exports.stxCallContractResultSchema = stxCallContractResultSchema;
2607
+ exports.stxDeployContractMethodName = stxDeployContractMethodName;
2608
+ exports.stxDeployContractParamsSchema = stxDeployContractParamsSchema;
2609
+ exports.stxDeployContractRequestMessageSchema = stxDeployContractRequestMessageSchema;
2610
+ exports.stxDeployContractResultSchema = stxDeployContractResultSchema;
2611
+ exports.stxGetAccountsMethodName = stxGetAccountsMethodName;
2612
+ exports.stxGetAccountsParamsSchema = stxGetAccountsParamsSchema;
2613
+ exports.stxGetAccountsRequestMessageSchema = stxGetAccountsRequestMessageSchema;
2614
+ exports.stxGetAccountsResultSchema = stxGetAccountsResultSchema;
2615
+ exports.stxGetAddressesMethodName = stxGetAddressesMethodName;
2616
+ exports.stxGetAddressesParamsSchema = stxGetAddressesParamsSchema;
2617
+ exports.stxGetAddressesRequestMessageSchema = stxGetAddressesRequestMessageSchema;
2618
+ exports.stxGetAddressesResultSchema = stxGetAddressesResultSchema;
2619
+ exports.stxSignMessageMethodName = stxSignMessageMethodName;
2620
+ exports.stxSignMessageParamsSchema = stxSignMessageParamsSchema;
2621
+ exports.stxSignMessageRequestMessageSchema = stxSignMessageRequestMessageSchema;
2622
+ exports.stxSignMessageResultSchema = stxSignMessageResultSchema;
2623
+ exports.stxSignStructuredMessageMethodName = stxSignStructuredMessageMethodName;
2624
+ exports.stxSignStructuredMessageParamsSchema = stxSignStructuredMessageParamsSchema;
2625
+ exports.stxSignStructuredMessageRequestMessageSchema = stxSignStructuredMessageRequestMessageSchema;
2626
+ exports.stxSignStructuredMessageResultSchema = stxSignStructuredMessageResultSchema;
2627
+ exports.stxSignTransactionMethodName = stxSignTransactionMethodName;
2628
+ exports.stxSignTransactionParamsSchema = stxSignTransactionParamsSchema;
2629
+ exports.stxSignTransactionRequestMessageSchema = stxSignTransactionRequestMessageSchema;
2630
+ exports.stxSignTransactionResultSchema = stxSignTransactionResultSchema;
2631
+ exports.stxSignTransactionsMethodName = stxSignTransactionsMethodName;
2632
+ exports.stxSignTransactionsParamsSchema = stxSignTransactionsParamsSchema;
2633
+ exports.stxSignTransactionsRequestMessageSchema = stxSignTransactionsRequestMessageSchema;
2634
+ exports.stxSignTransactionsResultSchema = stxSignTransactionsResultSchema;
2635
+ exports.stxTransferStxMethodName = stxTransferStxMethodName;
2636
+ exports.stxTransferStxParamsSchema = stxTransferStxParamsSchema;
2637
+ exports.stxTransferStxRequestMessageSchema = stxTransferStxRequestMessageSchema;
2638
+ exports.stxTransferStxResultSchema = stxTransferStxResultSchema;
2639
+ exports.walletActionsSchema = walletActionsSchema;
2640
+ exports.walletEventSchema = walletEventSchema;
2641
+ exports.walletPermissionSchema = walletPermissionSchema;
2642
+ exports.walletTypeSchema = walletTypeSchema;
2643
+ exports.walletTypes = walletTypes;