@sats-connect/core 0.16.0 → 0.17.0-2dadc04

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