@sats-connect/core 0.16.0-55e197a → 0.16.0-8db93ef

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,3848 @@
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
+ let ts_pattern = require("ts-pattern");
36
+
37
+ //#region src/request/rpc/objects/namespaces/wallet/shared/networks.ts
38
+ const commonNetworkConfigurationSchema = valibot.object({
39
+ id: valibot.string(),
40
+ name: valibot.string(),
41
+ mode: valibot.picklist([]),
42
+ blockExplorerUrl: valibot.optional(valibot.union([valibot.pipe(valibot.literal(""), valibot.transform(() => void 0)), valibot.pipe(valibot.string(), valibot.url())]))
43
+ });
44
+ const bitcoinChainModeSchema = valibot.enum({
45
+ mainnet: "mainnet",
46
+ testnet: "testnet",
47
+ testnet4: "testnet4",
48
+ signet: "signet",
49
+ regtest: "regtest"
50
+ });
51
+ const bitcoinNetworkConfigurationSchema = valibot.object({
52
+ chain: valibot.literal("bitcoin"),
53
+ ...commonNetworkConfigurationSchema.entries,
54
+ mode: valibot.pipe(valibot.string(), bitcoinChainModeSchema),
55
+ xverseApiUrl: valibot.pipe(valibot.string(), valibot.url()),
56
+ electrsApiUrl: valibot.pipe(valibot.string(), valibot.url())
57
+ });
58
+ const sparkChainMode = {
59
+ mainnet: "mainnet",
60
+ regtest: "regtest"
61
+ };
62
+ const sparkChainModeSchema = valibot.enum(sparkChainMode);
63
+ const sparkNetworkConfigurationSchema = valibot.object({
64
+ chain: valibot.literal("spark"),
65
+ ...commonNetworkConfigurationSchema.entries,
66
+ mode: valibot.pipe(valibot.string(), sparkChainModeSchema),
67
+ electrsApiUrl: valibot.pipe(valibot.string(), valibot.url())
68
+ });
69
+ const stacksChainMode = {
70
+ mainnet: "mainnet",
71
+ testnet: "testnet",
72
+ devnet: "devnet",
73
+ mocknet: "mocknet"
74
+ };
75
+ const stacksChainModeSchema = valibot.enum(stacksChainMode);
76
+ const stacksNetworkConfigurationSchema = valibot.object({
77
+ chain: valibot.literal("stacks"),
78
+ ...commonNetworkConfigurationSchema.entries,
79
+ mode: valibot.pipe(valibot.string(), stacksChainModeSchema),
80
+ stacksApiUrl: valibot.pipe(valibot.string(), valibot.url()),
81
+ xverseApiUrl: valibot.pipe(valibot.string(), valibot.url())
82
+ });
83
+ const starknetChainMode = {
84
+ mainnet: "mainnet",
85
+ sepolia: "sepolia"
86
+ };
87
+ const starknetChainModeSchema = valibot.enum(starknetChainMode);
88
+ const starknetNetworkConfigurationSchema = valibot.object({
89
+ chain: valibot.literal("starknet"),
90
+ ...commonNetworkConfigurationSchema.entries,
91
+ mode: valibot.pipe(valibot.string(), starknetChainModeSchema),
92
+ rpcApiUrl: valibot.pipe(valibot.string(), valibot.url()),
93
+ xverseApiUrl: valibot.pipe(valibot.string(), valibot.url())
94
+ });
95
+ const networkConfigurationSchema = valibot.variant("chain", [
96
+ bitcoinNetworkConfigurationSchema,
97
+ sparkNetworkConfigurationSchema,
98
+ stacksNetworkConfigurationSchema,
99
+ starknetNetworkConfigurationSchema
100
+ ]);
101
+ const bitcoinNetworkConfigurationOptionsSchema = valibot.omit(bitcoinNetworkConfigurationSchema, ["id"]);
102
+ const sparkNetworkConfigurationOptionsSchema = valibot.omit(sparkNetworkConfigurationSchema, ["id"]);
103
+ const stacksNetworkConfigurationOptionsSchema = valibot.omit(stacksNetworkConfigurationSchema, ["id"]);
104
+ const starknetNetworkConfigurationOptionsSchema = valibot.omit(starknetNetworkConfigurationSchema, ["id"]);
105
+ const networkConfigurationOptionsSchema = valibot.variant("chain", [
106
+ bitcoinNetworkConfigurationOptionsSchema,
107
+ sparkNetworkConfigurationOptionsSchema,
108
+ stacksNetworkConfigurationOptionsSchema,
109
+ starknetNetworkConfigurationOptionsSchema
110
+ ]);
111
+ const allResolvedNetworksSchema = valibot.object({
112
+ active: valibot.object({
113
+ bitcoin: bitcoinNetworkConfigurationSchema,
114
+ spark: sparkNetworkConfigurationSchema,
115
+ stacks: stacksNetworkConfigurationSchema,
116
+ starknet: starknetNetworkConfigurationSchema
117
+ }),
118
+ builtin: valibot.object({
119
+ bitcoin: valibot.array(bitcoinNetworkConfigurationSchema),
120
+ spark: valibot.array(sparkNetworkConfigurationSchema),
121
+ stacks: valibot.array(stacksNetworkConfigurationSchema),
122
+ starknet: valibot.array(starknetNetworkConfigurationSchema)
123
+ }),
124
+ custom: valibot.object({
125
+ bitcoin: valibot.array(bitcoinNetworkConfigurationSchema),
126
+ spark: valibot.array(sparkNetworkConfigurationSchema),
127
+ stacks: valibot.array(stacksNetworkConfigurationSchema),
128
+ starknet: valibot.array(starknetNetworkConfigurationSchema)
129
+ })
130
+ });
131
+
132
+ //#endregion
133
+ //#region src/request/rpc/objects/shared/index.ts
134
+ const walletTypes = [
135
+ "software",
136
+ "ledger",
137
+ "keystone"
138
+ ];
139
+ const walletTypeSchema = valibot.picklist(walletTypes);
140
+
141
+ //#endregion
142
+ //#region src/addresses/types.ts
143
+ let AddressPurpose = /* @__PURE__ */ function(AddressPurpose$1) {
144
+ AddressPurpose$1["Ordinals"] = "ordinals";
145
+ AddressPurpose$1["Payment"] = "payment";
146
+ AddressPurpose$1["Stacks"] = "stacks";
147
+ AddressPurpose$1["Starknet"] = "starknet";
148
+ AddressPurpose$1["Spark"] = "spark";
149
+ return AddressPurpose$1;
150
+ }({});
151
+ let AddressType = /* @__PURE__ */ function(AddressType$2) {
152
+ AddressType$2["p2pkh"] = "p2pkh";
153
+ AddressType$2["p2sh"] = "p2sh";
154
+ AddressType$2["p2wpkh"] = "p2wpkh";
155
+ AddressType$2["p2wsh"] = "p2wsh";
156
+ AddressType$2["p2tr"] = "p2tr";
157
+ AddressType$2["stacks"] = "stacks";
158
+ AddressType$2["starknet"] = "starknet";
159
+ AddressType$2["spark"] = "spark";
160
+ return AddressType$2;
161
+ }({});
162
+ const addressSchema = valibot.object({
163
+ address: valibot.string(),
164
+ publicKey: valibot.string(),
165
+ purpose: valibot.enum(AddressPurpose),
166
+ addressType: valibot.enum(AddressType),
167
+ walletType: walletTypeSchema
168
+ });
169
+
170
+ //#endregion
171
+ //#region src/addresses/index.ts
172
+ /**
173
+ * @deprecated Use `request()` instead
174
+ */
175
+ const getAddress = async (options) => {
176
+ const provider = await getProviderOrThrow(options.getProvider);
177
+ const { purposes } = options.payload;
178
+ if (!purposes) throw new Error("Address purposes are required");
179
+ try {
180
+ const request$1 = (0, jsontokens.createUnsecuredToken)(options.payload);
181
+ const response = await provider.connect(request$1);
182
+ options.onFinish?.(response);
183
+ } catch (error) {
184
+ console.error("[Connect] Error during address request", error);
185
+ options.onCancel?.();
186
+ }
187
+ };
188
+
189
+ //#endregion
190
+ //#region src/types.ts
191
+ let BitcoinNetworkType = /* @__PURE__ */ function(BitcoinNetworkType$1) {
192
+ BitcoinNetworkType$1["Mainnet"] = "Mainnet";
193
+ BitcoinNetworkType$1["Testnet"] = "Testnet";
194
+ BitcoinNetworkType$1["Testnet4"] = "Testnet4";
195
+ BitcoinNetworkType$1["Signet"] = "Signet";
196
+ BitcoinNetworkType$1["Regtest"] = "Regtest";
197
+ return BitcoinNetworkType$1;
198
+ }({});
199
+ let StacksNetworkType = /* @__PURE__ */ function(StacksNetworkType$1) {
200
+ StacksNetworkType$1["Mainnet"] = "mainnet";
201
+ StacksNetworkType$1["Testnet"] = "testnet";
202
+ return StacksNetworkType$1;
203
+ }({});
204
+ let StarknetNetworkType = /* @__PURE__ */ function(StarknetNetworkType$1) {
205
+ StarknetNetworkType$1["Mainnet"] = "mainnet";
206
+ StarknetNetworkType$1["Sepolia"] = "sepolia";
207
+ return StarknetNetworkType$1;
208
+ }({});
209
+ let SparkNetworkType = /* @__PURE__ */ function(SparkNetworkType$1) {
210
+ SparkNetworkType$1["Mainnet"] = "mainnet";
211
+ SparkNetworkType$1["Regtest"] = "regtest";
212
+ return SparkNetworkType$1;
213
+ }({});
214
+ /**
215
+ * @enum {number} RpcErrorCode
216
+ * @description JSON-RPC error codes
217
+ * @see https://www.jsonrpc.org/specification#error_object
218
+ */
219
+ let RpcErrorCode = /* @__PURE__ */ function(RpcErrorCode$1) {
220
+ /**
221
+ * Parse error Invalid JSON
222
+ **/
223
+ RpcErrorCode$1[RpcErrorCode$1["PARSE_ERROR"] = -32700] = "PARSE_ERROR";
224
+ /**
225
+ * The JSON sent is not a valid Request object.
226
+ **/
227
+ RpcErrorCode$1[RpcErrorCode$1["INVALID_REQUEST"] = -32600] = "INVALID_REQUEST";
228
+ /**
229
+ * The method does not exist/is not available.
230
+ **/
231
+ RpcErrorCode$1[RpcErrorCode$1["METHOD_NOT_FOUND"] = -32601] = "METHOD_NOT_FOUND";
232
+ /**
233
+ * Invalid method parameter(s).
234
+ */
235
+ RpcErrorCode$1[RpcErrorCode$1["INVALID_PARAMS"] = -32602] = "INVALID_PARAMS";
236
+ /**
237
+ * Internal JSON-RPC error.
238
+ * This is a generic error, used when the server encounters an error in performing the request.
239
+ **/
240
+ RpcErrorCode$1[RpcErrorCode$1["INTERNAL_ERROR"] = -32603] = "INTERNAL_ERROR";
241
+ /**
242
+ * user rejected/canceled the request
243
+ */
244
+ RpcErrorCode$1[RpcErrorCode$1["USER_REJECTION"] = -32e3] = "USER_REJECTION";
245
+ /**
246
+ * method is not supported for the address provided
247
+ */
248
+ RpcErrorCode$1[RpcErrorCode$1["METHOD_NOT_SUPPORTED"] = -32001] = "METHOD_NOT_SUPPORTED";
249
+ /**
250
+ * The client does not have permission to access the requested resource.
251
+ */
252
+ RpcErrorCode$1[RpcErrorCode$1["ACCESS_DENIED"] = -32002] = "ACCESS_DENIED";
253
+ return RpcErrorCode$1;
254
+ }({});
255
+
256
+ //#endregion
257
+ //#region src/provider/types.ts
258
+ const accountChangeEventName = "accountChange";
259
+ const accountChangeSchema = valibot.object({
260
+ type: valibot.literal(accountChangeEventName),
261
+ addresses: valibot.optional(valibot.array(addressSchema))
262
+ });
263
+ const networkChangeEventName = "networkChange";
264
+ const networkChangeSchema = valibot.object({
265
+ type: valibot.literal(networkChangeEventName),
266
+ bitcoin: valibot.object({ name: valibot.enum(BitcoinNetworkType) }),
267
+ stacks: valibot.object({ name: valibot.string() }),
268
+ addresses: valibot.optional(valibot.array(addressSchema))
269
+ });
270
+ const networkChangeEventNameV2 = "networkChangeV2";
271
+ const networkChangeV2Schema = valibot.object({
272
+ type: valibot.literal(networkChangeEventName),
273
+ networks: valibot.object({
274
+ bitcoin: bitcoinNetworkConfigurationSchema,
275
+ spark: sparkNetworkConfigurationSchema,
276
+ stacks: stacksNetworkConfigurationSchema,
277
+ starknet: starknetNetworkConfigurationSchema
278
+ }),
279
+ addresses: valibot.optional(valibot.array(addressSchema))
280
+ });
281
+ const disconnectEventName = "disconnect";
282
+ const disconnectSchema = valibot.object({ type: valibot.literal(disconnectEventName) });
283
+ const walletEventSchema = valibot.variant("type", [
284
+ accountChangeSchema,
285
+ networkChangeSchema,
286
+ disconnectSchema
287
+ ]);
288
+
289
+ //#endregion
290
+ //#region src/provider/index.ts
291
+ async function getProviderOrThrow(getProvider) {
292
+ const provider = await getProvider?.() || window.XverseProviders?.BitcoinProvider || window.BitcoinProvider;
293
+ if (!provider) throw new Error("No Bitcoin wallet installed");
294
+ return provider;
295
+ }
296
+ function getProviders() {
297
+ if (!window.btc_providers) window.btc_providers = [];
298
+ return window.btc_providers;
299
+ }
300
+ function getProviderById(providerId) {
301
+ return providerId?.split(".").reduce((acc, part) => acc?.[part], window);
302
+ }
303
+ function isProviderInstalled(providerId) {
304
+ return !!getProviderById(providerId);
305
+ }
306
+ function setDefaultProvider(providerId) {
307
+ localStorage.setItem("sats-connect_defaultProvider", providerId);
308
+ }
309
+ function getDefaultProvider() {
310
+ return localStorage.getItem("sats-connect_defaultProvider");
311
+ }
312
+ function removeDefaultProvider() {
313
+ localStorage.removeItem("sats-connect_defaultProvider");
314
+ }
315
+ function getSupportedWallets() {
316
+ return Object.values(DefaultAdaptersInfo).map((provider) => {
317
+ return {
318
+ ...provider,
319
+ isInstalled: isProviderInstalled(provider.id)
320
+ };
321
+ });
322
+ }
323
+
324
+ //#endregion
325
+ //#region src/runes/api.ts
326
+ const urlNetworkSuffix = {
327
+ [BitcoinNetworkType.Mainnet]: "",
328
+ [BitcoinNetworkType.Testnet]: "-testnet",
329
+ [BitcoinNetworkType.Testnet4]: "-testnet4",
330
+ [BitcoinNetworkType.Signet]: "-signet"
331
+ };
332
+ const ORDINALS_API_BASE_URL = (network = BitcoinNetworkType.Mainnet) => {
333
+ if (network === BitcoinNetworkType.Regtest) throw new Error(`Ordinals API does not support ${network} network`);
334
+ return `https://ordinals${urlNetworkSuffix[network]}.xverse.app/v1`;
335
+ };
336
+ var RunesApi = class {
337
+ client;
338
+ constructor(network) {
339
+ this.client = axios.default.create({ baseURL: ORDINALS_API_BASE_URL(network) });
340
+ }
341
+ parseError = (error) => {
342
+ return {
343
+ code: error.response?.status,
344
+ message: JSON.stringify(error.response?.data)
345
+ };
346
+ };
347
+ estimateMintCost = async (mintParams) => {
348
+ try {
349
+ return { data: (await this.client.post("/runes/mint/estimate", { ...mintParams })).data };
350
+ } catch (error) {
351
+ const err = error;
352
+ return { error: this.parseError(err) };
353
+ }
354
+ };
355
+ estimateEtchCost = async (etchParams) => {
356
+ try {
357
+ return { data: (await this.client.post("/runes/etch/estimate", { ...etchParams })).data };
358
+ } catch (error) {
359
+ const err = error;
360
+ return { error: this.parseError(err) };
361
+ }
362
+ };
363
+ createMintOrder = async (mintOrderParams) => {
364
+ try {
365
+ return { data: (await this.client.post("/runes/mint/orders", { ...mintOrderParams })).data };
366
+ } catch (error) {
367
+ const err = error;
368
+ return { error: this.parseError(err) };
369
+ }
370
+ };
371
+ createEtchOrder = async (etchOrderParams) => {
372
+ try {
373
+ return { data: (await this.client.post("/runes/etch/orders", { ...etchOrderParams })).data };
374
+ } catch (error) {
375
+ const err = error;
376
+ return { error: this.parseError(err) };
377
+ }
378
+ };
379
+ executeMint = async (orderId, fundTransactionId) => {
380
+ try {
381
+ return { data: (await this.client.post(`/runes/mint/orders/${orderId}/execute`, { fundTransactionId })).data };
382
+ } catch (error) {
383
+ const err = error;
384
+ return { error: this.parseError(err) };
385
+ }
386
+ };
387
+ executeEtch = async (orderId, fundTransactionId) => {
388
+ try {
389
+ return { data: (await this.client.post(`/runes/etch/orders/${orderId}/execute`, { fundTransactionId })).data };
390
+ } catch (error) {
391
+ const err = error;
392
+ return { error: this.parseError(err) };
393
+ }
394
+ };
395
+ getOrder = async (orderId) => {
396
+ try {
397
+ return { data: (await this.client.get(`/orders/${orderId}`)).data };
398
+ } catch (error) {
399
+ const err = error;
400
+ return { error: this.parseError(err) };
401
+ }
402
+ };
403
+ rbfOrder = async (rbfRequest) => {
404
+ const { orderId, newFeeRate } = rbfRequest;
405
+ try {
406
+ return { data: (await this.client.post(`/orders/${orderId}/rbf-estimate`, { newFeeRate })).data };
407
+ } catch (error) {
408
+ const err = error;
409
+ return { error: this.parseError(err) };
410
+ }
411
+ };
412
+ };
413
+ const clients = {};
414
+ const getRunesApiClient = (network = BitcoinNetworkType.Mainnet) => {
415
+ if (!clients[network]) clients[network] = new RunesApi(network);
416
+ return clients[network];
417
+ };
418
+
419
+ //#endregion
420
+ //#region src/adapters/satsConnectAdapter.ts
421
+ var SatsConnectAdapter = class {
422
+ async mintRunes(params) {
423
+ try {
424
+ const walletInfo = await this.requestInternal("getInfo", null).catch(() => null);
425
+ if (walletInfo && walletInfo.status === "success") {
426
+ if (walletInfo.result.methods?.includes("runes_mint")) {
427
+ const response = await this.requestInternal("runes_mint", params);
428
+ if (response) {
429
+ if (response.status === "success") return response;
430
+ if (response.status === "error" && response.error.code !== RpcErrorCode.METHOD_NOT_FOUND) return response;
431
+ }
432
+ }
433
+ }
434
+ const mintRequest = {
435
+ destinationAddress: params.destinationAddress,
436
+ feeRate: params.feeRate,
437
+ refundAddress: params.refundAddress,
438
+ repeats: params.repeats,
439
+ runeName: params.runeName,
440
+ appServiceFee: params.appServiceFee,
441
+ appServiceFeeAddress: params.appServiceFeeAddress
442
+ };
443
+ const orderResponse = await new RunesApi(params.network).createMintOrder(mintRequest);
444
+ if (!orderResponse.data) return {
445
+ status: "error",
446
+ error: {
447
+ code: orderResponse.error.code === 400 ? RpcErrorCode.INVALID_REQUEST : RpcErrorCode.INTERNAL_ERROR,
448
+ message: orderResponse.error.message
449
+ }
450
+ };
451
+ const paymentResponse = await this.requestInternal("sendTransfer", { recipients: [{
452
+ address: orderResponse.data.fundAddress,
453
+ amount: orderResponse.data.fundAmount
454
+ }] });
455
+ if (paymentResponse.status !== "success") return paymentResponse;
456
+ await new RunesApi(params.network).executeMint(orderResponse.data.orderId, paymentResponse.result.txid);
457
+ return {
458
+ status: "success",
459
+ result: {
460
+ orderId: orderResponse.data.orderId,
461
+ fundTransactionId: paymentResponse.result.txid,
462
+ fundingAddress: orderResponse.data.fundAddress
463
+ }
464
+ };
465
+ } catch (error) {
466
+ return {
467
+ status: "error",
468
+ error: {
469
+ code: RpcErrorCode.INTERNAL_ERROR,
470
+ message: error.message
471
+ }
472
+ };
473
+ }
474
+ }
475
+ async etchRunes(params) {
476
+ const etchRequest = {
477
+ destinationAddress: params.destinationAddress,
478
+ refundAddress: params.refundAddress,
479
+ feeRate: params.feeRate,
480
+ runeName: params.runeName,
481
+ divisibility: params.divisibility,
482
+ symbol: params.symbol,
483
+ premine: params.premine,
484
+ isMintable: params.isMintable,
485
+ terms: params.terms,
486
+ inscriptionDetails: params.inscriptionDetails,
487
+ delegateInscriptionId: params.delegateInscriptionId,
488
+ appServiceFee: params.appServiceFee,
489
+ appServiceFeeAddress: params.appServiceFeeAddress
490
+ };
491
+ try {
492
+ const walletInfo = await this.requestInternal("getInfo", null).catch(() => null);
493
+ if (walletInfo && walletInfo.status === "success") {
494
+ if (walletInfo.result.methods?.includes("runes_etch")) {
495
+ const response = await this.requestInternal("runes_etch", params);
496
+ if (response) {
497
+ if (response.status === "success") return response;
498
+ if (response.status === "error" && response.error.code !== RpcErrorCode.METHOD_NOT_FOUND) return response;
499
+ }
500
+ }
501
+ }
502
+ const orderResponse = await new RunesApi(params.network).createEtchOrder(etchRequest);
503
+ if (!orderResponse.data) return {
504
+ status: "error",
505
+ error: {
506
+ code: orderResponse.error.code === 400 ? RpcErrorCode.INVALID_REQUEST : RpcErrorCode.INTERNAL_ERROR,
507
+ message: orderResponse.error.message
508
+ }
509
+ };
510
+ const paymentResponse = await this.requestInternal("sendTransfer", { recipients: [{
511
+ address: orderResponse.data.fundAddress,
512
+ amount: orderResponse.data.fundAmount
513
+ }] });
514
+ if (paymentResponse.status !== "success") return paymentResponse;
515
+ await new RunesApi(params.network).executeEtch(orderResponse.data.orderId, paymentResponse.result.txid);
516
+ return {
517
+ status: "success",
518
+ result: {
519
+ orderId: orderResponse.data.orderId,
520
+ fundTransactionId: paymentResponse.result.txid,
521
+ fundingAddress: orderResponse.data.fundAddress
522
+ }
523
+ };
524
+ } catch (error) {
525
+ return {
526
+ status: "error",
527
+ error: {
528
+ code: RpcErrorCode.INTERNAL_ERROR,
529
+ message: error.message
530
+ }
531
+ };
532
+ }
533
+ }
534
+ async estimateMint(params) {
535
+ const estimateMintRequest = {
536
+ destinationAddress: params.destinationAddress,
537
+ feeRate: params.feeRate,
538
+ repeats: params.repeats,
539
+ runeName: params.runeName,
540
+ appServiceFee: params.appServiceFee,
541
+ appServiceFeeAddress: params.appServiceFeeAddress
542
+ };
543
+ const response = await getRunesApiClient(params.network).estimateMintCost(estimateMintRequest);
544
+ if (response.data) return {
545
+ status: "success",
546
+ result: response.data
547
+ };
548
+ return {
549
+ status: "error",
550
+ error: {
551
+ code: response.error.code === 400 ? RpcErrorCode.INVALID_REQUEST : RpcErrorCode.INTERNAL_ERROR,
552
+ message: response.error.message
553
+ }
554
+ };
555
+ }
556
+ async estimateEtch(params) {
557
+ const estimateEtchRequest = {
558
+ destinationAddress: params.destinationAddress,
559
+ feeRate: params.feeRate,
560
+ runeName: params.runeName,
561
+ divisibility: params.divisibility,
562
+ symbol: params.symbol,
563
+ premine: params.premine,
564
+ isMintable: params.isMintable,
565
+ terms: params.terms,
566
+ inscriptionDetails: params.inscriptionDetails,
567
+ delegateInscriptionId: params.delegateInscriptionId,
568
+ appServiceFee: params.appServiceFee,
569
+ appServiceFeeAddress: params.appServiceFeeAddress
570
+ };
571
+ const response = await getRunesApiClient(params.network).estimateEtchCost(estimateEtchRequest);
572
+ if (response.data) return {
573
+ status: "success",
574
+ result: response.data
575
+ };
576
+ return {
577
+ status: "error",
578
+ error: {
579
+ code: response.error.code === 400 ? RpcErrorCode.INVALID_REQUEST : RpcErrorCode.INTERNAL_ERROR,
580
+ message: response.error.message
581
+ }
582
+ };
583
+ }
584
+ async getOrder(params) {
585
+ const response = await getRunesApiClient(params.network).getOrder(params.id);
586
+ if (response.data) return {
587
+ status: "success",
588
+ result: response.data
589
+ };
590
+ return {
591
+ status: "error",
592
+ error: {
593
+ code: response.error.code === 400 || response.error.code === 404 ? RpcErrorCode.INVALID_REQUEST : RpcErrorCode.INTERNAL_ERROR,
594
+ message: response.error.message
595
+ }
596
+ };
597
+ }
598
+ async estimateRbfOrder(params) {
599
+ const rbfOrderRequest = {
600
+ newFeeRate: params.newFeeRate,
601
+ orderId: params.orderId
602
+ };
603
+ const response = await getRunesApiClient(params.network).rbfOrder(rbfOrderRequest);
604
+ if (response.data) return {
605
+ status: "success",
606
+ result: {
607
+ fundingAddress: response.data.fundingAddress,
608
+ rbfCost: response.data.rbfCost
609
+ }
610
+ };
611
+ return {
612
+ status: "error",
613
+ error: {
614
+ code: response.error.code === 400 || response.error.code === 404 ? RpcErrorCode.INVALID_REQUEST : RpcErrorCode.INTERNAL_ERROR,
615
+ message: response.error.message
616
+ }
617
+ };
618
+ }
619
+ async rbfOrder(params) {
620
+ try {
621
+ const rbfOrderRequest = {
622
+ newFeeRate: params.newFeeRate,
623
+ orderId: params.orderId
624
+ };
625
+ const orderResponse = await getRunesApiClient(params.network).rbfOrder(rbfOrderRequest);
626
+ if (!orderResponse.data) return {
627
+ status: "error",
628
+ error: {
629
+ code: orderResponse.error.code === 400 || orderResponse.error.code === 404 ? RpcErrorCode.INVALID_REQUEST : RpcErrorCode.INTERNAL_ERROR,
630
+ message: orderResponse.error.message
631
+ }
632
+ };
633
+ const paymentResponse = await this.requestInternal("sendTransfer", { recipients: [{
634
+ address: orderResponse.data.fundingAddress,
635
+ amount: orderResponse.data.rbfCost
636
+ }] });
637
+ if (paymentResponse.status !== "success") return paymentResponse;
638
+ return {
639
+ status: "success",
640
+ result: {
641
+ fundingAddress: orderResponse.data.fundingAddress,
642
+ orderId: rbfOrderRequest.orderId,
643
+ fundRBFTransactionId: paymentResponse.result.txid
644
+ }
645
+ };
646
+ } catch (error) {
647
+ return {
648
+ status: "error",
649
+ error: {
650
+ code: RpcErrorCode.INTERNAL_ERROR,
651
+ message: error.message
652
+ }
653
+ };
654
+ }
655
+ }
656
+ async request(method, params) {
657
+ switch (method) {
658
+ case "runes_mint": return this.mintRunes(params);
659
+ case "runes_etch": return this.etchRunes(params);
660
+ case "runes_estimateMint": return this.estimateMint(params);
661
+ case "runes_estimateEtch": return this.estimateEtch(params);
662
+ case "runes_getOrder": return this.getOrder(params);
663
+ case "runes_estimateRbfOrder": return this.estimateRbfOrder(params);
664
+ case "runes_rbfOrder": return this.rbfOrder(params);
665
+ default: return this.requestInternal(method, params);
666
+ }
667
+ }
668
+ };
669
+
670
+ //#endregion
671
+ //#region src/adapters/fordefi.ts
672
+ var FordefiAdapter = class extends SatsConnectAdapter {
673
+ id = DefaultAdaptersInfo.fordefi.id;
674
+ requestInternal = async (method, params) => {
675
+ const provider = getProviderById(this.id);
676
+ if (!provider) throw new Error("no wallet provider was found");
677
+ if (!method) throw new Error("A wallet method is required");
678
+ return await provider.request(method, params);
679
+ };
680
+ addListener = ({ eventName, cb }) => {
681
+ const provider = getProviderById(this.id);
682
+ if (!provider) throw new Error("no wallet provider was found");
683
+ if (!provider.addListener) {
684
+ console.error(`The wallet provider you are using does not support the addListener method. Please update your wallet provider.`);
685
+ return () => {};
686
+ }
687
+ return provider.addListener(eventName, cb);
688
+ };
689
+ };
690
+
691
+ //#endregion
692
+ //#region src/request/rpc/objects/namespaces/bitcoin/shared/index.ts
693
+ let MessageSigningProtocols = /* @__PURE__ */ function(MessageSigningProtocols$1) {
694
+ MessageSigningProtocols$1["ECDSA"] = "ECDSA";
695
+ MessageSigningProtocols$1["BIP322"] = "BIP322";
696
+ return MessageSigningProtocols$1;
697
+ }({});
698
+ let ProviderPlatform = /* @__PURE__ */ function(ProviderPlatform$1) {
699
+ ProviderPlatform$1["Web"] = "web";
700
+ ProviderPlatform$1["Mobile"] = "mobile";
701
+ return ProviderPlatform$1;
702
+ }({});
703
+
704
+ //#endregion
705
+ //#region src/adapters/unisat.ts
706
+ function convertSignInputsToInputType(signInputs) {
707
+ const result = [];
708
+ if (!signInputs) return result;
709
+ for (const address in signInputs) {
710
+ const indexes = signInputs[address];
711
+ for (const index of indexes) result.push({
712
+ index,
713
+ address
714
+ });
715
+ }
716
+ return result;
717
+ }
718
+ var UnisatAdapter = class extends SatsConnectAdapter {
719
+ id = DefaultAdaptersInfo.unisat.id;
720
+ async getAccounts(params) {
721
+ const { purposes } = params;
722
+ if (purposes.includes(AddressPurpose.Stacks) || purposes.includes(AddressPurpose.Starknet) || purposes.includes(AddressPurpose.Spark)) throw new Error("Only bitcoin addresses are supported");
723
+ const accounts = await window.unisat.requestAccounts();
724
+ const publicKey = await window.unisat.getPublicKey();
725
+ const address = accounts[0];
726
+ const addressType = (0, bitcoin_address_validation.getAddressInfo)(accounts[0]).type;
727
+ const pk = addressType === bitcoin_address_validation.AddressType.p2tr ? publicKey.slice(2) : publicKey;
728
+ const paymentAddress = {
729
+ address,
730
+ publicKey: pk,
731
+ addressType,
732
+ purpose: AddressPurpose.Payment,
733
+ walletType: "software"
734
+ };
735
+ const ordinalsAddress = {
736
+ address,
737
+ publicKey: pk,
738
+ addressType,
739
+ purpose: AddressPurpose.Ordinals,
740
+ walletType: "software"
741
+ };
742
+ const response = [];
743
+ if (purposes.includes(AddressPurpose.Payment)) response.push({
744
+ ...paymentAddress,
745
+ walletType: "software"
746
+ });
747
+ if (purposes.includes(AddressPurpose.Ordinals)) response.push({
748
+ ...ordinalsAddress,
749
+ walletType: "software"
750
+ });
751
+ return response;
752
+ }
753
+ async signMessage(params) {
754
+ const { message, address } = params;
755
+ const addressType = (0, bitcoin_address_validation.getAddressInfo)(address).type;
756
+ if ([bitcoin_address_validation.AddressType.p2wpkh, bitcoin_address_validation.AddressType.p2tr].includes(addressType)) return {
757
+ address,
758
+ messageHash: "",
759
+ signature: await window.unisat.signMessage(message, "bip322-simple"),
760
+ protocol: MessageSigningProtocols.BIP322
761
+ };
762
+ return {
763
+ address,
764
+ messageHash: "",
765
+ signature: await window.unisat.signMessage(message, "ecdsa"),
766
+ protocol: MessageSigningProtocols.ECDSA
767
+ };
768
+ }
769
+ async sendTransfer(params) {
770
+ const { recipients } = params;
771
+ if (recipients.length > 1) throw new Error("Only one recipient is supported by this wallet provider");
772
+ return { txid: await window.unisat.sendBitcoin(recipients[0].address, recipients[0].amount) };
773
+ }
774
+ async signPsbt(params) {
775
+ const { psbt, signInputs, broadcast } = params;
776
+ const psbtHex = buffer.Buffer.from(psbt, "base64").toString("hex");
777
+ const signedPsbt = await window.unisat.signPsbt(psbtHex, {
778
+ autoFinalized: broadcast,
779
+ toSignInputs: convertSignInputsToInputType(signInputs)
780
+ });
781
+ const signedPsbtBase64 = buffer.Buffer.from(signedPsbt, "hex").toString("base64");
782
+ let txid;
783
+ if (broadcast) txid = await window.unisat.pushPsbt(signedPsbt);
784
+ return {
785
+ psbt: signedPsbtBase64,
786
+ txid
787
+ };
788
+ }
789
+ requestInternal = async (method, params) => {
790
+ try {
791
+ switch (method) {
792
+ case "getAccounts": return {
793
+ status: "success",
794
+ result: await this.getAccounts(params)
795
+ };
796
+ case "sendTransfer": return {
797
+ status: "success",
798
+ result: await this.sendTransfer(params)
799
+ };
800
+ case "signMessage": return {
801
+ status: "success",
802
+ result: await this.signMessage(params)
803
+ };
804
+ case "signPsbt": return {
805
+ status: "success",
806
+ result: await this.signPsbt(params)
807
+ };
808
+ default: {
809
+ const error = {
810
+ code: RpcErrorCode.METHOD_NOT_SUPPORTED,
811
+ message: "Method not supported by the selected wallet"
812
+ };
813
+ console.error("Error calling the method", error);
814
+ return {
815
+ status: "error",
816
+ error
817
+ };
818
+ }
819
+ }
820
+ } catch (error) {
821
+ console.error("Error calling the method", error);
822
+ return {
823
+ status: "error",
824
+ error: {
825
+ code: error.code === 4001 ? RpcErrorCode.USER_REJECTION : RpcErrorCode.INTERNAL_ERROR,
826
+ message: error.message ? error.message : "Wallet method call error",
827
+ data: error
828
+ }
829
+ };
830
+ }
831
+ };
832
+ addListener = ({ eventName, cb }) => {
833
+ switch (eventName) {
834
+ case "accountChange": {
835
+ const handler = () => {
836
+ cb({ type: "accountChange" });
837
+ };
838
+ window.unisat.on("accountsChanged", handler);
839
+ return () => {
840
+ window.unisat.removeListener("accountsChanged", handler);
841
+ };
842
+ }
843
+ case "networkChange": {
844
+ const handler = () => {
845
+ cb({ type: "networkChange" });
846
+ };
847
+ window.unisat.on("networkChanged", handler);
848
+ return () => {
849
+ window.unisat.removeListener("networkChanged", handler);
850
+ };
851
+ }
852
+ default:
853
+ console.error("Event not supported by the selected wallet");
854
+ return () => {};
855
+ }
856
+ };
857
+ };
858
+
859
+ //#endregion
860
+ //#region src/request/rpcSpec.ts
861
+ const specIdSchema = valibot.union([
862
+ valibot.string(),
863
+ valibot.number(),
864
+ valibot.null()
865
+ ]);
866
+ const specRequestSchema = valibot.object({
867
+ jsonrpc: valibot.literal("2.0"),
868
+ method: valibot.string(),
869
+ params: valibot.optional(valibot.union([
870
+ valibot.array(valibot.unknown()),
871
+ valibot.looseObject({}),
872
+ valibot.null()
873
+ ])),
874
+ id: valibot.optional(specIdSchema)
875
+ });
876
+ const specSuccessResponseSchema = valibot.object({
877
+ jsonrpc: valibot.literal("2.0"),
878
+ result: valibot.unknown(),
879
+ id: specIdSchema
880
+ });
881
+ const warningSchema = valibot.variant("code", [valibot.object({
882
+ code: valibot.literal("DEPRECATION_NOTICE"),
883
+ message: valibot.string(),
884
+ sunsetDate: valibot.pipe(valibot.string(), valibot.isoDate())
885
+ })]);
886
+ /**
887
+ * Extends the standard JSON RPC 2.0 with an additional field as a means of
888
+ * providing clients with extra data, such as deprecation warnings, without
889
+ * altering the main payloads.
890
+ *
891
+ * A JSON-RPC response must either be a result (success) or an error (failure).
892
+ * To provide additional data, conventions must be layered atop these two types.
893
+ * Having an additional property is the least disruptive approach, and is
894
+ * acceptable when clients are known to be able to handle such a structure,
895
+ * which they can since they're all part of Sats Connect.
896
+ */
897
+ const specSuccessWithExtensionsResponseSchema = valibot.object({
898
+ ...specSuccessResponseSchema.entries,
899
+ extensions: valibot.optional(valibot.object({ warnings: valibot.array(warningSchema) }))
900
+ });
901
+ const specErrorObjectSchema = valibot.object({
902
+ code: valibot.number(),
903
+ message: valibot.string(),
904
+ data: valibot.optional(valibot.unknown())
905
+ });
906
+ const specErrorResponseSchema = valibot.object({
907
+ jsonrpc: valibot.literal("2.0"),
908
+ error: specErrorObjectSchema,
909
+ id: specIdSchema
910
+ });
911
+ const specResponseSchema = valibot.union([specSuccessWithExtensionsResponseSchema, specErrorResponseSchema]);
912
+
913
+ //#endregion
914
+ //#region src/request/sanitizeRequest.ts
915
+ const sanitizeRequest = (method, params, providerInfo) => {
916
+ try {
917
+ const [major, minor] = providerInfo.version.split(".").map((part) => parseInt(part, 10));
918
+ const platform = providerInfo.platform;
919
+ if (!platform || platform === ProviderPlatform.Web && major <= 1 && minor <= 4 || platform === ProviderPlatform.Mobile && major <= 1 && minor <= 54) {
920
+ const v1Sanitized = sanitizeAddressPurposeRequest(method, params);
921
+ method = v1Sanitized.method;
922
+ params = v1Sanitized.params;
923
+ }
924
+ } catch {}
925
+ return {
926
+ method,
927
+ params
928
+ };
929
+ };
930
+ const sanitizeAddressPurposeRequest = (method, params) => {
931
+ const filterPurposes = (purposes) => purposes?.filter((purpose) => purpose !== AddressPurpose.Spark && purpose !== AddressPurpose.Starknet);
932
+ if (method === "wallet_connect") {
933
+ const typedParams = params;
934
+ if (!typedParams) return {
935
+ method,
936
+ params
937
+ };
938
+ const { addresses, ...rest } = typedParams;
939
+ return {
940
+ method,
941
+ params: {
942
+ ...rest,
943
+ addresses: filterPurposes(addresses)
944
+ }
945
+ };
946
+ }
947
+ if (method === "getAccounts") {
948
+ const { purposes, ...rest } = params;
949
+ return {
950
+ method,
951
+ params: {
952
+ ...rest,
953
+ purposes: filterPurposes(purposes)
954
+ }
955
+ };
956
+ }
957
+ if (method === "getAddresses") {
958
+ const { purposes, ...rest } = params;
959
+ return {
960
+ method,
961
+ params: {
962
+ ...rest,
963
+ purposes: filterPurposes(purposes)
964
+ }
965
+ };
966
+ }
967
+ return {
968
+ method,
969
+ params
970
+ };
971
+ };
972
+
973
+ //#endregion
974
+ //#region src/request/methods.ts
975
+ const bitcoinMethods = {
976
+ getAccounts: "getAccounts",
977
+ bitcoin_getAccountsV2: "bitcoin_getAccountsV2",
978
+ getAddresses: "getAddresses",
979
+ bitcoin_getAddressesV2: "bitcoin_getAddressesV2",
980
+ getBalance: "getBalance",
981
+ bitcoin_getBalanceV2: "bitcoin_getBalanceV2",
982
+ getInfo: "getInfo",
983
+ bitcoin_getInfoV2: "bitcoin_getInfoV2",
984
+ sendTransfer: "sendTransfer",
985
+ bitcoin_sendTransferV2: "bitcoin_sendTransferV2",
986
+ signMessage: "signMessage",
987
+ bitcoin_signMessageV2: "bitcoin_signMessageV2",
988
+ signMultipleMessages: "signMultipleMessages",
989
+ bitcoin_signMultipleMessagesV2: "bitcoin_signMultipleMessagesV2",
990
+ signPsbt: "signPsbt",
991
+ bitcoin_signPsbtV2: "bitcoin_signPsbtV2"
992
+ };
993
+ const stacksMethods = {
994
+ stx_callContract: "stx_callContract",
995
+ stx_deployContract: "stx_deployContract",
996
+ stx_getAccounts: "stx_getAccounts",
997
+ stx_getAddresses: "stx_getAddresses",
998
+ stacks_getAddressesV2: "stacks_getAddressesV2",
999
+ stx_signMessage: "stx_signMessage",
1000
+ stx_signStructuredMessage: "stx_signStructuredMessage",
1001
+ stx_signTransaction: "stx_signTransaction",
1002
+ stx_signTransactions: "stx_signTransactions",
1003
+ stx_transferStx: "stx_transferStx"
1004
+ };
1005
+ const sparkMethods = {
1006
+ spark_getAddresses: "spark_getAddresses",
1007
+ spark_getAddressesV2: "spark_getAddressesV2",
1008
+ spark_getBalance: "spark_getBalance",
1009
+ spark_transfer: "spark_transfer",
1010
+ spark_transferToken: "spark_transferToken",
1011
+ spark_signMessage: "spark_signMessage",
1012
+ spark_flashnet_getJwt: "spark_flashnet_getJwt",
1013
+ spark_flashnet_signIntent: "spark_flashnet_signIntent",
1014
+ spark_flashnet_signStructuredMessage: "spark_flashnet_signStructuredMessage",
1015
+ spark_flashnet_executeSwap: "spark_flashnet_executeSwap",
1016
+ spark_flashnet_executeRouteSwap: "spark_flashnet_executeRouteSwap",
1017
+ spark_flashnet_clawbackFunds: "spark_flashnet_clawbackFunds",
1018
+ spark_flashnet_getClawbackEligibleTransfers: "spark_flashnet_getClawbackEligibleTransfers"
1019
+ };
1020
+ const runesMethods = {
1021
+ runes_estimateEtch: "runes_estimateEtch",
1022
+ runes_estimateMint: "runes_estimateMint",
1023
+ runes_estimateRbfOrder: "runes_estimateRbfOrder",
1024
+ runes_etch: "runes_etch",
1025
+ runes_getBalance: "runes_getBalance",
1026
+ runes_getOrder: "runes_getOrder",
1027
+ runes_mint: "runes_mint",
1028
+ runes_rbfOrder: "runes_rbfOrder",
1029
+ runes_transfer: "runes_transfer"
1030
+ };
1031
+ const ordinalsMethods = {
1032
+ ord_getInscriptions: "ord_getInscriptions",
1033
+ ord_sendInscriptions: "ord_sendInscriptions"
1034
+ };
1035
+ const walletMethods = {
1036
+ wallet_addNetwork: "wallet_addNetwork",
1037
+ wallet_addNetworkV2: "wallet_addNetworkV2",
1038
+ wallet_changeNetworkById: "wallet_changeNetworkById",
1039
+ wallet_changeNetwork: "wallet_changeNetwork",
1040
+ wallet_connect: "wallet_connect",
1041
+ wallet_connectV2: "wallet_connectV2",
1042
+ wallet_disconnect: "wallet_disconnect",
1043
+ wallet_getAccount: "wallet_getAccount",
1044
+ wallet_getAccountV2: "wallet_getAccountV2",
1045
+ wallet_getCurrentPermissions: "wallet_getCurrentPermissions",
1046
+ wallet_getNetwork: "wallet_getNetwork",
1047
+ wallet_getNetworks: "wallet_getNetworks",
1048
+ wallet_getWalletType: "wallet_getWalletType",
1049
+ wallet_openBridge: "wallet_openBridge",
1050
+ wallet_openBuy: "wallet_openBuy",
1051
+ wallet_openReceive: "wallet_openReceive",
1052
+ wallet_renouncePermissions: "wallet_renouncePermissions",
1053
+ wallet_requestPermissions: "wallet_requestPermissions"
1054
+ };
1055
+
1056
+ //#endregion
1057
+ //#region src/request/rpc/compat.ts
1058
+ function bitcoinModeToLegacyBitcoinNetworkType(mode) {
1059
+ return (0, ts_pattern.match)(mode).with("mainnet", () => BitcoinNetworkType.Mainnet).with("testnet", () => BitcoinNetworkType.Testnet).with("regtest", () => BitcoinNetworkType.Regtest).with("signet", () => BitcoinNetworkType.Signet).with("testnet4", () => BitcoinNetworkType.Testnet4).exhaustive();
1060
+ }
1061
+ function stacksModeToLegacyStacksNetworkType(mode) {
1062
+ return (0, ts_pattern.match)(mode).with("mainnet", () => StacksNetworkType.Mainnet).with("testnet", () => StacksNetworkType.Testnet).otherwise(() => StacksNetworkType.Testnet);
1063
+ }
1064
+ function sparkModeToLegacySparkNetworkType(mode) {
1065
+ return (0, ts_pattern.match)(mode).with("mainnet", () => SparkNetworkType.Mainnet).with("regtest", () => SparkNetworkType.Regtest).exhaustive();
1066
+ }
1067
+
1068
+ //#endregion
1069
+ //#region src/request/rpc/methodSupport.ts
1070
+ const { active } = {
1071
+ active: "active",
1072
+ deprecated: "deprecated",
1073
+ removed: "removed"
1074
+ };
1075
+ const methodSupport = {
1076
+ [bitcoinMethods.getAccounts]: active,
1077
+ [bitcoinMethods.bitcoin_getAccountsV2]: active,
1078
+ [bitcoinMethods.getAddresses]: active,
1079
+ [bitcoinMethods.bitcoin_getAddressesV2]: active,
1080
+ [bitcoinMethods.getBalance]: active,
1081
+ [bitcoinMethods.bitcoin_getBalanceV2]: active,
1082
+ [bitcoinMethods.getInfo]: active,
1083
+ [bitcoinMethods.bitcoin_getInfoV2]: active,
1084
+ [bitcoinMethods.sendTransfer]: active,
1085
+ [bitcoinMethods.bitcoin_sendTransferV2]: active,
1086
+ [bitcoinMethods.signMessage]: active,
1087
+ [bitcoinMethods.bitcoin_signMessageV2]: active,
1088
+ [bitcoinMethods.signMultipleMessages]: active,
1089
+ [bitcoinMethods.bitcoin_signMultipleMessagesV2]: active,
1090
+ [bitcoinMethods.signPsbt]: active,
1091
+ [bitcoinMethods.bitcoin_signPsbtV2]: active,
1092
+ [stacksMethods.stx_callContract]: active,
1093
+ [stacksMethods.stx_deployContract]: active,
1094
+ [stacksMethods.stx_getAccounts]: active,
1095
+ [stacksMethods.stx_getAddresses]: active,
1096
+ [stacksMethods.stacks_getAddressesV2]: active,
1097
+ [stacksMethods.stx_signMessage]: active,
1098
+ [stacksMethods.stx_signStructuredMessage]: active,
1099
+ [stacksMethods.stx_signTransaction]: active,
1100
+ [stacksMethods.stx_signTransactions]: active,
1101
+ [stacksMethods.stx_transferStx]: active,
1102
+ [sparkMethods.spark_getAddresses]: active,
1103
+ [sparkMethods.spark_getAddressesV2]: active,
1104
+ [sparkMethods.spark_getBalance]: active,
1105
+ [sparkMethods.spark_transfer]: active,
1106
+ [sparkMethods.spark_transferToken]: active,
1107
+ [sparkMethods.spark_signMessage]: active,
1108
+ [sparkMethods.spark_flashnet_getJwt]: active,
1109
+ [sparkMethods.spark_flashnet_signIntent]: active,
1110
+ [sparkMethods.spark_flashnet_signStructuredMessage]: active,
1111
+ [sparkMethods.spark_flashnet_executeSwap]: active,
1112
+ [sparkMethods.spark_flashnet_executeRouteSwap]: active,
1113
+ [sparkMethods.spark_flashnet_clawbackFunds]: active,
1114
+ [sparkMethods.spark_flashnet_getClawbackEligibleTransfers]: active,
1115
+ [runesMethods.runes_estimateEtch]: active,
1116
+ [runesMethods.runes_estimateMint]: active,
1117
+ [runesMethods.runes_estimateRbfOrder]: active,
1118
+ [runesMethods.runes_etch]: active,
1119
+ [runesMethods.runes_getBalance]: active,
1120
+ [runesMethods.runes_getOrder]: active,
1121
+ [runesMethods.runes_mint]: active,
1122
+ [runesMethods.runes_rbfOrder]: active,
1123
+ [runesMethods.runes_transfer]: active,
1124
+ [ordinalsMethods.ord_getInscriptions]: active,
1125
+ [ordinalsMethods.ord_sendInscriptions]: active,
1126
+ [walletMethods.wallet_addNetwork]: active,
1127
+ [walletMethods.wallet_addNetworkV2]: active,
1128
+ [walletMethods.wallet_changeNetworkById]: active,
1129
+ [walletMethods.wallet_changeNetwork]: active,
1130
+ [walletMethods.wallet_connect]: active,
1131
+ [walletMethods.wallet_connectV2]: active,
1132
+ [walletMethods.wallet_disconnect]: active,
1133
+ [walletMethods.wallet_getAccount]: active,
1134
+ [walletMethods.wallet_getAccountV2]: active,
1135
+ [walletMethods.wallet_getCurrentPermissions]: active,
1136
+ [walletMethods.wallet_getNetwork]: active,
1137
+ [walletMethods.wallet_getNetworks]: active,
1138
+ [walletMethods.wallet_getWalletType]: active,
1139
+ [walletMethods.wallet_openBridge]: active,
1140
+ [walletMethods.wallet_openBuy]: active,
1141
+ [walletMethods.wallet_openReceive]: active,
1142
+ [walletMethods.wallet_renouncePermissions]: active,
1143
+ [walletMethods.wallet_requestPermissions]: active
1144
+ };
1145
+
1146
+ //#endregion
1147
+ //#region src/request/shared.ts
1148
+ const rpcIdSchema = valibot.string();
1149
+
1150
+ //#endregion
1151
+ //#region src/request/createRequestSchema.ts
1152
+ function createRequestSchema({ paramsSchema, method }) {
1153
+ return valibot.object({
1154
+ ...specRequestSchema.entries,
1155
+ id: rpcIdSchema,
1156
+ method: valibot.literal(method),
1157
+ params: paramsSchema
1158
+ });
1159
+ }
1160
+
1161
+ //#endregion
1162
+ //#region src/request/rpc/objects/namespaces/bitcoin/methods/getAccounts/request.ts
1163
+ const bitcoinGetAccountsParamsSchema = valibot.object({
1164
+ purposes: valibot.array(valibot.enum(AddressPurpose)),
1165
+ message: valibot.optional(valibot.string())
1166
+ });
1167
+ const bitcoinGetAccountsRequestSchema = createRequestSchema({
1168
+ paramsSchema: bitcoinGetAccountsParamsSchema,
1169
+ method: bitcoinMethods.getAccounts
1170
+ });
1171
+
1172
+ //#endregion
1173
+ //#region src/request/createSuccessResponseSchema.ts
1174
+ function createSuccessResponseSchema({ method, resultSchema }) {
1175
+ return valibot.object({
1176
+ ...specSuccessWithExtensionsResponseSchema.entries,
1177
+ id: rpcIdSchema,
1178
+ result: resultSchema,
1179
+ "~sats-connect-method": valibot.literal(method)
1180
+ });
1181
+ }
1182
+
1183
+ //#endregion
1184
+ //#region src/request/rpc/objects/namespaces/bitcoin/methods/getAccounts/response.ts
1185
+ const bitcoinGetAccountsResultSchema = valibot.array(valibot.object({
1186
+ ...addressSchema.entries,
1187
+ ...valibot.object({ walletType: walletTypeSchema }).entries
1188
+ }));
1189
+ const bitcoinGetAccountsSuccessResponseSchema = createSuccessResponseSchema({
1190
+ resultSchema: bitcoinGetAccountsResultSchema,
1191
+ method: bitcoinMethods.getAccounts
1192
+ });
1193
+
1194
+ //#endregion
1195
+ //#region src/request/rpc/objects/namespaces/bitcoin/methods/getAccountsV2/request.ts
1196
+ const bitcoinGetAccountsV2ParamsSchema = valibot.object({
1197
+ purposes: valibot.array(valibot.enum(AddressPurpose)),
1198
+ message: valibot.optional(valibot.string())
1199
+ });
1200
+ const bitcoinGetAccountsV2RequestSchema = createRequestSchema({
1201
+ paramsSchema: bitcoinGetAccountsV2ParamsSchema,
1202
+ method: bitcoinMethods.bitcoin_getAccountsV2
1203
+ });
1204
+
1205
+ //#endregion
1206
+ //#region src/request/rpc/objects/namespaces/bitcoin/methods/getAccountsV2/response.ts
1207
+ const bitcoinGetAccountsV2ResultSchema = valibot.array(valibot.object({
1208
+ ...addressSchema.entries,
1209
+ ...valibot.object({ walletType: walletTypeSchema }).entries
1210
+ }));
1211
+ const bitcoinGetAccountsV2SuccessResponseSchema = createSuccessResponseSchema({
1212
+ resultSchema: bitcoinGetAccountsV2ResultSchema,
1213
+ method: bitcoinMethods.bitcoin_getAccountsV2
1214
+ });
1215
+
1216
+ //#endregion
1217
+ //#region src/request/rpc/objects/namespaces/bitcoin/methods/getAddresses/request.ts
1218
+ const bitcoinGetAddressesParamsSchema = valibot.object({
1219
+ purposes: valibot.array(valibot.enum(AddressPurpose)),
1220
+ message: valibot.optional(valibot.string())
1221
+ });
1222
+ const bitcoinGetAddressesRequestSchema = createRequestSchema({
1223
+ paramsSchema: bitcoinGetAddressesParamsSchema,
1224
+ method: bitcoinMethods.getAddresses
1225
+ });
1226
+
1227
+ //#endregion
1228
+ //#region src/request/rpc/objects/namespaces/bitcoin/methods/getAddresses/response.ts
1229
+ const getNetworkResultSchema = valibot.object({
1230
+ bitcoin: valibot.object({ name: valibot.string() }),
1231
+ stacks: valibot.object({ name: valibot.string() }),
1232
+ spark: valibot.object({ name: valibot.string() })
1233
+ });
1234
+ const bitcoinGetAddressesResultSchema = valibot.object({
1235
+ addresses: valibot.array(addressSchema),
1236
+ network: getNetworkResultSchema
1237
+ });
1238
+ const bitcoinGetAddressesSuccessResponseSchema = createSuccessResponseSchema({
1239
+ resultSchema: bitcoinGetAddressesResultSchema,
1240
+ method: bitcoinMethods.getAddresses
1241
+ });
1242
+
1243
+ //#endregion
1244
+ //#region src/request/rpc/objects/namespaces/bitcoin/methods/getAddressesV2/request.ts
1245
+ const bitcoinGetAddressesV2ParamsSchema = valibot.object({
1246
+ purposes: valibot.array(valibot.enum(AddressPurpose)),
1247
+ message: valibot.optional(valibot.string())
1248
+ });
1249
+ const bitcoinGetAddressesV2RequestSchema = createRequestSchema({
1250
+ paramsSchema: bitcoinGetAddressesV2ParamsSchema,
1251
+ method: bitcoinMethods.bitcoin_getAddressesV2
1252
+ });
1253
+
1254
+ //#endregion
1255
+ //#region src/request/rpc/objects/namespaces/bitcoin/methods/getAddressesV2/response.ts
1256
+ const getNetworksResultSchema = valibot.object({
1257
+ active: valibot.object({
1258
+ bitcoin: valibot.object({
1259
+ id: valibot.string(),
1260
+ type: valibot.string(),
1261
+ name: valibot.string()
1262
+ }),
1263
+ stacks: valibot.object({
1264
+ id: valibot.string(),
1265
+ type: valibot.string(),
1266
+ name: valibot.string()
1267
+ }),
1268
+ spark: valibot.object({
1269
+ id: valibot.string(),
1270
+ type: valibot.string(),
1271
+ name: valibot.string()
1272
+ }),
1273
+ starknet: valibot.object({
1274
+ id: valibot.string(),
1275
+ type: valibot.string(),
1276
+ name: valibot.string()
1277
+ })
1278
+ }),
1279
+ builtin: valibot.object({
1280
+ bitcoin: valibot.array(valibot.any()),
1281
+ stacks: valibot.array(valibot.any()),
1282
+ spark: valibot.array(valibot.any()),
1283
+ starknet: valibot.array(valibot.any())
1284
+ }),
1285
+ custom: valibot.object({
1286
+ bitcoin: valibot.array(valibot.any()),
1287
+ stacks: valibot.array(valibot.any()),
1288
+ spark: valibot.array(valibot.any()),
1289
+ starknet: valibot.array(valibot.any())
1290
+ })
1291
+ });
1292
+ const bitcoinGetAddressesV2ResultSchema = valibot.object({
1293
+ addresses: valibot.array(addressSchema),
1294
+ networks: getNetworksResultSchema
1295
+ });
1296
+ const bitcoinGetAddressesV2SuccessResponseSchema = createSuccessResponseSchema({
1297
+ resultSchema: bitcoinGetAddressesV2ResultSchema,
1298
+ method: bitcoinMethods.bitcoin_getAddressesV2
1299
+ });
1300
+
1301
+ //#endregion
1302
+ //#region src/request/rpc/objects/namespaces/bitcoin/methods/getBalance/request.ts
1303
+ const bitcoinGetBalanceParamsSchema = valibot.nullish(valibot.null());
1304
+ const bitcoinGetBalanceRequestSchema = createRequestSchema({
1305
+ paramsSchema: bitcoinGetBalanceParamsSchema,
1306
+ method: bitcoinMethods.getBalance
1307
+ });
1308
+
1309
+ //#endregion
1310
+ //#region src/request/rpc/objects/namespaces/bitcoin/methods/getBalance/response.ts
1311
+ const bitcoinGetBalanceResultSchema = valibot.object({
1312
+ confirmed: valibot.string(),
1313
+ unconfirmed: valibot.string(),
1314
+ total: valibot.string()
1315
+ });
1316
+ const bitcoinGetBalanceSuccessResponseSchema = createSuccessResponseSchema({
1317
+ resultSchema: bitcoinGetBalanceResultSchema,
1318
+ method: bitcoinMethods.getBalance
1319
+ });
1320
+
1321
+ //#endregion
1322
+ //#region src/request/rpc/objects/namespaces/bitcoin/methods/getBalanceV2/request.ts
1323
+ const bitcoinGetBalanceV2ParamsSchema = valibot.nullish(valibot.null());
1324
+ const bitcoinGetBalanceV2RequestSchema = createRequestSchema({
1325
+ paramsSchema: bitcoinGetBalanceV2ParamsSchema,
1326
+ method: bitcoinMethods.bitcoin_getBalanceV2
1327
+ });
1328
+
1329
+ //#endregion
1330
+ //#region src/request/rpc/objects/namespaces/bitcoin/methods/getBalanceV2/response.ts
1331
+ const bitcoinGetBalanceV2ResultSchema = valibot.object({
1332
+ confirmed: valibot.string(),
1333
+ unconfirmed: valibot.string(),
1334
+ total: valibot.string()
1335
+ });
1336
+ const bitcoinGetBalanceV2SuccessResponseSchema = createSuccessResponseSchema({
1337
+ resultSchema: bitcoinGetBalanceV2ResultSchema,
1338
+ method: bitcoinMethods.bitcoin_getBalanceV2
1339
+ });
1340
+
1341
+ //#endregion
1342
+ //#region src/request/rpc/objects/namespaces/bitcoin/methods/getInfo/request.ts
1343
+ const bitcoinGetInfoParamsSchema = valibot.nullish(valibot.null());
1344
+ const bitcoinGetInfoRequestSchema = createRequestSchema({
1345
+ paramsSchema: bitcoinGetInfoParamsSchema,
1346
+ method: bitcoinMethods.getInfo
1347
+ });
1348
+
1349
+ //#endregion
1350
+ //#region src/request/rpc/objects/namespaces/bitcoin/methods/getInfo/response.ts
1351
+ const bitcoinGetInfoResultSchema = valibot.object({
1352
+ version: valibot.string(),
1353
+ platform: valibot.optional(valibot.enum(ProviderPlatform)),
1354
+ methods: valibot.optional(valibot.array(valibot.string())),
1355
+ supports: valibot.array(valibot.string())
1356
+ });
1357
+ const bitcoinGetInfoSuccessResponseSchema = createSuccessResponseSchema({
1358
+ resultSchema: bitcoinGetInfoResultSchema,
1359
+ method: bitcoinMethods.getInfo
1360
+ });
1361
+
1362
+ //#endregion
1363
+ //#region src/request/rpc/objects/namespaces/bitcoin/methods/getInfoV2/request.ts
1364
+ const bitcoinGetInfoV2ParamsSchema = valibot.nullish(valibot.null());
1365
+ const bitcoinGetInfoV2RequestSchema = createRequestSchema({
1366
+ paramsSchema: bitcoinGetInfoV2ParamsSchema,
1367
+ method: bitcoinMethods.bitcoin_getInfoV2
1368
+ });
1369
+
1370
+ //#endregion
1371
+ //#region src/request/rpc/objects/namespaces/bitcoin/methods/getInfoV2/response.ts
1372
+ const bitcoinGetInfoV2ResultSchema = valibot.object({
1373
+ version: valibot.string(),
1374
+ platform: valibot.optional(valibot.enum(ProviderPlatform)),
1375
+ methods: valibot.optional(valibot.array(valibot.string())),
1376
+ supports: valibot.array(valibot.string())
1377
+ });
1378
+ const bitcoinGetInfoV2SuccessResponseSchema = createSuccessResponseSchema({
1379
+ resultSchema: bitcoinGetInfoV2ResultSchema,
1380
+ method: bitcoinMethods.bitcoin_getInfoV2
1381
+ });
1382
+
1383
+ //#endregion
1384
+ //#region src/request/rpc/objects/namespaces/bitcoin/methods/sendTransfer/request.ts
1385
+ const bitcoinSendTransferParamsSchema = valibot.object({ recipients: valibot.array(valibot.object({
1386
+ address: valibot.string(),
1387
+ amount: valibot.number()
1388
+ })) });
1389
+ const bitcoinSendTransferRequestSchema = createRequestSchema({
1390
+ paramsSchema: bitcoinSendTransferParamsSchema,
1391
+ method: bitcoinMethods.sendTransfer
1392
+ });
1393
+
1394
+ //#endregion
1395
+ //#region src/request/rpc/objects/namespaces/bitcoin/methods/sendTransfer/response.ts
1396
+ const bitcoinSendTransferResultSchema = valibot.object({ txid: valibot.string() });
1397
+ const bitcoinSendTransferSuccessResponseSchema = createSuccessResponseSchema({
1398
+ resultSchema: bitcoinSendTransferResultSchema,
1399
+ method: bitcoinMethods.sendTransfer
1400
+ });
1401
+
1402
+ //#endregion
1403
+ //#region src/request/rpc/objects/namespaces/bitcoin/methods/sendTransferV2/request.ts
1404
+ const bitcoinSendTransferV2ParamsSchema = valibot.object({ recipients: valibot.array(valibot.object({
1405
+ address: valibot.string(),
1406
+ amount: valibot.number()
1407
+ })) });
1408
+ const bitcoinSendTransferV2RequestSchema = createRequestSchema({
1409
+ paramsSchema: bitcoinSendTransferV2ParamsSchema,
1410
+ method: bitcoinMethods.bitcoin_sendTransferV2
1411
+ });
1412
+
1413
+ //#endregion
1414
+ //#region src/request/rpc/objects/namespaces/bitcoin/methods/sendTransferV2/response.ts
1415
+ const bitcoinSendTransferV2ResultSchema = valibot.object({ txid: valibot.string() });
1416
+ const bitcoinSendTransferV2SuccessResponseSchema = createSuccessResponseSchema({
1417
+ resultSchema: bitcoinSendTransferV2ResultSchema,
1418
+ method: bitcoinMethods.bitcoin_sendTransferV2
1419
+ });
1420
+
1421
+ //#endregion
1422
+ //#region src/request/rpc/objects/namespaces/bitcoin/methods/signMessage/request.ts
1423
+ const bitcoinSignMessageParamsSchema = valibot.object({
1424
+ address: valibot.string(),
1425
+ message: valibot.string(),
1426
+ protocol: valibot.optional(valibot.enum(MessageSigningProtocols))
1427
+ });
1428
+ const bitcoinSignMessageRequestSchema = createRequestSchema({
1429
+ paramsSchema: bitcoinSignMessageParamsSchema,
1430
+ method: bitcoinMethods.signMessage
1431
+ });
1432
+
1433
+ //#endregion
1434
+ //#region src/request/rpc/objects/namespaces/bitcoin/methods/signMessage/response.ts
1435
+ const bitcoinSignMessageResultSchema = valibot.object({
1436
+ signature: valibot.string(),
1437
+ messageHash: valibot.string(),
1438
+ address: valibot.string(),
1439
+ protocol: valibot.enum(MessageSigningProtocols)
1440
+ });
1441
+ const bitcoinSignMessageSuccessResponseSchema = createSuccessResponseSchema({
1442
+ resultSchema: bitcoinSignMessageResultSchema,
1443
+ method: bitcoinMethods.signMessage
1444
+ });
1445
+
1446
+ //#endregion
1447
+ //#region src/request/rpc/objects/namespaces/bitcoin/methods/signMessageV2/request.ts
1448
+ const bitcoinSignMessageV2ParamsSchema = valibot.object({
1449
+ address: valibot.string(),
1450
+ message: valibot.string(),
1451
+ protocol: valibot.optional(valibot.enum(MessageSigningProtocols))
1452
+ });
1453
+ const bitcoinSignMessageV2RequestSchema = createRequestSchema({
1454
+ paramsSchema: bitcoinSignMessageV2ParamsSchema,
1455
+ method: bitcoinMethods.bitcoin_signMessageV2
1456
+ });
1457
+
1458
+ //#endregion
1459
+ //#region src/request/rpc/objects/namespaces/bitcoin/methods/signMessageV2/response.ts
1460
+ const bitcoinSignMessageV2ResultSchema = valibot.object({
1461
+ signature: valibot.string(),
1462
+ messageHash: valibot.string(),
1463
+ address: valibot.string(),
1464
+ protocol: valibot.enum(MessageSigningProtocols)
1465
+ });
1466
+ const bitcoinSignMessageV2SuccessResponseSchema = createSuccessResponseSchema({
1467
+ resultSchema: bitcoinSignMessageV2ResultSchema,
1468
+ method: bitcoinMethods.bitcoin_signMessageV2
1469
+ });
1470
+
1471
+ //#endregion
1472
+ //#region src/request/rpc/objects/namespaces/bitcoin/methods/signMultipleMessages/request.ts
1473
+ const bitcoinSignMultipleMessagesParamsSchema = valibot.array(valibot.object({
1474
+ address: valibot.string(),
1475
+ message: valibot.string(),
1476
+ protocol: valibot.optional(valibot.enum(MessageSigningProtocols))
1477
+ }));
1478
+ const bitcoinSignMultipleMessagesRequestSchema = createRequestSchema({
1479
+ paramsSchema: bitcoinSignMultipleMessagesParamsSchema,
1480
+ method: bitcoinMethods.signMultipleMessages
1481
+ });
1482
+
1483
+ //#endregion
1484
+ //#region src/request/rpc/objects/namespaces/bitcoin/methods/signMultipleMessages/response.ts
1485
+ const bitcoinSignMultipleMessagesResultSchema = valibot.array(valibot.object({
1486
+ signature: valibot.string(),
1487
+ message: valibot.string(),
1488
+ messageHash: valibot.string(),
1489
+ address: valibot.string(),
1490
+ protocol: valibot.enum(MessageSigningProtocols)
1491
+ }));
1492
+ const bitcoinSignMultipleMessagesSuccessResponseSchema = createSuccessResponseSchema({
1493
+ resultSchema: bitcoinSignMultipleMessagesResultSchema,
1494
+ method: bitcoinMethods.signMultipleMessages
1495
+ });
1496
+
1497
+ //#endregion
1498
+ //#region src/request/rpc/objects/namespaces/bitcoin/methods/signMultipleMessagesV2/request.ts
1499
+ const bitcoinSignMultipleMessagesV2ParamsSchema = valibot.array(valibot.object({
1500
+ address: valibot.string(),
1501
+ message: valibot.string(),
1502
+ protocol: valibot.optional(valibot.enum(MessageSigningProtocols))
1503
+ }));
1504
+ const bitcoinSignMultipleMessagesV2RequestSchema = createRequestSchema({
1505
+ paramsSchema: bitcoinSignMultipleMessagesV2ParamsSchema,
1506
+ method: bitcoinMethods.bitcoin_signMultipleMessagesV2
1507
+ });
1508
+
1509
+ //#endregion
1510
+ //#region src/request/rpc/objects/namespaces/bitcoin/methods/signMultipleMessagesV2/response.ts
1511
+ const bitcoinSignMultipleMessagesV2ResultSchema = valibot.array(valibot.object({
1512
+ signature: valibot.string(),
1513
+ message: valibot.string(),
1514
+ messageHash: valibot.string(),
1515
+ address: valibot.string(),
1516
+ protocol: valibot.enum(MessageSigningProtocols)
1517
+ }));
1518
+ const bitcoinSignMultipleMessagesV2SuccessResponseSchema = createSuccessResponseSchema({
1519
+ resultSchema: bitcoinSignMultipleMessagesV2ResultSchema,
1520
+ method: bitcoinMethods.bitcoin_signMultipleMessagesV2
1521
+ });
1522
+
1523
+ //#endregion
1524
+ //#region src/request/rpc/objects/namespaces/bitcoin/methods/signPsbt/request.ts
1525
+ const bitcoinSignPsbtParamsSchema = valibot.object({
1526
+ psbt: valibot.string(),
1527
+ signInputs: valibot.optional(valibot.record(valibot.string(), valibot.array(valibot.number()))),
1528
+ broadcast: valibot.optional(valibot.boolean())
1529
+ });
1530
+ const bitcoinSignPsbtRequestSchema = createRequestSchema({
1531
+ paramsSchema: bitcoinSignPsbtParamsSchema,
1532
+ method: bitcoinMethods.signPsbt
1533
+ });
1534
+
1535
+ //#endregion
1536
+ //#region src/request/rpc/objects/namespaces/bitcoin/methods/signPsbt/response.ts
1537
+ const bitcoinSignPsbtResultSchema = valibot.object({
1538
+ psbt: valibot.string(),
1539
+ txid: valibot.optional(valibot.string())
1540
+ });
1541
+ const bitcoinSignPsbtSuccessResponseSchema = createSuccessResponseSchema({
1542
+ resultSchema: bitcoinSignPsbtResultSchema,
1543
+ method: bitcoinMethods.signPsbt
1544
+ });
1545
+
1546
+ //#endregion
1547
+ //#region src/request/rpc/objects/namespaces/bitcoin/methods/signPsbtV2/request.ts
1548
+ const bitcoinSignPsbtV2ParamsSchema = valibot.object({
1549
+ psbt: valibot.string(),
1550
+ signInputs: valibot.optional(valibot.record(valibot.string(), valibot.array(valibot.number()))),
1551
+ broadcast: valibot.optional(valibot.boolean())
1552
+ });
1553
+ const bitcoinSignPsbtV2RequestSchema = createRequestSchema({
1554
+ paramsSchema: bitcoinSignPsbtV2ParamsSchema,
1555
+ method: bitcoinMethods.bitcoin_signPsbtV2
1556
+ });
1557
+
1558
+ //#endregion
1559
+ //#region src/request/rpc/objects/namespaces/bitcoin/methods/signPsbtV2/response.ts
1560
+ const bitcoinSignPsbtV2ResultSchema = valibot.object({
1561
+ psbt: valibot.string(),
1562
+ txid: valibot.optional(valibot.string())
1563
+ });
1564
+ const bitcoinSignPsbtV2SuccessResponseSchema = createSuccessResponseSchema({
1565
+ resultSchema: bitcoinSignPsbtV2ResultSchema,
1566
+ method: bitcoinMethods.bitcoin_signPsbtV2
1567
+ });
1568
+
1569
+ //#endregion
1570
+ //#region src/request/rpc/objects/namespaces/bitcoin/index.ts
1571
+ const bitcoinRequestSchema = valibot.variant("method", [
1572
+ bitcoinGetAccountsRequestSchema,
1573
+ bitcoinGetAccountsV2RequestSchema,
1574
+ bitcoinGetAddressesRequestSchema,
1575
+ bitcoinGetAddressesV2RequestSchema,
1576
+ bitcoinGetBalanceRequestSchema,
1577
+ bitcoinGetBalanceV2RequestSchema,
1578
+ bitcoinGetInfoRequestSchema,
1579
+ bitcoinGetInfoV2RequestSchema,
1580
+ bitcoinSendTransferRequestSchema,
1581
+ bitcoinSendTransferV2RequestSchema,
1582
+ bitcoinSignMessageRequestSchema,
1583
+ bitcoinSignMessageV2RequestSchema,
1584
+ bitcoinSignMultipleMessagesRequestSchema,
1585
+ bitcoinSignMultipleMessagesV2RequestSchema,
1586
+ bitcoinSignPsbtRequestSchema,
1587
+ bitcoinSignPsbtV2RequestSchema
1588
+ ]);
1589
+ const bitcoinSuccessResponseSchema = valibot.variant("~sats-connect-method", [
1590
+ bitcoinGetAccountsSuccessResponseSchema,
1591
+ bitcoinGetAccountsV2SuccessResponseSchema,
1592
+ bitcoinGetAddressesSuccessResponseSchema,
1593
+ bitcoinGetAddressesV2SuccessResponseSchema,
1594
+ bitcoinGetBalanceSuccessResponseSchema,
1595
+ bitcoinGetBalanceV2SuccessResponseSchema,
1596
+ bitcoinGetInfoSuccessResponseSchema,
1597
+ bitcoinGetInfoV2SuccessResponseSchema,
1598
+ bitcoinSendTransferSuccessResponseSchema,
1599
+ bitcoinSendTransferV2SuccessResponseSchema,
1600
+ bitcoinSignMessageSuccessResponseSchema,
1601
+ bitcoinSignMessageV2SuccessResponseSchema,
1602
+ bitcoinSignMultipleMessagesSuccessResponseSchema,
1603
+ bitcoinSignMultipleMessagesV2SuccessResponseSchema,
1604
+ bitcoinSignPsbtSuccessResponseSchema,
1605
+ bitcoinSignPsbtV2SuccessResponseSchema
1606
+ ]);
1607
+
1608
+ //#endregion
1609
+ //#region src/request/rpc/objects/namespaces/ordinals/methods/getInscriptions/request.ts
1610
+ const ordinalsGetInscriptionsParamsSchema = valibot.object({
1611
+ offset: valibot.number(),
1612
+ limit: valibot.number()
1613
+ });
1614
+ const ordinalsGetInscriptionsRequestSchema = createRequestSchema({
1615
+ paramsSchema: ordinalsGetInscriptionsParamsSchema,
1616
+ method: ordinalsMethods.ord_getInscriptions
1617
+ });
1618
+
1619
+ //#endregion
1620
+ //#region src/request/rpc/objects/namespaces/ordinals/methods/getInscriptions/response.ts
1621
+ const ordinalsGetInscriptionsResultSchema = valibot.object({
1622
+ total: valibot.number(),
1623
+ limit: valibot.number(),
1624
+ offset: valibot.number(),
1625
+ inscriptions: valibot.array(valibot.object({
1626
+ inscriptionId: valibot.string(),
1627
+ inscriptionNumber: valibot.string(),
1628
+ address: valibot.string(),
1629
+ collectionName: valibot.optional(valibot.string()),
1630
+ postage: valibot.string(),
1631
+ contentLength: valibot.string(),
1632
+ contentType: valibot.string(),
1633
+ timestamp: valibot.number(),
1634
+ offset: valibot.number(),
1635
+ genesisTransaction: valibot.string(),
1636
+ output: valibot.string()
1637
+ }))
1638
+ });
1639
+ const ordinalsGetInscriptionsSuccessResponseSchema = createSuccessResponseSchema({
1640
+ resultSchema: ordinalsGetInscriptionsResultSchema,
1641
+ method: ordinalsMethods.ord_getInscriptions
1642
+ });
1643
+
1644
+ //#endregion
1645
+ //#region src/request/rpc/objects/namespaces/ordinals/methods/sendInscriptions/request.ts
1646
+ const ordinalsSendInscriptionsParamsSchema = valibot.object({ transfers: valibot.array(valibot.object({
1647
+ address: valibot.string(),
1648
+ inscriptionId: valibot.string()
1649
+ })) });
1650
+ const ordinalsSendInscriptionsRequestSchema = createRequestSchema({
1651
+ paramsSchema: ordinalsSendInscriptionsParamsSchema,
1652
+ method: ordinalsMethods.ord_sendInscriptions
1653
+ });
1654
+
1655
+ //#endregion
1656
+ //#region src/request/rpc/objects/namespaces/ordinals/methods/sendInscriptions/response.ts
1657
+ const ordinalsSendInscriptionsResultSchema = valibot.object({ txid: valibot.string() });
1658
+ const ordinalsSendInscriptionsSuccessResponseSchema = createSuccessResponseSchema({
1659
+ resultSchema: ordinalsSendInscriptionsResultSchema,
1660
+ method: ordinalsMethods.ord_sendInscriptions
1661
+ });
1662
+
1663
+ //#endregion
1664
+ //#region src/request/rpc/objects/namespaces/ordinals/index.ts
1665
+ const ordinalsRequestSchema = valibot.variant("method", [ordinalsGetInscriptionsRequestSchema, ordinalsSendInscriptionsRequestSchema]);
1666
+ const ordinalsSuccessResponseSchema = valibot.variant("~sats-connect-method", [ordinalsGetInscriptionsSuccessResponseSchema, ordinalsSendInscriptionsSuccessResponseSchema]);
1667
+
1668
+ //#endregion
1669
+ //#region src/request/rpc/objects/namespaces/runes/methods/estimateEtch/request.ts
1670
+ const etchTermsSchema$1 = valibot.object({
1671
+ amount: valibot.optional(valibot.string()),
1672
+ cap: valibot.optional(valibot.string()),
1673
+ heightStart: valibot.optional(valibot.string()),
1674
+ heightEnd: valibot.optional(valibot.string()),
1675
+ offsetStart: valibot.optional(valibot.string()),
1676
+ offsetEnd: valibot.optional(valibot.string())
1677
+ });
1678
+ const inscriptionDetailsSchema$1 = valibot.object({
1679
+ contentType: valibot.string(),
1680
+ contentBase64: valibot.string()
1681
+ });
1682
+ const runesEstimateEtchParamsSchema = valibot.object({
1683
+ runeName: valibot.string(),
1684
+ divisibility: valibot.optional(valibot.number()),
1685
+ symbol: valibot.optional(valibot.string()),
1686
+ premine: valibot.optional(valibot.string()),
1687
+ isMintable: valibot.boolean(),
1688
+ terms: valibot.optional(etchTermsSchema$1),
1689
+ inscriptionDetails: valibot.optional(inscriptionDetailsSchema$1),
1690
+ delegateInscriptionId: valibot.optional(valibot.string()),
1691
+ destinationAddress: valibot.string(),
1692
+ feeRate: valibot.number(),
1693
+ appServiceFee: valibot.optional(valibot.number()),
1694
+ appServiceFeeAddress: valibot.optional(valibot.string()),
1695
+ network: valibot.optional(valibot.enum(BitcoinNetworkType))
1696
+ });
1697
+ const runesEstimateEtchRequestSchema = createRequestSchema({
1698
+ paramsSchema: runesEstimateEtchParamsSchema,
1699
+ method: runesMethods.runes_estimateEtch
1700
+ });
1701
+
1702
+ //#endregion
1703
+ //#region src/request/rpc/objects/namespaces/runes/methods/estimateEtch/response.ts
1704
+ const runesEstimateEtchResultSchema = valibot.object({
1705
+ totalSize: valibot.number(),
1706
+ totalCost: valibot.number(),
1707
+ costBreakdown: valibot.object({
1708
+ postage: valibot.number(),
1709
+ networkFee: valibot.number(),
1710
+ serviceFee: valibot.number(),
1711
+ appServiceFee: valibot.number()
1712
+ })
1713
+ });
1714
+ const runesEstimateEtchSuccessResponseSchema = createSuccessResponseSchema({
1715
+ resultSchema: runesEstimateEtchResultSchema,
1716
+ method: runesMethods.runes_estimateEtch
1717
+ });
1718
+
1719
+ //#endregion
1720
+ //#region src/request/rpc/objects/namespaces/runes/methods/estimateMint/request.ts
1721
+ const runesEstimateMintParamsSchema = valibot.object({
1722
+ runeName: valibot.string(),
1723
+ repeats: valibot.number(),
1724
+ destinationAddress: valibot.string(),
1725
+ feeRate: valibot.number(),
1726
+ appServiceFee: valibot.optional(valibot.number()),
1727
+ appServiceFeeAddress: valibot.optional(valibot.string()),
1728
+ network: valibot.optional(valibot.enum(BitcoinNetworkType))
1729
+ });
1730
+ const runesEstimateMintRequestSchema = createRequestSchema({
1731
+ paramsSchema: runesEstimateMintParamsSchema,
1732
+ method: runesMethods.runes_estimateMint
1733
+ });
1734
+
1735
+ //#endregion
1736
+ //#region src/request/rpc/objects/namespaces/runes/methods/estimateMint/response.ts
1737
+ const runesEstimateMintResultSchema = valibot.object({
1738
+ totalSize: valibot.number(),
1739
+ totalCost: valibot.number(),
1740
+ costBreakdown: valibot.object({
1741
+ postage: valibot.number(),
1742
+ networkFee: valibot.number(),
1743
+ serviceFee: valibot.number(),
1744
+ appServiceFee: valibot.number()
1745
+ })
1746
+ });
1747
+ const runesEstimateMintSuccessResponseSchema = createSuccessResponseSchema({
1748
+ resultSchema: runesEstimateMintResultSchema,
1749
+ method: runesMethods.runes_estimateMint
1750
+ });
1751
+
1752
+ //#endregion
1753
+ //#region src/request/rpc/objects/namespaces/runes/methods/estimateRbfOrder/request.ts
1754
+ const runesEstimateRbfOrderParamsSchema = valibot.object({
1755
+ orderId: valibot.string(),
1756
+ newFeeRate: valibot.number(),
1757
+ network: valibot.optional(valibot.enum(BitcoinNetworkType))
1758
+ });
1759
+ const runesEstimateRbfOrderRequestSchema = createRequestSchema({
1760
+ paramsSchema: runesEstimateRbfOrderParamsSchema,
1761
+ method: runesMethods.runes_estimateRbfOrder
1762
+ });
1763
+
1764
+ //#endregion
1765
+ //#region src/request/rpc/objects/namespaces/runes/methods/estimateRbfOrder/response.ts
1766
+ const runesEstimateRbfOrderResultSchema = valibot.object({
1767
+ rbfCost: valibot.number(),
1768
+ fundingAddress: valibot.string()
1769
+ });
1770
+ const runesEstimateRbfOrderSuccessResponseSchema = createSuccessResponseSchema({
1771
+ resultSchema: runesEstimateRbfOrderResultSchema,
1772
+ method: runesMethods.runes_estimateRbfOrder
1773
+ });
1774
+
1775
+ //#endregion
1776
+ //#region src/request/rpc/objects/namespaces/runes/methods/etch/request.ts
1777
+ const etchTermsSchema = valibot.object({
1778
+ amount: valibot.optional(valibot.string()),
1779
+ cap: valibot.optional(valibot.string()),
1780
+ heightStart: valibot.optional(valibot.string()),
1781
+ heightEnd: valibot.optional(valibot.string()),
1782
+ offsetStart: valibot.optional(valibot.string()),
1783
+ offsetEnd: valibot.optional(valibot.string())
1784
+ });
1785
+ const inscriptionDetailsSchema = valibot.object({
1786
+ contentType: valibot.string(),
1787
+ contentBase64: valibot.string()
1788
+ });
1789
+ const runesEtchParamsSchema = valibot.object({
1790
+ runeName: valibot.string(),
1791
+ divisibility: valibot.optional(valibot.number()),
1792
+ symbol: valibot.optional(valibot.string()),
1793
+ premine: valibot.optional(valibot.string()),
1794
+ isMintable: valibot.boolean(),
1795
+ terms: valibot.optional(etchTermsSchema),
1796
+ inscriptionDetails: valibot.optional(inscriptionDetailsSchema),
1797
+ delegateInscriptionId: valibot.optional(valibot.string()),
1798
+ destinationAddress: valibot.string(),
1799
+ refundAddress: valibot.string(),
1800
+ feeRate: valibot.number(),
1801
+ appServiceFee: valibot.optional(valibot.number()),
1802
+ appServiceFeeAddress: valibot.optional(valibot.string()),
1803
+ network: valibot.optional(valibot.enum(BitcoinNetworkType))
1804
+ });
1805
+ const runesEtchRequestSchema = createRequestSchema({
1806
+ paramsSchema: runesEtchParamsSchema,
1807
+ method: runesMethods.runes_etch
1808
+ });
1809
+
1810
+ //#endregion
1811
+ //#region src/request/rpc/objects/namespaces/runes/methods/etch/response.ts
1812
+ const runesEtchResultSchema = valibot.object({
1813
+ orderId: valibot.string(),
1814
+ fundTransactionId: valibot.string(),
1815
+ fundingAddress: valibot.string()
1816
+ });
1817
+ const runesEtchSuccessResponseSchema = createSuccessResponseSchema({
1818
+ resultSchema: runesEtchResultSchema,
1819
+ method: runesMethods.runes_etch
1820
+ });
1821
+
1822
+ //#endregion
1823
+ //#region src/request/rpc/objects/namespaces/runes/methods/getBalance/request.ts
1824
+ const runesGetBalanceParamsSchema = valibot.nullish(valibot.null());
1825
+ const runesGetBalanceRequestSchema = createRequestSchema({
1826
+ paramsSchema: runesGetBalanceParamsSchema,
1827
+ method: runesMethods.runes_getBalance
1828
+ });
1829
+
1830
+ //#endregion
1831
+ //#region src/request/rpc/objects/namespaces/runes/methods/getBalance/response.ts
1832
+ const runesGetBalanceResultSchema = valibot.object({ balances: valibot.array(valibot.object({
1833
+ runeName: valibot.string(),
1834
+ amount: valibot.string(),
1835
+ divisibility: valibot.number(),
1836
+ symbol: valibot.string(),
1837
+ inscriptionId: valibot.nullish(valibot.string()),
1838
+ spendableBalance: valibot.string()
1839
+ })) });
1840
+ const runesGetBalanceSuccessResponseSchema = createSuccessResponseSchema({
1841
+ resultSchema: runesGetBalanceResultSchema,
1842
+ method: runesMethods.runes_getBalance
1843
+ });
1844
+
1845
+ //#endregion
1846
+ //#region src/request/rpc/objects/namespaces/runes/methods/getOrder/request.ts
1847
+ const runesGetOrderParamsSchema = valibot.object({
1848
+ id: valibot.string(),
1849
+ network: valibot.optional(valibot.enum(BitcoinNetworkType))
1850
+ });
1851
+ const runesGetOrderRequestSchema = createRequestSchema({
1852
+ paramsSchema: runesGetOrderParamsSchema,
1853
+ method: runesMethods.runes_getOrder
1854
+ });
1855
+
1856
+ //#endregion
1857
+ //#region src/request/rpc/objects/namespaces/runes/methods/getOrder/response.ts
1858
+ const runesGetOrderResultSchema = valibot.object({
1859
+ id: valibot.string(),
1860
+ orderType: valibot.union([valibot.literal("rune_mint"), valibot.literal("rune_etch")]),
1861
+ state: valibot.union([
1862
+ valibot.literal("new"),
1863
+ valibot.literal("pending"),
1864
+ valibot.literal("executing"),
1865
+ valibot.literal("complete"),
1866
+ valibot.literal("failed"),
1867
+ valibot.literal("refunded"),
1868
+ valibot.literal("stale")
1869
+ ]),
1870
+ fundingAddress: valibot.string(),
1871
+ reason: valibot.optional(valibot.string()),
1872
+ createdAt: valibot.string()
1873
+ });
1874
+ const runesGetOrderSuccessResponseSchema = createSuccessResponseSchema({
1875
+ resultSchema: runesGetOrderResultSchema,
1876
+ method: runesMethods.runes_getOrder
1877
+ });
1878
+
1879
+ //#endregion
1880
+ //#region src/request/rpc/objects/namespaces/runes/methods/mint/request.ts
1881
+ const runesMintParamsSchema = valibot.object({
1882
+ appServiceFee: valibot.optional(valibot.number()),
1883
+ appServiceFeeAddress: valibot.optional(valibot.string()),
1884
+ destinationAddress: valibot.string(),
1885
+ feeRate: valibot.number(),
1886
+ refundAddress: valibot.string(),
1887
+ repeats: valibot.number(),
1888
+ runeName: valibot.string(),
1889
+ network: valibot.optional(valibot.enum(BitcoinNetworkType))
1890
+ });
1891
+ const runesMintRequestSchema = createRequestSchema({
1892
+ paramsSchema: runesMintParamsSchema,
1893
+ method: runesMethods.runes_mint
1894
+ });
1895
+
1896
+ //#endregion
1897
+ //#region src/request/rpc/objects/namespaces/runes/methods/mint/response.ts
1898
+ const runesMintResultSchema = valibot.object({
1899
+ orderId: valibot.string(),
1900
+ fundTransactionId: valibot.string(),
1901
+ fundingAddress: valibot.string()
1902
+ });
1903
+ const runesMintSuccessResponseSchema = createSuccessResponseSchema({
1904
+ resultSchema: runesMintResultSchema,
1905
+ method: runesMethods.runes_mint
1906
+ });
1907
+
1908
+ //#endregion
1909
+ //#region src/request/rpc/objects/namespaces/runes/methods/rbfOrder/request.ts
1910
+ const runesRbfOrderParamsSchema = valibot.object({
1911
+ orderId: valibot.string(),
1912
+ newFeeRate: valibot.number(),
1913
+ network: valibot.optional(valibot.enum(BitcoinNetworkType))
1914
+ });
1915
+ const runesRbfOrderRequestSchema = createRequestSchema({
1916
+ paramsSchema: runesRbfOrderParamsSchema,
1917
+ method: runesMethods.runes_rbfOrder
1918
+ });
1919
+
1920
+ //#endregion
1921
+ //#region src/request/rpc/objects/namespaces/runes/methods/rbfOrder/response.ts
1922
+ const runesRbfOrderResultSchema = valibot.object({
1923
+ orderId: valibot.string(),
1924
+ fundRBFTransactionId: valibot.string(),
1925
+ fundingAddress: valibot.string()
1926
+ });
1927
+ const runesRbfOrderSuccessResponseSchema = createSuccessResponseSchema({
1928
+ resultSchema: runesRbfOrderResultSchema,
1929
+ method: runesMethods.runes_rbfOrder
1930
+ });
1931
+
1932
+ //#endregion
1933
+ //#region src/request/rpc/objects/namespaces/runes/methods/transfer/request.ts
1934
+ const runesTransferParamsSchema = valibot.object({
1935
+ recipients: valibot.array(valibot.object({
1936
+ runeName: valibot.string(),
1937
+ amount: valibot.string(),
1938
+ address: valibot.string()
1939
+ })),
1940
+ network: valibot.optional(valibot.enum(BitcoinNetworkType))
1941
+ });
1942
+ const runesTransferRequestSchema = createRequestSchema({
1943
+ paramsSchema: runesTransferParamsSchema,
1944
+ method: runesMethods.runes_transfer
1945
+ });
1946
+
1947
+ //#endregion
1948
+ //#region src/request/rpc/objects/namespaces/runes/methods/transfer/response.ts
1949
+ const runesTransferResultSchema = valibot.object({ txid: valibot.string() });
1950
+ const runesTransferSuccessResponseSchema = createSuccessResponseSchema({
1951
+ resultSchema: runesTransferResultSchema,
1952
+ method: runesMethods.runes_transfer
1953
+ });
1954
+
1955
+ //#endregion
1956
+ //#region src/request/rpc/objects/namespaces/runes/index.ts
1957
+ const runesRequestSchema = valibot.variant("method", [
1958
+ runesEstimateEtchRequestSchema,
1959
+ runesEstimateMintRequestSchema,
1960
+ runesEstimateRbfOrderRequestSchema,
1961
+ runesEtchRequestSchema,
1962
+ runesGetBalanceRequestSchema,
1963
+ runesGetOrderRequestSchema,
1964
+ runesMintRequestSchema,
1965
+ runesRbfOrderRequestSchema,
1966
+ runesTransferRequestSchema
1967
+ ]);
1968
+ const runesSuccessResponseSchema = valibot.variant("~sats-connect-method", [
1969
+ runesEstimateEtchSuccessResponseSchema,
1970
+ runesEstimateMintSuccessResponseSchema,
1971
+ runesEstimateRbfOrderSuccessResponseSchema,
1972
+ runesEtchSuccessResponseSchema,
1973
+ runesGetBalanceSuccessResponseSchema,
1974
+ runesGetOrderSuccessResponseSchema,
1975
+ runesMintSuccessResponseSchema,
1976
+ runesRbfOrderSuccessResponseSchema,
1977
+ runesTransferSuccessResponseSchema
1978
+ ]);
1979
+
1980
+ //#endregion
1981
+ //#region src/request/rpc/objects/namespaces/spark/methods/flashnetClawbackFunds/request.ts
1982
+ const sparkFlashnetClawbackFundsParamsSchema = valibot.object({
1983
+ sparkTransferId: valibot.string(),
1984
+ lpIdentityPublicKey: valibot.string()
1985
+ });
1986
+ const sparkFlashnetClawbackFundsRequestSchema = createRequestSchema({
1987
+ paramsSchema: sparkFlashnetClawbackFundsParamsSchema,
1988
+ method: sparkMethods.spark_flashnet_clawbackFunds
1989
+ });
1990
+
1991
+ //#endregion
1992
+ //#region src/request/rpc/objects/namespaces/spark/methods/flashnetClawbackFunds/response.ts
1993
+ const sparkFlashnetClawbackFundsResultSchema = valibot.object({
1994
+ requestId: valibot.string(),
1995
+ accepted: valibot.boolean(),
1996
+ internalRequestId: valibot.optional(valibot.string()),
1997
+ sparkStatusTrackingId: valibot.optional(valibot.string()),
1998
+ error: valibot.optional(valibot.string())
1999
+ });
2000
+ const sparkFlashnetClawbackFundsSuccessResponseSchema = createSuccessResponseSchema({
2001
+ resultSchema: sparkFlashnetClawbackFundsResultSchema,
2002
+ method: sparkMethods.spark_flashnet_clawbackFunds
2003
+ });
2004
+
2005
+ //#endregion
2006
+ //#region src/request/rpc/objects/namespaces/spark/methods/flashnetExecuteRouteSwap/request.ts
2007
+ const sparkFlashnetExecuteRouteSwapParamsSchema = valibot.object({
2008
+ hops: valibot.array(valibot.object({
2009
+ poolId: valibot.string(),
2010
+ assetInAddress: valibot.string(),
2011
+ assetOutAddress: valibot.string(),
2012
+ hopIntegratorFeeRateBps: valibot.optional(valibot.number())
2013
+ })),
2014
+ initialAssetAddress: valibot.string(),
2015
+ inputAmount: valibot.string(),
2016
+ maxRouteSlippageBps: valibot.string(),
2017
+ minAmountOut: valibot.optional(valibot.string()),
2018
+ integratorFeeRateBps: valibot.optional(valibot.number()),
2019
+ integratorPublicKey: valibot.optional(valibot.string())
2020
+ });
2021
+ const sparkFlashnetExecuteRouteSwapRequestSchema = createRequestSchema({
2022
+ paramsSchema: sparkFlashnetExecuteRouteSwapParamsSchema,
2023
+ method: sparkMethods.spark_flashnet_executeRouteSwap
2024
+ });
2025
+
2026
+ //#endregion
2027
+ //#region src/request/rpc/objects/namespaces/spark/methods/flashnetExecuteRouteSwap/response.ts
2028
+ const sparkFlashnetExecuteRouteSwapResultSchema = valibot.object({
2029
+ requestId: valibot.string(),
2030
+ accepted: valibot.boolean(),
2031
+ outputAmount: valibot.string(),
2032
+ executionPrice: valibot.string(),
2033
+ finalOutboundTransferId: valibot.string(),
2034
+ error: valibot.optional(valibot.string())
2035
+ });
2036
+ const sparkFlashnetExecuteRouteSwapSuccessResponseSchema = createSuccessResponseSchema({
2037
+ resultSchema: sparkFlashnetExecuteRouteSwapResultSchema,
2038
+ method: sparkMethods.spark_flashnet_executeRouteSwap
2039
+ });
2040
+
2041
+ //#endregion
2042
+ //#region src/request/rpc/objects/namespaces/spark/methods/flashnetExecuteSwap/request.ts
2043
+ const sparkFlashnetExecuteSwapParamsSchema = valibot.object({
2044
+ poolId: valibot.string(),
2045
+ assetInAddress: valibot.string(),
2046
+ assetOutAddress: valibot.string(),
2047
+ amountIn: valibot.string(),
2048
+ maxSlippageBps: valibot.number(),
2049
+ minAmountOut: valibot.optional(valibot.string()),
2050
+ integratorFeeRateBps: valibot.optional(valibot.number()),
2051
+ integratorPublicKey: valibot.optional(valibot.string())
2052
+ });
2053
+ const sparkFlashnetExecuteSwapRequestSchema = createRequestSchema({
2054
+ paramsSchema: sparkFlashnetExecuteSwapParamsSchema,
2055
+ method: sparkMethods.spark_flashnet_executeSwap
2056
+ });
2057
+
2058
+ //#endregion
2059
+ //#region src/request/rpc/objects/namespaces/spark/methods/flashnetExecuteSwap/response.ts
2060
+ const sparkFlashnetExecuteSwapResultSchema = valibot.object({
2061
+ requestId: valibot.string(),
2062
+ accepted: valibot.boolean(),
2063
+ amountOut: valibot.optional(valibot.string()),
2064
+ feeAmount: valibot.optional(valibot.string()),
2065
+ executionPrice: valibot.optional(valibot.string()),
2066
+ assetOutAddress: valibot.optional(valibot.string()),
2067
+ assetInAddress: valibot.optional(valibot.string()),
2068
+ outboundTransferId: valibot.optional(valibot.string()),
2069
+ error: valibot.optional(valibot.string())
2070
+ });
2071
+ const sparkFlashnetExecuteSwapSuccessResponseSchema = createSuccessResponseSchema({
2072
+ resultSchema: sparkFlashnetExecuteSwapResultSchema,
2073
+ method: sparkMethods.spark_flashnet_executeSwap
2074
+ });
2075
+
2076
+ //#endregion
2077
+ //#region src/request/rpc/objects/namespaces/spark/methods/flashnetGetClawbackEligibleTransfers/request.ts
2078
+ const sparkGetClawbackEligibleTransfersParamsSchema = valibot.nullish(valibot.null());
2079
+ const sparkGetClawbackEligibleTransfersRequestSchema = createRequestSchema({
2080
+ paramsSchema: sparkGetClawbackEligibleTransfersParamsSchema,
2081
+ method: sparkMethods.spark_flashnet_getClawbackEligibleTransfers
2082
+ });
2083
+
2084
+ //#endregion
2085
+ //#region src/request/rpc/objects/namespaces/spark/methods/flashnetGetClawbackEligibleTransfers/response.ts
2086
+ const sparkGetClawbackEligibleTransfersResultSchema = valibot.object({ eligibleTransfers: valibot.array(valibot.object({
2087
+ txId: valibot.string(),
2088
+ createdAt: valibot.string(),
2089
+ lpIdentityPublicKey: valibot.string()
2090
+ })) });
2091
+ const sparkGetClawbackEligibleTransfersSuccessResponseSchema = createSuccessResponseSchema({
2092
+ resultSchema: sparkGetClawbackEligibleTransfersResultSchema,
2093
+ method: sparkMethods.spark_flashnet_getClawbackEligibleTransfers
2094
+ });
2095
+
2096
+ //#endregion
2097
+ //#region src/request/rpc/objects/namespaces/spark/methods/flashnetGetJwt/request.ts
2098
+ const sparkFlashnetGetJwtParamsSchema = valibot.null();
2099
+ const sparkFlashnetGetJwtRequestSchema = createRequestSchema({
2100
+ paramsSchema: sparkFlashnetGetJwtParamsSchema,
2101
+ method: sparkMethods.spark_flashnet_getJwt
2102
+ });
2103
+
2104
+ //#endregion
2105
+ //#region src/request/rpc/objects/namespaces/spark/methods/flashnetGetJwt/response.ts
2106
+ const sparkFlashnetGetJwtResultSchema = valibot.object({ jwt: valibot.string() });
2107
+ const sparkFlashnetGetJwtSuccessResponseSchema = createSuccessResponseSchema({
2108
+ resultSchema: sparkFlashnetGetJwtResultSchema,
2109
+ method: sparkMethods.spark_flashnet_getJwt
2110
+ });
2111
+
2112
+ //#endregion
2113
+ //#region src/request/rpc/objects/namespaces/spark/methods/flashnetSignIntent/intents/addLiquidity.ts
2114
+ const sparkFlashnetAddLiquidityIntentSchema = valibot.object({
2115
+ type: valibot.literal("addLiquidity"),
2116
+ data: valibot.object({
2117
+ userPublicKey: valibot.string(),
2118
+ poolId: valibot.string(),
2119
+ assetAAmount: valibot.string(),
2120
+ assetBAmount: valibot.string(),
2121
+ assetAMinAmountIn: valibot.string(),
2122
+ assetBMinAmountIn: valibot.string(),
2123
+ assetATransferId: valibot.string(),
2124
+ assetBTransferId: valibot.string(),
2125
+ nonce: valibot.string()
2126
+ })
2127
+ });
2128
+
2129
+ //#endregion
2130
+ //#region src/request/rpc/objects/namespaces/spark/methods/flashnetSignIntent/intents/clawback.ts
2131
+ const sparkFlashnetClawbackIntentSchema = valibot.object({
2132
+ type: valibot.literal("clawback"),
2133
+ data: valibot.object({
2134
+ senderPublicKey: valibot.string(),
2135
+ sparkTransferId: valibot.string(),
2136
+ lpIdentityPublicKey: valibot.string(),
2137
+ nonce: valibot.string()
2138
+ })
2139
+ });
2140
+
2141
+ //#endregion
2142
+ //#region src/request/rpc/objects/namespaces/spark/methods/flashnetSignIntent/intents/confirmInitialDeposit.ts
2143
+ const sparkFlashnetConfirmInitialDepositIntentSchema = valibot.object({
2144
+ type: valibot.literal("confirmInitialDeposit"),
2145
+ data: valibot.object({
2146
+ poolId: valibot.string(),
2147
+ assetASparkTransferId: valibot.string(),
2148
+ poolOwnerPublicKey: valibot.string(),
2149
+ nonce: valibot.string()
2150
+ })
2151
+ });
2152
+
2153
+ //#endregion
2154
+ //#region src/request/rpc/objects/namespaces/spark/methods/flashnetSignIntent/intents/createConstantProductPool.ts
2155
+ const sparkFlashnetCreateConstantProductPoolIntentSchema = valibot.object({
2156
+ type: valibot.literal("createConstantProductPool"),
2157
+ data: valibot.object({
2158
+ poolOwnerPublicKey: valibot.string(),
2159
+ assetAAddress: valibot.string(),
2160
+ assetBAddress: valibot.string(),
2161
+ lpFeeRateBps: valibot.union([valibot.number(), valibot.string()]),
2162
+ totalHostFeeRateBps: valibot.union([valibot.number(), valibot.string()]),
2163
+ nonce: valibot.string()
2164
+ })
2165
+ });
2166
+
2167
+ //#endregion
2168
+ //#region src/request/rpc/objects/namespaces/spark/methods/flashnetSignIntent/intents/createSingleSidedPool.ts
2169
+ const sparkFlashnetCreateSingleSidedPoolIntentSchema = valibot.object({
2170
+ type: valibot.literal("createSingleSidedPool"),
2171
+ data: valibot.object({
2172
+ assetAAddress: valibot.string(),
2173
+ assetBAddress: valibot.string(),
2174
+ assetAInitialReserve: valibot.string(),
2175
+ virtualReserveA: valibot.union([valibot.number(), valibot.string()]),
2176
+ virtualReserveB: valibot.union([valibot.number(), valibot.string()]),
2177
+ threshold: valibot.union([valibot.number(), valibot.string()]),
2178
+ lpFeeRateBps: valibot.union([valibot.number(), valibot.string()]),
2179
+ totalHostFeeRateBps: valibot.union([valibot.number(), valibot.string()]),
2180
+ poolOwnerPublicKey: valibot.string(),
2181
+ nonce: valibot.string()
2182
+ })
2183
+ });
2184
+
2185
+ //#endregion
2186
+ //#region src/request/rpc/objects/namespaces/spark/methods/flashnetSignIntent/intents/removeLiquidity.ts
2187
+ const sparkFlashnetRemoveLiquidityIntentSchema = valibot.object({
2188
+ type: valibot.literal("removeLiquidity"),
2189
+ data: valibot.object({
2190
+ userPublicKey: valibot.string(),
2191
+ poolId: valibot.string(),
2192
+ lpTokensToRemove: valibot.string(),
2193
+ nonce: valibot.string()
2194
+ })
2195
+ });
2196
+
2197
+ //#endregion
2198
+ //#region src/request/rpc/objects/namespaces/spark/methods/flashnetSignIntent/intents/routeSwap.ts
2199
+ const sparkFlashnetRouteSwapIntentSchema = valibot.object({
2200
+ type: valibot.literal("executeRouteSwap"),
2201
+ data: valibot.object({
2202
+ userPublicKey: valibot.string(),
2203
+ initialSparkTransferId: valibot.string(),
2204
+ hops: valibot.array(valibot.object({
2205
+ poolId: valibot.string(),
2206
+ inputAssetAddress: valibot.string(),
2207
+ outputAssetAddress: valibot.string(),
2208
+ hopIntegratorFeeRateBps: valibot.optional(valibot.union([valibot.number(), valibot.string()]))
2209
+ })),
2210
+ inputAmount: valibot.string(),
2211
+ maxRouteSlippageBps: valibot.union([valibot.number(), valibot.string()]),
2212
+ minAmountOut: valibot.string(),
2213
+ defaultIntegratorFeeRateBps: valibot.optional(valibot.union([valibot.number(), valibot.string()])),
2214
+ nonce: valibot.string()
2215
+ })
2216
+ });
2217
+
2218
+ //#endregion
2219
+ //#region src/request/rpc/objects/namespaces/spark/methods/flashnetSignIntent/intents/swap.ts
2220
+ const sparkFlashnetSwapIntentSchema = valibot.object({
2221
+ type: valibot.literal("executeSwap"),
2222
+ data: valibot.object({
2223
+ userPublicKey: valibot.string(),
2224
+ poolId: valibot.string(),
2225
+ transferId: valibot.string(),
2226
+ assetInAddress: valibot.string(),
2227
+ assetOutAddress: valibot.string(),
2228
+ amountIn: valibot.string(),
2229
+ maxSlippageBps: valibot.union([valibot.number(), valibot.string()]),
2230
+ minAmountOut: valibot.string(),
2231
+ totalIntegratorFeeRateBps: valibot.optional(valibot.union([valibot.number(), valibot.string()])),
2232
+ nonce: valibot.string()
2233
+ })
2234
+ });
2235
+
2236
+ //#endregion
2237
+ //#region src/request/rpc/objects/namespaces/spark/methods/flashnetSignIntent/request.ts
2238
+ const sparkFlashnetSignIntentParamsSchema = valibot.union([
2239
+ sparkFlashnetSwapIntentSchema,
2240
+ sparkFlashnetRouteSwapIntentSchema,
2241
+ sparkFlashnetAddLiquidityIntentSchema,
2242
+ sparkFlashnetClawbackIntentSchema,
2243
+ sparkFlashnetConfirmInitialDepositIntentSchema,
2244
+ sparkFlashnetCreateConstantProductPoolIntentSchema,
2245
+ sparkFlashnetCreateSingleSidedPoolIntentSchema,
2246
+ sparkFlashnetRemoveLiquidityIntentSchema
2247
+ ]);
2248
+ const sparkFlashnetSignIntentRequestSchema = createRequestSchema({
2249
+ paramsSchema: sparkFlashnetSignIntentParamsSchema,
2250
+ method: sparkMethods.spark_flashnet_signIntent
2251
+ });
2252
+
2253
+ //#endregion
2254
+ //#region src/request/rpc/objects/namespaces/spark/methods/flashnetSignIntent/response.ts
2255
+ const sparkFlashnetSignIntentResultSchema = valibot.object({ signature: valibot.string() });
2256
+ const sparkFlashnetSignIntentSuccessResponseSchema = createSuccessResponseSchema({
2257
+ resultSchema: sparkFlashnetSignIntentResultSchema,
2258
+ method: sparkMethods.spark_flashnet_signIntent
2259
+ });
2260
+
2261
+ //#endregion
2262
+ //#region src/request/rpc/objects/namespaces/spark/methods/flashnetSignStructuredMessage/request.ts
2263
+ const sparkFlashnetSignStructuredMessageParamsSchema = valibot.object({ message: valibot.string() });
2264
+ const sparkFlashnetSignStructuredMessageRequestSchema = createRequestSchema({
2265
+ paramsSchema: sparkFlashnetSignStructuredMessageParamsSchema,
2266
+ method: sparkMethods.spark_flashnet_signStructuredMessage
2267
+ });
2268
+
2269
+ //#endregion
2270
+ //#region src/request/rpc/objects/namespaces/spark/methods/flashnetSignStructuredMessage/response.ts
2271
+ const sparkFlashnetSignStructuredMessageResultSchema = valibot.object({
2272
+ message: valibot.string(),
2273
+ signature: valibot.string()
2274
+ });
2275
+ const sparkFlashnetSignStructuredMessageSuccessResponseSchema = createSuccessResponseSchema({
2276
+ resultSchema: sparkFlashnetSignStructuredMessageResultSchema,
2277
+ method: sparkMethods.spark_flashnet_signStructuredMessage
2278
+ });
2279
+
2280
+ //#endregion
2281
+ //#region src/request/rpc/objects/namespaces/spark/methods/getAddresses/request.ts
2282
+ const sparkGetAddressesParamsSchema = valibot.nullish(valibot.object({ message: valibot.optional(valibot.string()) }));
2283
+ const sparkGetAddressesRequestSchema = createRequestSchema({
2284
+ paramsSchema: sparkGetAddressesParamsSchema,
2285
+ method: sparkMethods.spark_getAddresses
2286
+ });
2287
+
2288
+ //#endregion
2289
+ //#region src/request/rpc/objects/namespaces/wallet/methods/addNetwork/request.ts
2290
+ const walletAddNetworkParamsSchema = valibot.variant("chain", [
2291
+ valibot.object({
2292
+ chain: valibot.literal("bitcoin"),
2293
+ type: valibot.enum(BitcoinNetworkType),
2294
+ name: valibot.string(),
2295
+ rpcUrl: valibot.string(),
2296
+ rpcFallbackUrl: valibot.optional(valibot.string()),
2297
+ indexerUrl: valibot.optional(valibot.string()),
2298
+ blockExplorerUrl: valibot.optional(valibot.string()),
2299
+ switch: valibot.optional(valibot.boolean())
2300
+ }),
2301
+ valibot.object({
2302
+ chain: valibot.literal("stacks"),
2303
+ name: valibot.string(),
2304
+ type: valibot.enum(StacksNetworkType),
2305
+ rpcUrl: valibot.string(),
2306
+ blockExplorerUrl: valibot.optional(valibot.string()),
2307
+ switch: valibot.optional(valibot.boolean())
2308
+ }),
2309
+ valibot.object({
2310
+ chain: valibot.literal("starknet"),
2311
+ name: valibot.string(),
2312
+ type: valibot.enum(StarknetNetworkType),
2313
+ rpcUrl: valibot.string(),
2314
+ blockExplorerUrl: valibot.optional(valibot.string()),
2315
+ switch: valibot.optional(valibot.boolean())
2316
+ })
2317
+ ]);
2318
+ const walletAddNetworkRequestSchema = createRequestSchema({
2319
+ paramsSchema: walletAddNetworkParamsSchema,
2320
+ method: walletMethods.wallet_addNetwork
2321
+ });
2322
+
2323
+ //#endregion
2324
+ //#region src/request/rpc/objects/namespaces/wallet/methods/addNetwork/response.ts
2325
+ const walletAddNetworkResultSchema = valibot.object({ id: valibot.string() });
2326
+ const walletAddNetworkSuccessResponseSchema = createSuccessResponseSchema({
2327
+ resultSchema: walletAddNetworkResultSchema,
2328
+ method: walletMethods.wallet_addNetwork
2329
+ });
2330
+
2331
+ //#endregion
2332
+ //#region src/request/rpc/objects/namespaces/wallet/shared/permissions.ts
2333
+ const accountActionsSchema$2 = valibot.object({ read: valibot.optional(valibot.boolean()) });
2334
+ const walletActionsSchema$2 = valibot.object({ readNetwork: valibot.optional(valibot.boolean()) });
2335
+ const accountPermissionSchema$1 = valibot.object({
2336
+ type: valibot.literal("account"),
2337
+ resourceId: valibot.string(),
2338
+ clientId: valibot.string(),
2339
+ actions: accountActionsSchema$2
2340
+ });
2341
+ const walletPermissionSchema$1 = valibot.object({
2342
+ type: valibot.literal("wallet"),
2343
+ resourceId: valibot.string(),
2344
+ clientId: valibot.string(),
2345
+ actions: walletActionsSchema$2
2346
+ });
2347
+ const permissionSchema$1 = valibot.variant("type", [accountPermissionSchema$1, walletPermissionSchema$1]);
2348
+ /**
2349
+ * Permissions with the clientId field omitted and optional actions. Used for
2350
+ * permission requests, since the wallet performs authentication based on the
2351
+ * client's tab origin and should not rely on the client authenticating
2352
+ * themselves.
2353
+ */
2354
+ const permissionRequestParamsSchema = valibot.variant("type", [valibot.object({ ...valibot.omit(accountPermissionSchema$1, ["clientId"]).entries }), valibot.object({ ...valibot.omit(walletPermissionSchema$1, ["clientId"]).entries })]);
2355
+
2356
+ //#endregion
2357
+ //#region src/request/rpc/objects/namespaces/wallet/methods/addNetworkV2/request.ts
2358
+ const walletAddNetworkV2ParamsSchema = valibot.object({
2359
+ network: networkConfigurationOptionsSchema,
2360
+ isActive: valibot.optional(valibot.boolean())
2361
+ });
2362
+ const walletAddNetworkV2RequestSchema = createRequestSchema({
2363
+ paramsSchema: walletAddNetworkV2ParamsSchema,
2364
+ method: walletMethods.wallet_addNetworkV2
2365
+ });
2366
+
2367
+ //#endregion
2368
+ //#region src/request/rpc/objects/namespaces/wallet/methods/addNetworkV2/response.ts
2369
+ const walletAddNetworkV2ResultSchema = valibot.object({ id: valibot.string() });
2370
+ const walletAddNetworkV2SuccessResponseSchema = createSuccessResponseSchema({
2371
+ resultSchema: walletAddNetworkV2ResultSchema,
2372
+ method: walletMethods.wallet_addNetworkV2
2373
+ });
2374
+
2375
+ //#endregion
2376
+ //#region src/request/rpc/objects/namespaces/wallet/methods/changeNetwork/request.ts
2377
+ const walletChangeNetworkParamsSchema = valibot.object({ name: valibot.enum(BitcoinNetworkType) });
2378
+ const walletChangeNetworkRequestSchema = createRequestSchema({
2379
+ paramsSchema: walletChangeNetworkParamsSchema,
2380
+ method: walletMethods.wallet_changeNetwork
2381
+ });
2382
+
2383
+ //#endregion
2384
+ //#region src/request/rpc/objects/namespaces/wallet/methods/changeNetwork/response.ts
2385
+ const walletChangeNetworkResultSchema = valibot.nullish(valibot.null());
2386
+ const walletChangeNetworkSuccessResponseSchema = createSuccessResponseSchema({
2387
+ resultSchema: walletChangeNetworkResultSchema,
2388
+ method: walletMethods.wallet_changeNetwork
2389
+ });
2390
+
2391
+ //#endregion
2392
+ //#region src/request/rpc/objects/namespaces/wallet/methods/changeNetworkById/request.ts
2393
+ const walletChangeNetworkByIdParamsSchema = valibot.object({ id: valibot.string() });
2394
+ const walletChangeNetworkByIdRequestSchema = createRequestSchema({
2395
+ paramsSchema: walletChangeNetworkByIdParamsSchema,
2396
+ method: walletMethods.wallet_changeNetworkById
2397
+ });
2398
+
2399
+ //#endregion
2400
+ //#region src/request/rpc/objects/namespaces/wallet/methods/changeNetworkById/response.ts
2401
+ const walletChangeNetworkByIdResultSchema = valibot.nullish(valibot.null());
2402
+ const walletChangeNetworkByIdSuccessResponseSchema = createSuccessResponseSchema({
2403
+ resultSchema: walletChangeNetworkByIdResultSchema,
2404
+ method: walletMethods.wallet_changeNetworkById
2405
+ });
2406
+
2407
+ //#endregion
2408
+ //#region src/request/rpc/objects/namespaces/wallet/methods/connect/request.ts
2409
+ const walletConnectParamsSchema = valibot.nullish(valibot.object({
2410
+ permissions: valibot.optional(valibot.array(permissionRequestParamsSchema)),
2411
+ addresses: valibot.optional(valibot.array(valibot.enum(AddressPurpose))),
2412
+ message: valibot.optional(valibot.pipe(valibot.string(), valibot.maxLength(80, "The message must not exceed 80 characters."))),
2413
+ network: valibot.optional(valibot.picklist([
2414
+ "Mainnet",
2415
+ "Testnet",
2416
+ "Signet"
2417
+ ]))
2418
+ }));
2419
+ const walletConnectRequestSchema = createRequestSchema({
2420
+ paramsSchema: walletConnectParamsSchema,
2421
+ method: walletMethods.wallet_connect
2422
+ });
2423
+
2424
+ //#endregion
2425
+ //#region src/request/rpc/objects/namespaces/wallet/methods/getNetwork/request.ts
2426
+ const walletGetNetworkParamsSchema = valibot.nullish(valibot.null());
2427
+ const walletGetNetworkRequestSchema = createRequestSchema({
2428
+ paramsSchema: walletGetNetworkParamsSchema,
2429
+ method: walletMethods.wallet_getNetwork
2430
+ });
2431
+
2432
+ //#endregion
2433
+ //#region src/request/rpc/objects/namespaces/wallet/methods/getNetwork/response.ts
2434
+ const walletGetNetworkResultSchema = valibot.object({
2435
+ bitcoin: valibot.object({ name: valibot.enum(BitcoinNetworkType) }),
2436
+ stacks: valibot.object({ name: valibot.enum(StacksNetworkType) }),
2437
+ spark: valibot.object({ name: valibot.enum(SparkNetworkType) })
2438
+ });
2439
+ const walletGetNetworkSuccessResponseSchema = createSuccessResponseSchema({
2440
+ resultSchema: walletGetNetworkResultSchema,
2441
+ method: walletMethods.wallet_getNetwork
2442
+ });
2443
+
2444
+ //#endregion
2445
+ //#region src/request/rpc/objects/namespaces/wallet/methods/connect/response.ts
2446
+ const walletConnectResultSchema = valibot.object({
2447
+ id: valibot.string(),
2448
+ addresses: valibot.array(addressSchema),
2449
+ walletType: walletTypeSchema,
2450
+ network: walletGetNetworkResultSchema
2451
+ });
2452
+ const walletConnectSuccessResponseSchema = createSuccessResponseSchema({
2453
+ resultSchema: walletConnectResultSchema,
2454
+ method: walletMethods.wallet_connect
2455
+ });
2456
+
2457
+ //#endregion
2458
+ //#region src/request/rpc/objects/namespaces/wallet/methods/connectV2/request.ts
2459
+ const walletConnectV2ParamsSchema = valibot.nullish(valibot.object({
2460
+ permissions: permissionRequestParamsSchema,
2461
+ addresses: valibot.optional(valibot.array(valibot.enum(AddressPurpose))),
2462
+ message: valibot.optional(valibot.pipe(valibot.string(), valibot.maxLength(80, "The message must not exceed 80 characters."))),
2463
+ networkId: valibot.optional(valibot.string())
2464
+ }));
2465
+ const walletConnectV2RequestSchema = createRequestSchema({
2466
+ paramsSchema: walletConnectV2ParamsSchema,
2467
+ method: walletMethods.wallet_connectV2
2468
+ });
2469
+
2470
+ //#endregion
2471
+ //#region src/request/rpc/objects/namespaces/wallet/methods/getNetworks/request.ts
2472
+ const walletGetNetworksParamsSchema = valibot.nullish(valibot.null());
2473
+ const walletGetNetworksRequestSchema = createRequestSchema({
2474
+ paramsSchema: walletGetNetworksParamsSchema,
2475
+ method: walletMethods.wallet_getNetworks
2476
+ });
2477
+
2478
+ //#endregion
2479
+ //#region src/request/rpc/objects/namespaces/wallet/methods/getNetworks/response.ts
2480
+ const walletGetNetworksResultSchema = allResolvedNetworksSchema;
2481
+ const walletGetNetworksSuccessResponseSchema = createSuccessResponseSchema({
2482
+ resultSchema: walletGetNetworksResultSchema,
2483
+ method: walletMethods.wallet_getNetworks
2484
+ });
2485
+
2486
+ //#endregion
2487
+ //#region src/request/rpc/objects/namespaces/wallet/methods/connectV2/response.ts
2488
+ const walletConnectV2ResultSchema = valibot.object({
2489
+ accountId: valibot.string(),
2490
+ addresses: valibot.array(addressSchema),
2491
+ walletType: walletTypeSchema,
2492
+ networks: walletGetNetworksResultSchema
2493
+ });
2494
+ const walletConnectV2SuccessResponseSchema = createSuccessResponseSchema({
2495
+ resultSchema: walletConnectV2ResultSchema,
2496
+ method: walletMethods.wallet_connectV2
2497
+ });
2498
+
2499
+ //#endregion
2500
+ //#region src/request/rpc/objects/namespaces/wallet/methods/disconnect/request.ts
2501
+ const walletDisconnectParamsSchema = valibot.nullish(valibot.null());
2502
+ const walletDisconnectRequestSchema = createRequestSchema({
2503
+ paramsSchema: walletDisconnectParamsSchema,
2504
+ method: walletMethods.wallet_disconnect
2505
+ });
2506
+
2507
+ //#endregion
2508
+ //#region src/request/rpc/objects/namespaces/wallet/methods/disconnect/response.ts
2509
+ const walletDisconnectResultSchema = valibot.nullish(valibot.null());
2510
+ const walletDisconnectSuccessResponseSchema = createSuccessResponseSchema({
2511
+ resultSchema: walletDisconnectResultSchema,
2512
+ method: walletMethods.wallet_disconnect
2513
+ });
2514
+
2515
+ //#endregion
2516
+ //#region src/request/rpc/objects/namespaces/wallet/methods/getAccount/request.ts
2517
+ const walletGetAccountParamsSchema = valibot.nullish(valibot.null());
2518
+ const walletGetAccountRequestSchema = createRequestSchema({
2519
+ paramsSchema: walletGetAccountParamsSchema,
2520
+ method: walletMethods.wallet_getAccount
2521
+ });
2522
+
2523
+ //#endregion
2524
+ //#region src/request/rpc/objects/namespaces/wallet/methods/getAccount/response.ts
2525
+ const walletGetAccountResultSchema = valibot.object({
2526
+ id: valibot.string(),
2527
+ addresses: valibot.array(addressSchema),
2528
+ walletType: walletTypeSchema,
2529
+ network: walletGetNetworkResultSchema
2530
+ });
2531
+ const walletGetAccountSuccessResponseSchema = createSuccessResponseSchema({
2532
+ resultSchema: walletGetAccountResultSchema,
2533
+ method: walletMethods.wallet_getAccount
2534
+ });
2535
+
2536
+ //#endregion
2537
+ //#region src/request/rpc/objects/namespaces/wallet/methods/getAccountV2/request.ts
2538
+ const walletGetAccountV2ParamsSchema = valibot.nullish(valibot.null());
2539
+ const walletGetAccountV2RequestSchema = createRequestSchema({
2540
+ paramsSchema: walletGetAccountV2ParamsSchema,
2541
+ method: walletMethods.wallet_getAccountV2
2542
+ });
2543
+
2544
+ //#endregion
2545
+ //#region src/request/rpc/objects/namespaces/wallet/methods/getAccountV2/response.ts
2546
+ const walletGetAccountV2ResultSchema = valibot.object({
2547
+ id: valibot.string(),
2548
+ addresses: valibot.array(addressSchema),
2549
+ walletType: walletTypeSchema,
2550
+ networks: walletGetNetworksResultSchema
2551
+ });
2552
+ const walletGetAccountV2SuccessResponseSchema = createSuccessResponseSchema({
2553
+ resultSchema: walletGetAccountV2ResultSchema,
2554
+ method: walletMethods.wallet_getAccountV2
2555
+ });
2556
+
2557
+ //#endregion
2558
+ //#region src/request/rpc/objects/namespaces/wallet/methods/getCurrentPermissions/request.ts
2559
+ const walletGetCurrentPermissionsParamsSchema = valibot.nullish(valibot.null());
2560
+ const walletGetCurrentPermissionsRequestSchema = createRequestSchema({
2561
+ paramsSchema: walletGetCurrentPermissionsParamsSchema,
2562
+ method: walletMethods.wallet_getCurrentPermissions
2563
+ });
2564
+
2565
+ //#endregion
2566
+ //#region src/request/rpc/objects/namespaces/wallet/methods/getCurrentPermissions/response.ts
2567
+ const accountActionsSchema$1 = valibot.object({ read: valibot.optional(valibot.boolean()) });
2568
+ const walletActionsSchema$1 = valibot.object({ readNetwork: valibot.optional(valibot.boolean()) });
2569
+ const accountPermissionSchema = valibot.object({
2570
+ type: valibot.literal("account"),
2571
+ resourceId: valibot.string(),
2572
+ clientId: valibot.string(),
2573
+ actions: accountActionsSchema$1
2574
+ });
2575
+ const walletPermissionSchema = valibot.object({
2576
+ type: valibot.literal("wallet"),
2577
+ resourceId: valibot.string(),
2578
+ clientId: valibot.string(),
2579
+ actions: walletActionsSchema$1
2580
+ });
2581
+ const permissionSchema = valibot.variant("type", [accountPermissionSchema, walletPermissionSchema]);
2582
+ const walletGetCurrentPermissionsResultSchema = valibot.array(permissionSchema);
2583
+ const walletGetCurrentPermissionsSuccessResponseSchema = createSuccessResponseSchema({
2584
+ resultSchema: walletGetCurrentPermissionsResultSchema,
2585
+ method: walletMethods.wallet_getCurrentPermissions
2586
+ });
2587
+
2588
+ //#endregion
2589
+ //#region src/request/rpc/objects/namespaces/wallet/methods/getWalletType/request.ts
2590
+ const walletGetWalletTypeParamsSchema = valibot.nullish(valibot.null());
2591
+ const walletGetWalletTypeRequestSchema = createRequestSchema({
2592
+ paramsSchema: walletGetWalletTypeParamsSchema,
2593
+ method: walletMethods.wallet_getWalletType
2594
+ });
2595
+
2596
+ //#endregion
2597
+ //#region src/request/rpc/objects/namespaces/wallet/methods/getWalletType/response.ts
2598
+ const walletGetWalletTypeResultSchema = walletTypeSchema;
2599
+ const walletGetWalletTypeSuccessResponseSchema = createSuccessResponseSchema({
2600
+ resultSchema: walletGetWalletTypeResultSchema,
2601
+ method: walletMethods.wallet_getWalletType
2602
+ });
2603
+
2604
+ //#endregion
2605
+ //#region src/request/rpc/objects/namespaces/wallet/methods/openBridge/request.ts
2606
+ const walletOpenBridgeParamsSchema = valibot.object({
2607
+ fromAsset: valibot.string(),
2608
+ toAsset: valibot.string()
2609
+ });
2610
+ const walletOpenBridgeRequestSchema = createRequestSchema({
2611
+ paramsSchema: walletOpenBridgeParamsSchema,
2612
+ method: walletMethods.wallet_openBridge
2613
+ });
2614
+
2615
+ //#endregion
2616
+ //#region src/request/rpc/objects/namespaces/wallet/methods/openBridge/response.ts
2617
+ const walletOpenBridgeResultSchema = valibot.nullish(valibot.null());
2618
+ const walletOpenBridgeSuccessResponseSchema = createSuccessResponseSchema({
2619
+ resultSchema: walletOpenBridgeResultSchema,
2620
+ method: walletMethods.wallet_openBridge
2621
+ });
2622
+
2623
+ //#endregion
2624
+ //#region src/request/rpc/objects/namespaces/wallet/methods/openBuy/request.ts
2625
+ const walletOpenBuyParamsSchema = valibot.object({ asset: valibot.string() });
2626
+ const walletOpenBuyRequestSchema = createRequestSchema({
2627
+ paramsSchema: walletOpenBuyParamsSchema,
2628
+ method: walletMethods.wallet_openBuy
2629
+ });
2630
+
2631
+ //#endregion
2632
+ //#region src/request/rpc/objects/namespaces/wallet/methods/openBuy/response.ts
2633
+ const walletOpenBuyResultSchema = valibot.nullish(valibot.null());
2634
+ const walletOpenBuySuccessResponseSchema = createSuccessResponseSchema({
2635
+ resultSchema: walletOpenBuyResultSchema,
2636
+ method: walletMethods.wallet_openBuy
2637
+ });
2638
+
2639
+ //#endregion
2640
+ //#region src/request/rpc/objects/namespaces/wallet/methods/openReceive/request.ts
2641
+ const walletOpenReceiveParamsSchema = valibot.object({ address: valibot.string() });
2642
+ const walletOpenReceiveRequestSchema = createRequestSchema({
2643
+ paramsSchema: walletOpenReceiveParamsSchema,
2644
+ method: walletMethods.wallet_openReceive
2645
+ });
2646
+
2647
+ //#endregion
2648
+ //#region src/request/rpc/objects/namespaces/wallet/methods/openReceive/response.ts
2649
+ const walletOpenReceiveResultSchema = addressSchema;
2650
+ const walletOpenReceiveSuccessResponseSchema = createSuccessResponseSchema({
2651
+ resultSchema: walletOpenReceiveResultSchema,
2652
+ method: walletMethods.wallet_openReceive
2653
+ });
2654
+
2655
+ //#endregion
2656
+ //#region src/request/rpc/objects/namespaces/wallet/methods/renouncePermissions/request.ts
2657
+ const walletRenouncePermissionsParamsSchema = valibot.nullish(valibot.null());
2658
+ const walletRenouncePermissionsRequestSchema = createRequestSchema({
2659
+ paramsSchema: walletRenouncePermissionsParamsSchema,
2660
+ method: walletMethods.wallet_renouncePermissions
2661
+ });
2662
+
2663
+ //#endregion
2664
+ //#region src/request/rpc/objects/namespaces/wallet/methods/renouncePermissions/response.ts
2665
+ const walletRenouncePermissionsResultSchema = valibot.nullish(valibot.null());
2666
+ const walletRenouncePermissionsSuccessResponseSchema = createSuccessResponseSchema({
2667
+ resultSchema: walletRenouncePermissionsResultSchema,
2668
+ method: walletMethods.wallet_renouncePermissions
2669
+ });
2670
+
2671
+ //#endregion
2672
+ //#region src/request/rpc/objects/namespaces/wallet/methods/requestPermissions/request.ts
2673
+ const accountActionsSchema = valibot.object({ read: valibot.optional(valibot.boolean()) });
2674
+ const walletActionsSchema = valibot.object({ readNetwork: valibot.optional(valibot.boolean()) });
2675
+ const accountPermissionRequestSchema = valibot.object({
2676
+ type: valibot.literal("account"),
2677
+ resourceId: valibot.string(),
2678
+ actions: accountActionsSchema
2679
+ });
2680
+ const walletPermissionRequestSchema = valibot.object({
2681
+ type: valibot.literal("wallet"),
2682
+ resourceId: valibot.string(),
2683
+ actions: walletActionsSchema
2684
+ });
2685
+ const permissionRequestParamsSchema$1 = valibot.variant("type", [accountPermissionRequestSchema, walletPermissionRequestSchema]);
2686
+ const walletRequestPermissionsParamsSchema = valibot.nullish(valibot.array(permissionRequestParamsSchema$1));
2687
+ const walletRequestPermissionsRequestSchema = createRequestSchema({
2688
+ paramsSchema: walletRequestPermissionsParamsSchema,
2689
+ method: walletMethods.wallet_requestPermissions
2690
+ });
2691
+
2692
+ //#endregion
2693
+ //#region src/request/rpc/objects/namespaces/wallet/methods/requestPermissions/response.ts
2694
+ const walletRequestPermissionsResultSchema = valibot.literal(true);
2695
+ const walletRequestPermissionsSuccessResponseSchema = createSuccessResponseSchema({
2696
+ resultSchema: walletRequestPermissionsResultSchema,
2697
+ method: walletMethods.wallet_requestPermissions
2698
+ });
2699
+
2700
+ //#endregion
2701
+ //#region src/request/rpc/objects/namespaces/wallet/index.ts
2702
+ const walletRequestSchema = valibot.variant("method", [
2703
+ walletAddNetworkRequestSchema,
2704
+ walletAddNetworkV2RequestSchema,
2705
+ walletChangeNetworkByIdRequestSchema,
2706
+ walletChangeNetworkRequestSchema,
2707
+ walletConnectRequestSchema,
2708
+ walletConnectV2RequestSchema,
2709
+ walletDisconnectRequestSchema,
2710
+ walletGetAccountRequestSchema,
2711
+ walletGetAccountV2RequestSchema,
2712
+ walletGetCurrentPermissionsRequestSchema,
2713
+ walletGetNetworkRequestSchema,
2714
+ walletGetNetworksRequestSchema,
2715
+ walletGetWalletTypeRequestSchema,
2716
+ walletOpenBridgeRequestSchema,
2717
+ walletOpenBuyRequestSchema,
2718
+ walletOpenReceiveRequestSchema,
2719
+ walletRenouncePermissionsRequestSchema,
2720
+ walletRequestPermissionsRequestSchema
2721
+ ]);
2722
+ const walletSuccessResponseSchema = valibot.variant("~sats-connect-method", [
2723
+ walletAddNetworkSuccessResponseSchema,
2724
+ walletAddNetworkV2SuccessResponseSchema,
2725
+ walletChangeNetworkByIdSuccessResponseSchema,
2726
+ walletChangeNetworkSuccessResponseSchema,
2727
+ walletConnectSuccessResponseSchema,
2728
+ walletConnectV2SuccessResponseSchema,
2729
+ walletDisconnectSuccessResponseSchema,
2730
+ walletGetAccountSuccessResponseSchema,
2731
+ walletGetAccountV2SuccessResponseSchema,
2732
+ walletGetCurrentPermissionsSuccessResponseSchema,
2733
+ walletGetNetworkSuccessResponseSchema,
2734
+ walletGetNetworksSuccessResponseSchema,
2735
+ walletGetWalletTypeSuccessResponseSchema,
2736
+ walletOpenBridgeSuccessResponseSchema,
2737
+ walletOpenBuySuccessResponseSchema,
2738
+ walletOpenReceiveSuccessResponseSchema,
2739
+ walletRenouncePermissionsSuccessResponseSchema,
2740
+ walletRequestPermissionsSuccessResponseSchema
2741
+ ]);
2742
+
2743
+ //#endregion
2744
+ //#region src/request/rpc/objects/namespaces/spark/methods/getAddresses/response.ts
2745
+ const sparkGetAddressesResultSchema = valibot.object({
2746
+ addresses: valibot.array(addressSchema),
2747
+ network: walletGetNetworkResultSchema
2748
+ });
2749
+ const sparkGetAddressesSuccessResponseSchema = createSuccessResponseSchema({
2750
+ resultSchema: sparkGetAddressesResultSchema,
2751
+ method: sparkMethods.spark_getAddresses
2752
+ });
2753
+
2754
+ //#endregion
2755
+ //#region src/request/rpc/objects/namespaces/spark/methods/getAddressesV2/request.ts
2756
+ const sparkGetAddressesV2ParamsSchema = valibot.nullish(valibot.object({ message: valibot.optional(valibot.string()) }));
2757
+ const sparkGetAddressesV2RequestSchema = createRequestSchema({
2758
+ paramsSchema: sparkGetAddressesV2ParamsSchema,
2759
+ method: sparkMethods.spark_getAddressesV2
2760
+ });
2761
+
2762
+ //#endregion
2763
+ //#region src/request/rpc/objects/namespaces/spark/methods/getAddressesV2/response.ts
2764
+ const sparkGetAddressesV2ResultSchema = valibot.object({
2765
+ addresses: valibot.array(addressSchema),
2766
+ network: sparkNetworkConfigurationSchema
2767
+ });
2768
+ const sparkGetAddressesV2SuccessResponseSchema = createSuccessResponseSchema({
2769
+ resultSchema: sparkGetAddressesV2ResultSchema,
2770
+ method: sparkMethods.spark_getAddressesV2
2771
+ });
2772
+
2773
+ //#endregion
2774
+ //#region src/request/rpc/objects/namespaces/spark/methods/getBalance/request.ts
2775
+ const sparkGetBalanceParamsSchema = valibot.nullish(valibot.null());
2776
+ const sparkGetBalanceRequestSchema = createRequestSchema({
2777
+ paramsSchema: sparkGetBalanceParamsSchema,
2778
+ method: sparkMethods.spark_getBalance
2779
+ });
2780
+
2781
+ //#endregion
2782
+ //#region src/request/rpc/objects/namespaces/spark/methods/getBalance/response.ts
2783
+ const sparkGetBalanceResultSchema = valibot.object({
2784
+ balance: valibot.string(),
2785
+ tokenBalances: valibot.array(valibot.object({
2786
+ balance: valibot.string(),
2787
+ tokenMetadata: valibot.object({
2788
+ tokenIdentifier: valibot.string(),
2789
+ tokenName: valibot.string(),
2790
+ tokenTicker: valibot.string(),
2791
+ decimals: valibot.number(),
2792
+ maxSupply: valibot.string()
2793
+ })
2794
+ }))
2795
+ });
2796
+ const sparkGetBalanceSuccessResponseSchema = createSuccessResponseSchema({
2797
+ resultSchema: sparkGetBalanceResultSchema,
2798
+ method: sparkMethods.spark_getBalance
2799
+ });
2800
+
2801
+ //#endregion
2802
+ //#region src/request/rpc/objects/namespaces/spark/methods/signMessage/request.ts
2803
+ const sparkSignMessageParamsSchema = valibot.object({ message: valibot.string() });
2804
+ const sparkSignMessageRequestSchema = createRequestSchema({
2805
+ paramsSchema: sparkSignMessageParamsSchema,
2806
+ method: sparkMethods.spark_signMessage
2807
+ });
2808
+
2809
+ //#endregion
2810
+ //#region src/request/rpc/objects/namespaces/spark/methods/signMessage/response.ts
2811
+ const sparkSignMessageResultSchema = valibot.object({ signature: valibot.string() });
2812
+ const sparkSignMessageSuccessResponseSchema = createSuccessResponseSchema({
2813
+ resultSchema: sparkSignMessageResultSchema,
2814
+ method: sparkMethods.spark_signMessage
2815
+ });
2816
+
2817
+ //#endregion
2818
+ //#region src/request/rpc/objects/namespaces/spark/methods/transfer/request.ts
2819
+ const sparkTransferParamsSchema = valibot.object({
2820
+ amountSats: valibot.union([valibot.number(), valibot.string()]),
2821
+ receiverSparkAddress: valibot.string()
2822
+ });
2823
+ const sparkTransferRequestSchema = createRequestSchema({
2824
+ paramsSchema: sparkTransferParamsSchema,
2825
+ method: sparkMethods.spark_transfer
2826
+ });
2827
+
2828
+ //#endregion
2829
+ //#region src/request/rpc/objects/namespaces/spark/methods/transfer/response.ts
2830
+ const sparkTransferResultSchema = valibot.object({ id: valibot.string() });
2831
+ const sparkTransferSuccessResponseSchema = createSuccessResponseSchema({
2832
+ resultSchema: sparkTransferResultSchema,
2833
+ method: sparkMethods.spark_transfer
2834
+ });
2835
+
2836
+ //#endregion
2837
+ //#region src/request/rpc/objects/namespaces/spark/methods/transferToken/request.ts
2838
+ const sparkTransferTokenParamsSchema = valibot.object({
2839
+ tokenAmount: valibot.union([valibot.number(), valibot.string()]),
2840
+ tokenIdentifier: valibot.string(),
2841
+ receiverSparkAddress: valibot.string()
2842
+ });
2843
+ const sparkTransferTokenRequestSchema = createRequestSchema({
2844
+ paramsSchema: sparkTransferTokenParamsSchema,
2845
+ method: sparkMethods.spark_transferToken
2846
+ });
2847
+
2848
+ //#endregion
2849
+ //#region src/request/rpc/objects/namespaces/spark/methods/transferToken/response.ts
2850
+ const sparkTransferTokenResultSchema = valibot.object({ id: valibot.string() });
2851
+ const sparkTransferTokenSuccessResponseSchema = createSuccessResponseSchema({
2852
+ resultSchema: sparkTransferTokenResultSchema,
2853
+ method: sparkMethods.spark_transferToken
2854
+ });
2855
+
2856
+ //#endregion
2857
+ //#region src/request/rpc/objects/namespaces/spark/index.ts
2858
+ const sparkRequestSchema = valibot.variant("method", [
2859
+ sparkGetAddressesRequestSchema,
2860
+ sparkGetAddressesV2RequestSchema,
2861
+ sparkGetBalanceRequestSchema,
2862
+ sparkTransferRequestSchema,
2863
+ sparkTransferTokenRequestSchema,
2864
+ sparkSignMessageRequestSchema,
2865
+ sparkFlashnetGetJwtRequestSchema,
2866
+ sparkFlashnetSignIntentRequestSchema,
2867
+ sparkFlashnetSignStructuredMessageRequestSchema,
2868
+ sparkFlashnetExecuteSwapRequestSchema,
2869
+ sparkFlashnetExecuteRouteSwapRequestSchema,
2870
+ sparkFlashnetClawbackFundsRequestSchema,
2871
+ sparkGetClawbackEligibleTransfersRequestSchema
2872
+ ]);
2873
+ const sparkSuccessResponseSchema = valibot.variant("~sats-connect-method", [
2874
+ sparkGetAddressesSuccessResponseSchema,
2875
+ sparkGetAddressesV2SuccessResponseSchema,
2876
+ sparkGetBalanceSuccessResponseSchema,
2877
+ sparkTransferSuccessResponseSchema,
2878
+ sparkTransferTokenSuccessResponseSchema,
2879
+ sparkSignMessageSuccessResponseSchema,
2880
+ sparkFlashnetGetJwtSuccessResponseSchema,
2881
+ sparkFlashnetSignIntentSuccessResponseSchema,
2882
+ sparkFlashnetSignStructuredMessageSuccessResponseSchema,
2883
+ sparkFlashnetExecuteSwapSuccessResponseSchema,
2884
+ sparkFlashnetExecuteRouteSwapSuccessResponseSchema,
2885
+ sparkFlashnetClawbackFundsSuccessResponseSchema,
2886
+ sparkGetClawbackEligibleTransfersSuccessResponseSchema
2887
+ ]);
2888
+
2889
+ //#endregion
2890
+ //#region src/request/rpc/objects/namespaces/stacks/methods/callContract/request.ts
2891
+ const stacksCallContractParamsSchema = valibot.object({
2892
+ contract: valibot.string(),
2893
+ functionName: valibot.string(),
2894
+ arguments: valibot.optional(valibot.array(valibot.string())),
2895
+ functionArgs: valibot.optional(valibot.array(valibot.string())),
2896
+ postConditions: valibot.optional(valibot.array(valibot.string())),
2897
+ postConditionMode: valibot.optional(valibot.union([valibot.literal("allow"), valibot.literal("deny")]))
2898
+ });
2899
+ const stacksCallContractRequestSchema = createRequestSchema({
2900
+ paramsSchema: stacksCallContractParamsSchema,
2901
+ method: stacksMethods.stx_callContract
2902
+ });
2903
+
2904
+ //#endregion
2905
+ //#region src/request/rpc/objects/namespaces/stacks/methods/callContract/response.ts
2906
+ const stacksCallContractResultSchema = valibot.object({
2907
+ txid: valibot.string(),
2908
+ transaction: valibot.string()
2909
+ });
2910
+ const stacksCallContractSuccessResponseSchema = createSuccessResponseSchema({
2911
+ resultSchema: stacksCallContractResultSchema,
2912
+ method: stacksMethods.stx_callContract
2913
+ });
2914
+
2915
+ //#endregion
2916
+ //#region src/request/rpc/objects/namespaces/stacks/methods/deployContract/request.ts
2917
+ const stacksDeployContractParamsSchema = valibot.object({
2918
+ name: valibot.string(),
2919
+ clarityCode: valibot.string(),
2920
+ clarityVersion: valibot.optional(valibot.number()),
2921
+ postConditions: valibot.optional(valibot.array(valibot.string())),
2922
+ postConditionMode: valibot.optional(valibot.union([valibot.literal("allow"), valibot.literal("deny")]))
2923
+ });
2924
+ const stacksDeployContractRequestSchema = createRequestSchema({
2925
+ paramsSchema: stacksDeployContractParamsSchema,
2926
+ method: stacksMethods.stx_deployContract
2927
+ });
2928
+
2929
+ //#endregion
2930
+ //#region src/request/rpc/objects/namespaces/stacks/methods/deployContract/response.ts
2931
+ const stacksDeployContractResultSchema = valibot.object({
2932
+ txid: valibot.string(),
2933
+ transaction: valibot.string()
2934
+ });
2935
+ const stacksDeployContractSuccessResponseSchema = createSuccessResponseSchema({
2936
+ resultSchema: stacksDeployContractResultSchema,
2937
+ method: stacksMethods.stx_deployContract
2938
+ });
2939
+
2940
+ //#endregion
2941
+ //#region src/request/rpc/objects/namespaces/stacks/methods/getAccounts/request.ts
2942
+ const stacksGetAccountsParamsSchema = valibot.nullish(valibot.null());
2943
+ const stacksGetAccountsRequestSchema = createRequestSchema({
2944
+ paramsSchema: stacksGetAccountsParamsSchema,
2945
+ method: stacksMethods.stx_getAccounts
2946
+ });
2947
+
2948
+ //#endregion
2949
+ //#region src/request/rpc/objects/namespaces/stacks/methods/getAccounts/response.ts
2950
+ const stacksGetAccountsResultSchema = valibot.object({
2951
+ addresses: valibot.array(valibot.object({
2952
+ address: valibot.string(),
2953
+ publicKey: valibot.string(),
2954
+ gaiaHubUrl: valibot.string(),
2955
+ gaiaAppKey: valibot.string()
2956
+ })),
2957
+ network: walletGetNetworkResultSchema
2958
+ });
2959
+ const stacksGetAccountsSuccessResponseSchema = createSuccessResponseSchema({
2960
+ resultSchema: stacksGetAccountsResultSchema,
2961
+ method: stacksMethods.stx_getAccounts
2962
+ });
2963
+
2964
+ //#endregion
2965
+ //#region src/request/rpc/objects/namespaces/stacks/methods/getAddresses/request.ts
2966
+ const stacksGetAddressesParamsSchema = valibot.nullish(valibot.object({ message: valibot.optional(valibot.string()) }));
2967
+ const stacksGetAddressesRequestSchema = createRequestSchema({
2968
+ paramsSchema: stacksGetAddressesParamsSchema,
2969
+ method: stacksMethods.stx_getAddresses
2970
+ });
2971
+
2972
+ //#endregion
2973
+ //#region src/request/rpc/objects/namespaces/stacks/methods/getAddresses/response.ts
2974
+ const stacksGetAddressesResultSchema = valibot.object({
2975
+ addresses: valibot.array(addressSchema),
2976
+ network: walletGetNetworkResultSchema
2977
+ });
2978
+ const stacksGetAddressesSuccessResponseSchema = createSuccessResponseSchema({
2979
+ resultSchema: stacksGetAddressesResultSchema,
2980
+ method: stacksMethods.stx_getAddresses
2981
+ });
2982
+
2983
+ //#endregion
2984
+ //#region src/request/rpc/objects/namespaces/stacks/methods/getAddressesV2/request.ts
2985
+ const stacksGetAddressesV2ParamsSchema = valibot.nullish(valibot.object({ message: valibot.optional(valibot.string()) }));
2986
+ const stacksGetAddressesV2RequestSchema = createRequestSchema({
2987
+ paramsSchema: stacksGetAddressesV2ParamsSchema,
2988
+ method: stacksMethods.stacks_getAddressesV2
2989
+ });
2990
+
2991
+ //#endregion
2992
+ //#region src/request/rpc/objects/namespaces/stacks/methods/getAddressesV2/response.ts
2993
+ const stacksGetAddressesV2ResultSchema = valibot.object({
2994
+ addresses: valibot.array(addressSchema),
2995
+ network: valibot.object({
2996
+ type: valibot.union([
2997
+ valibot.literal("Mainnet"),
2998
+ valibot.literal("Testnet"),
2999
+ valibot.literal("Devnet"),
3000
+ valibot.literal("Signet")
3001
+ ]),
3002
+ chain: valibot.union([valibot.literal("bitcoin"), valibot.literal("stacks")])
3003
+ })
3004
+ });
3005
+ const stacksGetAddressesV2SuccessResponseSchema = createSuccessResponseSchema({
3006
+ resultSchema: stacksGetAddressesV2ResultSchema,
3007
+ method: stacksMethods.stacks_getAddressesV2
3008
+ });
3009
+
3010
+ //#endregion
3011
+ //#region src/request/rpc/objects/namespaces/stacks/methods/signMessage/request.ts
3012
+ const stacksSignMessageParamsSchema = valibot.object({ message: valibot.string() });
3013
+ const stacksSignMessageRequestSchema = createRequestSchema({
3014
+ paramsSchema: stacksSignMessageParamsSchema,
3015
+ method: stacksMethods.stx_signMessage
3016
+ });
3017
+
3018
+ //#endregion
3019
+ //#region src/request/rpc/objects/namespaces/stacks/methods/signMessage/response.ts
3020
+ const stacksSignMessageResultSchema = valibot.object({
3021
+ signature: valibot.string(),
3022
+ publicKey: valibot.string()
3023
+ });
3024
+ const stacksSignMessageSuccessResponseSchema = createSuccessResponseSchema({
3025
+ resultSchema: stacksSignMessageResultSchema,
3026
+ method: stacksMethods.stx_signMessage
3027
+ });
3028
+
3029
+ //#endregion
3030
+ //#region src/request/rpc/objects/namespaces/stacks/methods/signStructuredMessage/request.ts
3031
+ const stacksSignStructuredMessageParamsSchema = valibot.object({
3032
+ domain: valibot.string(),
3033
+ message: valibot.string(),
3034
+ publicKey: valibot.optional(valibot.string())
3035
+ });
3036
+ const stacksSignStructuredMessageRequestSchema = createRequestSchema({
3037
+ paramsSchema: stacksSignStructuredMessageParamsSchema,
3038
+ method: stacksMethods.stx_signStructuredMessage
3039
+ });
3040
+
3041
+ //#endregion
3042
+ //#region src/request/rpc/objects/namespaces/stacks/methods/signStructuredMessage/response.ts
3043
+ const stacksSignStructuredMessageResultSchema = valibot.object({
3044
+ signature: valibot.string(),
3045
+ publicKey: valibot.string()
3046
+ });
3047
+ const stacksSignStructuredMessageSuccessResponseSchema = createSuccessResponseSchema({
3048
+ resultSchema: stacksSignStructuredMessageResultSchema,
3049
+ method: stacksMethods.stx_signStructuredMessage
3050
+ });
3051
+
3052
+ //#endregion
3053
+ //#region src/request/rpc/objects/namespaces/stacks/methods/signTransaction/request.ts
3054
+ const stacksSignTransactionParamsSchema = valibot.object({
3055
+ transaction: valibot.string(),
3056
+ pubkey: valibot.optional(valibot.string()),
3057
+ broadcast: valibot.optional(valibot.boolean())
3058
+ });
3059
+ const stacksSignTransactionRequestSchema = createRequestSchema({
3060
+ paramsSchema: stacksSignTransactionParamsSchema,
3061
+ method: stacksMethods.stx_signTransaction
3062
+ });
3063
+
3064
+ //#endregion
3065
+ //#region src/request/rpc/objects/namespaces/stacks/methods/signTransaction/response.ts
3066
+ const stacksSignTransactionResultSchema = valibot.object({ transaction: valibot.string() });
3067
+ const stacksSignTransactionSuccessResponseSchema = createSuccessResponseSchema({
3068
+ resultSchema: stacksSignTransactionResultSchema,
3069
+ method: stacksMethods.stx_signTransaction
3070
+ });
3071
+
3072
+ //#endregion
3073
+ //#region src/request/rpc/objects/namespaces/stacks/methods/signTransactions/request.ts
3074
+ const stacksSignTransactionsParamsSchema = valibot.object({
3075
+ transactions: valibot.pipe(valibot.array(valibot.pipe(valibot.string(), valibot.check(() => {
3076
+ return true;
3077
+ }, "Invalid hex-encoded Stacks transaction."))), valibot.minLength(1)),
3078
+ broadcast: valibot.optional(valibot.boolean())
3079
+ });
3080
+ const stacksSignTransactionsRequestSchema = createRequestSchema({
3081
+ paramsSchema: stacksSignTransactionsParamsSchema,
3082
+ method: stacksMethods.stx_signTransactions
3083
+ });
3084
+
3085
+ //#endregion
3086
+ //#region src/request/rpc/objects/namespaces/stacks/methods/signTransactions/response.ts
3087
+ const stacksSignTransactionsResultSchema = valibot.object({ transactions: valibot.array(valibot.string()) });
3088
+ const stacksSignTransactionsSuccessResponseSchema = createSuccessResponseSchema({
3089
+ resultSchema: stacksSignTransactionsResultSchema,
3090
+ method: stacksMethods.stx_signTransactions
3091
+ });
3092
+
3093
+ //#endregion
3094
+ //#region src/request/rpc/objects/namespaces/stacks/methods/transferStx/request.ts
3095
+ const stacksTransferStxParamsSchema = valibot.object({
3096
+ amount: valibot.union([valibot.number(), valibot.string()]),
3097
+ recipient: valibot.string(),
3098
+ memo: valibot.optional(valibot.string()),
3099
+ version: valibot.optional(valibot.string()),
3100
+ postConditionMode: valibot.optional(valibot.number()),
3101
+ postConditions: valibot.optional(valibot.array(valibot.string())),
3102
+ pubkey: valibot.optional(valibot.string())
3103
+ });
3104
+ const stacksTransferStxRequestSchema = createRequestSchema({
3105
+ paramsSchema: stacksTransferStxParamsSchema,
3106
+ method: stacksMethods.stx_transferStx
3107
+ });
3108
+
3109
+ //#endregion
3110
+ //#region src/request/rpc/objects/namespaces/stacks/methods/transferStx/response.ts
3111
+ const stacksTransferStxResultSchema = valibot.object({
3112
+ txid: valibot.string(),
3113
+ transaction: valibot.string()
3114
+ });
3115
+ const stacksTransferStxSuccessResponseSchema = createSuccessResponseSchema({
3116
+ resultSchema: stacksTransferStxResultSchema,
3117
+ method: stacksMethods.stx_transferStx
3118
+ });
3119
+
3120
+ //#endregion
3121
+ //#region src/request/rpc/objects/namespaces/stacks/index.ts
3122
+ const stacksRequestSchema = valibot.variant("method", [
3123
+ stacksCallContractRequestSchema,
3124
+ stacksDeployContractRequestSchema,
3125
+ stacksGetAccountsRequestSchema,
3126
+ stacksGetAddressesRequestSchema,
3127
+ stacksGetAddressesV2RequestSchema,
3128
+ stacksSignMessageRequestSchema,
3129
+ stacksSignStructuredMessageRequestSchema,
3130
+ stacksSignTransactionRequestSchema,
3131
+ stacksSignTransactionsRequestSchema,
3132
+ stacksTransferStxRequestSchema
3133
+ ]);
3134
+ const stacksSuccessResponseSchema = valibot.variant("~sats-connect-method", [
3135
+ stacksCallContractSuccessResponseSchema,
3136
+ stacksDeployContractSuccessResponseSchema,
3137
+ stacksGetAccountsSuccessResponseSchema,
3138
+ stacksGetAddressesSuccessResponseSchema,
3139
+ stacksGetAddressesV2SuccessResponseSchema,
3140
+ stacksSignMessageSuccessResponseSchema,
3141
+ stacksSignStructuredMessageSuccessResponseSchema,
3142
+ stacksSignTransactionSuccessResponseSchema,
3143
+ stacksSignTransactionsSuccessResponseSchema,
3144
+ stacksTransferStxSuccessResponseSchema
3145
+ ]);
3146
+
3147
+ //#endregion
3148
+ //#region src/request/rpc/requests.ts
3149
+ const rpcRequestSchema = valibot.variant("method", [
3150
+ bitcoinRequestSchema,
3151
+ stacksRequestSchema,
3152
+ sparkRequestSchema,
3153
+ runesRequestSchema,
3154
+ ordinalsRequestSchema,
3155
+ walletRequestSchema
3156
+ ]);
3157
+ function createRpcRequest({ method, params, id }) {
3158
+ return {
3159
+ jsonrpc: "2.0",
3160
+ method,
3161
+ params,
3162
+ id
3163
+ };
3164
+ }
3165
+
3166
+ //#endregion
3167
+ //#region src/request/rpc/responses.ts
3168
+ const rpcSuccessResponseSchema = valibot.variant("~sats-connect-method", [
3169
+ bitcoinSuccessResponseSchema,
3170
+ stacksSuccessResponseSchema,
3171
+ sparkSuccessResponseSchema,
3172
+ runesSuccessResponseSchema,
3173
+ ordinalsSuccessResponseSchema,
3174
+ walletSuccessResponseSchema
3175
+ ]);
3176
+ function createRpcSuccessResponse({ method, result, id }) {
3177
+ return {
3178
+ jsonrpc: "2.0",
3179
+ id,
3180
+ result,
3181
+ "~sats-connect-method": method
3182
+ };
3183
+ }
3184
+
3185
+ //#endregion
3186
+ //#region src/request/index.ts
3187
+ const cache = {};
3188
+ const requestInternal = async (provider, method, params) => {
3189
+ const response = await provider.request(method, params);
3190
+ if (valibot.is(specErrorResponseSchema, response)) return {
3191
+ status: "error",
3192
+ error: response.error
3193
+ };
3194
+ if (valibot.is(specSuccessWithExtensionsResponseSchema, response)) return {
3195
+ status: "success",
3196
+ result: response.result
3197
+ };
3198
+ return {
3199
+ status: "error",
3200
+ error: {
3201
+ code: RpcErrorCode.INTERNAL_ERROR,
3202
+ message: "Received unknown response from provider.",
3203
+ data: response
3204
+ }
3205
+ };
3206
+ };
3207
+ const request = async (method, params, providerId) => {
3208
+ let provider = window.XverseProviders?.BitcoinProvider || window.BitcoinProvider;
3209
+ if (providerId) provider = await getProviderById(providerId);
3210
+ if (!provider) throw new Error("no wallet provider was found");
3211
+ if (!method) throw new Error("A wallet method is required");
3212
+ if (!cache.providerInfo) {
3213
+ const infoResult = await requestInternal(provider, "getInfo", null);
3214
+ if (infoResult.status === "success") cache.providerInfo = infoResult.result;
3215
+ }
3216
+ if (cache.providerInfo) {
3217
+ if (method === "getInfo") return {
3218
+ status: "success",
3219
+ result: cache.providerInfo
3220
+ };
3221
+ const sanitized = sanitizeRequest(method, params, cache.providerInfo);
3222
+ if (sanitized.overrideResponse) return sanitized.overrideResponse;
3223
+ method = sanitized.method;
3224
+ params = sanitized.params;
3225
+ }
3226
+ return requestInternal(provider, method, params);
3227
+ };
3228
+ /**
3229
+ * Adds an event listener.
3230
+ *
3231
+ * Currently expects 2 arguments, although is also capable of handling legacy
3232
+ * calls with 3 arguments consisting of:
3233
+ *
3234
+ * - event name (string)
3235
+ * - callback (function)
3236
+ * - provider ID (optional string)
3237
+ */
3238
+ const addListener = (...rawArgs) => {
3239
+ const [listenerInfo, providerId] = (() => {
3240
+ if (rawArgs.length === 1) return [rawArgs[0], void 0];
3241
+ if (rawArgs.length === 2) if (typeof rawArgs[1] === "function") return [{
3242
+ eventName: rawArgs[0],
3243
+ cb: rawArgs[1]
3244
+ }, void 0];
3245
+ else return rawArgs;
3246
+ if (rawArgs.length === 3) return [{
3247
+ eventName: rawArgs[0],
3248
+ cb: rawArgs[1]
3249
+ }, rawArgs[2]];
3250
+ throw new Error("Unexpected number of arguments. Expecting 2 (or 3 for legacy requests).", { cause: rawArgs });
3251
+ })();
3252
+ let provider = window.XverseProviders?.BitcoinProvider || window.BitcoinProvider;
3253
+ if (providerId) provider = getProviderById(providerId);
3254
+ if (!provider) throw new Error("no wallet provider was found");
3255
+ if (!provider.addListener) {
3256
+ console.error(`The wallet provider you are using does not support the addListener method. Please update your wallet provider.`);
3257
+ return () => {};
3258
+ }
3259
+ return provider.addListener(listenerInfo);
3260
+ };
3261
+
3262
+ //#endregion
3263
+ //#region src/adapters/xverse.ts
3264
+ var XverseAdapter = class extends SatsConnectAdapter {
3265
+ id = DefaultAdaptersInfo.xverse.id;
3266
+ requestInternal = async (method, params) => {
3267
+ return request(method, params, this.id);
3268
+ };
3269
+ addListener = (listenerInfo) => {
3270
+ return addListener(listenerInfo, this.id);
3271
+ };
3272
+ };
3273
+
3274
+ //#endregion
3275
+ //#region src/adapters/BaseAdapter.ts
3276
+ var BaseAdapter = class extends SatsConnectAdapter {
3277
+ id = "";
3278
+ constructor(providerId) {
3279
+ super();
3280
+ this.id = providerId;
3281
+ }
3282
+ requestInternal = async (method, params) => {
3283
+ return request(method, params, this.id);
3284
+ };
3285
+ addListener = (..._args) => {
3286
+ throw new Error("Method not supported for `BaseAdapter`.");
3287
+ };
3288
+ };
3289
+
3290
+ //#endregion
3291
+ //#region src/adapters/index.ts
3292
+ const DefaultAdaptersInfo = {
3293
+ fordefi: {
3294
+ id: "FordefiProviders.UtxoProvider",
3295
+ name: "Fordefi",
3296
+ webUrl: "https://www.fordefi.com/",
3297
+ chromeWebStoreUrl: "https://chromewebstore.google.com/detail/fordefi/hcmehenccjdmfbojapcbcofkgdpbnlle",
3298
+ icon: "data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjQiIGhlaWdodD0iMjQiIHZpZXdCb3g9IjAgMCAyNCAyNCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPGcgY2xpcC1wYXRoPSJ1cmwoI2NsaXAwXzEzNDk0XzY2MjU0KSI+CjxwYXRoIGQ9Ik0xMC44NzY5IDE1LjYzNzhIMS41VjE4LjM5OUMxLjUgMTkuODAxMyAyLjYzNDQ3IDIwLjkzOCA0LjAzMzkyIDIwLjkzOEg4LjI0OTkyTDEwLjg3NjkgMTUuNjM3OFoiIGZpbGw9IiM3OTk0RkYiLz4KPHBhdGggZD0iTTEuNSA5Ljc3NTUxSDE5LjA1MTZMMTcuMDEzOSAxMy44NzExSDEuNVY5Ljc3NTUxWiIgZmlsbD0iIzQ4NkRGRiIvPgo8cGF0aCBkPSJNNy42NTk5NiAzSDEuNTI0NDFWOC4wMDcwNEgyMi40NjEyVjNIMTYuMzI1NlY2LjczOTQ0SDE1LjA2MDZWM0g4LjkyNTAyVjYuNzM5NDRINy42NTk5NlYzWiIgZmlsbD0iIzVDRDFGQSIvPgo8L2c+CjxkZWZzPgo8Y2xpcFBhdGggaWQ9ImNsaXAwXzEzNDk0XzY2MjU0Ij4KPHJlY3Qgd2lkdGg9IjIxIiBoZWlnaHQ9IjE4IiBmaWxsPSJ3aGl0ZSIgdHJhbnNmb3JtPSJ0cmFuc2xhdGUoMS41IDMpIi8+CjwvY2xpcFBhdGg+CjwvZGVmcz4KPC9zdmc+Cg=="
3299
+ },
3300
+ xverse: {
3301
+ id: "XverseProviders.BitcoinProvider",
3302
+ name: "Xverse",
3303
+ webUrl: "https://www.xverse.app/",
3304
+ googlePlayStoreUrl: "https://play.google.com/store/apps/details?id=com.secretkeylabs.xverse",
3305
+ iOSAppStoreUrl: "https://apps.apple.com/app/xverse-bitcoin-web3-wallet/id1552272513",
3306
+ chromeWebStoreUrl: "https://chromewebstore.google.com/detail/xverse-wallet/idnnbdplmphpflfnlkomgpfbpcgelopg",
3307
+ icon: "data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTAyIiBoZWlnaHQ9IjEwMiIgdmlld0JveD0iMCAwIDEwMiAxMDIiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+CjxnIGlkPSJJY29uX0FydCAoRWRpdCBNZSkiPgo8cmVjdCB3aWR0aD0iMTAyIiBoZWlnaHQ9IjEwMiIgZmlsbD0iIzE4MTgxOCIvPgo8ZyBpZD0iTG9nby9FbWJsZW0iIGNsaXAtcGF0aD0idXJsKCNjbGlwMF8yMF8xMjIzKSI+CjxwYXRoIGlkPSJWZWN0b3IiIGQ9Ik03NC42NTQyIDczLjg4ODNWNjUuMjMxMkM3NC42NTQyIDY0Ljg4OCA3NC41MTc3IDY0LjU2MDYgNzQuMjc0NSA2NC4zMTc0TDM3LjQzOTcgMjcuNDgyNUMzNy4xOTY1IDI3LjIzOTIgMzYuODY5MSAyNy4xMDI4IDM2LjUyNTggMjcuMTAyOEgyNy44NjlDMjcuNDQxNiAyNy4xMDI4IDI3LjA5MzggMjcuNDUwNiAyNy4wOTM4IDI3Ljg3OFYzNS45MjExQzI3LjA5MzggMzYuMjY0NCAyNy4yMzAyIDM2LjU5MTcgMjcuNDczNCAzNi44MzVMNDAuNjk1MiA1MC4wNTY3QzQwLjk5NzUgNTAuMzU5MSA0MC45OTc1IDUwLjg1MDEgNDAuNjk1MiA1MS4xNTI0TDI3LjMyMTEgNjQuNTI2NUMyNy4xNzU2IDY0LjY3MiAyNy4wOTM4IDY0Ljg2OTggMjcuMDkzOCA2NS4wNzQ0VjczLjg4ODNDMjcuMDkzOCA3NC4zMTUzIDI3LjQ0MTYgNzQuNjYzNSAyNy44NjkgNzQuNjYzNUg0Mi4zMzQyQzQyLjc2MTYgNzQuNjYzNSA0My4xMDk0IDc0LjMxNTMgNDMuMTA5NCA3My44ODgzVjY4LjY5NThDNDMuMTA5NCA2OC40OTEyIDQzLjE5MTIgNjguMjkzNSA0My4zMzY4IDY4LjE0NzlMNTAuNTExNCA2MC45NzMzQzUwLjgxMzggNjAuNjcwOSA1MS4zMDQ4IDYwLjY3MDkgNTEuNjA3MiA2MC45NzMzTDY0LjkxOTggNzQuMjg2MUM2NS4xNjMxIDc0LjUyOTMgNjUuNDkwNCA3NC42NjU4IDY1LjgzMzcgNzQuNjY1OEg3My44NzY3Qzc0LjMwNDIgNzQuNjY1OCA3NC42NTE5IDc0LjMxNzYgNzQuNjUxOSA3My44OTA2TDc0LjY1NDIgNzMuODg4M1oiIGZpbGw9IndoaXRlIi8+CjxwYXRoIGlkPSJWZWN0b3JfMiIgZD0iTTU1LjM1OCAzOC41NjcySDYyLjYwMzFDNjMuMDMyOCAzOC41NjcyIDYzLjM4MjkgMzguOTE3MyA2My4zODI5IDM5LjM0NjlWNDYuNTkyMUM2My4zODI5IDQ3LjI4NzcgNjQuMjI0IDQ3LjYzNTUgNjQuNzE1MSA0Ny4xNDIyTDc0LjY1NDEgMzcuMTg3M0M3NC43OTk0IDM3LjA0MTggNzQuODgxNiAzNi44NDQgNzQuODgxNiAzNi42MzcxVjI3LjkxODlDNzQuODgxNiAyNy40ODkyIDc0LjUzMzQgMjcuMTM5MSA3NC4xMDE3IDI3LjEzOTFMNjUuMjUzOCAyNy4xMjc3QzY1LjA0NyAyNy4xMjc3IDY0Ljg0OTIgMjcuMjA5NiA2NC43MDE0IDI3LjM1NTFMNTQuODA1NiAzNy4yMzVDNTQuMzE0NSAzNy43MjYgNTQuNjYyMyAzOC41NjcyIDU1LjM1NTcgMzguNTY3Mkg1NS4zNThaIiBmaWxsPSIjRUU3QTMwIi8+CjwvZz4KPC9nPgo8ZGVmcz4KPGNsaXBQYXRoIGlkPSJjbGlwMF8yMF8xMjIzIj4KPHJlY3Qgd2lkdGg9IjQ3LjgxMjUiIGhlaWdodD0iNDcuODEyNSIgZmlsbD0id2hpdGUiIHRyYW5zZm9ybT0idHJhbnNsYXRlKDI3LjA5MzggMjcuMDkzOCkiLz4KPC9jbGlwUGF0aD4KPC9kZWZzPgo8L3N2Zz4K"
3308
+ },
3309
+ unisat: {
3310
+ id: "unisat",
3311
+ name: "Unisat",
3312
+ webUrl: "https://unisat.io/",
3313
+ icon: "data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTgwIiBoZWlnaHQ9IjE4MCIgdmlld0JveD0iMCAwIDE4MCAxODAiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+CjxyZWN0IHdpZHRoPSIxODAiIGhlaWdodD0iMTgwIiBmaWxsPSJibGFjayIvPgo8ZyBjbGlwLXBhdGg9InVybCgjY2xpcDBfMTAwNTBfNDE3MSkiPgo8cGF0aCBkPSJNMTEzLjY2IDI5LjI4OTdMMTQzLjk3IDU5LjMwOTdDMTQ2LjU1IDYxLjg1OTcgMTQ3LjgyIDY0LjQzOTcgMTQ3Ljc4IDY3LjAzOTdDMTQ3Ljc0IDY5LjYzOTcgMTQ2LjYzIDcyLjAwOTcgMTQ0LjQ2IDc0LjE1OTdDMTQyLjE5IDc2LjQwOTcgMTM5Ljc0IDc3LjU0OTcgMTM3LjEyIDc3LjU5OTdDMTM0LjUgNzcuNjM5NyAxMzEuOSA3Ni4zNzk3IDEyOS4zMiA3My44Mjk3TDk4LjMxOTkgNDMuMTI5N0M5NC43OTk5IDM5LjYzOTcgOTEuMzk5OSAzNy4xNjk3IDg4LjEyOTkgMzUuNzE5N0M4NC44NTk5IDM0LjI2OTcgODEuNDE5OSAzNC4wMzk3IDc3LjgxOTkgMzUuMDM5N0M3NC4yMDk5IDM2LjAyOTcgNzAuMzM5OSAzOC41Nzk3IDY2LjE4OTkgNDIuNjc5N0M2MC40Njk5IDQ4LjM0OTcgNTcuNzM5OSA1My42Njk3IDU4LjAxOTkgNTguNjM5N0M1OC4yOTk5IDYzLjYwOTcgNjEuMTM5OSA2OC43Njk3IDY2LjUyOTkgNzQuMDk5N0w5Ny43Nzk5IDEwNS4wNkMxMDAuMzkgMTA3LjY0IDEwMS42NyAxMTAuMjIgMTAxLjYzIDExMi43OEMxMDEuNTkgMTE1LjM1IDEwMC40NyAxMTcuNzIgOTguMjU5OSAxMTkuOTFDOTYuMDU5OSAxMjIuMDkgOTMuNjI5OSAxMjMuMjMgOTAuOTg5OSAxMjMuMzJDODguMzQ5OSAxMjMuNDEgODUuNzE5OSAxMjIuMTYgODMuMTE5OSAxMTkuNThMNTIuODA5OSA4OS41NTk3QzQ3Ljg3OTkgODQuNjc5NyA0NC4zMTk5IDgwLjA1OTcgNDIuMTI5OSA3NS42OTk3QzM5LjkzOTkgNzEuMzM5NyAzOS4xMTk5IDY2LjQwOTcgMzkuNjg5OSA2MC45MDk3QzQwLjE5OTkgNTYuMTk5NyA0MS43MDk5IDUxLjYzOTcgNDQuMjI5OSA0Ny4yMTk3QzQ2LjczOTkgNDIuNzk5NyA1MC4zMzk5IDM4LjI3OTcgNTUuMDA5OSAzMy42NDk3QzYwLjU2OTkgMjguMTM5NyA2NS44Nzk5IDIzLjkxOTcgNzAuOTM5OSAyMC45Nzk3Qzc1Ljk4OTkgMTguMDM5NyA4MC44Nzk5IDE2LjQwOTcgODUuNTk5OSAxNi4wNjk3QzkwLjMyOTkgMTUuNzI5NyA5NC45ODk5IDE2LjY2OTcgOTkuNTk5OSAxOC44ODk3QzEwNC4yMSAyMS4xMDk3IDEwOC44OSAyNC41Njk3IDExMy42NSAyOS4yODk3SDExMy42NloiIGZpbGw9InVybCgjcGFpbnQwX2xpbmVhcl8xMDA1MF80MTcxKSIvPgo8cGF0aCBkPSJNNjYuMTA5OSAxNTAuNDJMMzUuODA5OSAxMjAuNEMzMy4yMjk5IDExNy44NCAzMS45NTk5IDExNS4yNyAzMS45OTk5IDExMi42N0MzMi4wMzk5IDExMC4wNyAzMy4xNDk5IDEwNy43IDM1LjMxOTkgMTA1LjU1QzM3LjU4OTkgMTAzLjMgNDAuMDM5OSAxMDIuMTYgNDIuNjU5OSAxMDIuMTFDNDUuMjc5OSAxMDIuMDcgNDcuODc5OSAxMDMuMzIgNTAuNDU5OSAxMDUuODhMODEuNDQ5OSAxMzYuNThDODQuOTc5OSAxNDAuMDcgODguMzY5OSAxNDIuNTQgOTEuNjM5OSAxNDMuOTlDOTQuOTA5OSAxNDUuNDQgOTguMzQ5OSAxNDUuNjYgMTAxLjk2IDE0NC42N0MxMDUuNTcgMTQzLjY4IDEwOS40NCAxNDEuMTMgMTEzLjU5IDEzNy4wMkMxMTkuMzEgMTMxLjM1IDEyMi4wNCAxMjYuMDMgMTIxLjc2IDEyMS4wNkMxMjEuNDggMTE2LjA5IDExOC42NCAxMTAuOTMgMTEzLjI1IDEwNS41OUw5Ni41OTk5IDg5LjI0MDFDOTMuOTg5OSA4Ni42NjAxIDkyLjcwOTkgODQuMDgwMSA5Mi43NDk5IDgxLjUyMDFDOTIuNzg5OSA3OC45NTAxIDkzLjkwOTkgNzYuNTgwMSA5Ni4xMTk5IDc0LjM5MDFDOTguMzE5OSA3Mi4yMTAxIDEwMC43NSA3MS4wNzAxIDEwMy4zOSA3MC45ODAxQzEwNi4wMyA3MC44OTAxIDEwOC42NiA3Mi4xNDAxIDExMS4yNiA3NC43MjAxTDEyNi45NiA5MC4xMzAxQzEzMS44OSA5NS4wMTAxIDEzNS40NSA5OS42MzAxIDEzNy42NCAxMDMuOTlDMTM5LjgzIDEwOC4zNSAxNDAuNjUgMTEzLjI4IDE0MC4wOCAxMTguNzhDMTM5LjU3IDEyMy40OSAxMzguMDYgMTI4LjA1IDEzNS41NCAxMzIuNDdDMTMzLjAzIDEzNi44OSAxMjkuNDMgMTQxLjQxIDEyNC43NiAxNDYuMDRDMTE5LjIgMTUxLjU1IDExMy44OSAxNTUuNzcgMTA4LjgzIDE1OC43MUMxMDMuNzcgMTYxLjY1IDk4Ljg3OTkgMTYzLjI5IDk0LjE0OTkgMTYzLjYzQzg5LjQxOTkgMTYzLjk3IDg0Ljc1OTkgMTYzLjAzIDgwLjE0OTkgMTYwLjgxQzc1LjUzOTkgMTU4LjU5IDcwLjg1OTkgMTU1LjEzIDY2LjA5OTkgMTUwLjQxTDY2LjEwOTkgMTUwLjQyWiIgZmlsbD0idXJsKCNwYWludDFfbGluZWFyXzEwMDUwXzQxNzEpIi8+CjxwYXRoIGQ9Ik04NS4wMDk5IDcyLjk1OTJDOTEuMTU2OCA3Mi45NTkyIDk2LjEzOTkgNjcuOTc2MSA5Ni4xMzk5IDYxLjgyOTJDOTYuMTM5OSA1NS42ODIzIDkxLjE1NjggNTAuNjk5MiA4NS4wMDk5IDUwLjY5OTJDNzguODYzIDUwLjY5OTIgNzMuODc5OSA1NS42ODIzIDczLjg3OTkgNjEuODI5MkM3My44Nzk5IDY3Ljk3NjEgNzguODYzIDcyLjk1OTIgODUuMDA5OSA3Mi45NTkyWiIgZmlsbD0idXJsKCNwYWludDJfcmFkaWFsXzEwMDUwXzQxNzEpIi8+CjwvZz4KPGRlZnM+CjxsaW5lYXJHcmFkaWVudCBpZD0icGFpbnQwX2xpbmVhcl8xMDA1MF80MTcxIiB4MT0iMTM4Ljk4NSIgeTE9IjQ2Ljc3OTUiIHgyPSI0NS4wNTI5IiB5Mj0iODguNTIzMyIgZ3JhZGllbnRVbml0cz0idXNlclNwYWNlT25Vc2UiPgo8c3RvcCBzdG9wLWNvbG9yPSIjMjAxQzFCIi8+CjxzdG9wIG9mZnNldD0iMC4zNiIgc3RvcC1jb2xvcj0iIzc3MzkwRCIvPgo8c3RvcCBvZmZzZXQ9IjAuNjciIHN0b3AtY29sb3I9IiNFQTgxMDEiLz4KPHN0b3Agb2Zmc2V0PSIxIiBzdG9wLWNvbG9yPSIjRjRCODUyIi8+CjwvbGluZWFyR3JhZGllbnQ+CjxsaW5lYXJHcmFkaWVudCBpZD0icGFpbnQxX2xpbmVhcl8xMDA1MF80MTcxIiB4MT0iNDMuMzgxMiIgeTE9IjEzNC4xNjciIHgyPSIxNTIuMjMxIiB5Mj0iMTAxLjc3MSIgZ3JhZGllbnRVbml0cz0idXNlclNwYWNlT25Vc2UiPgo8c3RvcCBzdG9wLWNvbG9yPSIjMUYxRDFDIi8+CjxzdG9wIG9mZnNldD0iMC4zNyIgc3RvcC1jb2xvcj0iIzc3MzkwRCIvPgo8c3RvcCBvZmZzZXQ9IjAuNjciIHN0b3AtY29sb3I9IiNFQTgxMDEiLz4KPHN0b3Agb2Zmc2V0PSIxIiBzdG9wLWNvbG9yPSIjRjRGQjUyIi8+CjwvbGluZWFyR3JhZGllbnQ+CjxyYWRpYWxHcmFkaWVudCBpZD0icGFpbnQyX3JhZGlhbF8xMDA1MF80MTcxIiBjeD0iMCIgY3k9IjAiIHI9IjEiIGdyYWRpZW50VW5pdHM9InVzZXJTcGFjZU9uVXNlIiBncmFkaWVudFRyYW5zZm9ybT0idHJhbnNsYXRlKDg1LjAwOTkgNjEuODM5Mikgc2NhbGUoMTEuMTMpIj4KPHN0b3Agc3RvcC1jb2xvcj0iI0Y0Qjg1MiIvPgo8c3RvcCBvZmZzZXQ9IjAuMzMiIHN0b3AtY29sb3I9IiNFQTgxMDEiLz4KPHN0b3Agb2Zmc2V0PSIwLjY0IiBzdG9wLWNvbG9yPSIjNzczOTBEIi8+CjxzdG9wIG9mZnNldD0iMSIgc3RvcC1jb2xvcj0iIzIxMUMxRCIvPgo8L3JhZGlhbEdyYWRpZW50Pgo8Y2xpcFBhdGggaWQ9ImNsaXAwXzEwMDUwXzQxNzEiPgo8cmVjdCB3aWR0aD0iMTE1Ljc3IiBoZWlnaHQ9IjE0Ny43IiBmaWxsPSJ3aGl0ZSIgdHJhbnNmb3JtPSJ0cmFuc2xhdGUoMzIgMTYpIi8+CjwvY2xpcFBhdGg+CjwvZGVmcz4KPC9zdmc+Cg=="
3314
+ }
3315
+ };
3316
+ const defaultAdapters = {
3317
+ [DefaultAdaptersInfo.fordefi.id]: FordefiAdapter,
3318
+ [DefaultAdaptersInfo.xverse.id]: XverseAdapter,
3319
+ [DefaultAdaptersInfo.unisat.id]: UnisatAdapter
3320
+ };
3321
+
3322
+ //#endregion
3323
+ //#region src/capabilities/index.ts
3324
+ const extractOrValidateCapabilities = (provider, reportedCapabilities) => {
3325
+ const validateCapability = (capability) => {
3326
+ if (!provider[capability]) return false;
3327
+ if (reportedCapabilities && !reportedCapabilities.has(capability)) return false;
3328
+ return true;
3329
+ };
3330
+ const capabilityMap = {
3331
+ request: validateCapability("request"),
3332
+ connect: validateCapability("connect"),
3333
+ signMessage: validateCapability("signMessage"),
3334
+ signTransaction: validateCapability("signTransaction"),
3335
+ sendBtcTransaction: validateCapability("sendBtcTransaction"),
3336
+ createInscription: validateCapability("createInscription"),
3337
+ createRepeatInscriptions: validateCapability("createRepeatInscriptions"),
3338
+ signMultipleTransactions: validateCapability("signMultipleTransactions"),
3339
+ addListener: validateCapability("addListener")
3340
+ };
3341
+ return Object.entries(capabilityMap).reduce((acc, [capability, value]) => {
3342
+ if (value) return [...acc, capability];
3343
+ return acc;
3344
+ }, []);
3345
+ };
3346
+ const getCapabilities = async (options) => {
3347
+ const provider = await getProviderOrThrow(options.getProvider);
3348
+ const request$1 = (0, jsontokens.createUnsecuredToken)(options.payload);
3349
+ if (provider.getCapabilities) try {
3350
+ const response = await provider.getCapabilities(request$1);
3351
+ options.onFinish?.(extractOrValidateCapabilities(provider, new Set(response)));
3352
+ } catch (error) {
3353
+ console.error("[Connect] Error during capabilities request", error);
3354
+ }
3355
+ try {
3356
+ const inferredCapabilities = extractOrValidateCapabilities(provider);
3357
+ options.onFinish?.(inferredCapabilities);
3358
+ } catch (error) {
3359
+ console.error("[Connect] Error during capabilities request", error);
3360
+ options.onCancel?.();
3361
+ }
3362
+ };
3363
+
3364
+ //#endregion
3365
+ //#region src/inscriptions/utils.ts
3366
+ const MAX_CONTENT_LENGTH_MAINNET = 4e5;
3367
+ const MAX_CONTENT_LENGTH_TESTNET = 6e4;
3368
+ const validateInscriptionPayload = (payload) => {
3369
+ const { contentType, content, payloadType, network, appFeeAddress, appFee } = payload;
3370
+ if (!/^[a-z]+\/[a-z0-9\-.+]+(?=;.*|$)/.test(contentType)) throw new Error("Invalid content type detected");
3371
+ if (!content || content.length === 0) throw new Error("Empty content not allowed");
3372
+ if (!payloadType || payloadType !== "BASE_64" && payloadType !== "PLAIN_TEXT") throw new Error("Empty invalid payloadType specified");
3373
+ if (content.length > (network.type === "Mainnet" ? MAX_CONTENT_LENGTH_MAINNET : MAX_CONTENT_LENGTH_TESTNET)) throw new Error("Content too large");
3374
+ if ((appFeeAddress?.length ?? 0) > 0 && (appFee ?? 0) <= 0) throw new Error("Invalid combination of app fee address and fee provided");
3375
+ };
3376
+
3377
+ //#endregion
3378
+ //#region src/inscriptions/createInscription.ts
3379
+ const createInscription = async (options) => {
3380
+ const { getProvider } = options;
3381
+ const provider = await getProviderOrThrow(getProvider);
3382
+ validateInscriptionPayload(options.payload);
3383
+ try {
3384
+ const request$1 = (0, jsontokens.createUnsecuredToken)(options.payload);
3385
+ const response = await provider.createInscription(request$1);
3386
+ options.onFinish?.(response);
3387
+ } catch (error) {
3388
+ console.error("[Connect] Error during create inscription", error);
3389
+ options.onCancel?.();
3390
+ }
3391
+ };
3392
+
3393
+ //#endregion
3394
+ //#region src/inscriptions/createRepeatInscriptions.ts
3395
+ const createRepeatInscriptions = async (options) => {
3396
+ const { getProvider } = options;
3397
+ const provider = await getProviderOrThrow(getProvider);
3398
+ validateInscriptionPayload(options.payload);
3399
+ try {
3400
+ const request$1 = (0, jsontokens.createUnsecuredToken)(options.payload);
3401
+ const response = await provider.createRepeatInscriptions(request$1);
3402
+ options.onFinish?.(response);
3403
+ } catch (error) {
3404
+ console.error("[Connect] Error during create repeat inscriptions", error);
3405
+ options.onCancel?.();
3406
+ }
3407
+ };
3408
+
3409
+ //#endregion
3410
+ //#region src/messages/index.ts
3411
+ const signMessage = async (options) => {
3412
+ const provider = await getProviderOrThrow(options.getProvider);
3413
+ const { address, message } = options.payload;
3414
+ if (!address) throw new Error("An address is required to sign a message");
3415
+ if (!message) throw new Error("A message to be signed is required");
3416
+ try {
3417
+ const request$1 = (0, jsontokens.createUnsecuredToken)(options.payload);
3418
+ const response = await provider.signMessage(request$1);
3419
+ options.onFinish?.(response);
3420
+ } catch (error) {
3421
+ console.error("[Connect] Error during sign message request", error);
3422
+ options.onCancel?.();
3423
+ }
3424
+ };
3425
+
3426
+ //#endregion
3427
+ //#region src/transactions/sendBtcTransaction.ts
3428
+ const serializer = (recipient) => {
3429
+ return recipient.map((value) => {
3430
+ const { address, amountSats } = value;
3431
+ return {
3432
+ address,
3433
+ amountSats: amountSats.toString()
3434
+ };
3435
+ });
3436
+ };
3437
+ const sendBtcTransaction = async (options) => {
3438
+ const provider = await getProviderOrThrow(options.getProvider);
3439
+ const { recipients, senderAddress, network, message } = options.payload;
3440
+ if (!recipients || recipients.length === 0) throw new Error("At least one recipient is required");
3441
+ if (recipients.some((item) => typeof item.address !== "string" || typeof item.amountSats !== "bigint")) throw new Error("Incorrect recipient format");
3442
+ if (!senderAddress) throw new Error("The sender address is required");
3443
+ try {
3444
+ const request$1 = (0, jsontokens.createUnsecuredToken)({
3445
+ network,
3446
+ senderAddress,
3447
+ message,
3448
+ recipients: serializer(recipients)
3449
+ });
3450
+ const response = await provider.sendBtcTransaction(request$1);
3451
+ options.onFinish?.(response);
3452
+ } catch (error) {
3453
+ console.error("[Connect] Error during send BTC transaction request", error);
3454
+ options.onCancel?.();
3455
+ }
3456
+ };
3457
+
3458
+ //#endregion
3459
+ //#region src/transactions/signMultipleTransactions.ts
3460
+ const signMultipleTransactions = async (options) => {
3461
+ const provider = await getProviderOrThrow(options.getProvider);
3462
+ const { psbts } = options.payload;
3463
+ if (!psbts || !psbts.length) throw new Error("psbts array is required");
3464
+ if (psbts.length > 100) throw new Error("psbts array must contain less than 100 psbts");
3465
+ try {
3466
+ const request$1 = (0, jsontokens.createUnsecuredToken)(options.payload);
3467
+ const response = await provider.signMultipleTransactions(request$1);
3468
+ options.onFinish?.(response);
3469
+ } catch (error) {
3470
+ console.error("[Connect] Error during sign Multiple transactions request", error);
3471
+ options.onCancel?.();
3472
+ }
3473
+ };
3474
+
3475
+ //#endregion
3476
+ //#region src/transactions/signTransaction.ts
3477
+ const signTransaction = async (options) => {
3478
+ const provider = await getProviderOrThrow(options.getProvider);
3479
+ const { psbtBase64, inputsToSign } = options.payload;
3480
+ if (!psbtBase64) throw new Error("A value for psbtBase64 representing the tx hash is required");
3481
+ if (!inputsToSign) throw new Error("An array specifying the inputs to be signed by the wallet is required");
3482
+ try {
3483
+ const request$1 = (0, jsontokens.createUnsecuredToken)(options.payload);
3484
+ const response = await provider.signTransaction(request$1);
3485
+ options.onFinish?.(response);
3486
+ } catch (error) {
3487
+ console.error("[Connect] Error during sign transaction request", error);
3488
+ options.onCancel?.();
3489
+ }
3490
+ };
3491
+
3492
+ //#endregion
3493
+ exports.AddressPurpose = AddressPurpose;
3494
+ exports.AddressType = AddressType;
3495
+ exports.BaseAdapter = BaseAdapter;
3496
+ exports.BitcoinNetworkType = BitcoinNetworkType;
3497
+ exports.DefaultAdaptersInfo = DefaultAdaptersInfo;
3498
+ exports.MessageSigningProtocols = MessageSigningProtocols;
3499
+ exports.ProviderPlatform = ProviderPlatform;
3500
+ exports.RpcErrorCode = RpcErrorCode;
3501
+ exports.SatsConnectAdapter = SatsConnectAdapter;
3502
+ exports.SparkNetworkType = SparkNetworkType;
3503
+ exports.StacksNetworkType = StacksNetworkType;
3504
+ exports.StarknetNetworkType = StarknetNetworkType;
3505
+ exports.accountChangeEventName = accountChangeEventName;
3506
+ exports.accountChangeSchema = accountChangeSchema;
3507
+ exports.addListener = addListener;
3508
+ exports.addressSchema = addressSchema;
3509
+ exports.allResolvedNetworksSchema = allResolvedNetworksSchema;
3510
+ exports.bitcoinGetAccountsParamsSchema = bitcoinGetAccountsParamsSchema;
3511
+ exports.bitcoinGetAccountsRequestSchema = bitcoinGetAccountsRequestSchema;
3512
+ exports.bitcoinGetAccountsResultSchema = bitcoinGetAccountsResultSchema;
3513
+ exports.bitcoinGetAccountsSuccessResponseSchema = bitcoinGetAccountsSuccessResponseSchema;
3514
+ exports.bitcoinGetAccountsV2ParamsSchema = bitcoinGetAccountsV2ParamsSchema;
3515
+ exports.bitcoinGetAccountsV2RequestSchema = bitcoinGetAccountsV2RequestSchema;
3516
+ exports.bitcoinGetAccountsV2ResultSchema = bitcoinGetAccountsV2ResultSchema;
3517
+ exports.bitcoinGetAccountsV2SuccessResponseSchema = bitcoinGetAccountsV2SuccessResponseSchema;
3518
+ exports.bitcoinGetAddressesParamsSchema = bitcoinGetAddressesParamsSchema;
3519
+ exports.bitcoinGetAddressesRequestSchema = bitcoinGetAddressesRequestSchema;
3520
+ exports.bitcoinGetAddressesResultSchema = bitcoinGetAddressesResultSchema;
3521
+ exports.bitcoinGetAddressesSuccessResponseSchema = bitcoinGetAddressesSuccessResponseSchema;
3522
+ exports.bitcoinGetAddressesV2ParamsSchema = bitcoinGetAddressesV2ParamsSchema;
3523
+ exports.bitcoinGetAddressesV2RequestSchema = bitcoinGetAddressesV2RequestSchema;
3524
+ exports.bitcoinGetAddressesV2ResultSchema = bitcoinGetAddressesV2ResultSchema;
3525
+ exports.bitcoinGetAddressesV2SuccessResponseSchema = bitcoinGetAddressesV2SuccessResponseSchema;
3526
+ exports.bitcoinGetBalanceParamsSchema = bitcoinGetBalanceParamsSchema;
3527
+ exports.bitcoinGetBalanceRequestSchema = bitcoinGetBalanceRequestSchema;
3528
+ exports.bitcoinGetBalanceResultSchema = bitcoinGetBalanceResultSchema;
3529
+ exports.bitcoinGetBalanceSuccessResponseSchema = bitcoinGetBalanceSuccessResponseSchema;
3530
+ exports.bitcoinGetBalanceV2ParamsSchema = bitcoinGetBalanceV2ParamsSchema;
3531
+ exports.bitcoinGetBalanceV2RequestSchema = bitcoinGetBalanceV2RequestSchema;
3532
+ exports.bitcoinGetBalanceV2ResultSchema = bitcoinGetBalanceV2ResultSchema;
3533
+ exports.bitcoinGetBalanceV2SuccessResponseSchema = bitcoinGetBalanceV2SuccessResponseSchema;
3534
+ exports.bitcoinGetInfoParamsSchema = bitcoinGetInfoParamsSchema;
3535
+ exports.bitcoinGetInfoRequestSchema = bitcoinGetInfoRequestSchema;
3536
+ exports.bitcoinGetInfoResultSchema = bitcoinGetInfoResultSchema;
3537
+ exports.bitcoinGetInfoSuccessResponseSchema = bitcoinGetInfoSuccessResponseSchema;
3538
+ exports.bitcoinGetInfoV2ParamsSchema = bitcoinGetInfoV2ParamsSchema;
3539
+ exports.bitcoinGetInfoV2RequestSchema = bitcoinGetInfoV2RequestSchema;
3540
+ exports.bitcoinGetInfoV2ResultSchema = bitcoinGetInfoV2ResultSchema;
3541
+ exports.bitcoinGetInfoV2SuccessResponseSchema = bitcoinGetInfoV2SuccessResponseSchema;
3542
+ exports.bitcoinMethods = bitcoinMethods;
3543
+ exports.bitcoinModeToLegacyBitcoinNetworkType = bitcoinModeToLegacyBitcoinNetworkType;
3544
+ exports.bitcoinNetworkConfigurationOptionsSchema = bitcoinNetworkConfigurationOptionsSchema;
3545
+ exports.bitcoinRequestSchema = bitcoinRequestSchema;
3546
+ exports.bitcoinSendTransferParamsSchema = bitcoinSendTransferParamsSchema;
3547
+ exports.bitcoinSendTransferRequestSchema = bitcoinSendTransferRequestSchema;
3548
+ exports.bitcoinSendTransferResultSchema = bitcoinSendTransferResultSchema;
3549
+ exports.bitcoinSendTransferSuccessResponseSchema = bitcoinSendTransferSuccessResponseSchema;
3550
+ exports.bitcoinSendTransferV2ParamsSchema = bitcoinSendTransferV2ParamsSchema;
3551
+ exports.bitcoinSendTransferV2RequestSchema = bitcoinSendTransferV2RequestSchema;
3552
+ exports.bitcoinSendTransferV2ResultSchema = bitcoinSendTransferV2ResultSchema;
3553
+ exports.bitcoinSendTransferV2SuccessResponseSchema = bitcoinSendTransferV2SuccessResponseSchema;
3554
+ exports.bitcoinSignMessageParamsSchema = bitcoinSignMessageParamsSchema;
3555
+ exports.bitcoinSignMessageRequestSchema = bitcoinSignMessageRequestSchema;
3556
+ exports.bitcoinSignMessageResultSchema = bitcoinSignMessageResultSchema;
3557
+ exports.bitcoinSignMessageSuccessResponseSchema = bitcoinSignMessageSuccessResponseSchema;
3558
+ exports.bitcoinSignMessageV2ParamsSchema = bitcoinSignMessageV2ParamsSchema;
3559
+ exports.bitcoinSignMessageV2RequestSchema = bitcoinSignMessageV2RequestSchema;
3560
+ exports.bitcoinSignMessageV2ResultSchema = bitcoinSignMessageV2ResultSchema;
3561
+ exports.bitcoinSignMessageV2SuccessResponseSchema = bitcoinSignMessageV2SuccessResponseSchema;
3562
+ exports.bitcoinSignMultipleMessagesParamsSchema = bitcoinSignMultipleMessagesParamsSchema;
3563
+ exports.bitcoinSignMultipleMessagesRequestSchema = bitcoinSignMultipleMessagesRequestSchema;
3564
+ exports.bitcoinSignMultipleMessagesResultSchema = bitcoinSignMultipleMessagesResultSchema;
3565
+ exports.bitcoinSignMultipleMessagesSuccessResponseSchema = bitcoinSignMultipleMessagesSuccessResponseSchema;
3566
+ exports.bitcoinSignMultipleMessagesV2ParamsSchema = bitcoinSignMultipleMessagesV2ParamsSchema;
3567
+ exports.bitcoinSignMultipleMessagesV2RequestSchema = bitcoinSignMultipleMessagesV2RequestSchema;
3568
+ exports.bitcoinSignMultipleMessagesV2ResultSchema = bitcoinSignMultipleMessagesV2ResultSchema;
3569
+ exports.bitcoinSignMultipleMessagesV2SuccessResponseSchema = bitcoinSignMultipleMessagesV2SuccessResponseSchema;
3570
+ exports.bitcoinSignPsbtParamsSchema = bitcoinSignPsbtParamsSchema;
3571
+ exports.bitcoinSignPsbtRequestSchema = bitcoinSignPsbtRequestSchema;
3572
+ exports.bitcoinSignPsbtResultSchema = bitcoinSignPsbtResultSchema;
3573
+ exports.bitcoinSignPsbtSuccessResponseSchema = bitcoinSignPsbtSuccessResponseSchema;
3574
+ exports.bitcoinSignPsbtV2ParamsSchema = bitcoinSignPsbtV2ParamsSchema;
3575
+ exports.bitcoinSignPsbtV2RequestSchema = bitcoinSignPsbtV2RequestSchema;
3576
+ exports.bitcoinSignPsbtV2ResultSchema = bitcoinSignPsbtV2ResultSchema;
3577
+ exports.bitcoinSignPsbtV2SuccessResponseSchema = bitcoinSignPsbtV2SuccessResponseSchema;
3578
+ exports.bitcoinSuccessResponseSchema = bitcoinSuccessResponseSchema;
3579
+ exports.createInscription = createInscription;
3580
+ exports.createRepeatInscriptions = createRepeatInscriptions;
3581
+ exports.createRpcRequest = createRpcRequest;
3582
+ exports.createRpcSuccessResponse = createRpcSuccessResponse;
3583
+ exports.defaultAdapters = defaultAdapters;
3584
+ exports.disconnectEventName = disconnectEventName;
3585
+ exports.disconnectSchema = disconnectSchema;
3586
+ exports.getAddress = getAddress;
3587
+ exports.getCapabilities = getCapabilities;
3588
+ exports.getDefaultProvider = getDefaultProvider;
3589
+ exports.getProviderById = getProviderById;
3590
+ exports.getProviderOrThrow = getProviderOrThrow;
3591
+ exports.getProviders = getProviders;
3592
+ exports.getSupportedWallets = getSupportedWallets;
3593
+ exports.isProviderInstalled = isProviderInstalled;
3594
+ exports.methodSupport = methodSupport;
3595
+ exports.networkChangeEventName = networkChangeEventName;
3596
+ exports.networkChangeEventNameV2 = networkChangeEventNameV2;
3597
+ exports.networkChangeSchema = networkChangeSchema;
3598
+ exports.networkChangeV2Schema = networkChangeV2Schema;
3599
+ exports.networkConfigurationOptionsSchema = networkConfigurationOptionsSchema;
3600
+ exports.ordinalsGetInscriptionsParamsSchema = ordinalsGetInscriptionsParamsSchema;
3601
+ exports.ordinalsGetInscriptionsRequestSchema = ordinalsGetInscriptionsRequestSchema;
3602
+ exports.ordinalsGetInscriptionsResultSchema = ordinalsGetInscriptionsResultSchema;
3603
+ exports.ordinalsGetInscriptionsSuccessResponseSchema = ordinalsGetInscriptionsSuccessResponseSchema;
3604
+ exports.ordinalsMethods = ordinalsMethods;
3605
+ exports.ordinalsRequestSchema = ordinalsRequestSchema;
3606
+ exports.ordinalsSendInscriptionsParamsSchema = ordinalsSendInscriptionsParamsSchema;
3607
+ exports.ordinalsSendInscriptionsRequestSchema = ordinalsSendInscriptionsRequestSchema;
3608
+ exports.ordinalsSendInscriptionsResultSchema = ordinalsSendInscriptionsResultSchema;
3609
+ exports.ordinalsSendInscriptionsSuccessResponseSchema = ordinalsSendInscriptionsSuccessResponseSchema;
3610
+ exports.ordinalsSuccessResponseSchema = ordinalsSuccessResponseSchema;
3611
+ exports.permissionRequestParamsSchema = permissionRequestParamsSchema;
3612
+ exports.removeDefaultProvider = removeDefaultProvider;
3613
+ exports.request = request;
3614
+ exports.rpcIdSchema = rpcIdSchema;
3615
+ exports.rpcRequestSchema = rpcRequestSchema;
3616
+ exports.rpcSuccessResponseSchema = rpcSuccessResponseSchema;
3617
+ exports.runesEstimateEtchParamsSchema = runesEstimateEtchParamsSchema;
3618
+ exports.runesEstimateEtchRequestSchema = runesEstimateEtchRequestSchema;
3619
+ exports.runesEstimateEtchResultSchema = runesEstimateEtchResultSchema;
3620
+ exports.runesEstimateEtchSuccessResponseSchema = runesEstimateEtchSuccessResponseSchema;
3621
+ exports.runesEstimateMintParamsSchema = runesEstimateMintParamsSchema;
3622
+ exports.runesEstimateMintRequestSchema = runesEstimateMintRequestSchema;
3623
+ exports.runesEstimateMintResultSchema = runesEstimateMintResultSchema;
3624
+ exports.runesEstimateMintSuccessResponseSchema = runesEstimateMintSuccessResponseSchema;
3625
+ exports.runesEstimateRbfOrderParamsSchema = runesEstimateRbfOrderParamsSchema;
3626
+ exports.runesEstimateRbfOrderRequestSchema = runesEstimateRbfOrderRequestSchema;
3627
+ exports.runesEstimateRbfOrderResultSchema = runesEstimateRbfOrderResultSchema;
3628
+ exports.runesEstimateRbfOrderSuccessResponseSchema = runesEstimateRbfOrderSuccessResponseSchema;
3629
+ exports.runesEtchParamsSchema = runesEtchParamsSchema;
3630
+ exports.runesEtchRequestSchema = runesEtchRequestSchema;
3631
+ exports.runesEtchResultSchema = runesEtchResultSchema;
3632
+ exports.runesEtchSuccessResponseSchema = runesEtchSuccessResponseSchema;
3633
+ exports.runesGetBalanceParamsSchema = runesGetBalanceParamsSchema;
3634
+ exports.runesGetBalanceRequestSchema = runesGetBalanceRequestSchema;
3635
+ exports.runesGetBalanceResultSchema = runesGetBalanceResultSchema;
3636
+ exports.runesGetBalanceSuccessResponseSchema = runesGetBalanceSuccessResponseSchema;
3637
+ exports.runesGetOrderParamsSchema = runesGetOrderParamsSchema;
3638
+ exports.runesGetOrderRequestSchema = runesGetOrderRequestSchema;
3639
+ exports.runesGetOrderResultSchema = runesGetOrderResultSchema;
3640
+ exports.runesGetOrderSuccessResponseSchema = runesGetOrderSuccessResponseSchema;
3641
+ exports.runesMethods = runesMethods;
3642
+ exports.runesMintParamsSchema = runesMintParamsSchema;
3643
+ exports.runesMintRequestSchema = runesMintRequestSchema;
3644
+ exports.runesMintResultSchema = runesMintResultSchema;
3645
+ exports.runesMintSuccessResponseSchema = runesMintSuccessResponseSchema;
3646
+ exports.runesRbfOrderParamsSchema = runesRbfOrderParamsSchema;
3647
+ exports.runesRbfOrderRequestSchema = runesRbfOrderRequestSchema;
3648
+ exports.runesRbfOrderResultSchema = runesRbfOrderResultSchema;
3649
+ exports.runesRbfOrderSuccessResponseSchema = runesRbfOrderSuccessResponseSchema;
3650
+ exports.runesRequestSchema = runesRequestSchema;
3651
+ exports.runesSuccessResponseSchema = runesSuccessResponseSchema;
3652
+ exports.runesTransferParamsSchema = runesTransferParamsSchema;
3653
+ exports.runesTransferRequestSchema = runesTransferRequestSchema;
3654
+ exports.runesTransferResultSchema = runesTransferResultSchema;
3655
+ exports.runesTransferSuccessResponseSchema = runesTransferSuccessResponseSchema;
3656
+ exports.sendBtcTransaction = sendBtcTransaction;
3657
+ exports.setDefaultProvider = setDefaultProvider;
3658
+ exports.signMessage = signMessage;
3659
+ exports.signMultipleTransactions = signMultipleTransactions;
3660
+ exports.signTransaction = signTransaction;
3661
+ exports.sparkFlashnetClawbackFundsParamsSchema = sparkFlashnetClawbackFundsParamsSchema;
3662
+ exports.sparkFlashnetClawbackFundsRequestSchema = sparkFlashnetClawbackFundsRequestSchema;
3663
+ exports.sparkFlashnetClawbackFundsResultSchema = sparkFlashnetClawbackFundsResultSchema;
3664
+ exports.sparkFlashnetClawbackFundsSuccessResponseSchema = sparkFlashnetClawbackFundsSuccessResponseSchema;
3665
+ exports.sparkFlashnetExecuteRouteSwapParamsSchema = sparkFlashnetExecuteRouteSwapParamsSchema;
3666
+ exports.sparkFlashnetExecuteRouteSwapRequestSchema = sparkFlashnetExecuteRouteSwapRequestSchema;
3667
+ exports.sparkFlashnetExecuteRouteSwapResultSchema = sparkFlashnetExecuteRouteSwapResultSchema;
3668
+ exports.sparkFlashnetExecuteRouteSwapSuccessResponseSchema = sparkFlashnetExecuteRouteSwapSuccessResponseSchema;
3669
+ exports.sparkFlashnetExecuteSwapParamsSchema = sparkFlashnetExecuteSwapParamsSchema;
3670
+ exports.sparkFlashnetExecuteSwapRequestSchema = sparkFlashnetExecuteSwapRequestSchema;
3671
+ exports.sparkFlashnetExecuteSwapResultSchema = sparkFlashnetExecuteSwapResultSchema;
3672
+ exports.sparkFlashnetExecuteSwapSuccessResponseSchema = sparkFlashnetExecuteSwapSuccessResponseSchema;
3673
+ exports.sparkFlashnetGetJwtParamsSchema = sparkFlashnetGetJwtParamsSchema;
3674
+ exports.sparkFlashnetGetJwtRequestSchema = sparkFlashnetGetJwtRequestSchema;
3675
+ exports.sparkFlashnetGetJwtResultSchema = sparkFlashnetGetJwtResultSchema;
3676
+ exports.sparkFlashnetGetJwtSuccessResponseSchema = sparkFlashnetGetJwtSuccessResponseSchema;
3677
+ exports.sparkFlashnetSignIntentParamsSchema = sparkFlashnetSignIntentParamsSchema;
3678
+ exports.sparkFlashnetSignIntentRequestSchema = sparkFlashnetSignIntentRequestSchema;
3679
+ exports.sparkFlashnetSignIntentResultSchema = sparkFlashnetSignIntentResultSchema;
3680
+ exports.sparkFlashnetSignIntentSuccessResponseSchema = sparkFlashnetSignIntentSuccessResponseSchema;
3681
+ exports.sparkFlashnetSignStructuredMessageParamsSchema = sparkFlashnetSignStructuredMessageParamsSchema;
3682
+ exports.sparkFlashnetSignStructuredMessageRequestSchema = sparkFlashnetSignStructuredMessageRequestSchema;
3683
+ exports.sparkFlashnetSignStructuredMessageResultSchema = sparkFlashnetSignStructuredMessageResultSchema;
3684
+ exports.sparkFlashnetSignStructuredMessageSuccessResponseSchema = sparkFlashnetSignStructuredMessageSuccessResponseSchema;
3685
+ exports.sparkGetAddressesParamsSchema = sparkGetAddressesParamsSchema;
3686
+ exports.sparkGetAddressesRequestSchema = sparkGetAddressesRequestSchema;
3687
+ exports.sparkGetAddressesResultSchema = sparkGetAddressesResultSchema;
3688
+ exports.sparkGetAddressesSuccessResponseSchema = sparkGetAddressesSuccessResponseSchema;
3689
+ exports.sparkGetAddressesV2ParamsSchema = sparkGetAddressesV2ParamsSchema;
3690
+ exports.sparkGetAddressesV2RequestSchema = sparkGetAddressesV2RequestSchema;
3691
+ exports.sparkGetAddressesV2ResultSchema = sparkGetAddressesV2ResultSchema;
3692
+ exports.sparkGetAddressesV2SuccessResponseSchema = sparkGetAddressesV2SuccessResponseSchema;
3693
+ exports.sparkGetBalanceParamsSchema = sparkGetBalanceParamsSchema;
3694
+ exports.sparkGetBalanceRequestSchema = sparkGetBalanceRequestSchema;
3695
+ exports.sparkGetBalanceResultSchema = sparkGetBalanceResultSchema;
3696
+ exports.sparkGetBalanceSuccessResponseSchema = sparkGetBalanceSuccessResponseSchema;
3697
+ exports.sparkGetClawbackEligibleTransfersParamsSchema = sparkGetClawbackEligibleTransfersParamsSchema;
3698
+ exports.sparkGetClawbackEligibleTransfersRequestSchema = sparkGetClawbackEligibleTransfersRequestSchema;
3699
+ exports.sparkGetClawbackEligibleTransfersResultSchema = sparkGetClawbackEligibleTransfersResultSchema;
3700
+ exports.sparkGetClawbackEligibleTransfersSuccessResponseSchema = sparkGetClawbackEligibleTransfersSuccessResponseSchema;
3701
+ exports.sparkMethods = sparkMethods;
3702
+ exports.sparkModeToLegacySparkNetworkType = sparkModeToLegacySparkNetworkType;
3703
+ exports.sparkNetworkConfigurationOptionsSchema = sparkNetworkConfigurationOptionsSchema;
3704
+ exports.sparkRequestSchema = sparkRequestSchema;
3705
+ exports.sparkSignMessageParamsSchema = sparkSignMessageParamsSchema;
3706
+ exports.sparkSignMessageRequestSchema = sparkSignMessageRequestSchema;
3707
+ exports.sparkSignMessageResultSchema = sparkSignMessageResultSchema;
3708
+ exports.sparkSignMessageSuccessResponseSchema = sparkSignMessageSuccessResponseSchema;
3709
+ exports.sparkSuccessResponseSchema = sparkSuccessResponseSchema;
3710
+ exports.sparkTransferParamsSchema = sparkTransferParamsSchema;
3711
+ exports.sparkTransferRequestSchema = sparkTransferRequestSchema;
3712
+ exports.sparkTransferResultSchema = sparkTransferResultSchema;
3713
+ exports.sparkTransferSuccessResponseSchema = sparkTransferSuccessResponseSchema;
3714
+ exports.sparkTransferTokenParamsSchema = sparkTransferTokenParamsSchema;
3715
+ exports.sparkTransferTokenRequestSchema = sparkTransferTokenRequestSchema;
3716
+ exports.sparkTransferTokenResultSchema = sparkTransferTokenResultSchema;
3717
+ exports.sparkTransferTokenSuccessResponseSchema = sparkTransferTokenSuccessResponseSchema;
3718
+ exports.specErrorObjectSchema = specErrorObjectSchema;
3719
+ exports.specErrorResponseSchema = specErrorResponseSchema;
3720
+ exports.specIdSchema = specIdSchema;
3721
+ exports.specRequestSchema = specRequestSchema;
3722
+ exports.specResponseSchema = specResponseSchema;
3723
+ exports.specSuccessResponseSchema = specSuccessResponseSchema;
3724
+ exports.specSuccessWithExtensionsResponseSchema = specSuccessWithExtensionsResponseSchema;
3725
+ exports.stacksCallContractParamsSchema = stacksCallContractParamsSchema;
3726
+ exports.stacksCallContractRequestSchema = stacksCallContractRequestSchema;
3727
+ exports.stacksCallContractResultSchema = stacksCallContractResultSchema;
3728
+ exports.stacksCallContractSuccessResponseSchema = stacksCallContractSuccessResponseSchema;
3729
+ exports.stacksDeployContractParamsSchema = stacksDeployContractParamsSchema;
3730
+ exports.stacksDeployContractRequestSchema = stacksDeployContractRequestSchema;
3731
+ exports.stacksDeployContractResultSchema = stacksDeployContractResultSchema;
3732
+ exports.stacksDeployContractSuccessResponseSchema = stacksDeployContractSuccessResponseSchema;
3733
+ exports.stacksGetAccountsParamsSchema = stacksGetAccountsParamsSchema;
3734
+ exports.stacksGetAccountsRequestSchema = stacksGetAccountsRequestSchema;
3735
+ exports.stacksGetAccountsResultSchema = stacksGetAccountsResultSchema;
3736
+ exports.stacksGetAccountsSuccessResponseSchema = stacksGetAccountsSuccessResponseSchema;
3737
+ exports.stacksGetAddressesParamsSchema = stacksGetAddressesParamsSchema;
3738
+ exports.stacksGetAddressesRequestSchema = stacksGetAddressesRequestSchema;
3739
+ exports.stacksGetAddressesResultSchema = stacksGetAddressesResultSchema;
3740
+ exports.stacksGetAddressesSuccessResponseSchema = stacksGetAddressesSuccessResponseSchema;
3741
+ exports.stacksGetAddressesV2ParamsSchema = stacksGetAddressesV2ParamsSchema;
3742
+ exports.stacksGetAddressesV2RequestSchema = stacksGetAddressesV2RequestSchema;
3743
+ exports.stacksGetAddressesV2ResultSchema = stacksGetAddressesV2ResultSchema;
3744
+ exports.stacksGetAddressesV2SuccessResponseSchema = stacksGetAddressesV2SuccessResponseSchema;
3745
+ exports.stacksMethods = stacksMethods;
3746
+ exports.stacksModeToLegacyStacksNetworkType = stacksModeToLegacyStacksNetworkType;
3747
+ exports.stacksNetworkConfigurationOptionsSchema = stacksNetworkConfigurationOptionsSchema;
3748
+ exports.stacksRequestSchema = stacksRequestSchema;
3749
+ exports.stacksSignMessageParamsSchema = stacksSignMessageParamsSchema;
3750
+ exports.stacksSignMessageRequestSchema = stacksSignMessageRequestSchema;
3751
+ exports.stacksSignMessageResultSchema = stacksSignMessageResultSchema;
3752
+ exports.stacksSignMessageSuccessResponseSchema = stacksSignMessageSuccessResponseSchema;
3753
+ exports.stacksSignStructuredMessageParamsSchema = stacksSignStructuredMessageParamsSchema;
3754
+ exports.stacksSignStructuredMessageRequestSchema = stacksSignStructuredMessageRequestSchema;
3755
+ exports.stacksSignStructuredMessageResultSchema = stacksSignStructuredMessageResultSchema;
3756
+ exports.stacksSignStructuredMessageSuccessResponseSchema = stacksSignStructuredMessageSuccessResponseSchema;
3757
+ exports.stacksSignTransactionParamsSchema = stacksSignTransactionParamsSchema;
3758
+ exports.stacksSignTransactionRequestSchema = stacksSignTransactionRequestSchema;
3759
+ exports.stacksSignTransactionResultSchema = stacksSignTransactionResultSchema;
3760
+ exports.stacksSignTransactionSuccessResponseSchema = stacksSignTransactionSuccessResponseSchema;
3761
+ exports.stacksSignTransactionsParamsSchema = stacksSignTransactionsParamsSchema;
3762
+ exports.stacksSignTransactionsRequestSchema = stacksSignTransactionsRequestSchema;
3763
+ exports.stacksSignTransactionsResultSchema = stacksSignTransactionsResultSchema;
3764
+ exports.stacksSignTransactionsSuccessResponseSchema = stacksSignTransactionsSuccessResponseSchema;
3765
+ exports.stacksSuccessResponseSchema = stacksSuccessResponseSchema;
3766
+ exports.stacksTransferStxParamsSchema = stacksTransferStxParamsSchema;
3767
+ exports.stacksTransferStxRequestSchema = stacksTransferStxRequestSchema;
3768
+ exports.stacksTransferStxResultSchema = stacksTransferStxResultSchema;
3769
+ exports.stacksTransferStxSuccessResponseSchema = stacksTransferStxSuccessResponseSchema;
3770
+ exports.starknetNetworkConfigurationOptionsSchema = starknetNetworkConfigurationOptionsSchema;
3771
+ exports.walletAddNetworkParamsSchema = walletAddNetworkParamsSchema;
3772
+ exports.walletAddNetworkRequestSchema = walletAddNetworkRequestSchema;
3773
+ exports.walletAddNetworkResultSchema = walletAddNetworkResultSchema;
3774
+ exports.walletAddNetworkSuccessResponseSchema = walletAddNetworkSuccessResponseSchema;
3775
+ exports.walletAddNetworkV2ParamsSchema = walletAddNetworkV2ParamsSchema;
3776
+ exports.walletAddNetworkV2RequestSchema = walletAddNetworkV2RequestSchema;
3777
+ exports.walletAddNetworkV2ResultSchema = walletAddNetworkV2ResultSchema;
3778
+ exports.walletAddNetworkV2SuccessResponseSchema = walletAddNetworkV2SuccessResponseSchema;
3779
+ exports.walletChangeNetworkByIdParamsSchema = walletChangeNetworkByIdParamsSchema;
3780
+ exports.walletChangeNetworkByIdRequestSchema = walletChangeNetworkByIdRequestSchema;
3781
+ exports.walletChangeNetworkByIdResultSchema = walletChangeNetworkByIdResultSchema;
3782
+ exports.walletChangeNetworkByIdSuccessResponseSchema = walletChangeNetworkByIdSuccessResponseSchema;
3783
+ exports.walletChangeNetworkParamsSchema = walletChangeNetworkParamsSchema;
3784
+ exports.walletChangeNetworkRequestSchema = walletChangeNetworkRequestSchema;
3785
+ exports.walletChangeNetworkResultSchema = walletChangeNetworkResultSchema;
3786
+ exports.walletChangeNetworkSuccessResponseSchema = walletChangeNetworkSuccessResponseSchema;
3787
+ exports.walletConnectParamsSchema = walletConnectParamsSchema;
3788
+ exports.walletConnectRequestSchema = walletConnectRequestSchema;
3789
+ exports.walletConnectResultSchema = walletConnectResultSchema;
3790
+ exports.walletConnectSuccessResponseSchema = walletConnectSuccessResponseSchema;
3791
+ exports.walletConnectV2ParamsSchema = walletConnectV2ParamsSchema;
3792
+ exports.walletConnectV2RequestSchema = walletConnectV2RequestSchema;
3793
+ exports.walletConnectV2ResultSchema = walletConnectV2ResultSchema;
3794
+ exports.walletConnectV2SuccessResponseSchema = walletConnectV2SuccessResponseSchema;
3795
+ exports.walletDisconnectParamsSchema = walletDisconnectParamsSchema;
3796
+ exports.walletDisconnectRequestSchema = walletDisconnectRequestSchema;
3797
+ exports.walletDisconnectResultSchema = walletDisconnectResultSchema;
3798
+ exports.walletDisconnectSuccessResponseSchema = walletDisconnectSuccessResponseSchema;
3799
+ exports.walletEventSchema = walletEventSchema;
3800
+ exports.walletGetAccountParamsSchema = walletGetAccountParamsSchema;
3801
+ exports.walletGetAccountRequestSchema = walletGetAccountRequestSchema;
3802
+ exports.walletGetAccountResultSchema = walletGetAccountResultSchema;
3803
+ exports.walletGetAccountSuccessResponseSchema = walletGetAccountSuccessResponseSchema;
3804
+ exports.walletGetAccountV2ParamsSchema = walletGetAccountV2ParamsSchema;
3805
+ exports.walletGetAccountV2RequestSchema = walletGetAccountV2RequestSchema;
3806
+ exports.walletGetAccountV2ResultSchema = walletGetAccountV2ResultSchema;
3807
+ exports.walletGetAccountV2SuccessResponseSchema = walletGetAccountV2SuccessResponseSchema;
3808
+ exports.walletGetCurrentPermissionsParamsSchema = walletGetCurrentPermissionsParamsSchema;
3809
+ exports.walletGetCurrentPermissionsRequestSchema = walletGetCurrentPermissionsRequestSchema;
3810
+ exports.walletGetCurrentPermissionsResultSchema = walletGetCurrentPermissionsResultSchema;
3811
+ exports.walletGetCurrentPermissionsSuccessResponseSchema = walletGetCurrentPermissionsSuccessResponseSchema;
3812
+ exports.walletGetNetworkParamsSchema = walletGetNetworkParamsSchema;
3813
+ exports.walletGetNetworkRequestSchema = walletGetNetworkRequestSchema;
3814
+ exports.walletGetNetworkResultSchema = walletGetNetworkResultSchema;
3815
+ exports.walletGetNetworkSuccessResponseSchema = walletGetNetworkSuccessResponseSchema;
3816
+ exports.walletGetNetworksParamsSchema = walletGetNetworksParamsSchema;
3817
+ exports.walletGetNetworksRequestSchema = walletGetNetworksRequestSchema;
3818
+ exports.walletGetNetworksResultSchema = walletGetNetworksResultSchema;
3819
+ exports.walletGetNetworksSuccessResponseSchema = walletGetNetworksSuccessResponseSchema;
3820
+ exports.walletGetWalletTypeParamsSchema = walletGetWalletTypeParamsSchema;
3821
+ exports.walletGetWalletTypeRequestSchema = walletGetWalletTypeRequestSchema;
3822
+ exports.walletGetWalletTypeResultSchema = walletGetWalletTypeResultSchema;
3823
+ exports.walletGetWalletTypeSuccessResponseSchema = walletGetWalletTypeSuccessResponseSchema;
3824
+ exports.walletMethods = walletMethods;
3825
+ exports.walletOpenBridgeParamsSchema = walletOpenBridgeParamsSchema;
3826
+ exports.walletOpenBridgeRequestSchema = walletOpenBridgeRequestSchema;
3827
+ exports.walletOpenBridgeResultSchema = walletOpenBridgeResultSchema;
3828
+ exports.walletOpenBridgeSuccessResponseSchema = walletOpenBridgeSuccessResponseSchema;
3829
+ exports.walletOpenBuyParamsSchema = walletOpenBuyParamsSchema;
3830
+ exports.walletOpenBuyRequestSchema = walletOpenBuyRequestSchema;
3831
+ exports.walletOpenBuyResultSchema = walletOpenBuyResultSchema;
3832
+ exports.walletOpenBuySuccessResponseSchema = walletOpenBuySuccessResponseSchema;
3833
+ exports.walletOpenReceiveParamsSchema = walletOpenReceiveParamsSchema;
3834
+ exports.walletOpenReceiveRequestSchema = walletOpenReceiveRequestSchema;
3835
+ exports.walletOpenReceiveResultSchema = walletOpenReceiveResultSchema;
3836
+ exports.walletOpenReceiveSuccessResponseSchema = walletOpenReceiveSuccessResponseSchema;
3837
+ exports.walletRenouncePermissionsParamsSchema = walletRenouncePermissionsParamsSchema;
3838
+ exports.walletRenouncePermissionsRequestSchema = walletRenouncePermissionsRequestSchema;
3839
+ exports.walletRenouncePermissionsResultSchema = walletRenouncePermissionsResultSchema;
3840
+ exports.walletRenouncePermissionsSuccessResponseSchema = walletRenouncePermissionsSuccessResponseSchema;
3841
+ exports.walletRequestPermissionsParamsSchema = walletRequestPermissionsParamsSchema;
3842
+ exports.walletRequestPermissionsRequestSchema = walletRequestPermissionsRequestSchema;
3843
+ exports.walletRequestPermissionsResultSchema = walletRequestPermissionsResultSchema;
3844
+ exports.walletRequestPermissionsSuccessResponseSchema = walletRequestPermissionsSuccessResponseSchema;
3845
+ exports.walletRequestSchema = walletRequestSchema;
3846
+ exports.walletSuccessResponseSchema = walletSuccessResponseSchema;
3847
+ exports.walletTypeSchema = walletTypeSchema;
3848
+ exports.walletTypes = walletTypes;