@sats-connect/core 0.7.1 → 0.8.0

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.mjs CHANGED
@@ -17,6 +17,8 @@ var AddressPurpose = /* @__PURE__ */ ((AddressPurpose2) => {
17
17
  AddressPurpose2["Ordinals"] = "ordinals";
18
18
  AddressPurpose2["Payment"] = "payment";
19
19
  AddressPurpose2["Stacks"] = "stacks";
20
+ AddressPurpose2["Starknet"] = "starknet";
21
+ AddressPurpose2["Spark"] = "spark";
20
22
  return AddressPurpose2;
21
23
  })(AddressPurpose || {});
22
24
  var AddressType = /* @__PURE__ */ ((AddressType3) => {
@@ -26,6 +28,8 @@ var AddressType = /* @__PURE__ */ ((AddressType3) => {
26
28
  AddressType3["p2wsh"] = "p2wsh";
27
29
  AddressType3["p2tr"] = "p2tr";
28
30
  AddressType3["stacks"] = "stacks";
31
+ AddressType3["starknet"] = "starknet";
32
+ AddressType3["spark"] = "spark";
29
33
  return AddressType3;
30
34
  })(AddressType || {});
31
35
  var addressSchema = v2.object({
@@ -73,6 +77,11 @@ var StarknetNetworkType = /* @__PURE__ */ ((StarknetNetworkType2) => {
73
77
  StarknetNetworkType2["Sepolia"] = "sepolia";
74
78
  return StarknetNetworkType2;
75
79
  })(StarknetNetworkType || {});
80
+ var SparkNetworkType = /* @__PURE__ */ ((SparkNetworkType2) => {
81
+ SparkNetworkType2["Mainnet"] = "mainnet";
82
+ SparkNetworkType2["Regtest"] = "regtest";
83
+ return SparkNetworkType2;
84
+ })(SparkNetworkType || {});
76
85
  var RpcIdSchema = v3.optional(v3.union([v3.string(), v3.number(), v3.null()]));
77
86
  var rpcRequestMessageSchema = v3.object({
78
87
  jsonrpc: v3.literal("2.0"),
@@ -183,523 +192,1041 @@ function getSupportedWallets() {
183
192
  }
184
193
 
185
194
  // src/request/index.ts
186
- import * as v21 from "valibot";
187
-
188
- // src/request/types/stxMethods/callContract.ts
189
- import * as v5 from "valibot";
190
- var stxCallContractMethodName = "stx_callContract";
191
- var stxCallContractParamsSchema = v5.object({
192
- /**
193
- * The contract principal.
194
- *
195
- * E.g. `"SPKE...GD5C.my-contract"`
196
- */
197
- contract: v5.string(),
198
- /**
199
- * The name of the function to call.
200
- *
201
- * Note: spec changes ongoing,
202
- * https://github.com/stacksgov/sips/pull/166#pullrequestreview-1914236999
203
- */
204
- functionName: v5.string(),
205
- /**
206
- * @deprecated in favor of `functionArgs` for @stacks/connect compatibility
207
- */
208
- arguments: v5.optional(v5.array(v5.string())),
209
- /**
210
- * The function's arguments. The arguments are expected to be hex-encoded
211
- * strings of Clarity values.
212
- *
213
- * To convert Clarity values to their hex representation, the `cvToHex`
214
- * helper from the `@stacks/transactions` package may be helpful.
215
- *
216
- * ```js
217
- * import { cvToHex } from '@stacks/transactions';
218
- *
219
- * const functionArgs = [someClarityValue1, someClarityValue2];
220
- * const hexArgs = functionArgs.map(cvToHex);
221
- * ```
222
- */
223
- functionArgs: v5.optional(v5.array(v5.string())),
224
- /**
225
- * The post conditions to apply to the contract call.
226
- */
227
- postConditions: v5.optional(v5.array(v5.string())),
228
- /**
229
- * The mode to apply to the post conditions.
230
- */
231
- postConditionMode: v5.optional(v5.union([v5.literal("allow"), v5.literal("deny")]))
232
- });
233
- var stxCallContractResultSchema = v5.object({
234
- /**
235
- * The ID of the transaction.
236
- */
237
- txid: v5.string(),
238
- /**
239
- * A Stacks transaction as a hex-encoded string.
240
- */
241
- transaction: v5.string()
242
- });
243
- var stxCallContractRequestMessageSchema = v5.object({
244
- ...rpcRequestMessageSchema.entries,
245
- ...v5.object({
246
- method: v5.literal(stxCallContractMethodName),
247
- params: stxCallContractParamsSchema,
248
- id: v5.string()
249
- }).entries
250
- });
195
+ import * as v25 from "valibot";
251
196
 
252
- // src/request/types/stxMethods/deployContract.ts
197
+ // src/request/types/btcMethods.ts
253
198
  import * as v6 from "valibot";
254
- var stxDeployContractMethodName = "stx_deployContract";
255
- var stxDeployContractParamsSchema = v6.object({
256
- /**
257
- * Name of the contract.
258
- */
259
- name: v6.string(),
260
- /**
261
- * The source code of the Clarity contract.
262
- */
263
- clarityCode: v6.string(),
264
- /**
265
- * The version of the Clarity contract.
266
- */
267
- clarityVersion: v6.optional(v6.number()),
268
- /**
269
- * The post conditions to apply to the contract call.
270
- */
271
- postConditions: v6.optional(v6.array(v6.string())),
272
- /**
273
- * The mode to apply to the post conditions.
274
- */
275
- postConditionMode: v6.optional(v6.union([v6.literal("allow"), v6.literal("deny")]))
276
- });
277
- var stxDeployContractResultSchema = v6.object({
278
- /**
279
- * The ID of the transaction.
280
- */
281
- txid: v6.string(),
282
- /**
283
- * A Stacks transaction as a hex-encoded string.
284
- */
285
- transaction: v6.string()
286
- });
287
- var stxDeployContractRequestMessageSchema = v6.object({
288
- ...rpcRequestMessageSchema.entries,
289
- ...v6.object({
290
- method: v6.literal(stxDeployContractMethodName),
291
- params: stxDeployContractParamsSchema,
292
- id: v6.string()
293
- }).entries
294
- });
295
-
296
- // src/request/types/stxMethods/getAccounts.ts
297
- import * as v8 from "valibot";
298
199
 
299
200
  // src/request/types/walletMethods.ts
300
- import * as v7 from "valibot";
301
- var accountActionsSchema = v7.object({
302
- read: v7.optional(v7.boolean())
201
+ import * as v5 from "valibot";
202
+ var accountActionsSchema = v5.object({
203
+ read: v5.optional(v5.boolean())
303
204
  });
304
- var walletActionsSchema = v7.object({
305
- readNetwork: v7.optional(v7.boolean())
205
+ var walletActionsSchema = v5.object({
206
+ readNetwork: v5.optional(v5.boolean())
306
207
  });
307
- var accountPermissionSchema = v7.object({
308
- type: v7.literal("account"),
309
- resourceId: v7.string(),
310
- clientId: v7.string(),
208
+ var accountPermissionSchema = v5.object({
209
+ type: v5.literal("account"),
210
+ resourceId: v5.string(),
211
+ clientId: v5.string(),
311
212
  actions: accountActionsSchema
312
213
  });
313
- var walletPermissionSchema = v7.object({
314
- type: v7.literal("wallet"),
315
- resourceId: v7.string(),
316
- clientId: v7.string(),
214
+ var walletPermissionSchema = v5.object({
215
+ type: v5.literal("wallet"),
216
+ resourceId: v5.string(),
217
+ clientId: v5.string(),
317
218
  actions: walletActionsSchema
318
219
  });
319
- var PermissionRequestParams = v7.variant("type", [
320
- v7.object({
321
- ...v7.omit(accountPermissionSchema, ["clientId"]).entries
220
+ var PermissionRequestParams = v5.variant("type", [
221
+ v5.object({
222
+ ...v5.omit(accountPermissionSchema, ["clientId"]).entries
322
223
  }),
323
- v7.object({
324
- ...v7.omit(walletPermissionSchema, ["clientId"]).entries
224
+ v5.object({
225
+ ...v5.omit(walletPermissionSchema, ["clientId"]).entries
325
226
  })
326
227
  ]);
327
- var permission = v7.variant("type", [accountPermissionSchema, walletPermissionSchema]);
228
+ var permission = v5.variant("type", [accountPermissionSchema, walletPermissionSchema]);
328
229
  var requestPermissionsMethodName = "wallet_requestPermissions";
329
- var requestPermissionsParamsSchema = v7.nullish(v7.array(PermissionRequestParams));
330
- var requestPermissionsResultSchema = v7.literal(true);
331
- var requestPermissionsRequestMessageSchema = v7.object({
230
+ var requestPermissionsParamsSchema = v5.nullish(v5.array(PermissionRequestParams));
231
+ var requestPermissionsResultSchema = v5.literal(true);
232
+ var requestPermissionsRequestMessageSchema = v5.object({
332
233
  ...rpcRequestMessageSchema.entries,
333
- ...v7.object({
334
- method: v7.literal(requestPermissionsMethodName),
234
+ ...v5.object({
235
+ method: v5.literal(requestPermissionsMethodName),
335
236
  params: requestPermissionsParamsSchema,
336
- id: v7.string()
237
+ id: v5.string()
337
238
  }).entries
338
239
  });
339
240
  var renouncePermissionsMethodName = "wallet_renouncePermissions";
340
- var renouncePermissionsParamsSchema = v7.nullish(v7.null());
341
- var renouncePermissionsResultSchema = v7.nullish(v7.null());
342
- var renouncePermissionsRequestMessageSchema = v7.object({
241
+ var renouncePermissionsParamsSchema = v5.nullish(v5.null());
242
+ var renouncePermissionsResultSchema = v5.nullish(v5.null());
243
+ var renouncePermissionsRequestMessageSchema = v5.object({
343
244
  ...rpcRequestMessageSchema.entries,
344
- ...v7.object({
345
- method: v7.literal(renouncePermissionsMethodName),
245
+ ...v5.object({
246
+ method: v5.literal(renouncePermissionsMethodName),
346
247
  params: renouncePermissionsParamsSchema,
347
- id: v7.string()
248
+ id: v5.string()
348
249
  }).entries
349
250
  });
350
251
  var disconnectMethodName = "wallet_disconnect";
351
- var disconnectParamsSchema = v7.nullish(v7.null());
352
- var disconnectResultSchema = v7.nullish(v7.null());
353
- var disconnectRequestMessageSchema = v7.object({
252
+ var disconnectParamsSchema = v5.nullish(v5.null());
253
+ var disconnectResultSchema = v5.nullish(v5.null());
254
+ var disconnectRequestMessageSchema = v5.object({
354
255
  ...rpcRequestMessageSchema.entries,
355
- ...v7.object({
356
- method: v7.literal(disconnectMethodName),
256
+ ...v5.object({
257
+ method: v5.literal(disconnectMethodName),
357
258
  params: disconnectParamsSchema,
358
- id: v7.string()
259
+ id: v5.string()
359
260
  }).entries
360
261
  });
361
262
  var getWalletTypeMethodName = "wallet_getWalletType";
362
- var getWalletTypeParamsSchema = v7.nullish(v7.null());
263
+ var getWalletTypeParamsSchema = v5.nullish(v5.null());
363
264
  var getWalletTypeResultSchema = walletTypeSchema;
364
- var getWalletTypeRequestMessageSchema = v7.object({
265
+ var getWalletTypeRequestMessageSchema = v5.object({
365
266
  ...rpcRequestMessageSchema.entries,
366
- ...v7.object({
367
- method: v7.literal(getWalletTypeMethodName),
267
+ ...v5.object({
268
+ method: v5.literal(getWalletTypeMethodName),
368
269
  params: getWalletTypeParamsSchema,
369
- id: v7.string()
270
+ id: v5.string()
370
271
  }).entries
371
272
  });
372
273
  var getCurrentPermissionsMethodName = "wallet_getCurrentPermissions";
373
- var getCurrentPermissionsParamsSchema = v7.nullish(v7.null());
374
- var getCurrentPermissionsResultSchema = v7.array(permission);
375
- var getCurrentPermissionsRequestMessageSchema = v7.object({
274
+ var getCurrentPermissionsParamsSchema = v5.nullish(v5.null());
275
+ var getCurrentPermissionsResultSchema = v5.array(permission);
276
+ var getCurrentPermissionsRequestMessageSchema = v5.object({
376
277
  ...rpcRequestMessageSchema.entries,
377
- ...v7.object({
378
- method: v7.literal(getCurrentPermissionsMethodName),
278
+ ...v5.object({
279
+ method: v5.literal(getCurrentPermissionsMethodName),
379
280
  params: getCurrentPermissionsParamsSchema,
380
- id: v7.string()
281
+ id: v5.string()
381
282
  }).entries
382
283
  });
383
284
  var getNetworkMethodName = "wallet_getNetwork";
384
- var getNetworkParamsSchema = v7.nullish(v7.null());
385
- var getNetworkResultSchema = v7.object({
386
- bitcoin: v7.object({
387
- name: v7.enum(BitcoinNetworkType)
285
+ var getNetworkParamsSchema = v5.nullish(v5.null());
286
+ var getNetworkResultSchema = v5.object({
287
+ bitcoin: v5.object({
288
+ name: v5.enum(BitcoinNetworkType)
388
289
  }),
389
- stacks: v7.object({
390
- name: v7.string()
290
+ stacks: v5.object({
291
+ name: v5.enum(StacksNetworkType)
292
+ }),
293
+ spark: v5.object({
294
+ name: v5.enum(SparkNetworkType)
391
295
  })
392
296
  });
393
- var getNetworkRequestMessageSchema = v7.object({
297
+ var getNetworkRequestMessageSchema = v5.object({
394
298
  ...rpcRequestMessageSchema.entries,
395
- ...v7.object({
396
- method: v7.literal(getNetworkMethodName),
299
+ ...v5.object({
300
+ method: v5.literal(getNetworkMethodName),
397
301
  params: getNetworkParamsSchema,
398
- id: v7.string()
302
+ id: v5.string()
399
303
  }).entries
400
304
  });
401
305
  var changeNetworkMethodName = "wallet_changeNetwork";
402
- var changeNetworkParamsSchema = v7.object({
403
- name: v7.enum(BitcoinNetworkType)
306
+ var changeNetworkParamsSchema = v5.object({
307
+ name: v5.enum(BitcoinNetworkType)
404
308
  });
405
- var changeNetworkResultSchema = v7.nullish(v7.null());
406
- var changeNetworkRequestMessageSchema = v7.object({
309
+ var changeNetworkResultSchema = v5.nullish(v5.null());
310
+ var changeNetworkRequestMessageSchema = v5.object({
407
311
  ...rpcRequestMessageSchema.entries,
408
- ...v7.object({
409
- method: v7.literal(changeNetworkMethodName),
312
+ ...v5.object({
313
+ method: v5.literal(changeNetworkMethodName),
410
314
  params: changeNetworkParamsSchema,
411
- id: v7.string()
315
+ id: v5.string()
412
316
  }).entries
413
317
  });
414
318
  var changeNetworkByIdMethodName = "wallet_changeNetworkById";
415
- var changeNetworkByIdParamsSchema = v7.object({
416
- id: v7.string()
319
+ var changeNetworkByIdParamsSchema = v5.object({
320
+ id: v5.string()
417
321
  });
418
- var changeNetworkByIdResultSchema = v7.nullish(v7.null());
419
- var changeNetworkByIdRequestMessageSchema = v7.object({
322
+ var changeNetworkByIdResultSchema = v5.nullish(v5.null());
323
+ var changeNetworkByIdRequestMessageSchema = v5.object({
420
324
  ...rpcRequestMessageSchema.entries,
421
- ...v7.object({
422
- method: v7.literal(changeNetworkByIdMethodName),
325
+ ...v5.object({
326
+ method: v5.literal(changeNetworkByIdMethodName),
423
327
  params: changeNetworkByIdParamsSchema,
424
- id: v7.string()
328
+ id: v5.string()
425
329
  }).entries
426
330
  });
427
331
  var getAccountMethodName = "wallet_getAccount";
428
- var getAccountParamsSchema = v7.nullish(v7.null());
429
- var getAccountResultSchema = v7.object({
430
- id: v7.string(),
431
- addresses: v7.array(addressSchema),
332
+ var getAccountParamsSchema = v5.nullish(v5.null());
333
+ var getAccountResultSchema = v5.object({
334
+ id: v5.string(),
335
+ addresses: v5.array(addressSchema),
432
336
  walletType: walletTypeSchema,
433
337
  network: getNetworkResultSchema
434
338
  });
435
- var getAccountRequestMessageSchema = v7.object({
339
+ var getAccountRequestMessageSchema = v5.object({
436
340
  ...rpcRequestMessageSchema.entries,
437
- ...v7.object({
438
- method: v7.literal(getAccountMethodName),
341
+ ...v5.object({
342
+ method: v5.literal(getAccountMethodName),
439
343
  params: getAccountParamsSchema,
440
- id: v7.string()
344
+ id: v5.string()
441
345
  }).entries
442
346
  });
443
347
  var connectMethodName = "wallet_connect";
444
- var connectParamsSchema = v7.nullish(
445
- v7.object({
446
- permissions: v7.optional(v7.array(PermissionRequestParams)),
447
- addresses: v7.optional(v7.array(v7.enum(AddressPurpose))),
448
- message: v7.optional(
449
- v7.pipe(v7.string(), v7.maxLength(80, "The message must not exceed 80 characters."))
348
+ var connectParamsSchema = v5.nullish(
349
+ v5.object({
350
+ permissions: v5.optional(v5.array(PermissionRequestParams)),
351
+ addresses: v5.optional(v5.array(v5.enum(AddressPurpose))),
352
+ message: v5.optional(
353
+ v5.pipe(v5.string(), v5.maxLength(80, "The message must not exceed 80 characters."))
450
354
  ),
451
- network: v7.optional(v7.enum(BitcoinNetworkType))
355
+ network: v5.optional(v5.enum(BitcoinNetworkType))
452
356
  })
453
357
  );
454
- var connectResultSchema = v7.object({
455
- id: v7.string(),
456
- addresses: v7.array(addressSchema),
358
+ var connectResultSchema = v5.object({
359
+ id: v5.string(),
360
+ addresses: v5.array(addressSchema),
457
361
  walletType: walletTypeSchema,
458
362
  network: getNetworkResultSchema
459
363
  });
460
- var connectRequestMessageSchema = v7.object({
364
+ var connectRequestMessageSchema = v5.object({
461
365
  ...rpcRequestMessageSchema.entries,
462
- ...v7.object({
463
- method: v7.literal(connectMethodName),
366
+ ...v5.object({
367
+ method: v5.literal(connectMethodName),
464
368
  params: connectParamsSchema,
465
- id: v7.string()
369
+ id: v5.string()
466
370
  }).entries
467
371
  });
468
372
  var addNetworkMethodName = "wallet_addNetwork";
469
- var addNetworkParamsSchema = v7.variant("chain", [
470
- v7.object({
471
- chain: v7.literal("bitcoin"),
472
- type: v7.enum(BitcoinNetworkType),
473
- name: v7.string(),
474
- rpcUrl: v7.string(),
475
- rpcFallbackUrl: v7.optional(v7.string()),
476
- indexerUrl: v7.optional(v7.string()),
477
- blockExplorerUrl: v7.optional(v7.string()),
478
- switch: v7.optional(v7.boolean())
373
+ var addNetworkParamsSchema = v5.variant("chain", [
374
+ v5.object({
375
+ chain: v5.literal("bitcoin"),
376
+ type: v5.enum(BitcoinNetworkType),
377
+ name: v5.string(),
378
+ rpcUrl: v5.string(),
379
+ rpcFallbackUrl: v5.optional(v5.string()),
380
+ indexerUrl: v5.optional(v5.string()),
381
+ blockExplorerUrl: v5.optional(v5.string()),
382
+ switch: v5.optional(v5.boolean())
479
383
  }),
480
- v7.object({
481
- chain: v7.literal("stacks"),
482
- name: v7.string(),
483
- type: v7.enum(StacksNetworkType),
484
- rpcUrl: v7.string(),
485
- blockExplorerUrl: v7.optional(v7.string()),
486
- switch: v7.optional(v7.boolean())
384
+ v5.object({
385
+ chain: v5.literal("stacks"),
386
+ name: v5.string(),
387
+ type: v5.enum(StacksNetworkType),
388
+ rpcUrl: v5.string(),
389
+ blockExplorerUrl: v5.optional(v5.string()),
390
+ switch: v5.optional(v5.boolean())
487
391
  }),
488
- v7.object({
489
- chain: v7.literal("starknet"),
490
- name: v7.string(),
491
- type: v7.enum(StarknetNetworkType),
492
- rpcUrl: v7.string(),
493
- blockExplorerUrl: v7.optional(v7.string()),
494
- switch: v7.optional(v7.boolean())
392
+ v5.object({
393
+ chain: v5.literal("starknet"),
394
+ name: v5.string(),
395
+ type: v5.enum(StarknetNetworkType),
396
+ rpcUrl: v5.string(),
397
+ blockExplorerUrl: v5.optional(v5.string()),
398
+ switch: v5.optional(v5.boolean())
495
399
  })
496
400
  ]);
497
- var addNetworkRequestMessageSchema = v7.object({
401
+ var addNetworkRequestMessageSchema = v5.object({
498
402
  ...rpcRequestMessageSchema.entries,
499
- ...v7.object({
500
- method: v7.literal(addNetworkMethodName),
403
+ ...v5.object({
404
+ method: v5.literal(addNetworkMethodName),
501
405
  params: addNetworkParamsSchema,
502
- id: v7.string()
406
+ id: v5.string()
503
407
  }).entries
504
408
  });
505
- var addNetworkResultSchema = v7.object({
506
- id: v7.string()
409
+ var addNetworkResultSchema = v5.object({
410
+ id: v5.string()
507
411
  });
508
412
 
509
- // src/request/types/stxMethods/getAccounts.ts
510
- var stxGetAccountsMethodName = "stx_getAccounts";
511
- var stxGetAccountsParamsSchema = v8.nullish(v8.null());
512
- var stxGetAccountsResultSchema = v8.object({
413
+ // src/request/types/btcMethods.ts
414
+ var getInfoMethodName = "getInfo";
415
+ var getInfoParamsSchema = v6.nullish(v6.null());
416
+ var getInfoResultSchema = v6.object({
417
+ /**
418
+ * Version of the wallet.
419
+ */
420
+ version: v6.string(),
421
+ /**
422
+ * [WBIP](https://wbips.netlify.app/wbips/WBIP002) methods supported by the wallet.
423
+ */
424
+ methods: v6.optional(v6.array(v6.string())),
425
+ /**
426
+ * List of WBIP standards supported by the wallet. Not currently used.
427
+ */
428
+ supports: v6.array(v6.string())
429
+ });
430
+ var getInfoRequestMessageSchema = v6.object({
431
+ ...rpcRequestMessageSchema.entries,
432
+ ...v6.object({
433
+ method: v6.literal(getInfoMethodName),
434
+ params: getInfoParamsSchema,
435
+ id: v6.string()
436
+ }).entries
437
+ });
438
+ var getAddressesMethodName = "getAddresses";
439
+ var getAddressesParamsSchema = v6.object({
440
+ /**
441
+ * The purposes for which to generate addresses. See
442
+ * {@linkcode AddressPurpose} for available purposes.
443
+ */
444
+ purposes: v6.array(v6.enum(AddressPurpose)),
445
+ /**
446
+ * A message to be displayed to the user in the request prompt.
447
+ */
448
+ message: v6.optional(v6.string())
449
+ });
450
+ var getAddressesResultSchema = v6.object({
513
451
  /**
514
452
  * The addresses generated for the given purposes.
515
453
  */
516
- addresses: v8.array(
517
- v8.object({
518
- address: v8.string(),
519
- publicKey: v8.string(),
520
- gaiaHubUrl: v8.string(),
521
- gaiaAppKey: v8.string()
522
- })
523
- ),
454
+ addresses: v6.array(addressSchema),
524
455
  network: getNetworkResultSchema
525
456
  });
526
- var stxGetAccountsRequestMessageSchema = v8.object({
457
+ var getAddressesRequestMessageSchema = v6.object({
527
458
  ...rpcRequestMessageSchema.entries,
528
- ...v8.object({
529
- method: v8.literal(stxGetAccountsMethodName),
530
- params: stxGetAccountsParamsSchema,
531
- id: v8.string()
459
+ ...v6.object({
460
+ method: v6.literal(getAddressesMethodName),
461
+ params: getAddressesParamsSchema,
462
+ id: v6.string()
532
463
  }).entries
533
464
  });
534
-
535
- // src/request/types/stxMethods/getAddresses.ts
536
- import * as v9 from "valibot";
465
+ var signMessageMethodName = "signMessage";
466
+ var MessageSigningProtocols = /* @__PURE__ */ ((MessageSigningProtocols2) => {
467
+ MessageSigningProtocols2["ECDSA"] = "ECDSA";
468
+ MessageSigningProtocols2["BIP322"] = "BIP322";
469
+ return MessageSigningProtocols2;
470
+ })(MessageSigningProtocols || {});
471
+ var signMessageParamsSchema = v6.object({
472
+ /**
473
+ * The address used for signing.
474
+ **/
475
+ address: v6.string(),
476
+ /**
477
+ * The message to sign.
478
+ **/
479
+ message: v6.string(),
480
+ /**
481
+ * The protocol to use for signing the message.
482
+ */
483
+ protocol: v6.optional(v6.enum(MessageSigningProtocols))
484
+ });
485
+ var signMessageResultSchema = v6.object({
486
+ /**
487
+ * The signature of the message.
488
+ */
489
+ signature: v6.string(),
490
+ /**
491
+ * hash of the message.
492
+ */
493
+ messageHash: v6.string(),
494
+ /**
495
+ * The address used for signing.
496
+ */
497
+ address: v6.string(),
498
+ /**
499
+ * The protocol to use for signing the message.
500
+ */
501
+ protocol: v6.enum(MessageSigningProtocols)
502
+ });
503
+ var signMessageRequestMessageSchema = v6.object({
504
+ ...rpcRequestMessageSchema.entries,
505
+ ...v6.object({
506
+ method: v6.literal(signMessageMethodName),
507
+ params: signMessageParamsSchema,
508
+ id: v6.string()
509
+ }).entries
510
+ });
511
+ var sendTransferMethodName = "sendTransfer";
512
+ var sendTransferParamsSchema = v6.object({
513
+ /**
514
+ * Array of recipients to send to.
515
+ * The amount to send to each recipient is in satoshis.
516
+ */
517
+ recipients: v6.array(
518
+ v6.object({
519
+ address: v6.string(),
520
+ amount: v6.number()
521
+ })
522
+ )
523
+ });
524
+ var sendTransferResultSchema = v6.object({
525
+ /**
526
+ * The transaction id as a hex-encoded string.
527
+ */
528
+ txid: v6.string()
529
+ });
530
+ var sendTransferRequestMessageSchema = v6.object({
531
+ ...rpcRequestMessageSchema.entries,
532
+ ...v6.object({
533
+ method: v6.literal(sendTransferMethodName),
534
+ params: sendTransferParamsSchema,
535
+ id: v6.string()
536
+ }).entries
537
+ });
538
+ var signPsbtMethodName = "signPsbt";
539
+ var signPsbtParamsSchema = v6.object({
540
+ /**
541
+ * The base64 encoded PSBT to sign.
542
+ */
543
+ psbt: v6.string(),
544
+ /**
545
+ * The inputs to sign.
546
+ * The key is the address and the value is an array of indexes of the inputs to sign.
547
+ */
548
+ signInputs: v6.optional(v6.record(v6.string(), v6.array(v6.number()))),
549
+ /**
550
+ * Whether to broadcast the transaction after signing.
551
+ **/
552
+ broadcast: v6.optional(v6.boolean())
553
+ });
554
+ var signPsbtResultSchema = v6.object({
555
+ /**
556
+ * The base64 encoded PSBT after signing.
557
+ */
558
+ psbt: v6.string(),
559
+ /**
560
+ * The transaction id as a hex-encoded string.
561
+ * This is only returned if the transaction was broadcast.
562
+ **/
563
+ txid: v6.optional(v6.string())
564
+ });
565
+ var signPsbtRequestMessageSchema = v6.object({
566
+ ...rpcRequestMessageSchema.entries,
567
+ ...v6.object({
568
+ method: v6.literal(signPsbtMethodName),
569
+ params: signPsbtParamsSchema,
570
+ id: v6.string()
571
+ }).entries
572
+ });
573
+ var getAccountsMethodName = "getAccounts";
574
+ var getAccountsParamsSchema = v6.object({
575
+ /**
576
+ * The purposes for which to generate addresses. See
577
+ * {@linkcode AddressPurpose} for available purposes.
578
+ */
579
+ purposes: v6.array(v6.enum(AddressPurpose)),
580
+ /**
581
+ * A message to be displayed to the user in the request prompt.
582
+ */
583
+ message: v6.optional(v6.string())
584
+ });
585
+ var getAccountsResultSchema = v6.array(
586
+ v6.object({
587
+ ...addressSchema.entries,
588
+ ...v6.object({
589
+ walletType: walletTypeSchema
590
+ }).entries
591
+ })
592
+ );
593
+ var getAccountsRequestMessageSchema = v6.object({
594
+ ...rpcRequestMessageSchema.entries,
595
+ ...v6.object({
596
+ method: v6.literal(getAccountsMethodName),
597
+ params: getAccountsParamsSchema,
598
+ id: v6.string()
599
+ }).entries
600
+ });
601
+ var getBalanceMethodName = "getBalance";
602
+ var getBalanceParamsSchema = v6.nullish(v6.null());
603
+ var getBalanceResultSchema = v6.object({
604
+ /**
605
+ * The confirmed balance of the wallet in sats. Using a string due to chrome
606
+ * messages not supporting bigint
607
+ * (https://issues.chromium.org/issues/40116184).
608
+ */
609
+ confirmed: v6.string(),
610
+ /**
611
+ * The unconfirmed balance of the wallet in sats. Using a string due to chrome
612
+ * messages not supporting bigint
613
+ * (https://issues.chromium.org/issues/40116184).
614
+ */
615
+ unconfirmed: v6.string(),
616
+ /**
617
+ * The total balance (both confirmed and unconfrimed UTXOs) of the wallet in
618
+ * sats. Using a string due to chrome messages not supporting bigint
619
+ * (https://issues.chromium.org/issues/40116184).
620
+ */
621
+ total: v6.string()
622
+ });
623
+ var getBalanceRequestMessageSchema = v6.object({
624
+ ...rpcRequestMessageSchema.entries,
625
+ ...v6.object({
626
+ method: v6.literal(getBalanceMethodName),
627
+ id: v6.string()
628
+ }).entries
629
+ });
630
+
631
+ // src/request/types/ordinalsMethods.ts
632
+ import * as v7 from "valibot";
633
+ var getInscriptionsMethodName = "ord_getInscriptions";
634
+ var getInscriptionsParamsSchema = v7.object({
635
+ offset: v7.number(),
636
+ limit: v7.number()
637
+ });
638
+ var getInscriptionsResultSchema = v7.object({
639
+ total: v7.number(),
640
+ limit: v7.number(),
641
+ offset: v7.number(),
642
+ inscriptions: v7.array(
643
+ v7.object({
644
+ inscriptionId: v7.string(),
645
+ inscriptionNumber: v7.string(),
646
+ address: v7.string(),
647
+ collectionName: v7.optional(v7.string()),
648
+ postage: v7.string(),
649
+ contentLength: v7.string(),
650
+ contentType: v7.string(),
651
+ timestamp: v7.number(),
652
+ offset: v7.number(),
653
+ genesisTransaction: v7.string(),
654
+ output: v7.string()
655
+ })
656
+ )
657
+ });
658
+ var getInscriptionsRequestMessageSchema = v7.object({
659
+ ...rpcRequestMessageSchema.entries,
660
+ ...v7.object({
661
+ method: v7.literal(getInscriptionsMethodName),
662
+ params: getInscriptionsParamsSchema,
663
+ id: v7.string()
664
+ }).entries
665
+ });
666
+ var sendInscriptionsMethodName = "ord_sendInscriptions";
667
+ var sendInscriptionsParamsSchema = v7.object({
668
+ transfers: v7.array(
669
+ v7.object({
670
+ address: v7.string(),
671
+ inscriptionId: v7.string()
672
+ })
673
+ )
674
+ });
675
+ var sendInscriptionsResultSchema = v7.object({
676
+ txid: v7.string()
677
+ });
678
+ var sendInscriptionsRequestMessageSchema = v7.object({
679
+ ...rpcRequestMessageSchema.entries,
680
+ ...v7.object({
681
+ method: v7.literal(sendInscriptionsMethodName),
682
+ params: sendInscriptionsParamsSchema,
683
+ id: v7.string()
684
+ }).entries
685
+ });
686
+
687
+ // src/request/types/runesMethods/etch.ts
688
+ import * as v8 from "valibot";
689
+ var runesEtchMethodName = "runes_etch";
690
+ var etchTermsSchema = v8.object({
691
+ amount: v8.string(),
692
+ cap: v8.string(),
693
+ heightStart: v8.optional(v8.string()),
694
+ heightEnd: v8.optional(v8.string()),
695
+ offsetStart: v8.optional(v8.string()),
696
+ offsetEnd: v8.optional(v8.string())
697
+ });
698
+ var inscriptionDetailsSchema = v8.object({
699
+ contentType: v8.string(),
700
+ contentBase64: v8.string()
701
+ });
702
+ var runesEtchParamsSchema = v8.object({
703
+ runeName: v8.string(),
704
+ divisibility: v8.optional(v8.number()),
705
+ symbol: v8.optional(v8.string()),
706
+ premine: v8.optional(v8.string()),
707
+ isMintable: v8.boolean(),
708
+ delegateInscriptionId: v8.optional(v8.string()),
709
+ destinationAddress: v8.string(),
710
+ refundAddress: v8.string(),
711
+ feeRate: v8.number(),
712
+ appServiceFee: v8.optional(v8.number()),
713
+ appServiceFeeAddress: v8.optional(v8.string()),
714
+ terms: v8.optional(etchTermsSchema),
715
+ inscriptionDetails: v8.optional(inscriptionDetailsSchema),
716
+ network: v8.optional(v8.enum(BitcoinNetworkType))
717
+ });
718
+ var runesEtchResultSchema = v8.object({
719
+ orderId: v8.string(),
720
+ fundTransactionId: v8.string(),
721
+ fundingAddress: v8.string()
722
+ });
723
+ var runesEtchRequestMessageSchema = v8.object({
724
+ ...rpcRequestMessageSchema.entries,
725
+ ...v8.object({
726
+ method: v8.literal(runesEtchMethodName),
727
+ params: runesEtchParamsSchema,
728
+ id: v8.string()
729
+ }).entries
730
+ });
731
+
732
+ // src/request/types/runesMethods/getBalance.ts
733
+ import * as v9 from "valibot";
734
+ var runesGetBalanceMethodName = "runes_getBalance";
735
+ var runesGetBalanceParamsSchema = v9.nullish(v9.null());
736
+ var runesGetBalanceResultSchema = v9.object({
737
+ balances: v9.array(
738
+ v9.object({
739
+ runeName: v9.string(),
740
+ amount: v9.string(),
741
+ divisibility: v9.number(),
742
+ symbol: v9.string(),
743
+ inscriptionId: v9.nullish(v9.string()),
744
+ spendableBalance: v9.string()
745
+ })
746
+ )
747
+ });
748
+ var runesGetBalanceRequestMessageSchema = v9.object({
749
+ ...rpcRequestMessageSchema.entries,
750
+ ...v9.object({
751
+ method: v9.literal(runesGetBalanceMethodName),
752
+ params: runesGetBalanceParamsSchema,
753
+ id: v9.string()
754
+ }).entries
755
+ });
756
+
757
+ // src/request/types/runesMethods/mint.ts
758
+ import * as v10 from "valibot";
759
+ var runesMintMethodName = "runes_mint";
760
+ var runesMintParamsSchema = v10.object({
761
+ appServiceFee: v10.optional(v10.number()),
762
+ appServiceFeeAddress: v10.optional(v10.string()),
763
+ destinationAddress: v10.string(),
764
+ feeRate: v10.number(),
765
+ refundAddress: v10.string(),
766
+ repeats: v10.number(),
767
+ runeName: v10.string(),
768
+ network: v10.optional(v10.enum(BitcoinNetworkType))
769
+ });
770
+ var runesMintResultSchema = v10.object({
771
+ orderId: v10.string(),
772
+ fundTransactionId: v10.string(),
773
+ fundingAddress: v10.string()
774
+ });
775
+ var runesMintRequestMessageSchema = v10.object({
776
+ ...rpcRequestMessageSchema.entries,
777
+ ...v10.object({
778
+ method: v10.literal(runesMintMethodName),
779
+ params: runesMintParamsSchema,
780
+ id: v10.string()
781
+ }).entries
782
+ });
783
+
784
+ // src/request/types/runesMethods/transfer.ts
785
+ import * as v11 from "valibot";
786
+ var runesTransferMethodName = "runes_transfer";
787
+ var runesTransferParamsSchema = v11.object({
788
+ recipients: v11.array(
789
+ v11.object({
790
+ runeName: v11.string(),
791
+ amount: v11.string(),
792
+ address: v11.string()
793
+ })
794
+ )
795
+ });
796
+ var runesTransferResultSchema = v11.object({
797
+ txid: v11.string()
798
+ });
799
+ var runesTransferRequestMessageSchema = v11.object({
800
+ ...rpcRequestMessageSchema.entries,
801
+ ...v11.object({
802
+ method: v11.literal(runesTransferMethodName),
803
+ params: runesTransferParamsSchema,
804
+ id: v11.string()
805
+ }).entries
806
+ });
807
+
808
+ // src/request/types/sparkMethods/getAddresses.ts
809
+ import * as v12 from "valibot";
810
+ var sparkGetAddressesMethodName = "spark_getAddresses";
811
+ var sparkGetAddressesParamsSchema = v12.nullish(
812
+ v12.object({
813
+ /**
814
+ * A message to be displayed to the user in the request prompt.
815
+ */
816
+ message: v12.optional(v12.string())
817
+ })
818
+ );
819
+ var sparkGetAddressesResultSchema = v12.object({
820
+ /**
821
+ * The addresses generated for the given purposes.
822
+ */
823
+ addresses: v12.array(addressSchema),
824
+ network: getNetworkResultSchema
825
+ });
826
+ var sparkGetAddressesRequestMessageSchema = v12.object({
827
+ ...rpcRequestMessageSchema.entries,
828
+ ...v12.object({
829
+ method: v12.literal(sparkGetAddressesMethodName),
830
+ params: sparkGetAddressesParamsSchema,
831
+ id: v12.string()
832
+ }).entries
833
+ });
834
+
835
+ // src/request/types/sparkMethods/getBalance.ts
836
+ import * as v13 from "valibot";
837
+ var sparkGetBalanceMethodName = "spark_getBalance";
838
+ var sparkGetBalanceParamsSchema = v13.nullish(v13.null());
839
+ var sparkGetBalanceResultSchema = v13.object({
840
+ /**
841
+ * The Spark Bitcoin address balance in sats in string form.
842
+ */
843
+ balance: v13.string(),
844
+ tokenBalances: v13.array(
845
+ v13.object({
846
+ /* The address balance of the token in string form as it can overflow a js number */
847
+ balance: v13.string(),
848
+ tokenMetadata: v13.object({
849
+ tokenIdentifier: v13.string(),
850
+ tokenName: v13.string(),
851
+ tokenTicker: v13.string(),
852
+ decimals: v13.number(),
853
+ maxSupply: v13.string()
854
+ })
855
+ })
856
+ )
857
+ });
858
+ var sparkGetBalanceRequestMessageSchema = v13.object({
859
+ ...rpcRequestMessageSchema.entries,
860
+ ...v13.object({
861
+ method: v13.literal(sparkGetBalanceMethodName),
862
+ params: sparkGetBalanceParamsSchema,
863
+ id: v13.string()
864
+ }).entries
865
+ });
866
+
867
+ // src/request/types/sparkMethods/transfer.ts
868
+ import * as v14 from "valibot";
869
+ var sparkTransferMethodName = "spark_transfer";
870
+ var sparkTransferParamsSchema = v14.object({
871
+ /**
872
+ * Amount of SATS to transfer as a string or number.
873
+ */
874
+ amountSats: v14.union([v14.number(), v14.string()]),
875
+ /**
876
+ * The recipient's spark address.
877
+ */
878
+ receiverSparkAddress: v14.string()
879
+ });
880
+ var sparkTransferResultSchema = v14.object({
881
+ /**
882
+ * The ID of the transaction.
883
+ */
884
+ id: v14.string()
885
+ });
886
+ var sparkTransferRequestMessageSchema = v14.object({
887
+ ...rpcRequestMessageSchema.entries,
888
+ ...v14.object({
889
+ method: v14.literal(sparkTransferMethodName),
890
+ params: sparkTransferParamsSchema,
891
+ id: v14.string()
892
+ }).entries
893
+ });
894
+
895
+ // src/request/types/sparkMethods/transferToken.ts
896
+ import * as v15 from "valibot";
897
+ var sparkTransferTokenMethodName = "spark_transferToken";
898
+ var sparkTransferTokenParamsSchema = v15.object({
899
+ /**
900
+ * Amount of units of the token to transfer as a string or number.
901
+ */
902
+ tokenAmount: v15.union([v15.number(), v15.string()]),
903
+ /**
904
+ * The Bech32m token identifier.
905
+ */
906
+ tokenIdentifier: v15.string(),
907
+ /**
908
+ * The recipient's spark address.
909
+ */
910
+ receiverSparkAddress: v15.string()
911
+ });
912
+ var sparkTransferTokenResultSchema = v15.object({
913
+ /**
914
+ * The ID of the transaction.
915
+ */
916
+ id: v15.string()
917
+ });
918
+ var sparkTransferTokenRequestMessageSchema = v15.object({
919
+ ...rpcRequestMessageSchema.entries,
920
+ ...v15.object({
921
+ method: v15.literal(sparkTransferTokenMethodName),
922
+ params: sparkTransferTokenParamsSchema,
923
+ id: v15.string()
924
+ }).entries
925
+ });
926
+
927
+ // src/request/types/stxMethods/callContract.ts
928
+ import * as v16 from "valibot";
929
+ var stxCallContractMethodName = "stx_callContract";
930
+ var stxCallContractParamsSchema = v16.object({
931
+ /**
932
+ * The contract principal.
933
+ *
934
+ * E.g. `"SPKE...GD5C.my-contract"`
935
+ */
936
+ contract: v16.string(),
937
+ /**
938
+ * The name of the function to call.
939
+ *
940
+ * Note: spec changes ongoing,
941
+ * https://github.com/stacksgov/sips/pull/166#pullrequestreview-1914236999
942
+ */
943
+ functionName: v16.string(),
944
+ /**
945
+ * @deprecated in favor of `functionArgs` for @stacks/connect compatibility
946
+ */
947
+ arguments: v16.optional(v16.array(v16.string())),
948
+ /**
949
+ * The function's arguments. The arguments are expected to be hex-encoded
950
+ * strings of Clarity values.
951
+ *
952
+ * To convert Clarity values to their hex representation, the `cvToHex`
953
+ * helper from the `@stacks/transactions` package may be helpful.
954
+ *
955
+ * ```js
956
+ * import { cvToHex } from '@stacks/transactions';
957
+ *
958
+ * const functionArgs = [someClarityValue1, someClarityValue2];
959
+ * const hexArgs = functionArgs.map(cvToHex);
960
+ * ```
961
+ */
962
+ functionArgs: v16.optional(v16.array(v16.string())),
963
+ /**
964
+ * The post conditions to apply to the contract call.
965
+ */
966
+ postConditions: v16.optional(v16.array(v16.string())),
967
+ /**
968
+ * The mode to apply to the post conditions.
969
+ */
970
+ postConditionMode: v16.optional(v16.union([v16.literal("allow"), v16.literal("deny")]))
971
+ });
972
+ var stxCallContractResultSchema = v16.object({
973
+ /**
974
+ * The ID of the transaction.
975
+ */
976
+ txid: v16.string(),
977
+ /**
978
+ * A Stacks transaction as a hex-encoded string.
979
+ */
980
+ transaction: v16.string()
981
+ });
982
+ var stxCallContractRequestMessageSchema = v16.object({
983
+ ...rpcRequestMessageSchema.entries,
984
+ ...v16.object({
985
+ method: v16.literal(stxCallContractMethodName),
986
+ params: stxCallContractParamsSchema,
987
+ id: v16.string()
988
+ }).entries
989
+ });
990
+
991
+ // src/request/types/stxMethods/deployContract.ts
992
+ import * as v17 from "valibot";
993
+ var stxDeployContractMethodName = "stx_deployContract";
994
+ var stxDeployContractParamsSchema = v17.object({
995
+ /**
996
+ * Name of the contract.
997
+ */
998
+ name: v17.string(),
999
+ /**
1000
+ * The source code of the Clarity contract.
1001
+ */
1002
+ clarityCode: v17.string(),
1003
+ /**
1004
+ * The version of the Clarity contract.
1005
+ */
1006
+ clarityVersion: v17.optional(v17.number()),
1007
+ /**
1008
+ * The post conditions to apply to the contract call.
1009
+ */
1010
+ postConditions: v17.optional(v17.array(v17.string())),
1011
+ /**
1012
+ * The mode to apply to the post conditions.
1013
+ */
1014
+ postConditionMode: v17.optional(v17.union([v17.literal("allow"), v17.literal("deny")]))
1015
+ });
1016
+ var stxDeployContractResultSchema = v17.object({
1017
+ /**
1018
+ * The ID of the transaction.
1019
+ */
1020
+ txid: v17.string(),
1021
+ /**
1022
+ * A Stacks transaction as a hex-encoded string.
1023
+ */
1024
+ transaction: v17.string()
1025
+ });
1026
+ var stxDeployContractRequestMessageSchema = v17.object({
1027
+ ...rpcRequestMessageSchema.entries,
1028
+ ...v17.object({
1029
+ method: v17.literal(stxDeployContractMethodName),
1030
+ params: stxDeployContractParamsSchema,
1031
+ id: v17.string()
1032
+ }).entries
1033
+ });
1034
+
1035
+ // src/request/types/stxMethods/getAccounts.ts
1036
+ import * as v18 from "valibot";
1037
+ var stxGetAccountsMethodName = "stx_getAccounts";
1038
+ var stxGetAccountsParamsSchema = v18.nullish(v18.null());
1039
+ var stxGetAccountsResultSchema = v18.object({
1040
+ /**
1041
+ * The addresses generated for the given purposes.
1042
+ */
1043
+ addresses: v18.array(
1044
+ v18.object({
1045
+ address: v18.string(),
1046
+ publicKey: v18.string(),
1047
+ gaiaHubUrl: v18.string(),
1048
+ gaiaAppKey: v18.string()
1049
+ })
1050
+ ),
1051
+ network: getNetworkResultSchema
1052
+ });
1053
+ var stxGetAccountsRequestMessageSchema = v18.object({
1054
+ ...rpcRequestMessageSchema.entries,
1055
+ ...v18.object({
1056
+ method: v18.literal(stxGetAccountsMethodName),
1057
+ params: stxGetAccountsParamsSchema,
1058
+ id: v18.string()
1059
+ }).entries
1060
+ });
1061
+
1062
+ // src/request/types/stxMethods/getAddresses.ts
1063
+ import * as v19 from "valibot";
537
1064
  var stxGetAddressesMethodName = "stx_getAddresses";
538
- var stxGetAddressesParamsSchema = v9.nullish(
539
- v9.object({
1065
+ var stxGetAddressesParamsSchema = v19.nullish(
1066
+ v19.object({
540
1067
  /**
541
1068
  * A message to be displayed to the user in the request prompt.
542
1069
  */
543
- message: v9.optional(v9.string())
1070
+ message: v19.optional(v19.string())
544
1071
  })
545
1072
  );
546
- var stxGetAddressesResultSchema = v9.object({
1073
+ var stxGetAddressesResultSchema = v19.object({
547
1074
  /**
548
1075
  * The addresses generated for the given purposes.
549
1076
  */
550
- addresses: v9.array(addressSchema),
1077
+ addresses: v19.array(addressSchema),
551
1078
  network: getNetworkResultSchema
552
1079
  });
553
- var stxGetAddressesRequestMessageSchema = v9.object({
1080
+ var stxGetAddressesRequestMessageSchema = v19.object({
554
1081
  ...rpcRequestMessageSchema.entries,
555
- ...v9.object({
556
- method: v9.literal(stxGetAddressesMethodName),
1082
+ ...v19.object({
1083
+ method: v19.literal(stxGetAddressesMethodName),
557
1084
  params: stxGetAddressesParamsSchema,
558
- id: v9.string()
1085
+ id: v19.string()
559
1086
  }).entries
560
1087
  });
561
1088
 
562
1089
  // src/request/types/stxMethods/signMessage.ts
563
- import * as v10 from "valibot";
1090
+ import * as v20 from "valibot";
564
1091
  var stxSignMessageMethodName = "stx_signMessage";
565
- var stxSignMessageParamsSchema = v10.object({
1092
+ var stxSignMessageParamsSchema = v20.object({
566
1093
  /**
567
1094
  * The message to sign.
568
1095
  */
569
- message: v10.string()
1096
+ message: v20.string()
570
1097
  });
571
- var stxSignMessageResultSchema = v10.object({
1098
+ var stxSignMessageResultSchema = v20.object({
572
1099
  /**
573
1100
  * The signature of the message.
574
1101
  */
575
- signature: v10.string(),
1102
+ signature: v20.string(),
576
1103
  /**
577
1104
  * The public key used to sign the message.
578
1105
  */
579
- publicKey: v10.string()
1106
+ publicKey: v20.string()
580
1107
  });
581
- var stxSignMessageRequestMessageSchema = v10.object({
1108
+ var stxSignMessageRequestMessageSchema = v20.object({
582
1109
  ...rpcRequestMessageSchema.entries,
583
- ...v10.object({
584
- method: v10.literal(stxSignMessageMethodName),
1110
+ ...v20.object({
1111
+ method: v20.literal(stxSignMessageMethodName),
585
1112
  params: stxSignMessageParamsSchema,
586
- id: v10.string()
1113
+ id: v20.string()
587
1114
  }).entries
588
1115
  });
589
1116
 
590
1117
  // src/request/types/stxMethods/signStructuredMessage.ts
591
- import * as v11 from "valibot";
1118
+ import * as v21 from "valibot";
592
1119
  var stxSignStructuredMessageMethodName = "stx_signStructuredMessage";
593
- var stxSignStructuredMessageParamsSchema = v11.object({
1120
+ var stxSignStructuredMessageParamsSchema = v21.object({
594
1121
  /**
595
1122
  * The domain to be signed.
596
1123
  */
597
- domain: v11.string(),
1124
+ domain: v21.string(),
598
1125
  /**
599
1126
  * Message payload to be signed.
600
1127
  */
601
- message: v11.string(),
1128
+ message: v21.string(),
602
1129
  /**
603
1130
  * The public key to sign the message with.
604
1131
  */
605
- publicKey: v11.optional(v11.string())
1132
+ publicKey: v21.optional(v21.string())
606
1133
  });
607
- var stxSignStructuredMessageResultSchema = v11.object({
1134
+ var stxSignStructuredMessageResultSchema = v21.object({
608
1135
  /**
609
1136
  * Signature of the message.
610
1137
  */
611
- signature: v11.string(),
1138
+ signature: v21.string(),
612
1139
  /**
613
1140
  * Public key as hex-encoded string.
614
1141
  */
615
- publicKey: v11.string()
1142
+ publicKey: v21.string()
616
1143
  });
617
- var stxSignStructuredMessageRequestMessageSchema = v11.object({
1144
+ var stxSignStructuredMessageRequestMessageSchema = v21.object({
618
1145
  ...rpcRequestMessageSchema.entries,
619
- ...v11.object({
620
- method: v11.literal(stxSignStructuredMessageMethodName),
1146
+ ...v21.object({
1147
+ method: v21.literal(stxSignStructuredMessageMethodName),
621
1148
  params: stxSignStructuredMessageParamsSchema,
622
- id: v11.string()
1149
+ id: v21.string()
623
1150
  }).entries
624
1151
  });
625
1152
 
626
1153
  // src/request/types/stxMethods/signTransaction.ts
627
- import * as v12 from "valibot";
1154
+ import * as v22 from "valibot";
628
1155
  var stxSignTransactionMethodName = "stx_signTransaction";
629
- var stxSignTransactionParamsSchema = v12.object({
1156
+ var stxSignTransactionParamsSchema = v22.object({
630
1157
  /**
631
1158
  * The transaction to sign as a hex-encoded string.
632
1159
  */
633
- transaction: v12.string(),
1160
+ transaction: v22.string(),
634
1161
  /**
635
1162
  * The public key to sign the transaction with. The wallet may use any key
636
1163
  * when not provided.
637
1164
  */
638
- pubkey: v12.optional(v12.string()),
1165
+ pubkey: v22.optional(v22.string()),
639
1166
  /**
640
1167
  * Whether to broadcast the transaction after signing. Defaults to `true`.
641
1168
  */
642
- broadcast: v12.optional(v12.boolean())
1169
+ broadcast: v22.optional(v22.boolean())
643
1170
  });
644
- var stxSignTransactionResultSchema = v12.object({
1171
+ var stxSignTransactionResultSchema = v22.object({
645
1172
  /**
646
1173
  * The signed transaction as a hex-encoded string.
647
1174
  */
648
- transaction: v12.string()
1175
+ transaction: v22.string()
649
1176
  });
650
- var stxSignTransactionRequestMessageSchema = v12.object({
1177
+ var stxSignTransactionRequestMessageSchema = v22.object({
651
1178
  ...rpcRequestMessageSchema.entries,
652
- ...v12.object({
653
- method: v12.literal(stxSignTransactionMethodName),
1179
+ ...v22.object({
1180
+ method: v22.literal(stxSignTransactionMethodName),
654
1181
  params: stxSignTransactionParamsSchema,
655
- id: v12.string()
1182
+ id: v22.string()
656
1183
  }).entries
657
1184
  });
658
1185
 
659
1186
  // src/request/types/stxMethods/signTransactions.ts
660
- import * as v13 from "valibot";
1187
+ import * as v23 from "valibot";
661
1188
  var stxSignTransactionsMethodName = "stx_signTransactions";
662
- var stxSignTransactionsParamsSchema = v13.object({
1189
+ var stxSignTransactionsParamsSchema = v23.object({
663
1190
  /**
664
1191
  * The transactions to sign as hex-encoded strings.
665
1192
  */
666
- transactions: v13.pipe(
667
- v13.array(
668
- v13.pipe(
669
- v13.string(),
670
- v13.check((hex) => {
1193
+ transactions: v23.pipe(
1194
+ v23.array(
1195
+ v23.pipe(
1196
+ v23.string(),
1197
+ v23.check((hex) => {
671
1198
  return true;
672
1199
  }, "Invalid hex-encoded Stacks transaction.")
673
1200
  )
674
1201
  ),
675
- v13.minLength(1)
1202
+ v23.minLength(1)
676
1203
  ),
677
1204
  /**
678
1205
  * Whether the signed transactions should be broadcast after signing. Defaults
679
1206
  * to `true`.
680
1207
  */
681
- broadcast: v13.optional(v13.boolean())
1208
+ broadcast: v23.optional(v23.boolean())
682
1209
  });
683
- var stxSignTransactionsResultSchema = v13.object({
1210
+ var stxSignTransactionsResultSchema = v23.object({
684
1211
  /**
685
1212
  * The signed transactions as hex-encoded strings, in the same order as in the
686
1213
  * sign request.
687
1214
  */
688
- transactions: v13.array(v13.string())
1215
+ transactions: v23.array(v23.string())
689
1216
  });
690
- var stxSignTransactionsRequestMessageSchema = v13.object({
1217
+ var stxSignTransactionsRequestMessageSchema = v23.object({
691
1218
  ...rpcRequestMessageSchema.entries,
692
- ...v13.object({
693
- method: v13.literal(stxSignTransactionsMethodName),
1219
+ ...v23.object({
1220
+ method: v23.literal(stxSignTransactionsMethodName),
694
1221
  params: stxSignTransactionsParamsSchema,
695
- id: v13.string()
1222
+ id: v23.string()
696
1223
  }).entries
697
1224
  });
698
1225
 
699
1226
  // src/request/types/stxMethods/transferStx.ts
700
- import * as v14 from "valibot";
1227
+ import * as v24 from "valibot";
701
1228
  var stxTransferStxMethodName = "stx_transferStx";
702
- var stxTransferStxParamsSchema = v14.object({
1229
+ var stxTransferStxParamsSchema = v24.object({
703
1230
  /**
704
1231
  * Amount of STX tokens to transfer in microstacks as a string. Anything
705
1232
  * parseable by `BigInt` is acceptable.
@@ -712,23 +1239,23 @@ var stxTransferStxParamsSchema = v14.object({
712
1239
  * const amount3 = '1234';
713
1240
  * ```
714
1241
  */
715
- amount: v14.union([v14.number(), v14.string()]),
1242
+ amount: v24.union([v24.number(), v24.string()]),
716
1243
  /**
717
- * The recipeint's principal.
1244
+ * The recipient's principal.
718
1245
  */
719
- recipient: v14.string(),
1246
+ recipient: v24.string(),
720
1247
  /**
721
1248
  * A string representing the memo.
722
1249
  */
723
- memo: v14.optional(v14.string()),
1250
+ memo: v24.optional(v24.string()),
724
1251
  /**
725
1252
  * Version of parameter format.
726
1253
  */
727
- version: v14.optional(v14.string()),
1254
+ version: v24.optional(v24.string()),
728
1255
  /**
729
1256
  * The mode of the post conditions.
730
1257
  */
731
- postConditionMode: v14.optional(v14.number()),
1258
+ postConditionMode: v24.optional(v24.number()),
732
1259
  /**
733
1260
  * A hex-encoded string representing the post conditions.
734
1261
  *
@@ -741,425 +1268,29 @@ var stxTransferStxParamsSchema = v14.object({
741
1268
  * const hexPostCondition = serializePostCondition(postCondition).toString('hex');
742
1269
  * ```
743
1270
  */
744
- postConditions: v14.optional(v14.array(v14.string())),
1271
+ postConditions: v24.optional(v24.array(v24.string())),
745
1272
  /**
746
1273
  * The public key to sign the transaction with. The wallet may use any key
747
1274
  * when not provided.
748
1275
  */
749
- pubkey: v14.optional(v14.string())
1276
+ pubkey: v24.optional(v24.string())
750
1277
  });
751
- var stxTransferStxResultSchema = v14.object({
1278
+ var stxTransferStxResultSchema = v24.object({
752
1279
  /**
753
1280
  * The ID of the transaction.
754
1281
  */
755
- txid: v14.string(),
1282
+ txid: v24.string(),
756
1283
  /**
757
1284
  * A Stacks transaction as a hex-encoded string.
758
1285
  */
759
- transaction: v14.string()
1286
+ transaction: v24.string()
760
1287
  });
761
- var stxTransferStxRequestMessageSchema = v14.object({
1288
+ var stxTransferStxRequestMessageSchema = v24.object({
762
1289
  ...rpcRequestMessageSchema.entries,
763
- ...v14.object({
764
- method: v14.literal(stxTransferStxMethodName),
1290
+ ...v24.object({
1291
+ method: v24.literal(stxTransferStxMethodName),
765
1292
  params: stxTransferStxParamsSchema,
766
- id: v14.string()
767
- }).entries
768
- });
769
-
770
- // src/request/types/btcMethods.ts
771
- import * as v15 from "valibot";
772
- var getInfoMethodName = "getInfo";
773
- var getInfoParamsSchema = v15.nullish(v15.null());
774
- var getInfoResultSchema = v15.object({
775
- /**
776
- * Version of the wallet.
777
- */
778
- version: v15.string(),
779
- /**
780
- * [WBIP](https://wbips.netlify.app/wbips/WBIP002) methods supported by the wallet.
781
- */
782
- methods: v15.optional(v15.array(v15.string())),
783
- /**
784
- * List of WBIP standards supported by the wallet. Not currently used.
785
- */
786
- supports: v15.array(v15.string())
787
- });
788
- var getInfoRequestMessageSchema = v15.object({
789
- ...rpcRequestMessageSchema.entries,
790
- ...v15.object({
791
- method: v15.literal(getInfoMethodName),
792
- params: getInfoParamsSchema,
793
- id: v15.string()
794
- }).entries
795
- });
796
- var getAddressesMethodName = "getAddresses";
797
- var getAddressesParamsSchema = v15.object({
798
- /**
799
- * The purposes for which to generate addresses. See
800
- * {@linkcode AddressPurpose} for available purposes.
801
- */
802
- purposes: v15.array(v15.enum(AddressPurpose)),
803
- /**
804
- * A message to be displayed to the user in the request prompt.
805
- */
806
- message: v15.optional(v15.string())
807
- });
808
- var getAddressesResultSchema = v15.object({
809
- /**
810
- * The addresses generated for the given purposes.
811
- */
812
- addresses: v15.array(addressSchema),
813
- network: getNetworkResultSchema
814
- });
815
- var getAddressesRequestMessageSchema = v15.object({
816
- ...rpcRequestMessageSchema.entries,
817
- ...v15.object({
818
- method: v15.literal(getAddressesMethodName),
819
- params: getAddressesParamsSchema,
820
- id: v15.string()
821
- }).entries
822
- });
823
- var signMessageMethodName = "signMessage";
824
- var MessageSigningProtocols = /* @__PURE__ */ ((MessageSigningProtocols2) => {
825
- MessageSigningProtocols2["ECDSA"] = "ECDSA";
826
- MessageSigningProtocols2["BIP322"] = "BIP322";
827
- return MessageSigningProtocols2;
828
- })(MessageSigningProtocols || {});
829
- var signMessageParamsSchema = v15.object({
830
- /**
831
- * The address used for signing.
832
- **/
833
- address: v15.string(),
834
- /**
835
- * The message to sign.
836
- **/
837
- message: v15.string(),
838
- /**
839
- * The protocol to use for signing the message.
840
- */
841
- protocol: v15.optional(v15.enum(MessageSigningProtocols))
842
- });
843
- var signMessageResultSchema = v15.object({
844
- /**
845
- * The signature of the message.
846
- */
847
- signature: v15.string(),
848
- /**
849
- * hash of the message.
850
- */
851
- messageHash: v15.string(),
852
- /**
853
- * The address used for signing.
854
- */
855
- address: v15.string(),
856
- /**
857
- * The protocol to use for signing the message.
858
- */
859
- protocol: v15.enum(MessageSigningProtocols)
860
- });
861
- var signMessageRequestMessageSchema = v15.object({
862
- ...rpcRequestMessageSchema.entries,
863
- ...v15.object({
864
- method: v15.literal(signMessageMethodName),
865
- params: signMessageParamsSchema,
866
- id: v15.string()
867
- }).entries
868
- });
869
- var sendTransferMethodName = "sendTransfer";
870
- var sendTransferParamsSchema = v15.object({
871
- /**
872
- * Array of recipients to send to.
873
- * The amount to send to each recipient is in satoshis.
874
- */
875
- recipients: v15.array(
876
- v15.object({
877
- address: v15.string(),
878
- amount: v15.number()
879
- })
880
- )
881
- });
882
- var sendTransferResultSchema = v15.object({
883
- /**
884
- * The transaction id as a hex-encoded string.
885
- */
886
- txid: v15.string()
887
- });
888
- var sendTransferRequestMessageSchema = v15.object({
889
- ...rpcRequestMessageSchema.entries,
890
- ...v15.object({
891
- method: v15.literal(sendTransferMethodName),
892
- params: sendTransferParamsSchema,
893
- id: v15.string()
894
- }).entries
895
- });
896
- var signPsbtMethodName = "signPsbt";
897
- var signPsbtParamsSchema = v15.object({
898
- /**
899
- * The base64 encoded PSBT to sign.
900
- */
901
- psbt: v15.string(),
902
- /**
903
- * The inputs to sign.
904
- * The key is the address and the value is an array of indexes of the inputs to sign.
905
- */
906
- signInputs: v15.optional(v15.record(v15.string(), v15.array(v15.number()))),
907
- /**
908
- * Whether to broadcast the transaction after signing.
909
- **/
910
- broadcast: v15.optional(v15.boolean())
911
- });
912
- var signPsbtResultSchema = v15.object({
913
- /**
914
- * The base64 encoded PSBT after signing.
915
- */
916
- psbt: v15.string(),
917
- /**
918
- * The transaction id as a hex-encoded string.
919
- * This is only returned if the transaction was broadcast.
920
- **/
921
- txid: v15.optional(v15.string())
922
- });
923
- var signPsbtRequestMessageSchema = v15.object({
924
- ...rpcRequestMessageSchema.entries,
925
- ...v15.object({
926
- method: v15.literal(signPsbtMethodName),
927
- params: signPsbtParamsSchema,
928
- id: v15.string()
929
- }).entries
930
- });
931
- var getAccountsMethodName = "getAccounts";
932
- var getAccountsParamsSchema = v15.object({
933
- /**
934
- * The purposes for which to generate addresses. See
935
- * {@linkcode AddressPurpose} for available purposes.
936
- */
937
- purposes: v15.array(v15.enum(AddressPurpose)),
938
- /**
939
- * A message to be displayed to the user in the request prompt.
940
- */
941
- message: v15.optional(v15.string())
942
- });
943
- var getAccountsResultSchema = v15.array(
944
- v15.object({
945
- ...addressSchema.entries,
946
- ...v15.object({
947
- walletType: walletTypeSchema
948
- }).entries
949
- })
950
- );
951
- var getAccountsRequestMessageSchema = v15.object({
952
- ...rpcRequestMessageSchema.entries,
953
- ...v15.object({
954
- method: v15.literal(getAccountsMethodName),
955
- params: getAccountsParamsSchema,
956
- id: v15.string()
957
- }).entries
958
- });
959
- var getBalanceMethodName = "getBalance";
960
- var getBalanceParamsSchema = v15.nullish(v15.null());
961
- var getBalanceResultSchema = v15.object({
962
- /**
963
- * The confirmed balance of the wallet in sats. Using a string due to chrome
964
- * messages not supporting bigint
965
- * (https://issues.chromium.org/issues/40116184).
966
- */
967
- confirmed: v15.string(),
968
- /**
969
- * The unconfirmed balance of the wallet in sats. Using a string due to chrome
970
- * messages not supporting bigint
971
- * (https://issues.chromium.org/issues/40116184).
972
- */
973
- unconfirmed: v15.string(),
974
- /**
975
- * The total balance (both confirmed and unconfrimed UTXOs) of the wallet in
976
- * sats. Using a string due to chrome messages not supporting bigint
977
- * (https://issues.chromium.org/issues/40116184).
978
- */
979
- total: v15.string()
980
- });
981
- var getBalanceRequestMessageSchema = v15.object({
982
- ...rpcRequestMessageSchema.entries,
983
- ...v15.object({
984
- method: v15.literal(getBalanceMethodName),
985
- id: v15.string()
986
- }).entries
987
- });
988
-
989
- // src/request/types/runesMethods/etch.ts
990
- import * as v16 from "valibot";
991
- var runesEtchMethodName = "runes_etch";
992
- var etchTermsSchema = v16.object({
993
- amount: v16.string(),
994
- cap: v16.string(),
995
- heightStart: v16.optional(v16.string()),
996
- heightEnd: v16.optional(v16.string()),
997
- offsetStart: v16.optional(v16.string()),
998
- offsetEnd: v16.optional(v16.string())
999
- });
1000
- var inscriptionDetailsSchema = v16.object({
1001
- contentType: v16.string(),
1002
- contentBase64: v16.string()
1003
- });
1004
- var runesEtchParamsSchema = v16.object({
1005
- runeName: v16.string(),
1006
- divisibility: v16.optional(v16.number()),
1007
- symbol: v16.optional(v16.string()),
1008
- premine: v16.optional(v16.string()),
1009
- isMintable: v16.boolean(),
1010
- delegateInscriptionId: v16.optional(v16.string()),
1011
- destinationAddress: v16.string(),
1012
- refundAddress: v16.string(),
1013
- feeRate: v16.number(),
1014
- appServiceFee: v16.optional(v16.number()),
1015
- appServiceFeeAddress: v16.optional(v16.string()),
1016
- terms: v16.optional(etchTermsSchema),
1017
- inscriptionDetails: v16.optional(inscriptionDetailsSchema),
1018
- network: v16.optional(v16.enum(BitcoinNetworkType))
1019
- });
1020
- var runesEtchResultSchema = v16.object({
1021
- orderId: v16.string(),
1022
- fundTransactionId: v16.string(),
1023
- fundingAddress: v16.string()
1024
- });
1025
- var runesEtchRequestMessageSchema = v16.object({
1026
- ...rpcRequestMessageSchema.entries,
1027
- ...v16.object({
1028
- method: v16.literal(runesEtchMethodName),
1029
- params: runesEtchParamsSchema,
1030
- id: v16.string()
1031
- }).entries
1032
- });
1033
-
1034
- // src/request/types/runesMethods/getBalance.ts
1035
- import * as v17 from "valibot";
1036
- var runesGetBalanceMethodName = "runes_getBalance";
1037
- var runesGetBalanceParamsSchema = v17.nullish(v17.null());
1038
- var runesGetBalanceResultSchema = v17.object({
1039
- balances: v17.array(
1040
- v17.object({
1041
- runeName: v17.string(),
1042
- amount: v17.string(),
1043
- divisibility: v17.number(),
1044
- symbol: v17.string(),
1045
- inscriptionId: v17.nullish(v17.string()),
1046
- spendableBalance: v17.string()
1047
- })
1048
- )
1049
- });
1050
- var runesGetBalanceRequestMessageSchema = v17.object({
1051
- ...rpcRequestMessageSchema.entries,
1052
- ...v17.object({
1053
- method: v17.literal(runesGetBalanceMethodName),
1054
- params: runesGetBalanceParamsSchema,
1055
- id: v17.string()
1056
- }).entries
1057
- });
1058
-
1059
- // src/request/types/runesMethods/mint.ts
1060
- import * as v18 from "valibot";
1061
- var runesMintMethodName = "runes_mint";
1062
- var runesMintParamsSchema = v18.object({
1063
- appServiceFee: v18.optional(v18.number()),
1064
- appServiceFeeAddress: v18.optional(v18.string()),
1065
- destinationAddress: v18.string(),
1066
- feeRate: v18.number(),
1067
- refundAddress: v18.string(),
1068
- repeats: v18.number(),
1069
- runeName: v18.string(),
1070
- network: v18.optional(v18.enum(BitcoinNetworkType))
1071
- });
1072
- var runesMintResultSchema = v18.object({
1073
- orderId: v18.string(),
1074
- fundTransactionId: v18.string(),
1075
- fundingAddress: v18.string()
1076
- });
1077
- var runesMintRequestMessageSchema = v18.object({
1078
- ...rpcRequestMessageSchema.entries,
1079
- ...v18.object({
1080
- method: v18.literal(runesMintMethodName),
1081
- params: runesMintParamsSchema,
1082
- id: v18.string()
1083
- }).entries
1084
- });
1085
-
1086
- // src/request/types/runesMethods/transfer.ts
1087
- import * as v19 from "valibot";
1088
- var runesTransferMethodName = "runes_transfer";
1089
- var runesTransferParamsSchema = v19.object({
1090
- recipients: v19.array(
1091
- v19.object({
1092
- runeName: v19.string(),
1093
- amount: v19.string(),
1094
- address: v19.string()
1095
- })
1096
- )
1097
- });
1098
- var runesTransferResultSchema = v19.object({
1099
- txid: v19.string()
1100
- });
1101
- var runesTransferRequestMessageSchema = v19.object({
1102
- ...rpcRequestMessageSchema.entries,
1103
- ...v19.object({
1104
- method: v19.literal(runesTransferMethodName),
1105
- params: runesTransferParamsSchema,
1106
- id: v19.string()
1107
- }).entries
1108
- });
1109
-
1110
- // src/request/types/ordinalsMethods.ts
1111
- import * as v20 from "valibot";
1112
- var getInscriptionsMethodName = "ord_getInscriptions";
1113
- var getInscriptionsParamsSchema = v20.object({
1114
- offset: v20.number(),
1115
- limit: v20.number()
1116
- });
1117
- var getInscriptionsResultSchema = v20.object({
1118
- total: v20.number(),
1119
- limit: v20.number(),
1120
- offset: v20.number(),
1121
- inscriptions: v20.array(
1122
- v20.object({
1123
- inscriptionId: v20.string(),
1124
- inscriptionNumber: v20.string(),
1125
- address: v20.string(),
1126
- collectionName: v20.optional(v20.string()),
1127
- postage: v20.string(),
1128
- contentLength: v20.string(),
1129
- contentType: v20.string(),
1130
- timestamp: v20.number(),
1131
- offset: v20.number(),
1132
- genesisTransaction: v20.string(),
1133
- output: v20.string()
1134
- })
1135
- )
1136
- });
1137
- var getInscriptionsRequestMessageSchema = v20.object({
1138
- ...rpcRequestMessageSchema.entries,
1139
- ...v20.object({
1140
- method: v20.literal(getInscriptionsMethodName),
1141
- params: getInscriptionsParamsSchema,
1142
- id: v20.string()
1143
- }).entries
1144
- });
1145
- var sendInscriptionsMethodName = "ord_sendInscriptions";
1146
- var sendInscriptionsParamsSchema = v20.object({
1147
- transfers: v20.array(
1148
- v20.object({
1149
- address: v20.string(),
1150
- inscriptionId: v20.string()
1151
- })
1152
- )
1153
- });
1154
- var sendInscriptionsResultSchema = v20.object({
1155
- txid: v20.string()
1156
- });
1157
- var sendInscriptionsRequestMessageSchema = v20.object({
1158
- ...rpcRequestMessageSchema.entries,
1159
- ...v20.object({
1160
- method: v20.literal(sendInscriptionsMethodName),
1161
- params: sendInscriptionsParamsSchema,
1162
- id: v20.string()
1293
+ id: v24.string()
1163
1294
  }).entries
1164
1295
  });
1165
1296
 
@@ -1176,13 +1307,13 @@ var request = async (method, params, providerId) => {
1176
1307
  throw new Error("A wallet method is required");
1177
1308
  }
1178
1309
  const response = await provider.request(method, params);
1179
- if (v21.is(rpcErrorResponseMessageSchema, response)) {
1310
+ if (v25.is(rpcErrorResponseMessageSchema, response)) {
1180
1311
  return {
1181
1312
  status: "error",
1182
1313
  error: response.error
1183
1314
  };
1184
1315
  }
1185
- if (v21.is(rpcSuccessResponseMessageSchema, response)) {
1316
+ if (v25.is(rpcSuccessResponseMessageSchema, response)) {
1186
1317
  return {
1187
1318
  status: "success",
1188
1319
  result: response.result
@@ -1745,7 +1876,7 @@ var UnisatAdapter = class extends SatsConnectAdapter {
1745
1876
  id = DefaultAdaptersInfo.unisat.id;
1746
1877
  async getAccounts(params) {
1747
1878
  const { purposes } = params;
1748
- if (purposes.includes("stacks" /* Stacks */)) {
1879
+ if (purposes.includes("stacks" /* Stacks */) || purposes.includes("starknet" /* Starknet */) || purposes.includes("spark" /* Spark */)) {
1749
1880
  throw new Error("Only bitcoin addresses are supported");
1750
1881
  }
1751
1882
  const accounts = await window.unisat.requestAccounts();
@@ -2204,6 +2335,7 @@ export {
2204
2335
  RpcErrorCode,
2205
2336
  RpcIdSchema,
2206
2337
  SatsConnectAdapter,
2338
+ SparkNetworkType,
2207
2339
  StacksNetworkType,
2208
2340
  StarknetNetworkType,
2209
2341
  accountActionsSchema,
@@ -2335,6 +2467,22 @@ export {
2335
2467
  signPsbtRequestMessageSchema,
2336
2468
  signPsbtResultSchema,
2337
2469
  signTransaction,
2470
+ sparkGetAddressesMethodName,
2471
+ sparkGetAddressesParamsSchema,
2472
+ sparkGetAddressesRequestMessageSchema,
2473
+ sparkGetAddressesResultSchema,
2474
+ sparkGetBalanceMethodName,
2475
+ sparkGetBalanceParamsSchema,
2476
+ sparkGetBalanceRequestMessageSchema,
2477
+ sparkGetBalanceResultSchema,
2478
+ sparkTransferMethodName,
2479
+ sparkTransferParamsSchema,
2480
+ sparkTransferRequestMessageSchema,
2481
+ sparkTransferResultSchema,
2482
+ sparkTransferTokenMethodName,
2483
+ sparkTransferTokenParamsSchema,
2484
+ sparkTransferTokenRequestMessageSchema,
2485
+ sparkTransferTokenResultSchema,
2338
2486
  stxCallContractMethodName,
2339
2487
  stxCallContractParamsSchema,
2340
2488
  stxCallContractRequestMessageSchema,