@sats-connect/core 0.16.0-2dd02aa → 0.16.0-51b6afa

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,3894 @@
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
+ let result = [];
708
+ if (!signInputs) return result;
709
+ for (let address in signInputs) {
710
+ let indexes = signInputs[address];
711
+ for (let 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, patch] = 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.picklist([
2378
+ "Mainnet",
2379
+ "Testnet",
2380
+ "Signet"
2381
+ ]) });
2382
+ const walletChangeNetworkRequestSchema = createRequestSchema({
2383
+ paramsSchema: walletChangeNetworkParamsSchema,
2384
+ method: walletMethods.wallet_changeNetwork
2385
+ });
2386
+
2387
+ //#endregion
2388
+ //#region src/request/rpc/objects/namespaces/wallet/methods/changeNetwork/response.ts
2389
+ const walletChangeNetworkResultSchema = valibot.nullish(valibot.null());
2390
+ const walletChangeNetworkSuccessResponseSchema = createSuccessResponseSchema({
2391
+ resultSchema: walletChangeNetworkResultSchema,
2392
+ method: walletMethods.wallet_changeNetwork
2393
+ });
2394
+
2395
+ //#endregion
2396
+ //#region src/request/rpc/objects/namespaces/wallet/methods/changeNetworkById/request.ts
2397
+ const walletChangeNetworkByIdParamsSchema = valibot.object({ id: valibot.string() });
2398
+ const walletChangeNetworkByIdRequestSchema = createRequestSchema({
2399
+ paramsSchema: walletChangeNetworkByIdParamsSchema,
2400
+ method: walletMethods.wallet_changeNetworkById
2401
+ });
2402
+
2403
+ //#endregion
2404
+ //#region src/request/rpc/objects/namespaces/wallet/methods/changeNetworkById/response.ts
2405
+ const walletChangeNetworkByIdResultSchema = valibot.nullish(valibot.null());
2406
+ const walletChangeNetworkByIdSuccessResponseSchema = createSuccessResponseSchema({
2407
+ resultSchema: walletChangeNetworkByIdResultSchema,
2408
+ method: walletMethods.wallet_changeNetworkById
2409
+ });
2410
+
2411
+ //#endregion
2412
+ //#region src/request/rpc/objects/namespaces/wallet/methods/connect/request.ts
2413
+ const walletConnectParamsSchema = valibot.nullish(valibot.object({
2414
+ permissions: valibot.optional(valibot.array(permissionRequestParamsSchema)),
2415
+ addresses: valibot.optional(valibot.array(valibot.enum(AddressPurpose))),
2416
+ message: valibot.optional(valibot.pipe(valibot.string(), valibot.maxLength(80, "The message must not exceed 80 characters."))),
2417
+ network: valibot.optional(valibot.picklist([
2418
+ "Mainnet",
2419
+ "Testnet",
2420
+ "Signet"
2421
+ ]))
2422
+ }));
2423
+ const walletConnectRequestSchema = createRequestSchema({
2424
+ paramsSchema: walletConnectParamsSchema,
2425
+ method: walletMethods.wallet_connect
2426
+ });
2427
+
2428
+ //#endregion
2429
+ //#region src/request/rpc/objects/namespaces/wallet/methods/getNetwork/request.ts
2430
+ const walletGetNetworkParamsSchema = valibot.nullish(valibot.null());
2431
+ const walletGetNetworkRequestSchema = createRequestSchema({
2432
+ paramsSchema: walletGetNetworkParamsSchema,
2433
+ method: walletMethods.wallet_getNetwork
2434
+ });
2435
+
2436
+ //#endregion
2437
+ //#region src/request/rpc/objects/namespaces/wallet/methods/getNetwork/response.ts
2438
+ const walletGetNetworkResultSchema = valibot.object({
2439
+ bitcoin: valibot.object({ name: valibot.enum(BitcoinNetworkType) }),
2440
+ stacks: valibot.object({ name: valibot.enum(StacksNetworkType) }),
2441
+ spark: valibot.object({ name: valibot.enum(SparkNetworkType) })
2442
+ });
2443
+ const walletGetNetworkSuccessResponseSchema = createSuccessResponseSchema({
2444
+ resultSchema: walletGetNetworkResultSchema,
2445
+ method: walletMethods.wallet_getNetwork
2446
+ });
2447
+
2448
+ //#endregion
2449
+ //#region src/request/rpc/objects/namespaces/wallet/methods/connect/response.ts
2450
+ const walletConnectResultSchema = valibot.object({
2451
+ id: valibot.string(),
2452
+ addresses: valibot.array(addressSchema),
2453
+ walletType: walletTypeSchema,
2454
+ network: walletGetNetworkResultSchema
2455
+ });
2456
+ const walletConnectSuccessResponseSchema = createSuccessResponseSchema({
2457
+ resultSchema: walletConnectResultSchema,
2458
+ method: walletMethods.wallet_connect
2459
+ });
2460
+
2461
+ //#endregion
2462
+ //#region src/request/rpc/objects/namespaces/wallet/methods/connectV2/request.ts
2463
+ const walletConnectV2ParamsSchema = valibot.nullish(valibot.object({
2464
+ permissions: permissionRequestParamsSchema,
2465
+ addresses: valibot.optional(valibot.array(valibot.enum(AddressPurpose))),
2466
+ message: valibot.optional(valibot.pipe(valibot.string(), valibot.maxLength(80, "The message must not exceed 80 characters."))),
2467
+ networkId: valibot.optional(valibot.string())
2468
+ }));
2469
+ const walletConnectV2RequestSchema = createRequestSchema({
2470
+ paramsSchema: walletConnectV2ParamsSchema,
2471
+ method: walletMethods.wallet_connectV2
2472
+ });
2473
+
2474
+ //#endregion
2475
+ //#region src/request/rpc/objects/namespaces/wallet/methods/getNetworks/request.ts
2476
+ const walletGetNetworksParamsSchema = valibot.nullish(valibot.null());
2477
+ const walletGetNetworksRequestSchema = createRequestSchema({
2478
+ paramsSchema: walletGetNetworksParamsSchema,
2479
+ method: walletMethods.wallet_getNetworks
2480
+ });
2481
+
2482
+ //#endregion
2483
+ //#region src/request/rpc/objects/namespaces/wallet/methods/getNetworks/response.ts
2484
+ const walletGetNetworksResultSchema = allResolvedNetworksSchema;
2485
+ const walletGetNetworksSuccessResponseSchema = createSuccessResponseSchema({
2486
+ resultSchema: walletGetNetworksResultSchema,
2487
+ method: walletMethods.wallet_getNetworks
2488
+ });
2489
+
2490
+ //#endregion
2491
+ //#region src/request/rpc/objects/namespaces/wallet/methods/connectV2/response.ts
2492
+ const walletConnectV2ResultSchema = valibot.object({
2493
+ accountId: valibot.string(),
2494
+ addresses: valibot.array(addressSchema),
2495
+ walletType: walletTypeSchema,
2496
+ networks: walletGetNetworksResultSchema
2497
+ });
2498
+ const walletConnectV2SuccessResponseSchema = createSuccessResponseSchema({
2499
+ resultSchema: walletConnectV2ResultSchema,
2500
+ method: walletMethods.wallet_connectV2
2501
+ });
2502
+
2503
+ //#endregion
2504
+ //#region src/request/rpc/objects/namespaces/wallet/methods/disconnect/request.ts
2505
+ const walletDisconnectParamsSchema = valibot.nullish(valibot.null());
2506
+ const walletDisconnectRequestSchema = createRequestSchema({
2507
+ paramsSchema: walletDisconnectParamsSchema,
2508
+ method: walletMethods.wallet_disconnect
2509
+ });
2510
+
2511
+ //#endregion
2512
+ //#region src/request/rpc/objects/namespaces/wallet/methods/disconnect/response.ts
2513
+ const walletDisconnectResultSchema = valibot.nullish(valibot.null());
2514
+ const walletDisconnectSuccessResponseSchema = createSuccessResponseSchema({
2515
+ resultSchema: walletDisconnectResultSchema,
2516
+ method: walletMethods.wallet_disconnect
2517
+ });
2518
+
2519
+ //#endregion
2520
+ //#region src/request/rpc/objects/namespaces/wallet/methods/getAccount/request.ts
2521
+ const walletGetAccountParamsSchema = valibot.nullish(valibot.null());
2522
+ const walletGetAccountRequestSchema = createRequestSchema({
2523
+ paramsSchema: walletGetAccountParamsSchema,
2524
+ method: walletMethods.wallet_getAccount
2525
+ });
2526
+
2527
+ //#endregion
2528
+ //#region src/request/rpc/objects/namespaces/wallet/methods/getAccount/response.ts
2529
+ const walletGetAccountResultSchema = valibot.object({
2530
+ id: valibot.string(),
2531
+ addresses: valibot.array(addressSchema),
2532
+ walletType: walletTypeSchema,
2533
+ network: walletGetNetworkResultSchema
2534
+ });
2535
+ const walletGetAccountSuccessResponseSchema = createSuccessResponseSchema({
2536
+ resultSchema: walletGetAccountResultSchema,
2537
+ method: walletMethods.wallet_getAccount
2538
+ });
2539
+
2540
+ //#endregion
2541
+ //#region src/request/rpc/objects/namespaces/wallet/methods/getAccountV2/request.ts
2542
+ const walletGetAccountV2ParamsSchema = valibot.nullish(valibot.null());
2543
+ const walletGetAccountV2RequestSchema = createRequestSchema({
2544
+ paramsSchema: walletGetAccountV2ParamsSchema,
2545
+ method: walletMethods.wallet_getAccountV2
2546
+ });
2547
+
2548
+ //#endregion
2549
+ //#region src/request/rpc/objects/namespaces/wallet/methods/getAccountV2/response.ts
2550
+ const walletGetAccountV2ResultSchema = valibot.object({
2551
+ id: valibot.string(),
2552
+ addresses: valibot.array(addressSchema),
2553
+ walletType: walletTypeSchema,
2554
+ networks: walletGetNetworksResultSchema
2555
+ });
2556
+ const walletGetAccountV2SuccessResponseSchema = createSuccessResponseSchema({
2557
+ resultSchema: walletGetAccountV2ResultSchema,
2558
+ method: walletMethods.wallet_getAccountV2
2559
+ });
2560
+
2561
+ //#endregion
2562
+ //#region src/request/rpc/objects/namespaces/wallet/methods/getCurrentPermissions/request.ts
2563
+ const walletGetCurrentPermissionsParamsSchema = valibot.nullish(valibot.null());
2564
+ const walletGetCurrentPermissionsRequestSchema = createRequestSchema({
2565
+ paramsSchema: walletGetCurrentPermissionsParamsSchema,
2566
+ method: walletMethods.wallet_getCurrentPermissions
2567
+ });
2568
+
2569
+ //#endregion
2570
+ //#region src/request/rpc/objects/namespaces/wallet/methods/getCurrentPermissions/response.ts
2571
+ const accountActionsSchema$1 = valibot.object({ read: valibot.optional(valibot.boolean()) });
2572
+ const walletActionsSchema$1 = valibot.object({ readNetwork: valibot.optional(valibot.boolean()) });
2573
+ const accountPermissionSchema = valibot.object({
2574
+ type: valibot.literal("account"),
2575
+ resourceId: valibot.string(),
2576
+ clientId: valibot.string(),
2577
+ actions: accountActionsSchema$1
2578
+ });
2579
+ const walletPermissionSchema = valibot.object({
2580
+ type: valibot.literal("wallet"),
2581
+ resourceId: valibot.string(),
2582
+ clientId: valibot.string(),
2583
+ actions: walletActionsSchema$1
2584
+ });
2585
+ const permissionSchema = valibot.variant("type", [accountPermissionSchema, walletPermissionSchema]);
2586
+ const walletGetCurrentPermissionsResultSchema = valibot.array(permissionSchema);
2587
+ const walletGetCurrentPermissionsSuccessResponseSchema = createSuccessResponseSchema({
2588
+ resultSchema: walletGetCurrentPermissionsResultSchema,
2589
+ method: walletMethods.wallet_getCurrentPermissions
2590
+ });
2591
+
2592
+ //#endregion
2593
+ //#region src/request/rpc/objects/namespaces/wallet/methods/getWalletType/request.ts
2594
+ const walletGetWalletTypeParamsSchema = valibot.nullish(valibot.null());
2595
+ const walletGetWalletTypeRequestSchema = createRequestSchema({
2596
+ paramsSchema: walletGetWalletTypeParamsSchema,
2597
+ method: walletMethods.wallet_getWalletType
2598
+ });
2599
+
2600
+ //#endregion
2601
+ //#region src/request/rpc/objects/namespaces/wallet/methods/getWalletType/response.ts
2602
+ const walletGetWalletTypeResultSchema = walletTypeSchema;
2603
+ const walletGetWalletTypeSuccessResponseSchema = createSuccessResponseSchema({
2604
+ resultSchema: walletGetWalletTypeResultSchema,
2605
+ method: walletMethods.wallet_getWalletType
2606
+ });
2607
+
2608
+ //#endregion
2609
+ //#region src/request/rpc/objects/namespaces/wallet/methods/openBridge/request.ts
2610
+ const walletOpenBridgeParamsSchema = valibot.object({
2611
+ fromAsset: valibot.string(),
2612
+ toAsset: valibot.string()
2613
+ });
2614
+ const walletOpenBridgeRequestSchema = createRequestSchema({
2615
+ paramsSchema: walletOpenBridgeParamsSchema,
2616
+ method: walletMethods.wallet_openBridge
2617
+ });
2618
+
2619
+ //#endregion
2620
+ //#region src/request/rpc/objects/namespaces/wallet/methods/openBridge/response.ts
2621
+ const walletOpenBridgeResultSchema = valibot.nullish(valibot.null());
2622
+ const walletOpenBridgeSuccessResponseSchema = createSuccessResponseSchema({
2623
+ resultSchema: walletOpenBridgeResultSchema,
2624
+ method: walletMethods.wallet_openBridge
2625
+ });
2626
+
2627
+ //#endregion
2628
+ //#region src/request/rpc/objects/namespaces/wallet/methods/openBuy/request.ts
2629
+ const walletOpenBuyParamsSchema = valibot.object({ asset: valibot.string() });
2630
+ const walletOpenBuyRequestSchema = createRequestSchema({
2631
+ paramsSchema: walletOpenBuyParamsSchema,
2632
+ method: walletMethods.wallet_openBuy
2633
+ });
2634
+
2635
+ //#endregion
2636
+ //#region src/request/rpc/objects/namespaces/wallet/methods/openBuy/response.ts
2637
+ const walletOpenBuyResultSchema = valibot.nullish(valibot.null());
2638
+ const walletOpenBuySuccessResponseSchema = createSuccessResponseSchema({
2639
+ resultSchema: walletOpenBuyResultSchema,
2640
+ method: walletMethods.wallet_openBuy
2641
+ });
2642
+
2643
+ //#endregion
2644
+ //#region src/request/rpc/objects/namespaces/wallet/methods/openReceive/request.ts
2645
+ const walletOpenReceiveParamsSchema = valibot.object({ address: valibot.string() });
2646
+ const walletOpenReceiveRequestSchema = createRequestSchema({
2647
+ paramsSchema: walletOpenReceiveParamsSchema,
2648
+ method: walletMethods.wallet_openReceive
2649
+ });
2650
+
2651
+ //#endregion
2652
+ //#region src/request/rpc/objects/namespaces/wallet/methods/openReceive/response.ts
2653
+ const walletOpenReceiveResultSchema = addressSchema;
2654
+ const walletOpenReceiveSuccessResponseSchema = createSuccessResponseSchema({
2655
+ resultSchema: walletOpenReceiveResultSchema,
2656
+ method: walletMethods.wallet_openReceive
2657
+ });
2658
+
2659
+ //#endregion
2660
+ //#region src/request/rpc/objects/namespaces/wallet/methods/renouncePermissions/request.ts
2661
+ const walletRenouncePermissionsParamsSchema = valibot.nullish(valibot.null());
2662
+ const walletRenouncePermissionsRequestSchema = createRequestSchema({
2663
+ paramsSchema: walletRenouncePermissionsParamsSchema,
2664
+ method: walletMethods.wallet_renouncePermissions
2665
+ });
2666
+
2667
+ //#endregion
2668
+ //#region src/request/rpc/objects/namespaces/wallet/methods/renouncePermissions/response.ts
2669
+ const walletRenouncePermissionsResultSchema = valibot.nullish(valibot.null());
2670
+ const walletRenouncePermissionsSuccessResponseSchema = createSuccessResponseSchema({
2671
+ resultSchema: walletRenouncePermissionsResultSchema,
2672
+ method: walletMethods.wallet_renouncePermissions
2673
+ });
2674
+
2675
+ //#endregion
2676
+ //#region src/request/rpc/objects/namespaces/wallet/methods/requestPermissions/request.ts
2677
+ const accountActionsSchema = valibot.object({ read: valibot.optional(valibot.boolean()) });
2678
+ const walletActionsSchema = valibot.object({ readNetwork: valibot.optional(valibot.boolean()) });
2679
+ const accountPermissionRequestSchema = valibot.object({
2680
+ type: valibot.literal("account"),
2681
+ resourceId: valibot.string(),
2682
+ actions: accountActionsSchema
2683
+ });
2684
+ const walletPermissionRequestSchema = valibot.object({
2685
+ type: valibot.literal("wallet"),
2686
+ resourceId: valibot.string(),
2687
+ actions: walletActionsSchema
2688
+ });
2689
+ const permissionRequestParamsSchema$1 = valibot.variant("type", [accountPermissionRequestSchema, walletPermissionRequestSchema]);
2690
+ const walletRequestPermissionsParamsSchema = valibot.nullish(valibot.array(permissionRequestParamsSchema$1));
2691
+ const walletRequestPermissionsRequestSchema = createRequestSchema({
2692
+ paramsSchema: walletRequestPermissionsParamsSchema,
2693
+ method: walletMethods.wallet_requestPermissions
2694
+ });
2695
+
2696
+ //#endregion
2697
+ //#region src/request/rpc/objects/namespaces/wallet/methods/requestPermissions/response.ts
2698
+ const walletRequestPermissionsResultSchema = valibot.literal(true);
2699
+ const walletRequestPermissionsSuccessResponseSchema = createSuccessResponseSchema({
2700
+ resultSchema: walletRequestPermissionsResultSchema,
2701
+ method: walletMethods.wallet_requestPermissions
2702
+ });
2703
+
2704
+ //#endregion
2705
+ //#region src/request/rpc/objects/namespaces/wallet/index.ts
2706
+ const walletRequestSchema = valibot.variant("method", [
2707
+ walletAddNetworkRequestSchema,
2708
+ walletAddNetworkV2RequestSchema,
2709
+ walletChangeNetworkByIdRequestSchema,
2710
+ walletChangeNetworkRequestSchema,
2711
+ walletConnectRequestSchema,
2712
+ walletConnectV2RequestSchema,
2713
+ walletDisconnectRequestSchema,
2714
+ walletGetAccountRequestSchema,
2715
+ walletGetAccountV2RequestSchema,
2716
+ walletGetCurrentPermissionsRequestSchema,
2717
+ walletGetNetworkRequestSchema,
2718
+ walletGetNetworksRequestSchema,
2719
+ walletGetWalletTypeRequestSchema,
2720
+ walletOpenBridgeRequestSchema,
2721
+ walletOpenBuyRequestSchema,
2722
+ walletOpenReceiveRequestSchema,
2723
+ walletRenouncePermissionsRequestSchema,
2724
+ walletRequestPermissionsRequestSchema
2725
+ ]);
2726
+ const walletSuccessResponseSchema = valibot.variant("~sats-connect-method", [
2727
+ walletAddNetworkSuccessResponseSchema,
2728
+ walletAddNetworkV2SuccessResponseSchema,
2729
+ walletChangeNetworkByIdSuccessResponseSchema,
2730
+ walletChangeNetworkSuccessResponseSchema,
2731
+ walletConnectSuccessResponseSchema,
2732
+ walletConnectV2SuccessResponseSchema,
2733
+ walletDisconnectSuccessResponseSchema,
2734
+ walletGetAccountSuccessResponseSchema,
2735
+ walletGetAccountV2SuccessResponseSchema,
2736
+ walletGetCurrentPermissionsSuccessResponseSchema,
2737
+ walletGetNetworkSuccessResponseSchema,
2738
+ walletGetNetworksSuccessResponseSchema,
2739
+ walletGetWalletTypeSuccessResponseSchema,
2740
+ walletOpenBridgeSuccessResponseSchema,
2741
+ walletOpenBuySuccessResponseSchema,
2742
+ walletOpenReceiveSuccessResponseSchema,
2743
+ walletRenouncePermissionsSuccessResponseSchema,
2744
+ walletRequestPermissionsSuccessResponseSchema
2745
+ ]);
2746
+
2747
+ //#endregion
2748
+ //#region src/request/rpc/objects/namespaces/spark/methods/getAddresses/response.ts
2749
+ const sparkGetAddressesResultSchema = valibot.object({
2750
+ addresses: valibot.array(addressSchema),
2751
+ network: walletGetNetworkResultSchema
2752
+ });
2753
+ const sparkGetAddressesSuccessResponseSchema = createSuccessResponseSchema({
2754
+ resultSchema: sparkGetAddressesResultSchema,
2755
+ method: sparkMethods.spark_getAddresses
2756
+ });
2757
+
2758
+ //#endregion
2759
+ //#region src/request/rpc/objects/namespaces/spark/methods/getAddressesV2/request.ts
2760
+ const sparkGetAddressesV2ParamsSchema = valibot.nullish(valibot.object({ message: valibot.optional(valibot.string()) }));
2761
+ const sparkGetAddressesV2RequestSchema = createRequestSchema({
2762
+ paramsSchema: sparkGetAddressesV2ParamsSchema,
2763
+ method: sparkMethods.spark_getAddressesV2
2764
+ });
2765
+
2766
+ //#endregion
2767
+ //#region src/request/rpc/objects/namespaces/spark/methods/getAddressesV2/response.ts
2768
+ const sparkGetAddressesV2ResultSchema = valibot.object({
2769
+ addresses: valibot.array(addressSchema),
2770
+ network: sparkNetworkConfigurationSchema
2771
+ });
2772
+ const sparkGetAddressesV2SuccessResponseSchema = createSuccessResponseSchema({
2773
+ resultSchema: sparkGetAddressesV2ResultSchema,
2774
+ method: sparkMethods.spark_getAddressesV2
2775
+ });
2776
+
2777
+ //#endregion
2778
+ //#region src/request/rpc/objects/namespaces/spark/methods/getBalance/request.ts
2779
+ const sparkGetBalanceParamsSchema = valibot.nullish(valibot.null());
2780
+ const sparkGetBalanceRequestSchema = createRequestSchema({
2781
+ paramsSchema: sparkGetBalanceParamsSchema,
2782
+ method: sparkMethods.spark_getBalance
2783
+ });
2784
+
2785
+ //#endregion
2786
+ //#region src/request/rpc/objects/namespaces/spark/methods/getBalance/response.ts
2787
+ const sparkGetBalanceResultSchema = valibot.object({
2788
+ balance: valibot.string(),
2789
+ tokenBalances: valibot.array(valibot.object({
2790
+ balance: valibot.string(),
2791
+ tokenMetadata: valibot.object({
2792
+ tokenIdentifier: valibot.string(),
2793
+ tokenName: valibot.string(),
2794
+ tokenTicker: valibot.string(),
2795
+ decimals: valibot.number(),
2796
+ maxSupply: valibot.string()
2797
+ })
2798
+ }))
2799
+ });
2800
+ const sparkGetBalanceSuccessResponseSchema = createSuccessResponseSchema({
2801
+ resultSchema: sparkGetBalanceResultSchema,
2802
+ method: sparkMethods.spark_getBalance
2803
+ });
2804
+
2805
+ //#endregion
2806
+ //#region src/request/rpc/objects/namespaces/spark/methods/signMessage/request.ts
2807
+ const sparkSignMessageParamsSchema = valibot.object({ message: valibot.string() });
2808
+ const sparkSignMessageRequestSchema = createRequestSchema({
2809
+ paramsSchema: sparkSignMessageParamsSchema,
2810
+ method: sparkMethods.spark_signMessage
2811
+ });
2812
+
2813
+ //#endregion
2814
+ //#region src/request/rpc/objects/namespaces/spark/methods/signMessage/response.ts
2815
+ const sparkSignMessageResultSchema = valibot.object({ signature: valibot.string() });
2816
+ const sparkSignMessageSuccessResponseSchema = createSuccessResponseSchema({
2817
+ resultSchema: sparkSignMessageResultSchema,
2818
+ method: sparkMethods.spark_signMessage
2819
+ });
2820
+
2821
+ //#endregion
2822
+ //#region src/request/rpc/objects/namespaces/spark/methods/transfer/request.ts
2823
+ const sparkTransferParamsSchema = valibot.object({
2824
+ amountSats: valibot.union([valibot.number(), valibot.string()]),
2825
+ receiverSparkAddress: valibot.string()
2826
+ });
2827
+ const sparkTransferRequestSchema = createRequestSchema({
2828
+ paramsSchema: sparkTransferParamsSchema,
2829
+ method: sparkMethods.spark_transfer
2830
+ });
2831
+
2832
+ //#endregion
2833
+ //#region src/request/rpc/objects/namespaces/spark/methods/transfer/response.ts
2834
+ const sparkTransferResultSchema = valibot.object({ id: valibot.string() });
2835
+ const sparkTransferSuccessResponseSchema = createSuccessResponseSchema({
2836
+ resultSchema: sparkTransferResultSchema,
2837
+ method: sparkMethods.spark_transfer
2838
+ });
2839
+
2840
+ //#endregion
2841
+ //#region src/request/rpc/objects/namespaces/spark/methods/transferToken/request.ts
2842
+ const sparkTransferTokenParamsSchema = valibot.object({
2843
+ tokenAmount: valibot.union([valibot.number(), valibot.string()]),
2844
+ tokenIdentifier: valibot.string(),
2845
+ receiverSparkAddress: valibot.string()
2846
+ });
2847
+ const sparkTransferTokenRequestSchema = createRequestSchema({
2848
+ paramsSchema: sparkTransferTokenParamsSchema,
2849
+ method: sparkMethods.spark_transferToken
2850
+ });
2851
+
2852
+ //#endregion
2853
+ //#region src/request/rpc/objects/namespaces/spark/methods/transferToken/response.ts
2854
+ const sparkTransferTokenResultSchema = valibot.object({ id: valibot.string() });
2855
+ const sparkTransferTokenSuccessResponseSchema = createSuccessResponseSchema({
2856
+ resultSchema: sparkTransferTokenResultSchema,
2857
+ method: sparkMethods.spark_transferToken
2858
+ });
2859
+
2860
+ //#endregion
2861
+ //#region src/request/rpc/objects/namespaces/spark/index.ts
2862
+ const sparkRequestSchema = valibot.variant("method", [
2863
+ sparkGetAddressesRequestSchema,
2864
+ sparkGetAddressesV2RequestSchema,
2865
+ sparkGetBalanceRequestSchema,
2866
+ sparkTransferRequestSchema,
2867
+ sparkTransferTokenRequestSchema,
2868
+ sparkSignMessageRequestSchema,
2869
+ sparkFlashnetGetJwtRequestSchema,
2870
+ sparkFlashnetSignIntentRequestSchema,
2871
+ sparkFlashnetSignStructuredMessageRequestSchema,
2872
+ sparkFlashnetExecuteSwapRequestSchema,
2873
+ sparkFlashnetExecuteRouteSwapRequestSchema,
2874
+ sparkFlashnetClawbackFundsRequestSchema,
2875
+ sparkGetClawbackEligibleTransfersRequestSchema
2876
+ ]);
2877
+ const sparkSuccessResponseSchema = valibot.variant("~sats-connect-method", [
2878
+ sparkGetAddressesSuccessResponseSchema,
2879
+ sparkGetAddressesV2SuccessResponseSchema,
2880
+ sparkGetBalanceSuccessResponseSchema,
2881
+ sparkTransferSuccessResponseSchema,
2882
+ sparkTransferTokenSuccessResponseSchema,
2883
+ sparkSignMessageSuccessResponseSchema,
2884
+ sparkFlashnetGetJwtSuccessResponseSchema,
2885
+ sparkFlashnetSignIntentSuccessResponseSchema,
2886
+ sparkFlashnetSignStructuredMessageSuccessResponseSchema,
2887
+ sparkFlashnetExecuteSwapSuccessResponseSchema,
2888
+ sparkFlashnetExecuteRouteSwapSuccessResponseSchema,
2889
+ sparkFlashnetClawbackFundsSuccessResponseSchema,
2890
+ sparkGetClawbackEligibleTransfersSuccessResponseSchema
2891
+ ]);
2892
+
2893
+ //#endregion
2894
+ //#region src/request/rpc/objects/namespaces/stacks/methods/callContract/request.ts
2895
+ const stacksCallContractParamsSchema = valibot.object({
2896
+ contract: valibot.string(),
2897
+ functionName: valibot.string(),
2898
+ arguments: valibot.optional(valibot.array(valibot.string())),
2899
+ functionArgs: valibot.optional(valibot.array(valibot.string())),
2900
+ postConditions: valibot.optional(valibot.array(valibot.string())),
2901
+ postConditionMode: valibot.optional(valibot.union([valibot.literal("allow"), valibot.literal("deny")]))
2902
+ });
2903
+ const stacksCallContractRequestSchema = createRequestSchema({
2904
+ paramsSchema: stacksCallContractParamsSchema,
2905
+ method: stacksMethods.stx_callContract
2906
+ });
2907
+
2908
+ //#endregion
2909
+ //#region src/request/rpc/objects/namespaces/stacks/methods/callContract/response.ts
2910
+ const stacksCallContractResultSchema = valibot.object({
2911
+ txid: valibot.string(),
2912
+ transaction: valibot.string()
2913
+ });
2914
+ const stacksCallContractSuccessResponseSchema = createSuccessResponseSchema({
2915
+ resultSchema: stacksCallContractResultSchema,
2916
+ method: stacksMethods.stx_callContract
2917
+ });
2918
+
2919
+ //#endregion
2920
+ //#region src/request/rpc/objects/namespaces/stacks/methods/deployContract/request.ts
2921
+ const stacksDeployContractParamsSchema = valibot.object({
2922
+ name: valibot.string(),
2923
+ clarityCode: valibot.string(),
2924
+ clarityVersion: valibot.optional(valibot.number()),
2925
+ postConditions: valibot.optional(valibot.array(valibot.string())),
2926
+ postConditionMode: valibot.optional(valibot.union([valibot.literal("allow"), valibot.literal("deny")]))
2927
+ });
2928
+ const stacksDeployContractRequestSchema = createRequestSchema({
2929
+ paramsSchema: stacksDeployContractParamsSchema,
2930
+ method: stacksMethods.stx_deployContract
2931
+ });
2932
+
2933
+ //#endregion
2934
+ //#region src/request/rpc/objects/namespaces/stacks/methods/deployContract/response.ts
2935
+ const stacksDeployContractResultSchema = valibot.object({
2936
+ txid: valibot.string(),
2937
+ transaction: valibot.string()
2938
+ });
2939
+ const stacksDeployContractSuccessResponseSchema = createSuccessResponseSchema({
2940
+ resultSchema: stacksDeployContractResultSchema,
2941
+ method: stacksMethods.stx_deployContract
2942
+ });
2943
+
2944
+ //#endregion
2945
+ //#region src/request/rpc/objects/namespaces/stacks/methods/getAccounts/request.ts
2946
+ const stacksGetAccountsParamsSchema = valibot.nullish(valibot.null());
2947
+ const stacksGetAccountsRequestSchema = createRequestSchema({
2948
+ paramsSchema: stacksGetAccountsParamsSchema,
2949
+ method: stacksMethods.stx_getAccounts
2950
+ });
2951
+
2952
+ //#endregion
2953
+ //#region src/request/rpc/objects/namespaces/stacks/methods/getAccounts/response.ts
2954
+ const stacksGetAccountsResultSchema = valibot.object({
2955
+ addresses: valibot.array(valibot.object({
2956
+ address: valibot.string(),
2957
+ publicKey: valibot.string(),
2958
+ gaiaHubUrl: valibot.string(),
2959
+ gaiaAppKey: valibot.string()
2960
+ })),
2961
+ network: walletGetNetworkResultSchema
2962
+ });
2963
+ const stacksGetAccountsSuccessResponseSchema = createSuccessResponseSchema({
2964
+ resultSchema: stacksGetAccountsResultSchema,
2965
+ method: stacksMethods.stx_getAccounts
2966
+ });
2967
+
2968
+ //#endregion
2969
+ //#region src/request/rpc/objects/namespaces/stacks/methods/getAddresses/request.ts
2970
+ const stacksGetAddressesParamsSchema = valibot.nullish(valibot.object({ message: valibot.optional(valibot.string()) }));
2971
+ const stacksGetAddressesRequestSchema = createRequestSchema({
2972
+ paramsSchema: stacksGetAddressesParamsSchema,
2973
+ method: stacksMethods.stx_getAddresses
2974
+ });
2975
+
2976
+ //#endregion
2977
+ //#region src/request/rpc/objects/namespaces/stacks/methods/getAddresses/response.ts
2978
+ const stacksGetAddressesResultSchema = valibot.object({
2979
+ addresses: valibot.array(addressSchema),
2980
+ network: walletGetNetworkResultSchema
2981
+ });
2982
+ const stacksGetAddressesSuccessResponseSchema = createSuccessResponseSchema({
2983
+ resultSchema: stacksGetAddressesResultSchema,
2984
+ method: stacksMethods.stx_getAddresses
2985
+ });
2986
+
2987
+ //#endregion
2988
+ //#region src/request/rpc/objects/namespaces/stacks/methods/getAddressesV2/request.ts
2989
+ const stacksGetAddressesV2ParamsSchema = valibot.nullish(valibot.object({ message: valibot.optional(valibot.string()) }));
2990
+ const stacksGetAddressesV2RequestSchema = createRequestSchema({
2991
+ paramsSchema: stacksGetAddressesV2ParamsSchema,
2992
+ method: stacksMethods.stacks_getAddressesV2
2993
+ });
2994
+
2995
+ //#endregion
2996
+ //#region src/request/rpc/objects/namespaces/stacks/methods/getAddressesV2/response.ts
2997
+ const stacksGetAddressesV2ResultSchema = valibot.object({
2998
+ addresses: valibot.array(addressSchema),
2999
+ network: valibot.object({
3000
+ type: valibot.union([
3001
+ valibot.literal("Mainnet"),
3002
+ valibot.literal("Testnet"),
3003
+ valibot.literal("Devnet"),
3004
+ valibot.literal("Signet")
3005
+ ]),
3006
+ chain: valibot.union([valibot.literal("bitcoin"), valibot.literal("stacks")])
3007
+ })
3008
+ });
3009
+ const stacksGetAddressesV2SuccessResponseSchema = createSuccessResponseSchema({
3010
+ resultSchema: stacksGetAddressesV2ResultSchema,
3011
+ method: stacksMethods.stacks_getAddressesV2
3012
+ });
3013
+
3014
+ //#endregion
3015
+ //#region src/request/rpc/objects/namespaces/stacks/methods/signMessage/request.ts
3016
+ const stacksSignMessageParamsSchema = valibot.object({ message: valibot.string() });
3017
+ const stacksSignMessageRequestSchema = createRequestSchema({
3018
+ paramsSchema: stacksSignMessageParamsSchema,
3019
+ method: stacksMethods.stx_signMessage
3020
+ });
3021
+
3022
+ //#endregion
3023
+ //#region src/request/rpc/objects/namespaces/stacks/methods/signMessage/response.ts
3024
+ const stacksSignMessageResultSchema = valibot.object({
3025
+ signature: valibot.string(),
3026
+ publicKey: valibot.string()
3027
+ });
3028
+ const stacksSignMessageSuccessResponseSchema = createSuccessResponseSchema({
3029
+ resultSchema: stacksSignMessageResultSchema,
3030
+ method: stacksMethods.stx_signMessage
3031
+ });
3032
+
3033
+ //#endregion
3034
+ //#region src/request/rpc/objects/namespaces/stacks/methods/signStructuredMessage/request.ts
3035
+ const stacksSignStructuredMessageParamsSchema = valibot.object({
3036
+ domain: valibot.string(),
3037
+ message: valibot.string(),
3038
+ publicKey: valibot.optional(valibot.string())
3039
+ });
3040
+ const stacksSignStructuredMessageRequestSchema = createRequestSchema({
3041
+ paramsSchema: stacksSignStructuredMessageParamsSchema,
3042
+ method: stacksMethods.stx_signStructuredMessage
3043
+ });
3044
+
3045
+ //#endregion
3046
+ //#region src/request/rpc/objects/namespaces/stacks/methods/signStructuredMessage/response.ts
3047
+ const stacksSignStructuredMessageResultSchema = valibot.object({
3048
+ signature: valibot.string(),
3049
+ publicKey: valibot.string()
3050
+ });
3051
+ const stacksSignStructuredMessageSuccessResponseSchema = createSuccessResponseSchema({
3052
+ resultSchema: stacksSignStructuredMessageResultSchema,
3053
+ method: stacksMethods.stx_signStructuredMessage
3054
+ });
3055
+
3056
+ //#endregion
3057
+ //#region src/request/rpc/objects/namespaces/stacks/methods/signTransaction/request.ts
3058
+ const stacksSignTransactionParamsSchema = valibot.object({
3059
+ transaction: valibot.string(),
3060
+ pubkey: valibot.optional(valibot.string()),
3061
+ broadcast: valibot.optional(valibot.boolean())
3062
+ });
3063
+ const stacksSignTransactionRequestSchema = createRequestSchema({
3064
+ paramsSchema: stacksSignTransactionParamsSchema,
3065
+ method: stacksMethods.stx_signTransaction
3066
+ });
3067
+
3068
+ //#endregion
3069
+ //#region src/request/rpc/objects/namespaces/stacks/methods/signTransaction/response.ts
3070
+ const stacksSignTransactionResultSchema = valibot.object({ transaction: valibot.string() });
3071
+ const stacksSignTransactionSuccessResponseSchema = createSuccessResponseSchema({
3072
+ resultSchema: stacksSignTransactionResultSchema,
3073
+ method: stacksMethods.stx_signTransaction
3074
+ });
3075
+
3076
+ //#endregion
3077
+ //#region src/request/rpc/objects/namespaces/stacks/methods/signTransactions/request.ts
3078
+ const stacksSignTransactionsParamsSchema = valibot.object({
3079
+ transactions: valibot.pipe(valibot.array(valibot.pipe(valibot.string(), valibot.check((hex) => {
3080
+ return true;
3081
+ }, "Invalid hex-encoded Stacks transaction."))), valibot.minLength(1)),
3082
+ broadcast: valibot.optional(valibot.boolean())
3083
+ });
3084
+ const stacksSignTransactionsRequestSchema = createRequestSchema({
3085
+ paramsSchema: stacksSignTransactionsParamsSchema,
3086
+ method: stacksMethods.stx_signTransactions
3087
+ });
3088
+
3089
+ //#endregion
3090
+ //#region src/request/rpc/objects/namespaces/stacks/methods/signTransactions/response.ts
3091
+ const stacksSignTransactionsResultSchema = valibot.object({ transactions: valibot.array(valibot.string()) });
3092
+ const stacksSignTransactionsSuccessResponseSchema = createSuccessResponseSchema({
3093
+ resultSchema: stacksSignTransactionsResultSchema,
3094
+ method: stacksMethods.stx_signTransactions
3095
+ });
3096
+
3097
+ //#endregion
3098
+ //#region src/request/rpc/objects/namespaces/stacks/methods/transferStx/request.ts
3099
+ const stacksTransferStxParamsSchema = valibot.object({
3100
+ amount: valibot.union([valibot.number(), valibot.string()]),
3101
+ recipient: valibot.string(),
3102
+ memo: valibot.optional(valibot.string()),
3103
+ version: valibot.optional(valibot.string()),
3104
+ postConditionMode: valibot.optional(valibot.number()),
3105
+ postConditions: valibot.optional(valibot.array(valibot.string())),
3106
+ pubkey: valibot.optional(valibot.string())
3107
+ });
3108
+ const stacksTransferStxRequestSchema = createRequestSchema({
3109
+ paramsSchema: stacksTransferStxParamsSchema,
3110
+ method: stacksMethods.stx_transferStx
3111
+ });
3112
+
3113
+ //#endregion
3114
+ //#region src/request/rpc/objects/namespaces/stacks/methods/transferStx/response.ts
3115
+ const stacksTransferStxResultSchema = valibot.object({
3116
+ txid: valibot.string(),
3117
+ transaction: valibot.string()
3118
+ });
3119
+ const stacksTransferStxSuccessResponseSchema = createSuccessResponseSchema({
3120
+ resultSchema: stacksTransferStxResultSchema,
3121
+ method: stacksMethods.stx_transferStx
3122
+ });
3123
+
3124
+ //#endregion
3125
+ //#region src/request/rpc/objects/namespaces/stacks/index.ts
3126
+ const stacksRequestSchema = valibot.variant("method", [
3127
+ stacksCallContractRequestSchema,
3128
+ stacksDeployContractRequestSchema,
3129
+ stacksGetAccountsRequestSchema,
3130
+ stacksGetAddressesRequestSchema,
3131
+ stacksGetAddressesV2RequestSchema,
3132
+ stacksSignMessageRequestSchema,
3133
+ stacksSignStructuredMessageRequestSchema,
3134
+ stacksSignTransactionRequestSchema,
3135
+ stacksSignTransactionsRequestSchema,
3136
+ stacksTransferStxRequestSchema
3137
+ ]);
3138
+ const stacksSuccessResponseSchema = valibot.variant("~sats-connect-method", [
3139
+ stacksCallContractSuccessResponseSchema,
3140
+ stacksDeployContractSuccessResponseSchema,
3141
+ stacksGetAccountsSuccessResponseSchema,
3142
+ stacksGetAddressesSuccessResponseSchema,
3143
+ stacksGetAddressesV2SuccessResponseSchema,
3144
+ stacksSignMessageSuccessResponseSchema,
3145
+ stacksSignStructuredMessageSuccessResponseSchema,
3146
+ stacksSignTransactionSuccessResponseSchema,
3147
+ stacksSignTransactionsSuccessResponseSchema,
3148
+ stacksTransferStxSuccessResponseSchema
3149
+ ]);
3150
+
3151
+ //#endregion
3152
+ //#region src/request/rpc/requests.ts
3153
+ const rpcRequestSchema = valibot.variant("method", [
3154
+ bitcoinRequestSchema,
3155
+ stacksRequestSchema,
3156
+ sparkRequestSchema,
3157
+ runesRequestSchema,
3158
+ ordinalsRequestSchema,
3159
+ walletRequestSchema
3160
+ ]);
3161
+ function createRpcRequest({ method, params, id }) {
3162
+ return {
3163
+ jsonrpc: "2.0",
3164
+ method,
3165
+ params,
3166
+ id
3167
+ };
3168
+ }
3169
+
3170
+ //#endregion
3171
+ //#region src/request/rpc/responses.ts
3172
+ const rpcSuccessResponseSchema = valibot.variant("~sats-connect-method", [
3173
+ bitcoinSuccessResponseSchema,
3174
+ stacksSuccessResponseSchema,
3175
+ sparkSuccessResponseSchema,
3176
+ runesSuccessResponseSchema,
3177
+ ordinalsSuccessResponseSchema,
3178
+ walletSuccessResponseSchema
3179
+ ]);
3180
+ function createRpcSuccessResponse({ method, result, id }) {
3181
+ return {
3182
+ jsonrpc: "2.0",
3183
+ id,
3184
+ result,
3185
+ "~sats-connect-method": method
3186
+ };
3187
+ }
3188
+
3189
+ //#endregion
3190
+ //#region src/request/index.ts
3191
+ const cache = {};
3192
+ const requestInternal = async (provider, method, params) => {
3193
+ const response = await provider.request(method, params);
3194
+ if (valibot.is(specErrorResponseSchema, response)) return {
3195
+ status: "error",
3196
+ error: response.error
3197
+ };
3198
+ if (valibot.is(specSuccessWithExtensionsResponseSchema, response)) return {
3199
+ status: "success",
3200
+ result: response.result
3201
+ };
3202
+ return {
3203
+ status: "error",
3204
+ error: {
3205
+ code: RpcErrorCode.INTERNAL_ERROR,
3206
+ message: "Received unknown response from provider.",
3207
+ data: response
3208
+ }
3209
+ };
3210
+ };
3211
+ const request = async (method, params, providerId) => {
3212
+ let provider = window.XverseProviders?.BitcoinProvider || window.BitcoinProvider;
3213
+ if (providerId) provider = await getProviderById(providerId);
3214
+ if (!provider) throw new Error("no wallet provider was found");
3215
+ if (!method) throw new Error("A wallet method is required");
3216
+ if (!cache.providerInfo) {
3217
+ const infoResult = await requestInternal(provider, "getInfo", null);
3218
+ if (infoResult.status === "success") cache.providerInfo = infoResult.result;
3219
+ }
3220
+ if (cache.providerInfo) {
3221
+ if (method === "getInfo") return {
3222
+ status: "success",
3223
+ result: cache.providerInfo
3224
+ };
3225
+ const sanitized = sanitizeRequest(method, params, cache.providerInfo);
3226
+ if (sanitized.overrideResponse) return sanitized.overrideResponse;
3227
+ method = sanitized.method;
3228
+ params = sanitized.params;
3229
+ }
3230
+ return requestInternal(provider, method, params);
3231
+ };
3232
+ /**
3233
+ * Adds an event listener.
3234
+ *
3235
+ * Currently expects 2 arguments, although is also capable of handling legacy
3236
+ * calls with 3 arguments consisting of:
3237
+ *
3238
+ * - event name (string)
3239
+ * - callback (function)
3240
+ * - provider ID (optional string)
3241
+ */
3242
+ const addListener = (...rawArgs) => {
3243
+ const [listenerInfo, providerId] = (() => {
3244
+ if (rawArgs.length === 1) return [rawArgs[0], void 0];
3245
+ if (rawArgs.length === 2) if (typeof rawArgs[1] === "function") return [{
3246
+ eventName: rawArgs[0],
3247
+ cb: rawArgs[1]
3248
+ }, void 0];
3249
+ else return rawArgs;
3250
+ if (rawArgs.length === 3) return [{
3251
+ eventName: rawArgs[0],
3252
+ cb: rawArgs[1]
3253
+ }, rawArgs[2]];
3254
+ throw new Error("Unexpected number of arguments. Expecting 2 (or 3 for legacy requests).", { cause: rawArgs });
3255
+ })();
3256
+ let provider = window.XverseProviders?.BitcoinProvider || window.BitcoinProvider;
3257
+ if (providerId) provider = getProviderById(providerId);
3258
+ if (!provider) throw new Error("no wallet provider was found");
3259
+ if (!provider.addListener) {
3260
+ console.error(`The wallet provider you are using does not support the addListener method. Please update your wallet provider.`);
3261
+ return () => {};
3262
+ }
3263
+ return provider.addListener(listenerInfo);
3264
+ };
3265
+
3266
+ //#endregion
3267
+ //#region src/adapters/xverse.ts
3268
+ var XverseAdapter = class extends SatsConnectAdapter {
3269
+ id = DefaultAdaptersInfo.xverse.id;
3270
+ requestInternal = async (method, params) => {
3271
+ return request(method, params, this.id);
3272
+ };
3273
+ addListener = (listenerInfo) => {
3274
+ return addListener(listenerInfo, this.id);
3275
+ };
3276
+ };
3277
+
3278
+ //#endregion
3279
+ //#region src/adapters/BaseAdapter.ts
3280
+ var BaseAdapter = class extends SatsConnectAdapter {
3281
+ id = "";
3282
+ constructor(providerId) {
3283
+ super();
3284
+ this.id = providerId;
3285
+ }
3286
+ requestInternal = async (method, params) => {
3287
+ return request(method, params, this.id);
3288
+ };
3289
+ addListener = (..._args) => {
3290
+ throw new Error("Method not supported for `BaseAdapter`.");
3291
+ };
3292
+ };
3293
+
3294
+ //#endregion
3295
+ //#region src/adapters/index.ts
3296
+ const DefaultAdaptersInfo = {
3297
+ fordefi: {
3298
+ id: "FordefiProviders.UtxoProvider",
3299
+ name: "Fordefi",
3300
+ webUrl: "https://www.fordefi.com/",
3301
+ chromeWebStoreUrl: "https://chromewebstore.google.com/detail/fordefi/hcmehenccjdmfbojapcbcofkgdpbnlle",
3302
+ icon: "data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjQiIGhlaWdodD0iMjQiIHZpZXdCb3g9IjAgMCAyNCAyNCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPGcgY2xpcC1wYXRoPSJ1cmwoI2NsaXAwXzEzNDk0XzY2MjU0KSI+CjxwYXRoIGQ9Ik0xMC44NzY5IDE1LjYzNzhIMS41VjE4LjM5OUMxLjUgMTkuODAxMyAyLjYzNDQ3IDIwLjkzOCA0LjAzMzkyIDIwLjkzOEg4LjI0OTkyTDEwLjg3NjkgMTUuNjM3OFoiIGZpbGw9IiM3OTk0RkYiLz4KPHBhdGggZD0iTTEuNSA5Ljc3NTUxSDE5LjA1MTZMMTcuMDEzOSAxMy44NzExSDEuNVY5Ljc3NTUxWiIgZmlsbD0iIzQ4NkRGRiIvPgo8cGF0aCBkPSJNNy42NTk5NiAzSDEuNTI0NDFWOC4wMDcwNEgyMi40NjEyVjNIMTYuMzI1NlY2LjczOTQ0SDE1LjA2MDZWM0g4LjkyNTAyVjYuNzM5NDRINy42NTk5NlYzWiIgZmlsbD0iIzVDRDFGQSIvPgo8L2c+CjxkZWZzPgo8Y2xpcFBhdGggaWQ9ImNsaXAwXzEzNDk0XzY2MjU0Ij4KPHJlY3Qgd2lkdGg9IjIxIiBoZWlnaHQ9IjE4IiBmaWxsPSJ3aGl0ZSIgdHJhbnNmb3JtPSJ0cmFuc2xhdGUoMS41IDMpIi8+CjwvY2xpcFBhdGg+CjwvZGVmcz4KPC9zdmc+Cg=="
3303
+ },
3304
+ xverse: {
3305
+ id: "XverseProviders.BitcoinProvider",
3306
+ name: "Xverse",
3307
+ webUrl: "https://www.xverse.app/",
3308
+ googlePlayStoreUrl: "https://play.google.com/store/apps/details?id=com.secretkeylabs.xverse",
3309
+ iOSAppStoreUrl: "https://apps.apple.com/app/xverse-bitcoin-web3-wallet/id1552272513",
3310
+ chromeWebStoreUrl: "https://chromewebstore.google.com/detail/xverse-wallet/idnnbdplmphpflfnlkomgpfbpcgelopg",
3311
+ icon: "data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTAyIiBoZWlnaHQ9IjEwMiIgdmlld0JveD0iMCAwIDEwMiAxMDIiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+CjxnIGlkPSJJY29uX0FydCAoRWRpdCBNZSkiPgo8cmVjdCB3aWR0aD0iMTAyIiBoZWlnaHQ9IjEwMiIgZmlsbD0iIzE4MTgxOCIvPgo8ZyBpZD0iTG9nby9FbWJsZW0iIGNsaXAtcGF0aD0idXJsKCNjbGlwMF8yMF8xMjIzKSI+CjxwYXRoIGlkPSJWZWN0b3IiIGQ9Ik03NC42NTQyIDczLjg4ODNWNjUuMjMxMkM3NC42NTQyIDY0Ljg4OCA3NC41MTc3IDY0LjU2MDYgNzQuMjc0NSA2NC4zMTc0TDM3LjQzOTcgMjcuNDgyNUMzNy4xOTY1IDI3LjIzOTIgMzYuODY5MSAyNy4xMDI4IDM2LjUyNTggMjcuMTAyOEgyNy44NjlDMjcuNDQxNiAyNy4xMDI4IDI3LjA5MzggMjcuNDUwNiAyNy4wOTM4IDI3Ljg3OFYzNS45MjExQzI3LjA5MzggMzYuMjY0NCAyNy4yMzAyIDM2LjU5MTcgMjcuNDczNCAzNi44MzVMNDAuNjk1MiA1MC4wNTY3QzQwLjk5NzUgNTAuMzU5MSA0MC45OTc1IDUwLjg1MDEgNDAuNjk1MiA1MS4xNTI0TDI3LjMyMTEgNjQuNTI2NUMyNy4xNzU2IDY0LjY3MiAyNy4wOTM4IDY0Ljg2OTggMjcuMDkzOCA2NS4wNzQ0VjczLjg4ODNDMjcuMDkzOCA3NC4zMTUzIDI3LjQ0MTYgNzQuNjYzNSAyNy44NjkgNzQuNjYzNUg0Mi4zMzQyQzQyLjc2MTYgNzQuNjYzNSA0My4xMDk0IDc0LjMxNTMgNDMuMTA5NCA3My44ODgzVjY4LjY5NThDNDMuMTA5NCA2OC40OTEyIDQzLjE5MTIgNjguMjkzNSA0My4zMzY4IDY4LjE0NzlMNTAuNTExNCA2MC45NzMzQzUwLjgxMzggNjAuNjcwOSA1MS4zMDQ4IDYwLjY3MDkgNTEuNjA3MiA2MC45NzMzTDY0LjkxOTggNzQuMjg2MUM2NS4xNjMxIDc0LjUyOTMgNjUuNDkwNCA3NC42NjU4IDY1LjgzMzcgNzQuNjY1OEg3My44NzY3Qzc0LjMwNDIgNzQuNjY1OCA3NC42NTE5IDc0LjMxNzYgNzQuNjUxOSA3My44OTA2TDc0LjY1NDIgNzMuODg4M1oiIGZpbGw9IndoaXRlIi8+CjxwYXRoIGlkPSJWZWN0b3JfMiIgZD0iTTU1LjM1OCAzOC41NjcySDYyLjYwMzFDNjMuMDMyOCAzOC41NjcyIDYzLjM4MjkgMzguOTE3MyA2My4zODI5IDM5LjM0NjlWNDYuNTkyMUM2My4zODI5IDQ3LjI4NzcgNjQuMjI0IDQ3LjYzNTUgNjQuNzE1MSA0Ny4xNDIyTDc0LjY1NDEgMzcuMTg3M0M3NC43OTk0IDM3LjA0MTggNzQuODgxNiAzNi44NDQgNzQuODgxNiAzNi42MzcxVjI3LjkxODlDNzQuODgxNiAyNy40ODkyIDc0LjUzMzQgMjcuMTM5MSA3NC4xMDE3IDI3LjEzOTFMNjUuMjUzOCAyNy4xMjc3QzY1LjA0NyAyNy4xMjc3IDY0Ljg0OTIgMjcuMjA5NiA2NC43MDE0IDI3LjM1NTFMNTQuODA1NiAzNy4yMzVDNTQuMzE0NSAzNy43MjYgNTQuNjYyMyAzOC41NjcyIDU1LjM1NTcgMzguNTY3Mkg1NS4zNThaIiBmaWxsPSIjRUU3QTMwIi8+CjwvZz4KPC9nPgo8ZGVmcz4KPGNsaXBQYXRoIGlkPSJjbGlwMF8yMF8xMjIzIj4KPHJlY3Qgd2lkdGg9IjQ3LjgxMjUiIGhlaWdodD0iNDcuODEyNSIgZmlsbD0id2hpdGUiIHRyYW5zZm9ybT0idHJhbnNsYXRlKDI3LjA5MzggMjcuMDkzOCkiLz4KPC9jbGlwUGF0aD4KPC9kZWZzPgo8L3N2Zz4K"
3312
+ },
3313
+ unisat: {
3314
+ id: "unisat",
3315
+ name: "Unisat",
3316
+ webUrl: "https://unisat.io/",
3317
+ icon: "data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTgwIiBoZWlnaHQ9IjE4MCIgdmlld0JveD0iMCAwIDE4MCAxODAiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+CjxyZWN0IHdpZHRoPSIxODAiIGhlaWdodD0iMTgwIiBmaWxsPSJibGFjayIvPgo8ZyBjbGlwLXBhdGg9InVybCgjY2xpcDBfMTAwNTBfNDE3MSkiPgo8cGF0aCBkPSJNMTEzLjY2IDI5LjI4OTdMMTQzLjk3IDU5LjMwOTdDMTQ2LjU1IDYxLjg1OTcgMTQ3LjgyIDY0LjQzOTcgMTQ3Ljc4IDY3LjAzOTdDMTQ3Ljc0IDY5LjYzOTcgMTQ2LjYzIDcyLjAwOTcgMTQ0LjQ2IDc0LjE1OTdDMTQyLjE5IDc2LjQwOTcgMTM5Ljc0IDc3LjU0OTcgMTM3LjEyIDc3LjU5OTdDMTM0LjUgNzcuNjM5NyAxMzEuOSA3Ni4zNzk3IDEyOS4zMiA3My44Mjk3TDk4LjMxOTkgNDMuMTI5N0M5NC43OTk5IDM5LjYzOTcgOTEuMzk5OSAzNy4xNjk3IDg4LjEyOTkgMzUuNzE5N0M4NC44NTk5IDM0LjI2OTcgODEuNDE5OSAzNC4wMzk3IDc3LjgxOTkgMzUuMDM5N0M3NC4yMDk5IDM2LjAyOTcgNzAuMzM5OSAzOC41Nzk3IDY2LjE4OTkgNDIuNjc5N0M2MC40Njk5IDQ4LjM0OTcgNTcuNzM5OSA1My42Njk3IDU4LjAxOTkgNTguNjM5N0M1OC4yOTk5IDYzLjYwOTcgNjEuMTM5OSA2OC43Njk3IDY2LjUyOTkgNzQuMDk5N0w5Ny43Nzk5IDEwNS4wNkMxMDAuMzkgMTA3LjY0IDEwMS42NyAxMTAuMjIgMTAxLjYzIDExMi43OEMxMDEuNTkgMTE1LjM1IDEwMC40NyAxMTcuNzIgOTguMjU5OSAxMTkuOTFDOTYuMDU5OSAxMjIuMDkgOTMuNjI5OSAxMjMuMjMgOTAuOTg5OSAxMjMuMzJDODguMzQ5OSAxMjMuNDEgODUuNzE5OSAxMjIuMTYgODMuMTE5OSAxMTkuNThMNTIuODA5OSA4OS41NTk3QzQ3Ljg3OTkgODQuNjc5NyA0NC4zMTk5IDgwLjA1OTcgNDIuMTI5OSA3NS42OTk3QzM5LjkzOTkgNzEuMzM5NyAzOS4xMTk5IDY2LjQwOTcgMzkuNjg5OSA2MC45MDk3QzQwLjE5OTkgNTYuMTk5NyA0MS43MDk5IDUxLjYzOTcgNDQuMjI5OSA0Ny4yMTk3QzQ2LjczOTkgNDIuNzk5NyA1MC4zMzk5IDM4LjI3OTcgNTUuMDA5OSAzMy42NDk3QzYwLjU2OTkgMjguMTM5NyA2NS44Nzk5IDIzLjkxOTcgNzAuOTM5OSAyMC45Nzk3Qzc1Ljk4OTkgMTguMDM5NyA4MC44Nzk5IDE2LjQwOTcgODUuNTk5OSAxNi4wNjk3QzkwLjMyOTkgMTUuNzI5NyA5NC45ODk5IDE2LjY2OTcgOTkuNTk5OSAxOC44ODk3QzEwNC4yMSAyMS4xMDk3IDEwOC44OSAyNC41Njk3IDExMy42NSAyOS4yODk3SDExMy42NloiIGZpbGw9InVybCgjcGFpbnQwX2xpbmVhcl8xMDA1MF80MTcxKSIvPgo8cGF0aCBkPSJNNjYuMTA5OSAxNTAuNDJMMzUuODA5OSAxMjAuNEMzMy4yMjk5IDExNy44NCAzMS45NTk5IDExNS4yNyAzMS45OTk5IDExMi42N0MzMi4wMzk5IDExMC4wNyAzMy4xNDk5IDEwNy43IDM1LjMxOTkgMTA1LjU1QzM3LjU4OTkgMTAzLjMgNDAuMDM5OSAxMDIuMTYgNDIuNjU5OSAxMDIuMTFDNDUuMjc5OSAxMDIuMDcgNDcuODc5OSAxMDMuMzIgNTAuNDU5OSAxMDUuODhMODEuNDQ5OSAxMzYuNThDODQuOTc5OSAxNDAuMDcgODguMzY5OSAxNDIuNTQgOTEuNjM5OSAxNDMuOTlDOTQuOTA5OSAxNDUuNDQgOTguMzQ5OSAxNDUuNjYgMTAxLjk2IDE0NC42N0MxMDUuNTcgMTQzLjY4IDEwOS40NCAxNDEuMTMgMTEzLjU5IDEzNy4wMkMxMTkuMzEgMTMxLjM1IDEyMi4wNCAxMjYuMDMgMTIxLjc2IDEyMS4wNkMxMjEuNDggMTE2LjA5IDExOC42NCAxMTAuOTMgMTEzLjI1IDEwNS41OUw5Ni41OTk5IDg5LjI0MDFDOTMuOTg5OSA4Ni42NjAxIDkyLjcwOTkgODQuMDgwMSA5Mi43NDk5IDgxLjUyMDFDOTIuNzg5OSA3OC45NTAxIDkzLjkwOTkgNzYuNTgwMSA5Ni4xMTk5IDc0LjM5MDFDOTguMzE5OSA3Mi4yMTAxIDEwMC43NSA3MS4wNzAxIDEwMy4zOSA3MC45ODAxQzEwNi4wMyA3MC44OTAxIDEwOC42NiA3Mi4xNDAxIDExMS4yNiA3NC43MjAxTDEyNi45NiA5MC4xMzAxQzEzMS44OSA5NS4wMTAxIDEzNS40NSA5OS42MzAxIDEzNy42NCAxMDMuOTlDMTM5LjgzIDEwOC4zNSAxNDAuNjUgMTEzLjI4IDE0MC4wOCAxMTguNzhDMTM5LjU3IDEyMy40OSAxMzguMDYgMTI4LjA1IDEzNS41NCAxMzIuNDdDMTMzLjAzIDEzNi44OSAxMjkuNDMgMTQxLjQxIDEyNC43NiAxNDYuMDRDMTE5LjIgMTUxLjU1IDExMy44OSAxNTUuNzcgMTA4LjgzIDE1OC43MUMxMDMuNzcgMTYxLjY1IDk4Ljg3OTkgMTYzLjI5IDk0LjE0OTkgMTYzLjYzQzg5LjQxOTkgMTYzLjk3IDg0Ljc1OTkgMTYzLjAzIDgwLjE0OTkgMTYwLjgxQzc1LjUzOTkgMTU4LjU5IDcwLjg1OTkgMTU1LjEzIDY2LjA5OTkgMTUwLjQxTDY2LjEwOTkgMTUwLjQyWiIgZmlsbD0idXJsKCNwYWludDFfbGluZWFyXzEwMDUwXzQxNzEpIi8+CjxwYXRoIGQ9Ik04NS4wMDk5IDcyLjk1OTJDOTEuMTU2OCA3Mi45NTkyIDk2LjEzOTkgNjcuOTc2MSA5Ni4xMzk5IDYxLjgyOTJDOTYuMTM5OSA1NS42ODIzIDkxLjE1NjggNTAuNjk5MiA4NS4wMDk5IDUwLjY5OTJDNzguODYzIDUwLjY5OTIgNzMuODc5OSA1NS42ODIzIDczLjg3OTkgNjEuODI5MkM3My44Nzk5IDY3Ljk3NjEgNzguODYzIDcyLjk1OTIgODUuMDA5OSA3Mi45NTkyWiIgZmlsbD0idXJsKCNwYWludDJfcmFkaWFsXzEwMDUwXzQxNzEpIi8+CjwvZz4KPGRlZnM+CjxsaW5lYXJHcmFkaWVudCBpZD0icGFpbnQwX2xpbmVhcl8xMDA1MF80MTcxIiB4MT0iMTM4Ljk4NSIgeTE9IjQ2Ljc3OTUiIHgyPSI0NS4wNTI5IiB5Mj0iODguNTIzMyIgZ3JhZGllbnRVbml0cz0idXNlclNwYWNlT25Vc2UiPgo8c3RvcCBzdG9wLWNvbG9yPSIjMjAxQzFCIi8+CjxzdG9wIG9mZnNldD0iMC4zNiIgc3RvcC1jb2xvcj0iIzc3MzkwRCIvPgo8c3RvcCBvZmZzZXQ9IjAuNjciIHN0b3AtY29sb3I9IiNFQTgxMDEiLz4KPHN0b3Agb2Zmc2V0PSIxIiBzdG9wLWNvbG9yPSIjRjRCODUyIi8+CjwvbGluZWFyR3JhZGllbnQ+CjxsaW5lYXJHcmFkaWVudCBpZD0icGFpbnQxX2xpbmVhcl8xMDA1MF80MTcxIiB4MT0iNDMuMzgxMiIgeTE9IjEzNC4xNjciIHgyPSIxNTIuMjMxIiB5Mj0iMTAxLjc3MSIgZ3JhZGllbnRVbml0cz0idXNlclNwYWNlT25Vc2UiPgo8c3RvcCBzdG9wLWNvbG9yPSIjMUYxRDFDIi8+CjxzdG9wIG9mZnNldD0iMC4zNyIgc3RvcC1jb2xvcj0iIzc3MzkwRCIvPgo8c3RvcCBvZmZzZXQ9IjAuNjciIHN0b3AtY29sb3I9IiNFQTgxMDEiLz4KPHN0b3Agb2Zmc2V0PSIxIiBzdG9wLWNvbG9yPSIjRjRGQjUyIi8+CjwvbGluZWFyR3JhZGllbnQ+CjxyYWRpYWxHcmFkaWVudCBpZD0icGFpbnQyX3JhZGlhbF8xMDA1MF80MTcxIiBjeD0iMCIgY3k9IjAiIHI9IjEiIGdyYWRpZW50VW5pdHM9InVzZXJTcGFjZU9uVXNlIiBncmFkaWVudFRyYW5zZm9ybT0idHJhbnNsYXRlKDg1LjAwOTkgNjEuODM5Mikgc2NhbGUoMTEuMTMpIj4KPHN0b3Agc3RvcC1jb2xvcj0iI0Y0Qjg1MiIvPgo8c3RvcCBvZmZzZXQ9IjAuMzMiIHN0b3AtY29sb3I9IiNFQTgxMDEiLz4KPHN0b3Agb2Zmc2V0PSIwLjY0IiBzdG9wLWNvbG9yPSIjNzczOTBEIi8+CjxzdG9wIG9mZnNldD0iMSIgc3RvcC1jb2xvcj0iIzIxMUMxRCIvPgo8L3JhZGlhbEdyYWRpZW50Pgo8Y2xpcFBhdGggaWQ9ImNsaXAwXzEwMDUwXzQxNzEiPgo8cmVjdCB3aWR0aD0iMTE1Ljc3IiBoZWlnaHQ9IjE0Ny43IiBmaWxsPSJ3aGl0ZSIgdHJhbnNmb3JtPSJ0cmFuc2xhdGUoMzIgMTYpIi8+CjwvY2xpcFBhdGg+CjwvZGVmcz4KPC9zdmc+Cg=="
3318
+ }
3319
+ };
3320
+ const defaultAdapters = {
3321
+ [DefaultAdaptersInfo.fordefi.id]: FordefiAdapter,
3322
+ [DefaultAdaptersInfo.xverse.id]: XverseAdapter,
3323
+ [DefaultAdaptersInfo.unisat.id]: UnisatAdapter
3324
+ };
3325
+
3326
+ //#endregion
3327
+ //#region src/capabilities/index.ts
3328
+ const extractOrValidateCapabilities = (provider, reportedCapabilities) => {
3329
+ const validateCapability = (capability) => {
3330
+ if (!provider[capability]) return false;
3331
+ if (reportedCapabilities && !reportedCapabilities.has(capability)) return false;
3332
+ return true;
3333
+ };
3334
+ const capabilityMap = {
3335
+ request: validateCapability("request"),
3336
+ connect: validateCapability("connect"),
3337
+ signMessage: validateCapability("signMessage"),
3338
+ signTransaction: validateCapability("signTransaction"),
3339
+ sendBtcTransaction: validateCapability("sendBtcTransaction"),
3340
+ createInscription: validateCapability("createInscription"),
3341
+ createRepeatInscriptions: validateCapability("createRepeatInscriptions"),
3342
+ signMultipleTransactions: validateCapability("signMultipleTransactions"),
3343
+ addListener: validateCapability("addListener")
3344
+ };
3345
+ return Object.entries(capabilityMap).reduce((acc, [capability, value]) => {
3346
+ if (value) return [...acc, capability];
3347
+ return acc;
3348
+ }, []);
3349
+ };
3350
+ const getCapabilities = async (options) => {
3351
+ const provider = await getProviderOrThrow(options.getProvider);
3352
+ const request$1 = (0, jsontokens.createUnsecuredToken)(options.payload);
3353
+ if (provider.getCapabilities) try {
3354
+ const response = await provider.getCapabilities(request$1);
3355
+ options.onFinish?.(extractOrValidateCapabilities(provider, new Set(response)));
3356
+ } catch (error) {
3357
+ console.error("[Connect] Error during capabilities request", error);
3358
+ }
3359
+ try {
3360
+ const inferredCapabilities = extractOrValidateCapabilities(provider);
3361
+ options.onFinish?.(inferredCapabilities);
3362
+ } catch (error) {
3363
+ console.error("[Connect] Error during capabilities request", error);
3364
+ options.onCancel?.();
3365
+ }
3366
+ };
3367
+
3368
+ //#endregion
3369
+ //#region src/inscriptions/utils.ts
3370
+ const MAX_CONTENT_LENGTH_MAINNET = 4e5;
3371
+ const MAX_CONTENT_LENGTH_TESTNET = 6e4;
3372
+ const validateInscriptionPayload = (payload) => {
3373
+ const { contentType, content, payloadType, network, appFeeAddress, appFee } = payload;
3374
+ if (!/^[a-z]+\/[a-z0-9\-\.\+]+(?=;.*|$)/.test(contentType)) throw new Error("Invalid content type detected");
3375
+ if (!content || content.length === 0) throw new Error("Empty content not allowed");
3376
+ if (!payloadType || payloadType !== "BASE_64" && payloadType !== "PLAIN_TEXT") throw new Error("Empty invalid payloadType specified");
3377
+ if (content.length > (network.type === "Mainnet" ? MAX_CONTENT_LENGTH_MAINNET : MAX_CONTENT_LENGTH_TESTNET)) throw new Error("Content too large");
3378
+ if ((appFeeAddress?.length ?? 0) > 0 && (appFee ?? 0) <= 0) throw new Error("Invalid combination of app fee address and fee provided");
3379
+ };
3380
+
3381
+ //#endregion
3382
+ //#region src/inscriptions/createInscription.ts
3383
+ const createInscription = async (options) => {
3384
+ const { getProvider } = options;
3385
+ const provider = await getProviderOrThrow(getProvider);
3386
+ validateInscriptionPayload(options.payload);
3387
+ try {
3388
+ const request$1 = (0, jsontokens.createUnsecuredToken)(options.payload);
3389
+ const response = await provider.createInscription(request$1);
3390
+ options.onFinish?.(response);
3391
+ } catch (error) {
3392
+ console.error("[Connect] Error during create inscription", error);
3393
+ options.onCancel?.();
3394
+ }
3395
+ };
3396
+
3397
+ //#endregion
3398
+ //#region src/inscriptions/createRepeatInscriptions.ts
3399
+ const createRepeatInscriptions = async (options) => {
3400
+ const { getProvider } = options;
3401
+ const provider = await getProviderOrThrow(getProvider);
3402
+ validateInscriptionPayload(options.payload);
3403
+ try {
3404
+ const request$1 = (0, jsontokens.createUnsecuredToken)(options.payload);
3405
+ const response = await provider.createRepeatInscriptions(request$1);
3406
+ options.onFinish?.(response);
3407
+ } catch (error) {
3408
+ console.error("[Connect] Error during create repeat inscriptions", error);
3409
+ options.onCancel?.();
3410
+ }
3411
+ };
3412
+
3413
+ //#endregion
3414
+ //#region src/messages/index.ts
3415
+ const signMessage = async (options) => {
3416
+ const provider = await getProviderOrThrow(options.getProvider);
3417
+ const { address, message } = options.payload;
3418
+ if (!address) throw new Error("An address is required to sign a message");
3419
+ if (!message) throw new Error("A message to be signed is required");
3420
+ try {
3421
+ const request$1 = (0, jsontokens.createUnsecuredToken)(options.payload);
3422
+ const response = await provider.signMessage(request$1);
3423
+ options.onFinish?.(response);
3424
+ } catch (error) {
3425
+ console.error("[Connect] Error during sign message request", error);
3426
+ options.onCancel?.();
3427
+ }
3428
+ };
3429
+
3430
+ //#endregion
3431
+ //#region src/transactions/sendBtcTransaction.ts
3432
+ const serializer = (recipient) => {
3433
+ return recipient.map((value) => {
3434
+ const { address, amountSats } = value;
3435
+ return {
3436
+ address,
3437
+ amountSats: amountSats.toString()
3438
+ };
3439
+ });
3440
+ };
3441
+ const sendBtcTransaction = async (options) => {
3442
+ const provider = await getProviderOrThrow(options.getProvider);
3443
+ const { recipients, senderAddress, network, message } = options.payload;
3444
+ if (!recipients || recipients.length === 0) throw new Error("At least one recipient is required");
3445
+ if (recipients.some((item) => typeof item.address !== "string" || typeof item.amountSats !== "bigint")) throw new Error("Incorrect recipient format");
3446
+ if (!senderAddress) throw new Error("The sender address is required");
3447
+ try {
3448
+ const request$1 = (0, jsontokens.createUnsecuredToken)({
3449
+ network,
3450
+ senderAddress,
3451
+ message,
3452
+ recipients: serializer(recipients)
3453
+ });
3454
+ const response = await provider.sendBtcTransaction(request$1);
3455
+ options.onFinish?.(response);
3456
+ } catch (error) {
3457
+ console.error("[Connect] Error during send BTC transaction request", error);
3458
+ options.onCancel?.();
3459
+ }
3460
+ };
3461
+
3462
+ //#endregion
3463
+ //#region src/transactions/signMultipleTransactions.ts
3464
+ const signMultipleTransactions = async (options) => {
3465
+ const provider = await getProviderOrThrow(options.getProvider);
3466
+ const { psbts } = options.payload;
3467
+ if (!psbts || !psbts.length) throw new Error("psbts array is required");
3468
+ if (psbts.length > 100) throw new Error("psbts array must contain less than 100 psbts");
3469
+ try {
3470
+ const request$1 = (0, jsontokens.createUnsecuredToken)(options.payload);
3471
+ const response = await provider.signMultipleTransactions(request$1);
3472
+ options.onFinish?.(response);
3473
+ } catch (error) {
3474
+ console.error("[Connect] Error during sign Multiple transactions request", error);
3475
+ options.onCancel?.();
3476
+ }
3477
+ };
3478
+
3479
+ //#endregion
3480
+ //#region src/transactions/signTransaction.ts
3481
+ const signTransaction = async (options) => {
3482
+ const provider = await getProviderOrThrow(options.getProvider);
3483
+ const { psbtBase64, inputsToSign } = options.payload;
3484
+ if (!psbtBase64) throw new Error("A value for psbtBase64 representing the tx hash is required");
3485
+ if (!inputsToSign) throw new Error("An array specifying the inputs to be signed by the wallet is required");
3486
+ try {
3487
+ const request$1 = (0, jsontokens.createUnsecuredToken)(options.payload);
3488
+ const response = await provider.signTransaction(request$1);
3489
+ options.onFinish?.(response);
3490
+ } catch (error) {
3491
+ console.error("[Connect] Error during sign transaction request", error);
3492
+ options.onCancel?.();
3493
+ }
3494
+ };
3495
+
3496
+ //#endregion
3497
+ exports.AddressPurpose = AddressPurpose;
3498
+ exports.AddressType = AddressType;
3499
+ Object.defineProperty(exports, 'AllResolvedNetworks', {
3500
+ enumerable: true,
3501
+ get: function () {
3502
+ return AllResolvedNetworks;
3503
+ }
3504
+ });
3505
+ exports.BaseAdapter = BaseAdapter;
3506
+ Object.defineProperty(exports, 'BitcoinNetworkConfigurationOptions', {
3507
+ enumerable: true,
3508
+ get: function () {
3509
+ return BitcoinNetworkConfigurationOptions;
3510
+ }
3511
+ });
3512
+ exports.BitcoinNetworkType = BitcoinNetworkType;
3513
+ exports.DefaultAdaptersInfo = DefaultAdaptersInfo;
3514
+ exports.MessageSigningProtocols = MessageSigningProtocols;
3515
+ Object.defineProperty(exports, 'NetworkConfigurationOptions', {
3516
+ enumerable: true,
3517
+ get: function () {
3518
+ return NetworkConfigurationOptions;
3519
+ }
3520
+ });
3521
+ Object.defineProperty(exports, 'PermissionWithoutClientId', {
3522
+ enumerable: true,
3523
+ get: function () {
3524
+ return PermissionWithoutClientId;
3525
+ }
3526
+ });
3527
+ exports.ProviderPlatform = ProviderPlatform;
3528
+ exports.RpcErrorCode = RpcErrorCode;
3529
+ exports.SatsConnectAdapter = SatsConnectAdapter;
3530
+ Object.defineProperty(exports, 'SparkNetworkConfigurationOptions', {
3531
+ enumerable: true,
3532
+ get: function () {
3533
+ return SparkNetworkConfigurationOptions;
3534
+ }
3535
+ });
3536
+ exports.SparkNetworkType = SparkNetworkType;
3537
+ Object.defineProperty(exports, 'StacksNetworkConfigurationOptions', {
3538
+ enumerable: true,
3539
+ get: function () {
3540
+ return StacksNetworkConfigurationOptions;
3541
+ }
3542
+ });
3543
+ exports.StacksNetworkType = StacksNetworkType;
3544
+ Object.defineProperty(exports, 'StarknetNetworkConfigurationOptions', {
3545
+ enumerable: true,
3546
+ get: function () {
3547
+ return StarknetNetworkConfigurationOptions;
3548
+ }
3549
+ });
3550
+ exports.StarknetNetworkType = StarknetNetworkType;
3551
+ exports.accountChangeEventName = accountChangeEventName;
3552
+ exports.accountChangeSchema = accountChangeSchema;
3553
+ exports.addListener = addListener;
3554
+ exports.addressSchema = addressSchema;
3555
+ exports.allResolvedNetworksSchema = allResolvedNetworksSchema;
3556
+ exports.bitcoinGetAccountsParamsSchema = bitcoinGetAccountsParamsSchema;
3557
+ exports.bitcoinGetAccountsRequestSchema = bitcoinGetAccountsRequestSchema;
3558
+ exports.bitcoinGetAccountsResultSchema = bitcoinGetAccountsResultSchema;
3559
+ exports.bitcoinGetAccountsSuccessResponseSchema = bitcoinGetAccountsSuccessResponseSchema;
3560
+ exports.bitcoinGetAccountsV2ParamsSchema = bitcoinGetAccountsV2ParamsSchema;
3561
+ exports.bitcoinGetAccountsV2RequestSchema = bitcoinGetAccountsV2RequestSchema;
3562
+ exports.bitcoinGetAccountsV2ResultSchema = bitcoinGetAccountsV2ResultSchema;
3563
+ exports.bitcoinGetAccountsV2SuccessResponseSchema = bitcoinGetAccountsV2SuccessResponseSchema;
3564
+ exports.bitcoinGetAddressesParamsSchema = bitcoinGetAddressesParamsSchema;
3565
+ exports.bitcoinGetAddressesRequestSchema = bitcoinGetAddressesRequestSchema;
3566
+ exports.bitcoinGetAddressesResultSchema = bitcoinGetAddressesResultSchema;
3567
+ exports.bitcoinGetAddressesSuccessResponseSchema = bitcoinGetAddressesSuccessResponseSchema;
3568
+ exports.bitcoinGetAddressesV2ParamsSchema = bitcoinGetAddressesV2ParamsSchema;
3569
+ exports.bitcoinGetAddressesV2RequestSchema = bitcoinGetAddressesV2RequestSchema;
3570
+ exports.bitcoinGetAddressesV2ResultSchema = bitcoinGetAddressesV2ResultSchema;
3571
+ exports.bitcoinGetAddressesV2SuccessResponseSchema = bitcoinGetAddressesV2SuccessResponseSchema;
3572
+ exports.bitcoinGetBalanceParamsSchema = bitcoinGetBalanceParamsSchema;
3573
+ exports.bitcoinGetBalanceRequestSchema = bitcoinGetBalanceRequestSchema;
3574
+ exports.bitcoinGetBalanceResultSchema = bitcoinGetBalanceResultSchema;
3575
+ exports.bitcoinGetBalanceSuccessResponseSchema = bitcoinGetBalanceSuccessResponseSchema;
3576
+ exports.bitcoinGetBalanceV2ParamsSchema = bitcoinGetBalanceV2ParamsSchema;
3577
+ exports.bitcoinGetBalanceV2RequestSchema = bitcoinGetBalanceV2RequestSchema;
3578
+ exports.bitcoinGetBalanceV2ResultSchema = bitcoinGetBalanceV2ResultSchema;
3579
+ exports.bitcoinGetBalanceV2SuccessResponseSchema = bitcoinGetBalanceV2SuccessResponseSchema;
3580
+ exports.bitcoinGetInfoParamsSchema = bitcoinGetInfoParamsSchema;
3581
+ exports.bitcoinGetInfoRequestSchema = bitcoinGetInfoRequestSchema;
3582
+ exports.bitcoinGetInfoResultSchema = bitcoinGetInfoResultSchema;
3583
+ exports.bitcoinGetInfoSuccessResponseSchema = bitcoinGetInfoSuccessResponseSchema;
3584
+ exports.bitcoinGetInfoV2ParamsSchema = bitcoinGetInfoV2ParamsSchema;
3585
+ exports.bitcoinGetInfoV2RequestSchema = bitcoinGetInfoV2RequestSchema;
3586
+ exports.bitcoinGetInfoV2ResultSchema = bitcoinGetInfoV2ResultSchema;
3587
+ exports.bitcoinGetInfoV2SuccessResponseSchema = bitcoinGetInfoV2SuccessResponseSchema;
3588
+ exports.bitcoinMethods = bitcoinMethods;
3589
+ exports.bitcoinModeToLegacyBitcoinNetworkType = bitcoinModeToLegacyBitcoinNetworkType;
3590
+ exports.bitcoinNetworkConfigurationOptionsSchema = bitcoinNetworkConfigurationOptionsSchema;
3591
+ exports.bitcoinRequestSchema = bitcoinRequestSchema;
3592
+ exports.bitcoinSendTransferParamsSchema = bitcoinSendTransferParamsSchema;
3593
+ exports.bitcoinSendTransferRequestSchema = bitcoinSendTransferRequestSchema;
3594
+ exports.bitcoinSendTransferResultSchema = bitcoinSendTransferResultSchema;
3595
+ exports.bitcoinSendTransferSuccessResponseSchema = bitcoinSendTransferSuccessResponseSchema;
3596
+ exports.bitcoinSendTransferV2ParamsSchema = bitcoinSendTransferV2ParamsSchema;
3597
+ exports.bitcoinSendTransferV2RequestSchema = bitcoinSendTransferV2RequestSchema;
3598
+ exports.bitcoinSendTransferV2ResultSchema = bitcoinSendTransferV2ResultSchema;
3599
+ exports.bitcoinSendTransferV2SuccessResponseSchema = bitcoinSendTransferV2SuccessResponseSchema;
3600
+ exports.bitcoinSignMessageParamsSchema = bitcoinSignMessageParamsSchema;
3601
+ exports.bitcoinSignMessageRequestSchema = bitcoinSignMessageRequestSchema;
3602
+ exports.bitcoinSignMessageResultSchema = bitcoinSignMessageResultSchema;
3603
+ exports.bitcoinSignMessageSuccessResponseSchema = bitcoinSignMessageSuccessResponseSchema;
3604
+ exports.bitcoinSignMessageV2ParamsSchema = bitcoinSignMessageV2ParamsSchema;
3605
+ exports.bitcoinSignMessageV2RequestSchema = bitcoinSignMessageV2RequestSchema;
3606
+ exports.bitcoinSignMessageV2ResultSchema = bitcoinSignMessageV2ResultSchema;
3607
+ exports.bitcoinSignMessageV2SuccessResponseSchema = bitcoinSignMessageV2SuccessResponseSchema;
3608
+ exports.bitcoinSignMultipleMessagesParamsSchema = bitcoinSignMultipleMessagesParamsSchema;
3609
+ exports.bitcoinSignMultipleMessagesRequestSchema = bitcoinSignMultipleMessagesRequestSchema;
3610
+ exports.bitcoinSignMultipleMessagesResultSchema = bitcoinSignMultipleMessagesResultSchema;
3611
+ exports.bitcoinSignMultipleMessagesSuccessResponseSchema = bitcoinSignMultipleMessagesSuccessResponseSchema;
3612
+ exports.bitcoinSignMultipleMessagesV2ParamsSchema = bitcoinSignMultipleMessagesV2ParamsSchema;
3613
+ exports.bitcoinSignMultipleMessagesV2RequestSchema = bitcoinSignMultipleMessagesV2RequestSchema;
3614
+ exports.bitcoinSignMultipleMessagesV2ResultSchema = bitcoinSignMultipleMessagesV2ResultSchema;
3615
+ exports.bitcoinSignMultipleMessagesV2SuccessResponseSchema = bitcoinSignMultipleMessagesV2SuccessResponseSchema;
3616
+ exports.bitcoinSignPsbtParamsSchema = bitcoinSignPsbtParamsSchema;
3617
+ exports.bitcoinSignPsbtRequestSchema = bitcoinSignPsbtRequestSchema;
3618
+ exports.bitcoinSignPsbtResultSchema = bitcoinSignPsbtResultSchema;
3619
+ exports.bitcoinSignPsbtSuccessResponseSchema = bitcoinSignPsbtSuccessResponseSchema;
3620
+ exports.bitcoinSignPsbtV2ParamsSchema = bitcoinSignPsbtV2ParamsSchema;
3621
+ exports.bitcoinSignPsbtV2RequestSchema = bitcoinSignPsbtV2RequestSchema;
3622
+ exports.bitcoinSignPsbtV2ResultSchema = bitcoinSignPsbtV2ResultSchema;
3623
+ exports.bitcoinSignPsbtV2SuccessResponseSchema = bitcoinSignPsbtV2SuccessResponseSchema;
3624
+ exports.bitcoinSuccessResponseSchema = bitcoinSuccessResponseSchema;
3625
+ exports.createInscription = createInscription;
3626
+ exports.createRepeatInscriptions = createRepeatInscriptions;
3627
+ exports.createRpcRequest = createRpcRequest;
3628
+ exports.createRpcSuccessResponse = createRpcSuccessResponse;
3629
+ exports.defaultAdapters = defaultAdapters;
3630
+ exports.disconnectEventName = disconnectEventName;
3631
+ exports.disconnectSchema = disconnectSchema;
3632
+ exports.getAddress = getAddress;
3633
+ exports.getCapabilities = getCapabilities;
3634
+ exports.getDefaultProvider = getDefaultProvider;
3635
+ exports.getProviderById = getProviderById;
3636
+ exports.getProviderOrThrow = getProviderOrThrow;
3637
+ exports.getProviders = getProviders;
3638
+ exports.getSupportedWallets = getSupportedWallets;
3639
+ exports.isProviderInstalled = isProviderInstalled;
3640
+ exports.methodSupport = methodSupport;
3641
+ exports.networkChangeEventName = networkChangeEventName;
3642
+ exports.networkChangeEventNameV2 = networkChangeEventNameV2;
3643
+ exports.networkChangeSchema = networkChangeSchema;
3644
+ exports.networkChangeV2Schema = networkChangeV2Schema;
3645
+ exports.networkConfigurationOptionsSchema = networkConfigurationOptionsSchema;
3646
+ exports.ordinalsGetInscriptionsParamsSchema = ordinalsGetInscriptionsParamsSchema;
3647
+ exports.ordinalsGetInscriptionsRequestSchema = ordinalsGetInscriptionsRequestSchema;
3648
+ exports.ordinalsGetInscriptionsResultSchema = ordinalsGetInscriptionsResultSchema;
3649
+ exports.ordinalsGetInscriptionsSuccessResponseSchema = ordinalsGetInscriptionsSuccessResponseSchema;
3650
+ exports.ordinalsMethods = ordinalsMethods;
3651
+ exports.ordinalsRequestSchema = ordinalsRequestSchema;
3652
+ exports.ordinalsSendInscriptionsParamsSchema = ordinalsSendInscriptionsParamsSchema;
3653
+ exports.ordinalsSendInscriptionsRequestSchema = ordinalsSendInscriptionsRequestSchema;
3654
+ exports.ordinalsSendInscriptionsResultSchema = ordinalsSendInscriptionsResultSchema;
3655
+ exports.ordinalsSendInscriptionsSuccessResponseSchema = ordinalsSendInscriptionsSuccessResponseSchema;
3656
+ exports.ordinalsSuccessResponseSchema = ordinalsSuccessResponseSchema;
3657
+ exports.permissionRequestParamsSchema = permissionRequestParamsSchema;
3658
+ exports.removeDefaultProvider = removeDefaultProvider;
3659
+ exports.request = request;
3660
+ exports.rpcIdSchema = rpcIdSchema;
3661
+ exports.rpcRequestSchema = rpcRequestSchema;
3662
+ exports.rpcSuccessResponseSchema = rpcSuccessResponseSchema;
3663
+ exports.runesEstimateEtchParamsSchema = runesEstimateEtchParamsSchema;
3664
+ exports.runesEstimateEtchRequestSchema = runesEstimateEtchRequestSchema;
3665
+ exports.runesEstimateEtchResultSchema = runesEstimateEtchResultSchema;
3666
+ exports.runesEstimateEtchSuccessResponseSchema = runesEstimateEtchSuccessResponseSchema;
3667
+ exports.runesEstimateMintParamsSchema = runesEstimateMintParamsSchema;
3668
+ exports.runesEstimateMintRequestSchema = runesEstimateMintRequestSchema;
3669
+ exports.runesEstimateMintResultSchema = runesEstimateMintResultSchema;
3670
+ exports.runesEstimateMintSuccessResponseSchema = runesEstimateMintSuccessResponseSchema;
3671
+ exports.runesEstimateRbfOrderParamsSchema = runesEstimateRbfOrderParamsSchema;
3672
+ exports.runesEstimateRbfOrderRequestSchema = runesEstimateRbfOrderRequestSchema;
3673
+ exports.runesEstimateRbfOrderResultSchema = runesEstimateRbfOrderResultSchema;
3674
+ exports.runesEstimateRbfOrderSuccessResponseSchema = runesEstimateRbfOrderSuccessResponseSchema;
3675
+ exports.runesEtchParamsSchema = runesEtchParamsSchema;
3676
+ exports.runesEtchRequestSchema = runesEtchRequestSchema;
3677
+ exports.runesEtchResultSchema = runesEtchResultSchema;
3678
+ exports.runesEtchSuccessResponseSchema = runesEtchSuccessResponseSchema;
3679
+ exports.runesGetBalanceParamsSchema = runesGetBalanceParamsSchema;
3680
+ exports.runesGetBalanceRequestSchema = runesGetBalanceRequestSchema;
3681
+ exports.runesGetBalanceResultSchema = runesGetBalanceResultSchema;
3682
+ exports.runesGetBalanceSuccessResponseSchema = runesGetBalanceSuccessResponseSchema;
3683
+ exports.runesGetOrderParamsSchema = runesGetOrderParamsSchema;
3684
+ exports.runesGetOrderRequestSchema = runesGetOrderRequestSchema;
3685
+ exports.runesGetOrderResultSchema = runesGetOrderResultSchema;
3686
+ exports.runesGetOrderSuccessResponseSchema = runesGetOrderSuccessResponseSchema;
3687
+ exports.runesMethods = runesMethods;
3688
+ exports.runesMintParamsSchema = runesMintParamsSchema;
3689
+ exports.runesMintRequestSchema = runesMintRequestSchema;
3690
+ exports.runesMintResultSchema = runesMintResultSchema;
3691
+ exports.runesMintSuccessResponseSchema = runesMintSuccessResponseSchema;
3692
+ exports.runesRbfOrderParamsSchema = runesRbfOrderParamsSchema;
3693
+ exports.runesRbfOrderRequestSchema = runesRbfOrderRequestSchema;
3694
+ exports.runesRbfOrderResultSchema = runesRbfOrderResultSchema;
3695
+ exports.runesRbfOrderSuccessResponseSchema = runesRbfOrderSuccessResponseSchema;
3696
+ exports.runesRequestSchema = runesRequestSchema;
3697
+ exports.runesSuccessResponseSchema = runesSuccessResponseSchema;
3698
+ exports.runesTransferParamsSchema = runesTransferParamsSchema;
3699
+ exports.runesTransferRequestSchema = runesTransferRequestSchema;
3700
+ exports.runesTransferResultSchema = runesTransferResultSchema;
3701
+ exports.runesTransferSuccessResponseSchema = runesTransferSuccessResponseSchema;
3702
+ exports.sendBtcTransaction = sendBtcTransaction;
3703
+ exports.setDefaultProvider = setDefaultProvider;
3704
+ exports.signMessage = signMessage;
3705
+ exports.signMultipleTransactions = signMultipleTransactions;
3706
+ exports.signTransaction = signTransaction;
3707
+ exports.sparkFlashnetClawbackFundsParamsSchema = sparkFlashnetClawbackFundsParamsSchema;
3708
+ exports.sparkFlashnetClawbackFundsRequestSchema = sparkFlashnetClawbackFundsRequestSchema;
3709
+ exports.sparkFlashnetClawbackFundsResultSchema = sparkFlashnetClawbackFundsResultSchema;
3710
+ exports.sparkFlashnetClawbackFundsSuccessResponseSchema = sparkFlashnetClawbackFundsSuccessResponseSchema;
3711
+ exports.sparkFlashnetExecuteRouteSwapParamsSchema = sparkFlashnetExecuteRouteSwapParamsSchema;
3712
+ exports.sparkFlashnetExecuteRouteSwapRequestSchema = sparkFlashnetExecuteRouteSwapRequestSchema;
3713
+ exports.sparkFlashnetExecuteRouteSwapResultSchema = sparkFlashnetExecuteRouteSwapResultSchema;
3714
+ exports.sparkFlashnetExecuteRouteSwapSuccessResponseSchema = sparkFlashnetExecuteRouteSwapSuccessResponseSchema;
3715
+ exports.sparkFlashnetExecuteSwapParamsSchema = sparkFlashnetExecuteSwapParamsSchema;
3716
+ exports.sparkFlashnetExecuteSwapRequestSchema = sparkFlashnetExecuteSwapRequestSchema;
3717
+ exports.sparkFlashnetExecuteSwapResultSchema = sparkFlashnetExecuteSwapResultSchema;
3718
+ exports.sparkFlashnetExecuteSwapSuccessResponseSchema = sparkFlashnetExecuteSwapSuccessResponseSchema;
3719
+ exports.sparkFlashnetGetJwtParamsSchema = sparkFlashnetGetJwtParamsSchema;
3720
+ exports.sparkFlashnetGetJwtRequestSchema = sparkFlashnetGetJwtRequestSchema;
3721
+ exports.sparkFlashnetGetJwtResultSchema = sparkFlashnetGetJwtResultSchema;
3722
+ exports.sparkFlashnetGetJwtSuccessResponseSchema = sparkFlashnetGetJwtSuccessResponseSchema;
3723
+ exports.sparkFlashnetSignIntentParamsSchema = sparkFlashnetSignIntentParamsSchema;
3724
+ exports.sparkFlashnetSignIntentRequestSchema = sparkFlashnetSignIntentRequestSchema;
3725
+ exports.sparkFlashnetSignIntentResultSchema = sparkFlashnetSignIntentResultSchema;
3726
+ exports.sparkFlashnetSignIntentSuccessResponseSchema = sparkFlashnetSignIntentSuccessResponseSchema;
3727
+ exports.sparkFlashnetSignStructuredMessageParamsSchema = sparkFlashnetSignStructuredMessageParamsSchema;
3728
+ exports.sparkFlashnetSignStructuredMessageRequestSchema = sparkFlashnetSignStructuredMessageRequestSchema;
3729
+ exports.sparkFlashnetSignStructuredMessageResultSchema = sparkFlashnetSignStructuredMessageResultSchema;
3730
+ exports.sparkFlashnetSignStructuredMessageSuccessResponseSchema = sparkFlashnetSignStructuredMessageSuccessResponseSchema;
3731
+ exports.sparkGetAddressesParamsSchema = sparkGetAddressesParamsSchema;
3732
+ exports.sparkGetAddressesRequestSchema = sparkGetAddressesRequestSchema;
3733
+ exports.sparkGetAddressesResultSchema = sparkGetAddressesResultSchema;
3734
+ exports.sparkGetAddressesSuccessResponseSchema = sparkGetAddressesSuccessResponseSchema;
3735
+ exports.sparkGetAddressesV2ParamsSchema = sparkGetAddressesV2ParamsSchema;
3736
+ exports.sparkGetAddressesV2RequestSchema = sparkGetAddressesV2RequestSchema;
3737
+ exports.sparkGetAddressesV2ResultSchema = sparkGetAddressesV2ResultSchema;
3738
+ exports.sparkGetAddressesV2SuccessResponseSchema = sparkGetAddressesV2SuccessResponseSchema;
3739
+ exports.sparkGetBalanceParamsSchema = sparkGetBalanceParamsSchema;
3740
+ exports.sparkGetBalanceRequestSchema = sparkGetBalanceRequestSchema;
3741
+ exports.sparkGetBalanceResultSchema = sparkGetBalanceResultSchema;
3742
+ exports.sparkGetBalanceSuccessResponseSchema = sparkGetBalanceSuccessResponseSchema;
3743
+ exports.sparkGetClawbackEligibleTransfersParamsSchema = sparkGetClawbackEligibleTransfersParamsSchema;
3744
+ exports.sparkGetClawbackEligibleTransfersRequestSchema = sparkGetClawbackEligibleTransfersRequestSchema;
3745
+ exports.sparkGetClawbackEligibleTransfersResultSchema = sparkGetClawbackEligibleTransfersResultSchema;
3746
+ exports.sparkGetClawbackEligibleTransfersSuccessResponseSchema = sparkGetClawbackEligibleTransfersSuccessResponseSchema;
3747
+ exports.sparkMethods = sparkMethods;
3748
+ exports.sparkModeToLegacySparkNetworkType = sparkModeToLegacySparkNetworkType;
3749
+ exports.sparkNetworkConfigurationOptionsSchema = sparkNetworkConfigurationOptionsSchema;
3750
+ exports.sparkRequestSchema = sparkRequestSchema;
3751
+ exports.sparkSignMessageParamsSchema = sparkSignMessageParamsSchema;
3752
+ exports.sparkSignMessageRequestSchema = sparkSignMessageRequestSchema;
3753
+ exports.sparkSignMessageResultSchema = sparkSignMessageResultSchema;
3754
+ exports.sparkSignMessageSuccessResponseSchema = sparkSignMessageSuccessResponseSchema;
3755
+ exports.sparkSuccessResponseSchema = sparkSuccessResponseSchema;
3756
+ exports.sparkTransferParamsSchema = sparkTransferParamsSchema;
3757
+ exports.sparkTransferRequestSchema = sparkTransferRequestSchema;
3758
+ exports.sparkTransferResultSchema = sparkTransferResultSchema;
3759
+ exports.sparkTransferSuccessResponseSchema = sparkTransferSuccessResponseSchema;
3760
+ exports.sparkTransferTokenParamsSchema = sparkTransferTokenParamsSchema;
3761
+ exports.sparkTransferTokenRequestSchema = sparkTransferTokenRequestSchema;
3762
+ exports.sparkTransferTokenResultSchema = sparkTransferTokenResultSchema;
3763
+ exports.sparkTransferTokenSuccessResponseSchema = sparkTransferTokenSuccessResponseSchema;
3764
+ exports.specErrorObjectSchema = specErrorObjectSchema;
3765
+ exports.specErrorResponseSchema = specErrorResponseSchema;
3766
+ exports.specIdSchema = specIdSchema;
3767
+ exports.specRequestSchema = specRequestSchema;
3768
+ exports.specResponseSchema = specResponseSchema;
3769
+ exports.specSuccessResponseSchema = specSuccessResponseSchema;
3770
+ exports.specSuccessWithExtensionsResponseSchema = specSuccessWithExtensionsResponseSchema;
3771
+ exports.stacksCallContractParamsSchema = stacksCallContractParamsSchema;
3772
+ exports.stacksCallContractRequestSchema = stacksCallContractRequestSchema;
3773
+ exports.stacksCallContractResultSchema = stacksCallContractResultSchema;
3774
+ exports.stacksCallContractSuccessResponseSchema = stacksCallContractSuccessResponseSchema;
3775
+ exports.stacksDeployContractParamsSchema = stacksDeployContractParamsSchema;
3776
+ exports.stacksDeployContractRequestSchema = stacksDeployContractRequestSchema;
3777
+ exports.stacksDeployContractResultSchema = stacksDeployContractResultSchema;
3778
+ exports.stacksDeployContractSuccessResponseSchema = stacksDeployContractSuccessResponseSchema;
3779
+ exports.stacksGetAccountsParamsSchema = stacksGetAccountsParamsSchema;
3780
+ exports.stacksGetAccountsRequestSchema = stacksGetAccountsRequestSchema;
3781
+ exports.stacksGetAccountsResultSchema = stacksGetAccountsResultSchema;
3782
+ exports.stacksGetAccountsSuccessResponseSchema = stacksGetAccountsSuccessResponseSchema;
3783
+ exports.stacksGetAddressesParamsSchema = stacksGetAddressesParamsSchema;
3784
+ exports.stacksGetAddressesRequestSchema = stacksGetAddressesRequestSchema;
3785
+ exports.stacksGetAddressesResultSchema = stacksGetAddressesResultSchema;
3786
+ exports.stacksGetAddressesSuccessResponseSchema = stacksGetAddressesSuccessResponseSchema;
3787
+ exports.stacksGetAddressesV2ParamsSchema = stacksGetAddressesV2ParamsSchema;
3788
+ exports.stacksGetAddressesV2RequestSchema = stacksGetAddressesV2RequestSchema;
3789
+ exports.stacksGetAddressesV2ResultSchema = stacksGetAddressesV2ResultSchema;
3790
+ exports.stacksGetAddressesV2SuccessResponseSchema = stacksGetAddressesV2SuccessResponseSchema;
3791
+ exports.stacksMethods = stacksMethods;
3792
+ exports.stacksModeToLegacyStacksNetworkType = stacksModeToLegacyStacksNetworkType;
3793
+ exports.stacksNetworkConfigurationOptionsSchema = stacksNetworkConfigurationOptionsSchema;
3794
+ exports.stacksRequestSchema = stacksRequestSchema;
3795
+ exports.stacksSignMessageParamsSchema = stacksSignMessageParamsSchema;
3796
+ exports.stacksSignMessageRequestSchema = stacksSignMessageRequestSchema;
3797
+ exports.stacksSignMessageResultSchema = stacksSignMessageResultSchema;
3798
+ exports.stacksSignMessageSuccessResponseSchema = stacksSignMessageSuccessResponseSchema;
3799
+ exports.stacksSignStructuredMessageParamsSchema = stacksSignStructuredMessageParamsSchema;
3800
+ exports.stacksSignStructuredMessageRequestSchema = stacksSignStructuredMessageRequestSchema;
3801
+ exports.stacksSignStructuredMessageResultSchema = stacksSignStructuredMessageResultSchema;
3802
+ exports.stacksSignStructuredMessageSuccessResponseSchema = stacksSignStructuredMessageSuccessResponseSchema;
3803
+ exports.stacksSignTransactionParamsSchema = stacksSignTransactionParamsSchema;
3804
+ exports.stacksSignTransactionRequestSchema = stacksSignTransactionRequestSchema;
3805
+ exports.stacksSignTransactionResultSchema = stacksSignTransactionResultSchema;
3806
+ exports.stacksSignTransactionSuccessResponseSchema = stacksSignTransactionSuccessResponseSchema;
3807
+ exports.stacksSignTransactionsParamsSchema = stacksSignTransactionsParamsSchema;
3808
+ exports.stacksSignTransactionsRequestSchema = stacksSignTransactionsRequestSchema;
3809
+ exports.stacksSignTransactionsResultSchema = stacksSignTransactionsResultSchema;
3810
+ exports.stacksSignTransactionsSuccessResponseSchema = stacksSignTransactionsSuccessResponseSchema;
3811
+ exports.stacksSuccessResponseSchema = stacksSuccessResponseSchema;
3812
+ exports.stacksTransferStxParamsSchema = stacksTransferStxParamsSchema;
3813
+ exports.stacksTransferStxRequestSchema = stacksTransferStxRequestSchema;
3814
+ exports.stacksTransferStxResultSchema = stacksTransferStxResultSchema;
3815
+ exports.stacksTransferStxSuccessResponseSchema = stacksTransferStxSuccessResponseSchema;
3816
+ exports.starknetNetworkConfigurationOptionsSchema = starknetNetworkConfigurationOptionsSchema;
3817
+ exports.walletAddNetworkParamsSchema = walletAddNetworkParamsSchema;
3818
+ exports.walletAddNetworkRequestSchema = walletAddNetworkRequestSchema;
3819
+ exports.walletAddNetworkResultSchema = walletAddNetworkResultSchema;
3820
+ exports.walletAddNetworkSuccessResponseSchema = walletAddNetworkSuccessResponseSchema;
3821
+ exports.walletAddNetworkV2ParamsSchema = walletAddNetworkV2ParamsSchema;
3822
+ exports.walletAddNetworkV2RequestSchema = walletAddNetworkV2RequestSchema;
3823
+ exports.walletAddNetworkV2ResultSchema = walletAddNetworkV2ResultSchema;
3824
+ exports.walletAddNetworkV2SuccessResponseSchema = walletAddNetworkV2SuccessResponseSchema;
3825
+ exports.walletChangeNetworkByIdParamsSchema = walletChangeNetworkByIdParamsSchema;
3826
+ exports.walletChangeNetworkByIdRequestSchema = walletChangeNetworkByIdRequestSchema;
3827
+ exports.walletChangeNetworkByIdResultSchema = walletChangeNetworkByIdResultSchema;
3828
+ exports.walletChangeNetworkByIdSuccessResponseSchema = walletChangeNetworkByIdSuccessResponseSchema;
3829
+ exports.walletChangeNetworkParamsSchema = walletChangeNetworkParamsSchema;
3830
+ exports.walletChangeNetworkRequestSchema = walletChangeNetworkRequestSchema;
3831
+ exports.walletChangeNetworkResultSchema = walletChangeNetworkResultSchema;
3832
+ exports.walletChangeNetworkSuccessResponseSchema = walletChangeNetworkSuccessResponseSchema;
3833
+ exports.walletConnectParamsSchema = walletConnectParamsSchema;
3834
+ exports.walletConnectRequestSchema = walletConnectRequestSchema;
3835
+ exports.walletConnectResultSchema = walletConnectResultSchema;
3836
+ exports.walletConnectSuccessResponseSchema = walletConnectSuccessResponseSchema;
3837
+ exports.walletConnectV2ParamsSchema = walletConnectV2ParamsSchema;
3838
+ exports.walletConnectV2RequestSchema = walletConnectV2RequestSchema;
3839
+ exports.walletConnectV2ResultSchema = walletConnectV2ResultSchema;
3840
+ exports.walletConnectV2SuccessResponseSchema = walletConnectV2SuccessResponseSchema;
3841
+ exports.walletDisconnectParamsSchema = walletDisconnectParamsSchema;
3842
+ exports.walletDisconnectRequestSchema = walletDisconnectRequestSchema;
3843
+ exports.walletDisconnectResultSchema = walletDisconnectResultSchema;
3844
+ exports.walletDisconnectSuccessResponseSchema = walletDisconnectSuccessResponseSchema;
3845
+ exports.walletEventSchema = walletEventSchema;
3846
+ exports.walletGetAccountParamsSchema = walletGetAccountParamsSchema;
3847
+ exports.walletGetAccountRequestSchema = walletGetAccountRequestSchema;
3848
+ exports.walletGetAccountResultSchema = walletGetAccountResultSchema;
3849
+ exports.walletGetAccountSuccessResponseSchema = walletGetAccountSuccessResponseSchema;
3850
+ exports.walletGetAccountV2ParamsSchema = walletGetAccountV2ParamsSchema;
3851
+ exports.walletGetAccountV2RequestSchema = walletGetAccountV2RequestSchema;
3852
+ exports.walletGetAccountV2ResultSchema = walletGetAccountV2ResultSchema;
3853
+ exports.walletGetAccountV2SuccessResponseSchema = walletGetAccountV2SuccessResponseSchema;
3854
+ exports.walletGetCurrentPermissionsParamsSchema = walletGetCurrentPermissionsParamsSchema;
3855
+ exports.walletGetCurrentPermissionsRequestSchema = walletGetCurrentPermissionsRequestSchema;
3856
+ exports.walletGetCurrentPermissionsResultSchema = walletGetCurrentPermissionsResultSchema;
3857
+ exports.walletGetCurrentPermissionsSuccessResponseSchema = walletGetCurrentPermissionsSuccessResponseSchema;
3858
+ exports.walletGetNetworkParamsSchema = walletGetNetworkParamsSchema;
3859
+ exports.walletGetNetworkRequestSchema = walletGetNetworkRequestSchema;
3860
+ exports.walletGetNetworkResultSchema = walletGetNetworkResultSchema;
3861
+ exports.walletGetNetworkSuccessResponseSchema = walletGetNetworkSuccessResponseSchema;
3862
+ exports.walletGetNetworksParamsSchema = walletGetNetworksParamsSchema;
3863
+ exports.walletGetNetworksRequestSchema = walletGetNetworksRequestSchema;
3864
+ exports.walletGetNetworksResultSchema = walletGetNetworksResultSchema;
3865
+ exports.walletGetNetworksSuccessResponseSchema = walletGetNetworksSuccessResponseSchema;
3866
+ exports.walletGetWalletTypeParamsSchema = walletGetWalletTypeParamsSchema;
3867
+ exports.walletGetWalletTypeRequestSchema = walletGetWalletTypeRequestSchema;
3868
+ exports.walletGetWalletTypeResultSchema = walletGetWalletTypeResultSchema;
3869
+ exports.walletGetWalletTypeSuccessResponseSchema = walletGetWalletTypeSuccessResponseSchema;
3870
+ exports.walletMethods = walletMethods;
3871
+ exports.walletOpenBridgeParamsSchema = walletOpenBridgeParamsSchema;
3872
+ exports.walletOpenBridgeRequestSchema = walletOpenBridgeRequestSchema;
3873
+ exports.walletOpenBridgeResultSchema = walletOpenBridgeResultSchema;
3874
+ exports.walletOpenBridgeSuccessResponseSchema = walletOpenBridgeSuccessResponseSchema;
3875
+ exports.walletOpenBuyParamsSchema = walletOpenBuyParamsSchema;
3876
+ exports.walletOpenBuyRequestSchema = walletOpenBuyRequestSchema;
3877
+ exports.walletOpenBuyResultSchema = walletOpenBuyResultSchema;
3878
+ exports.walletOpenBuySuccessResponseSchema = walletOpenBuySuccessResponseSchema;
3879
+ exports.walletOpenReceiveParamsSchema = walletOpenReceiveParamsSchema;
3880
+ exports.walletOpenReceiveRequestSchema = walletOpenReceiveRequestSchema;
3881
+ exports.walletOpenReceiveResultSchema = walletOpenReceiveResultSchema;
3882
+ exports.walletOpenReceiveSuccessResponseSchema = walletOpenReceiveSuccessResponseSchema;
3883
+ exports.walletRenouncePermissionsParamsSchema = walletRenouncePermissionsParamsSchema;
3884
+ exports.walletRenouncePermissionsRequestSchema = walletRenouncePermissionsRequestSchema;
3885
+ exports.walletRenouncePermissionsResultSchema = walletRenouncePermissionsResultSchema;
3886
+ exports.walletRenouncePermissionsSuccessResponseSchema = walletRenouncePermissionsSuccessResponseSchema;
3887
+ exports.walletRequestPermissionsParamsSchema = walletRequestPermissionsParamsSchema;
3888
+ exports.walletRequestPermissionsRequestSchema = walletRequestPermissionsRequestSchema;
3889
+ exports.walletRequestPermissionsResultSchema = walletRequestPermissionsResultSchema;
3890
+ exports.walletRequestPermissionsSuccessResponseSchema = walletRequestPermissionsSuccessResponseSchema;
3891
+ exports.walletRequestSchema = walletRequestSchema;
3892
+ exports.walletSuccessResponseSchema = walletSuccessResponseSchema;
3893
+ exports.walletTypeSchema = walletTypeSchema;
3894
+ exports.walletTypes = walletTypes;