@sats-connect/core 0.4.0-ff58e17 → 0.4.1-78faa9d

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.js CHANGED
@@ -36,12 +36,14 @@ __export(src_exports, {
36
36
  BitcoinNetworkType: () => BitcoinNetworkType,
37
37
  DefaultAdaptersInfo: () => DefaultAdaptersInfo,
38
38
  MessageSigningProtocols: () => MessageSigningProtocols,
39
+ PermissionRequestParams: () => PermissionRequestParams,
39
40
  RpcErrorCode: () => RpcErrorCode,
40
41
  RpcIdSchema: () => RpcIdSchema,
41
42
  SatsConnectAdapter: () => SatsConnectAdapter,
42
- TransferRunesResultSchema: () => TransferRunesResultSchema,
43
+ accountActionsSchema: () => accountActionsSchema,
43
44
  accountChangeEventName: () => accountChangeEventName,
44
45
  accountChangeSchema: () => accountChangeSchema,
46
+ accountPermissionSchema: () => accountPermissionSchema,
45
47
  addListener: () => addListener,
46
48
  addressSchema: () => addressSchema,
47
49
  connectMethodName: () => connectMethodName,
@@ -86,15 +88,11 @@ __export(src_exports, {
86
88
  getInfoResultSchema: () => getInfoResultSchema,
87
89
  getInscriptionsMethodName: () => getInscriptionsMethodName,
88
90
  getInscriptionsParamsSchema: () => getInscriptionsParamsSchema,
91
+ getInscriptionsRequestMessageSchema: () => getInscriptionsRequestMessageSchema,
89
92
  getInscriptionsResultSchema: () => getInscriptionsResultSchema,
90
- getInscriptionsSchema: () => getInscriptionsSchema,
91
93
  getProviderById: () => getProviderById,
92
94
  getProviderOrThrow: () => getProviderOrThrow,
93
95
  getProviders: () => getProviders,
94
- getRunesBalanceMethodName: () => getRunesBalanceMethodName,
95
- getRunesBalanceParamsSchema: () => getRunesBalanceParamsSchema,
96
- getRunesBalanceRequestMessageSchema: () => getRunesBalanceRequestMessageSchema,
97
- getRunesBalanceResultSchema: () => getRunesBalanceResultSchema,
98
96
  getSupportedWallets: () => getSupportedWallets,
99
97
  getWalletTypeMethodName: () => getWalletTypeMethodName,
100
98
  getWalletTypeParamsSchema: () => getWalletTypeParamsSchema,
@@ -103,7 +101,7 @@ __export(src_exports, {
103
101
  isProviderInstalled: () => isProviderInstalled,
104
102
  networkChangeEventName: () => networkChangeEventName,
105
103
  networkChangeSchema: () => networkChangeSchema,
106
- permissionTemplate: () => permissionTemplate,
104
+ permission: () => permission,
107
105
  removeDefaultProvider: () => removeDefaultProvider,
108
106
  renouncePermissionsMethodName: () => renouncePermissionsMethodName,
109
107
  renouncePermissionsParamsSchema: () => renouncePermissionsParamsSchema,
@@ -118,11 +116,27 @@ __export(src_exports, {
118
116
  rpcRequestMessageSchema: () => rpcRequestMessageSchema,
119
117
  rpcResponseMessageSchema: () => rpcResponseMessageSchema,
120
118
  rpcSuccessResponseMessageSchema: () => rpcSuccessResponseMessageSchema,
119
+ runesEtchMethodName: () => runesEtchMethodName,
120
+ runesEtchParamsSchema: () => runesEtchParamsSchema,
121
+ runesEtchRequestMessageSchema: () => runesEtchRequestMessageSchema,
122
+ runesEtchResultSchema: () => runesEtchResultSchema,
123
+ runesGetBalanceMethodName: () => runesGetBalanceMethodName,
124
+ runesGetBalanceParamsSchema: () => runesGetBalanceParamsSchema,
125
+ runesGetBalanceRequestMessageSchema: () => runesGetBalanceRequestMessageSchema,
126
+ runesGetBalanceResultSchema: () => runesGetBalanceResultSchema,
127
+ runesMintMethodName: () => runesMintMethodName,
128
+ runesMintParamsSchema: () => runesMintParamsSchema,
129
+ runesMintRequestMessageSchema: () => runesMintRequestMessageSchema,
130
+ runesMintResultSchema: () => runesMintResultSchema,
131
+ runesTransferMethodName: () => runesTransferMethodName,
132
+ runesTransferParamsSchema: () => runesTransferParamsSchema,
133
+ runesTransferRequestMessageSchema: () => runesTransferRequestMessageSchema,
134
+ runesTransferResultSchema: () => runesTransferResultSchema,
121
135
  sendBtcTransaction: () => sendBtcTransaction,
122
136
  sendInscriptionsMethodName: () => sendInscriptionsMethodName,
123
137
  sendInscriptionsParamsSchema: () => sendInscriptionsParamsSchema,
138
+ sendInscriptionsRequestMessageSchema: () => sendInscriptionsRequestMessageSchema,
124
139
  sendInscriptionsResultSchema: () => sendInscriptionsResultSchema,
125
- sendInscriptionsSchema: () => sendInscriptionsSchema,
126
140
  sendTransferMethodName: () => sendTransferMethodName,
127
141
  sendTransferParamsSchema: () => sendTransferParamsSchema,
128
142
  sendTransferRequestMessageSchema: () => sendTransferRequestMessageSchema,
@@ -143,18 +157,37 @@ __export(src_exports, {
143
157
  stxCallContractParamsSchema: () => stxCallContractParamsSchema,
144
158
  stxCallContractRequestMessageSchema: () => stxCallContractRequestMessageSchema,
145
159
  stxCallContractResultSchema: () => stxCallContractResultSchema,
160
+ stxDeployContractMethodName: () => stxDeployContractMethodName,
161
+ stxDeployContractParamsSchema: () => stxDeployContractParamsSchema,
162
+ stxDeployContractRequestMessageSchema: () => stxDeployContractRequestMessageSchema,
163
+ stxDeployContractResultSchema: () => stxDeployContractResultSchema,
164
+ stxGetAccountsMethodName: () => stxGetAccountsMethodName,
165
+ stxGetAccountsParamsSchema: () => stxGetAccountsParamsSchema,
166
+ stxGetAccountsRequestMessageSchema: () => stxGetAccountsRequestMessageSchema,
167
+ stxGetAccountsResultSchema: () => stxGetAccountsResultSchema,
146
168
  stxGetAddressesMethodName: () => stxGetAddressesMethodName,
147
169
  stxGetAddressesParamsSchema: () => stxGetAddressesParamsSchema,
148
170
  stxGetAddressesRequestMessageSchema: () => stxGetAddressesRequestMessageSchema,
149
171
  stxGetAddressesResultSchema: () => stxGetAddressesResultSchema,
172
+ stxSignMessageMethodName: () => stxSignMessageMethodName,
173
+ stxSignMessageParamsSchema: () => stxSignMessageParamsSchema,
174
+ stxSignMessageRequestMessageSchema: () => stxSignMessageRequestMessageSchema,
175
+ stxSignMessageResultSchema: () => stxSignMessageResultSchema,
176
+ stxSignStructuredMessageMethodName: () => stxSignStructuredMessageMethodName,
177
+ stxSignStructuredMessageParamsSchema: () => stxSignStructuredMessageParamsSchema,
178
+ stxSignStructuredMessageRequestMessageSchema: () => stxSignStructuredMessageRequestMessageSchema,
179
+ stxSignStructuredMessageResultSchema: () => stxSignStructuredMessageResultSchema,
150
180
  stxSignTransactionMethodName: () => stxSignTransactionMethodName,
151
181
  stxSignTransactionParamsSchema: () => stxSignTransactionParamsSchema,
152
182
  stxSignTransactionRequestMessageSchema: () => stxSignTransactionRequestMessageSchema,
153
183
  stxSignTransactionResultSchema: () => stxSignTransactionResultSchema,
154
- transferRunesMethodName: () => transferRunesMethodName,
155
- transferRunesParamsSchema: () => transferRunesParamsSchema,
156
- transferRunesRequestSchema: () => transferRunesRequestSchema,
184
+ stxTransferStxMethodName: () => stxTransferStxMethodName,
185
+ stxTransferStxParamsSchema: () => stxTransferStxParamsSchema,
186
+ stxTransferStxRequestMessageSchema: () => stxTransferStxRequestMessageSchema,
187
+ stxTransferStxResultSchema: () => stxTransferStxResultSchema,
188
+ walletActionsSchema: () => walletActionsSchema,
157
189
  walletEventSchema: () => walletEventSchema,
190
+ walletPermissionSchema: () => walletPermissionSchema,
158
191
  walletTypeSchema: () => walletTypeSchema,
159
192
  walletTypes: () => walletTypes
160
193
  });
@@ -189,8 +222,7 @@ async function getProviderOrThrow(getProvider) {
189
222
  return provider;
190
223
  }
191
224
  function getProviders() {
192
- if (!window.btc_providers)
193
- window.btc_providers = [];
225
+ if (!window.btc_providers) window.btc_providers = [];
194
226
  return window.btc_providers;
195
227
  }
196
228
  function getProviderById(providerId) {
@@ -209,10 +241,7 @@ function removeDefaultProvider() {
209
241
  localStorage.removeItem("sats-connect_defaultProvider");
210
242
  }
211
243
  function getSupportedWallets() {
212
- const ambientProviders = getProviders();
213
- const { xverse, ...defaultProviders } = DefaultAdaptersInfo;
214
- const allProviders = [...ambientProviders, ...Object.values(defaultProviders)];
215
- const wallets = allProviders.map((provider) => {
244
+ const wallets = Object.values(DefaultAdaptersInfo).map((provider) => {
216
245
  {
217
246
  return {
218
247
  ...provider,
@@ -225,11 +254,11 @@ function getSupportedWallets() {
225
254
 
226
255
  // src/types.ts
227
256
  var v2 = __toESM(require("valibot"));
228
- var BitcoinNetworkType = /* @__PURE__ */ ((BitcoinNetworkType3) => {
229
- BitcoinNetworkType3["Mainnet"] = "Mainnet";
230
- BitcoinNetworkType3["Testnet"] = "Testnet";
231
- BitcoinNetworkType3["Signet"] = "Signet";
232
- return BitcoinNetworkType3;
257
+ var BitcoinNetworkType = /* @__PURE__ */ ((BitcoinNetworkType2) => {
258
+ BitcoinNetworkType2["Mainnet"] = "Mainnet";
259
+ BitcoinNetworkType2["Testnet"] = "Testnet";
260
+ BitcoinNetworkType2["Signet"] = "Signet";
261
+ return BitcoinNetworkType2;
233
262
  })(BitcoinNetworkType || {});
234
263
  var RpcIdSchema = v2.optional(v2.union([v2.string(), v2.number(), v2.null()]));
235
264
  var rpcRequestMessageSchema = v2.object({
@@ -246,7 +275,7 @@ var rpcRequestMessageSchema = v2.object({
246
275
  v2.null()
247
276
  ])
248
277
  ),
249
- id: RpcIdSchema
278
+ id: v2.unwrap(RpcIdSchema)
250
279
  });
251
280
  var RpcErrorCode = /* @__PURE__ */ ((RpcErrorCode2) => {
252
281
  RpcErrorCode2[RpcErrorCode2["PARSE_ERROR"] = -32700] = "PARSE_ERROR";
@@ -275,16 +304,127 @@ var rpcResponseMessageSchema = v2.union([
275
304
  ]);
276
305
 
277
306
  // src/request/index.ts
278
- var v10 = __toESM(require("valibot"));
307
+ var v20 = __toESM(require("valibot"));
279
308
 
280
- // src/request/types/stxMethods.ts
309
+ // src/request/types/stxMethods/callContract.ts
310
+ var v3 = __toESM(require("valibot"));
311
+ var stxCallContractMethodName = "stx_callContract";
312
+ var stxCallContractParamsSchema = v3.object({
313
+ /**
314
+ * The contract principal.
315
+ *
316
+ * E.g. `"SPKE...GD5C.my-contract"`
317
+ */
318
+ contract: v3.string(),
319
+ /**
320
+ * The name of the function to call.
321
+ *
322
+ * Note: spec changes ongoing,
323
+ * https://github.com/stacksgov/sips/pull/166#pullrequestreview-1914236999
324
+ */
325
+ functionName: v3.string(),
326
+ /**
327
+ * The function's arguments. The arguments are expected to be hex-encoded
328
+ * strings of Clarity values.
329
+ *
330
+ * To convert Clarity values to their hex representation, the `cvToString`
331
+ * helper from the `@stacks/transactions` package may be helpful.
332
+ *
333
+ * ```js
334
+ * import { cvToString } from '@stacks/transactions';
335
+ *
336
+ * const functionArgs = [someClarityValue1, someClarityValue2];
337
+ * const hexArgs = functionArgs.map(cvToString);
338
+ * ```
339
+ */
340
+ arguments: v3.optional(v3.array(v3.string()))
341
+ });
342
+ var stxCallContractResultSchema = v3.object({
343
+ /**
344
+ * The ID of the transaction.
345
+ */
346
+ txid: v3.string(),
347
+ /**
348
+ * A Stacks transaction as a hex-encoded string.
349
+ */
350
+ transaction: v3.string()
351
+ });
352
+ var stxCallContractRequestMessageSchema = v3.object({
353
+ ...rpcRequestMessageSchema.entries,
354
+ ...v3.object({
355
+ method: v3.literal(stxCallContractMethodName),
356
+ params: stxCallContractParamsSchema,
357
+ id: v3.string()
358
+ }).entries
359
+ });
360
+
361
+ // src/request/types/stxMethods/deployContract.ts
281
362
  var v4 = __toESM(require("valibot"));
363
+ var stxDeployContractMethodName = "stx_deployContract";
364
+ var stxDeployContractParamsSchema = v4.object({
365
+ /**
366
+ * Name of the contract.
367
+ */
368
+ name: v4.string(),
369
+ /**
370
+ * The source code of the Clarity contract.
371
+ */
372
+ clarityCode: v4.string(),
373
+ /**
374
+ * The version of the Clarity contract.
375
+ */
376
+ clarityVersion: v4.optional(v4.string())
377
+ });
378
+ var stxDeployContractResultSchema = v4.object({
379
+ /**
380
+ * The ID of the transaction.
381
+ */
382
+ txid: v4.string(),
383
+ /**
384
+ * A Stacks transaction as a hex-encoded string.
385
+ */
386
+ transaction: v4.string()
387
+ });
388
+ var stxDeployContractRequestMessageSchema = v4.object({
389
+ ...rpcRequestMessageSchema.entries,
390
+ ...v4.object({
391
+ method: v4.literal(stxDeployContractMethodName),
392
+ params: stxDeployContractParamsSchema,
393
+ id: v4.string()
394
+ }).entries
395
+ });
396
+
397
+ // src/request/types/stxMethods/getAccounts.ts
398
+ var v5 = __toESM(require("valibot"));
399
+ var stxGetAccountsMethodName = "stx_getAccounts";
400
+ var stxGetAccountsParamsSchema = v5.nullish(v5.null());
401
+ var stxGetAccountsResultSchema = v5.object({
402
+ /**
403
+ * The addresses generated for the given purposes.
404
+ */
405
+ addresses: v5.array(
406
+ v5.object({
407
+ address: v5.string(),
408
+ publicKey: v5.string(),
409
+ gaiaHubUrl: v5.string(),
410
+ gaiaAppKey: v5.string()
411
+ })
412
+ )
413
+ });
414
+ var stxGetAccountsRequestMessageSchema = v5.object({
415
+ ...rpcRequestMessageSchema.entries,
416
+ ...v5.object({
417
+ method: v5.literal(stxGetAccountsMethodName),
418
+ params: stxGetAccountsParamsSchema,
419
+ id: v5.string()
420
+ }).entries
421
+ });
282
422
 
283
423
  // src/addresses/index.ts
284
424
  var import_jsontokens = require("jsontokens");
285
425
 
286
426
  // src/addresses/types.ts
287
- var v3 = __toESM(require("valibot"));
427
+ var v6 = __toESM(require("valibot"));
288
428
  var AddressPurpose = /* @__PURE__ */ ((AddressPurpose2) => {
289
429
  AddressPurpose2["Ordinals"] = "ordinals";
290
430
  AddressPurpose2["Payment"] = "payment";
@@ -300,11 +440,11 @@ var AddressType = /* @__PURE__ */ ((AddressType3) => {
300
440
  AddressType3["stacks"] = "stacks";
301
441
  return AddressType3;
302
442
  })(AddressType || {});
303
- var addressSchema = v3.object({
304
- address: v3.string(),
305
- publicKey: v3.string(),
306
- purpose: v3.enum(AddressPurpose),
307
- addressType: v3.enum(AddressType)
443
+ var addressSchema = v6.object({
444
+ address: v6.string(),
445
+ publicKey: v6.string(),
446
+ purpose: v6.enum(AddressPurpose),
447
+ addressType: v6.enum(AddressType)
308
448
  });
309
449
 
310
450
  // src/addresses/index.ts
@@ -324,167 +464,269 @@ var getAddress = async (options) => {
324
464
  }
325
465
  };
326
466
 
327
- // src/request/types/stxMethods.ts
328
- var stxCallContractMethodName = "stx_callContract";
329
- var stxCallContractParamsSchema = v4.object({
467
+ // src/request/types/stxMethods/getAddresses.ts
468
+ var v7 = __toESM(require("valibot"));
469
+ var stxGetAddressesMethodName = "stx_getAddresses";
470
+ var stxGetAddressesParamsSchema = v7.nullish(
471
+ v7.object({
472
+ /**
473
+ * A message to be displayed to the user in the request prompt.
474
+ */
475
+ message: v7.optional(v7.string())
476
+ })
477
+ );
478
+ var stxGetAddressesResultSchema = v7.object({
330
479
  /**
331
- * The contract principal.
332
- *
333
- * E.g. `"SPKE...GD5C.my-contract"`
480
+ * The addresses generated for the given purposes.
334
481
  */
335
- contract: v4.string(),
482
+ addresses: v7.array(addressSchema)
483
+ });
484
+ var stxGetAddressesRequestMessageSchema = v7.object({
485
+ ...rpcRequestMessageSchema.entries,
486
+ ...v7.object({
487
+ method: v7.literal(stxGetAddressesMethodName),
488
+ params: stxGetAddressesParamsSchema,
489
+ id: v7.string()
490
+ }).entries
491
+ });
492
+
493
+ // src/request/types/stxMethods/signMessage.ts
494
+ var v8 = __toESM(require("valibot"));
495
+ var stxSignMessageMethodName = "stx_signMessage";
496
+ var stxSignMessageParamsSchema = v8.object({
336
497
  /**
337
- * The name of the function to call.
338
- *
339
- * Note: spec changes ongoing,
340
- * https://github.com/stacksgov/sips/pull/166#pullrequestreview-1914236999
498
+ * The message to sign.
341
499
  */
342
- functionName: v4.string(),
500
+ message: v8.string(),
343
501
  /**
344
- * The function's arguments. The arguments are expected to be hex-encoded
345
- * strings of Clarity values.
346
- *
347
- * To convert Clarity values to their hex representation, the `cvToString`
348
- * helper from the `@stacks/transactions` package may be helpful.
349
- *
350
- * ```js
351
- * import { cvToString } from '@stacks/transactions';
352
- *
353
- * const functionArgs = [someClarityValue1, someClarityValue2];
354
- * const hexArgs = functionArgs.map(cvToString);
355
- * ```
502
+ * The public key to sign the message with.
503
+ */
504
+ publicKey: v8.string(),
505
+ /**
506
+ * The format version of the parameter.
356
507
  */
357
- arguments: v4.optional(v4.array(v4.string()))
508
+ parameterFormatVersion: v8.optional(v8.number())
358
509
  });
359
- var stxCallContractResultSchema = v4.object({
510
+ var stxSignMessageResultSchema = v8.object({
360
511
  /**
361
- * The ID of the transaction.
512
+ * The signature of the message.
362
513
  */
363
- txid: v4.string(),
514
+ signature: v8.string(),
364
515
  /**
365
- * A Stacks transaction as a hex-encoded string.
516
+ * The public key used to sign the message.
366
517
  */
367
- transaction: v4.string()
518
+ publicKey: v8.string()
368
519
  });
369
- var stxCallContractRequestMessageSchema = v4.object({
520
+ var stxSignMessageRequestMessageSchema = v8.object({
370
521
  ...rpcRequestMessageSchema.entries,
371
- ...v4.object({
372
- method: v4.literal(stxCallContractMethodName),
373
- params: stxCallContractParamsSchema,
374
- id: v4.string()
522
+ ...v8.object({
523
+ method: v8.literal(stxSignMessageMethodName),
524
+ params: stxSignMessageParamsSchema,
525
+ id: v8.string()
375
526
  }).entries
376
527
  });
377
- var stxGetAddressesMethodName = "stx_getAddresses";
378
- var stxGetAddressesParamsSchema = v4.nullish(
379
- v4.object({
380
- /**
381
- * A message to be displayed to the user in the request prompt.
382
- */
383
- message: v4.optional(v4.string())
384
- })
385
- );
386
- var stxGetAddressesResultSchema = v4.object({
528
+
529
+ // src/request/types/stxMethods/signStructuredMessage.ts
530
+ var v9 = __toESM(require("valibot"));
531
+ var stxSignStructuredMessageMethodName = "stx_signStructuredMessage";
532
+ var stxSignStructuredMessageParamsSchema = v9.object({
387
533
  /**
388
- * The addresses generated for the given purposes.
534
+ * The domain to be signed.
535
+ */
536
+ domain: v9.string(),
537
+ /**
538
+ * Message payload to be signed.
539
+ */
540
+ message: v9.string(),
541
+ /**
542
+ * The format version of the parameter.
543
+ */
544
+ parameterFormatVersion: v9.optional(v9.number()),
545
+ /**
546
+ * The public key to sign the message with.
547
+ */
548
+ publicKey: v9.optional(v9.string())
549
+ });
550
+ var stxSignStructuredMessageResultSchema = v9.object({
551
+ /**
552
+ * Signature of the message.
389
553
  */
390
- addresses: v4.array(addressSchema)
554
+ signature: v9.string(),
555
+ /**
556
+ * Public key as hex-encoded string.
557
+ */
558
+ publicKey: v9.string()
391
559
  });
392
- var stxGetAddressesRequestMessageSchema = v4.object({
560
+ var stxSignStructuredMessageRequestMessageSchema = v9.object({
393
561
  ...rpcRequestMessageSchema.entries,
394
- ...v4.object({
395
- method: v4.literal(stxGetAddressesMethodName),
396
- params: stxGetAddressesParamsSchema,
397
- id: v4.string()
562
+ ...v9.object({
563
+ method: v9.literal(stxSignStructuredMessageMethodName),
564
+ params: stxSignStructuredMessageParamsSchema,
565
+ id: v9.string()
398
566
  }).entries
399
567
  });
568
+
569
+ // src/request/types/stxMethods/signTransaction.ts
570
+ var v10 = __toESM(require("valibot"));
400
571
  var stxSignTransactionMethodName = "stx_signTransaction";
401
- var stxSignTransactionParamsSchema = v4.object({
572
+ var stxSignTransactionParamsSchema = v10.object({
402
573
  /**
403
574
  * The transaction to sign as a hex-encoded string.
404
575
  */
405
- transaction: v4.string(),
576
+ transaction: v10.string(),
406
577
  /**
407
578
  * The public key to sign the transaction with. The wallet may use any key
408
579
  * when not provided.
409
580
  */
410
- pubkey: v4.optional(v4.string()),
581
+ pubkey: v10.optional(v10.string()),
411
582
  /**
412
583
  * Whether to broadcast the transaction after signing. Defaults to `true`.
413
584
  */
414
- broadcast: v4.optional(v4.boolean())
585
+ broadcast: v10.optional(v10.boolean())
415
586
  });
416
- var stxSignTransactionResultSchema = v4.object({
587
+ var stxSignTransactionResultSchema = v10.object({
417
588
  /**
418
589
  * The signed transaction as a hex-encoded string.
419
590
  */
420
- transaction: v4.string()
591
+ transaction: v10.string()
421
592
  });
422
- var stxSignTransactionRequestMessageSchema = v4.object({
593
+ var stxSignTransactionRequestMessageSchema = v10.object({
423
594
  ...rpcRequestMessageSchema.entries,
424
- ...v4.object({
425
- method: v4.literal(stxSignTransactionMethodName),
595
+ ...v10.object({
596
+ method: v10.literal(stxSignTransactionMethodName),
426
597
  params: stxSignTransactionParamsSchema,
427
- id: v4.string()
598
+ id: v10.string()
599
+ }).entries
600
+ });
601
+
602
+ // src/request/types/stxMethods/transferStx.ts
603
+ var v11 = __toESM(require("valibot"));
604
+ var stxTransferStxMethodName = "stx_transferStx";
605
+ var stxTransferStxParamsSchema = v11.object({
606
+ /**
607
+ * Amount of STX tokens to transfer in microstacks as a string. Anything
608
+ * parseable by `BigInt` is acceptable.
609
+ *
610
+ * Example,
611
+ *
612
+ * ```js
613
+ * const amount1 = 1234;
614
+ * const amount2 = 1234n;
615
+ * const amount3 = '1234';
616
+ * ```
617
+ */
618
+ amount: v11.union([v11.number(), v11.string()]),
619
+ /**
620
+ * The recipeint's principal.
621
+ */
622
+ recipient: v11.string(),
623
+ /**
624
+ * A string representing the memo.
625
+ */
626
+ memo: v11.optional(v11.string()),
627
+ /**
628
+ * Version of parameter format.
629
+ */
630
+ version: v11.optional(v11.string()),
631
+ /**
632
+ * The mode of the post conditions.
633
+ */
634
+ postConditionMode: v11.optional(v11.number()),
635
+ /**
636
+ * A hex-encoded string representing the post conditions.
637
+ *
638
+ * A post condition may be converted to it's hex representation using the `serializePostCondition` helper from the `@stacks/transactions` package,
639
+ *
640
+ * ```js
641
+ * import { serializePostCondition } from '@stacks/transactions';
642
+ *
643
+ * const postCondition = somePostCondition;
644
+ * const hexPostCondition = serializePostCondition(postCondition).toString('hex');
645
+ * ```
646
+ */
647
+ postConditions: v11.optional(v11.array(v11.string())),
648
+ /**
649
+ * The public key to sign the transaction with. The wallet may use any key
650
+ * when not provided.
651
+ */
652
+ pubkey: v11.optional(v11.string())
653
+ });
654
+ var stxTransferStxResultSchema = v11.object({
655
+ /**
656
+ * The ID of the transaction.
657
+ */
658
+ txid: v11.string(),
659
+ /**
660
+ * A Stacks transaction as a hex-encoded string.
661
+ */
662
+ transaction: v11.string()
663
+ });
664
+ var stxTransferStxRequestMessageSchema = v11.object({
665
+ ...rpcRequestMessageSchema.entries,
666
+ ...v11.object({
667
+ method: v11.literal(stxTransferStxMethodName),
668
+ params: stxTransferStxParamsSchema,
669
+ id: v11.string()
428
670
  }).entries
429
671
  });
430
672
 
431
673
  // src/request/types/btcMethods.ts
432
- var v6 = __toESM(require("valibot"));
674
+ var v13 = __toESM(require("valibot"));
433
675
 
434
676
  // src/request/types/common.ts
435
- var v5 = __toESM(require("valibot"));
677
+ var v12 = __toESM(require("valibot"));
436
678
  var walletTypes = ["software", "ledger"];
437
- var walletTypeSchema = v5.picklist(walletTypes);
679
+ var walletTypeSchema = v12.picklist(walletTypes);
438
680
 
439
681
  // src/request/types/btcMethods.ts
440
682
  var getInfoMethodName = "getInfo";
441
- var getInfoParamsSchema = v6.nullish(v6.null());
442
- var getInfoResultSchema = v6.object({
683
+ var getInfoParamsSchema = v13.nullish(v13.null());
684
+ var getInfoResultSchema = v13.object({
443
685
  /**
444
686
  * Version of the wallet.
445
687
  */
446
- version: v6.string(),
688
+ version: v13.string(),
447
689
  /**
448
690
  * [WBIP](https://wbips.netlify.app/wbips/WBIP002) methods supported by the wallet.
449
691
  */
450
- methods: v6.optional(v6.array(v6.string())),
692
+ methods: v13.optional(v13.array(v13.string())),
451
693
  /**
452
694
  * List of WBIP standards supported by the wallet. Not currently used.
453
695
  */
454
- supports: v6.array(v6.string())
696
+ supports: v13.array(v13.string())
455
697
  });
456
- var getInfoRequestMessageSchema = v6.object({
698
+ var getInfoRequestMessageSchema = v13.object({
457
699
  ...rpcRequestMessageSchema.entries,
458
- ...v6.object({
459
- method: v6.literal(getInfoMethodName),
700
+ ...v13.object({
701
+ method: v13.literal(getInfoMethodName),
460
702
  params: getInfoParamsSchema,
461
- id: v6.string()
703
+ id: v13.string()
462
704
  }).entries
463
705
  });
464
706
  var getAddressesMethodName = "getAddresses";
465
- var getAddressesParamsSchema = v6.object({
707
+ var getAddressesParamsSchema = v13.object({
466
708
  /**
467
709
  * The purposes for which to generate addresses. See
468
710
  * {@linkcode AddressPurpose} for available purposes.
469
711
  */
470
- purposes: v6.array(v6.enum(AddressPurpose)),
712
+ purposes: v13.array(v13.enum(AddressPurpose)),
471
713
  /**
472
714
  * A message to be displayed to the user in the request prompt.
473
715
  */
474
- message: v6.optional(v6.string())
716
+ message: v13.optional(v13.string())
475
717
  });
476
- var getAddressesResultSchema = v6.object({
718
+ var getAddressesResultSchema = v13.object({
477
719
  /**
478
720
  * The addresses generated for the given purposes.
479
721
  */
480
- addresses: v6.array(addressSchema)
722
+ addresses: v13.array(addressSchema)
481
723
  });
482
- var getAddressesRequestMessageSchema = v6.object({
724
+ var getAddressesRequestMessageSchema = v13.object({
483
725
  ...rpcRequestMessageSchema.entries,
484
- ...v6.object({
485
- method: v6.literal(getAddressesMethodName),
726
+ ...v13.object({
727
+ method: v13.literal(getAddressesMethodName),
486
728
  params: getAddressesParamsSchema,
487
- id: v6.string()
729
+ id: v13.string()
488
730
  }).entries
489
731
  });
490
732
  var signMessageMethodName = "signMessage";
@@ -493,364 +735,456 @@ var MessageSigningProtocols = /* @__PURE__ */ ((MessageSigningProtocols2) => {
493
735
  MessageSigningProtocols2["BIP322"] = "BIP322";
494
736
  return MessageSigningProtocols2;
495
737
  })(MessageSigningProtocols || {});
496
- var signMessageParamsSchema = v6.object({
738
+ var signMessageParamsSchema = v13.object({
497
739
  /**
498
740
  * The address used for signing.
499
741
  **/
500
- address: v6.string(),
742
+ address: v13.string(),
501
743
  /**
502
744
  * The message to sign.
503
745
  **/
504
- message: v6.string(),
746
+ message: v13.string(),
505
747
  /**
506
748
  * The protocol to use for signing the message.
507
749
  */
508
- protocol: v6.optional(v6.enum(MessageSigningProtocols))
750
+ protocol: v13.optional(v13.enum(MessageSigningProtocols))
509
751
  });
510
- var signMessageResultSchema = v6.object({
752
+ var signMessageResultSchema = v13.object({
511
753
  /**
512
754
  * The signature of the message.
513
755
  */
514
- signature: v6.string(),
756
+ signature: v13.string(),
515
757
  /**
516
758
  * hash of the message.
517
759
  */
518
- messageHash: v6.string(),
760
+ messageHash: v13.string(),
519
761
  /**
520
762
  * The address used for signing.
521
763
  */
522
- address: v6.string(),
764
+ address: v13.string(),
523
765
  /**
524
766
  * The protocol to use for signing the message.
525
767
  */
526
- protocol: v6.enum(MessageSigningProtocols)
768
+ protocol: v13.enum(MessageSigningProtocols)
527
769
  });
528
- var signMessageRequestMessageSchema = v6.object({
770
+ var signMessageRequestMessageSchema = v13.object({
529
771
  ...rpcRequestMessageSchema.entries,
530
- ...v6.object({
531
- method: v6.literal(signMessageMethodName),
772
+ ...v13.object({
773
+ method: v13.literal(signMessageMethodName),
532
774
  params: signMessageParamsSchema,
533
- id: v6.string()
775
+ id: v13.string()
534
776
  }).entries
535
777
  });
536
778
  var sendTransferMethodName = "sendTransfer";
537
- var sendTransferParamsSchema = v6.object({
779
+ var sendTransferParamsSchema = v13.object({
538
780
  /**
539
781
  * Array of recipients to send to.
540
782
  * The amount to send to each recipient is in satoshis.
541
783
  */
542
- recipients: v6.array(
543
- v6.object({
544
- address: v6.string(),
545
- amount: v6.number()
784
+ recipients: v13.array(
785
+ v13.object({
786
+ address: v13.string(),
787
+ amount: v13.number()
546
788
  })
547
789
  )
548
790
  });
549
- var sendTransferResultSchema = v6.object({
791
+ var sendTransferResultSchema = v13.object({
550
792
  /**
551
793
  * The transaction id as a hex-encoded string.
552
794
  */
553
- txid: v6.string()
795
+ txid: v13.string()
554
796
  });
555
- var sendTransferRequestMessageSchema = v6.object({
797
+ var sendTransferRequestMessageSchema = v13.object({
556
798
  ...rpcRequestMessageSchema.entries,
557
- ...v6.object({
558
- method: v6.literal(sendTransferMethodName),
799
+ ...v13.object({
800
+ method: v13.literal(sendTransferMethodName),
559
801
  params: sendTransferParamsSchema,
560
- id: v6.string()
802
+ id: v13.string()
561
803
  }).entries
562
804
  });
563
805
  var signPsbtMethodName = "signPsbt";
564
- var signPsbtParamsSchema = v6.object({
806
+ var signPsbtParamsSchema = v13.object({
565
807
  /**
566
808
  * The base64 encoded PSBT to sign.
567
809
  */
568
- psbt: v6.string(),
810
+ psbt: v13.string(),
569
811
  /**
570
812
  * The inputs to sign.
571
813
  * The key is the address and the value is an array of indexes of the inputs to sign.
572
814
  */
573
- signInputs: v6.record(v6.string(), v6.array(v6.number())),
574
- allowedSignHash: v6.optional(v6.number()),
815
+ signInputs: v13.record(v13.string(), v13.array(v13.number())),
575
816
  /**
576
817
  * Whether to broadcast the transaction after signing.
577
818
  **/
578
- broadcast: v6.optional(v6.boolean())
819
+ broadcast: v13.optional(v13.boolean())
579
820
  });
580
- var signPsbtResultSchema = v6.object({
821
+ var signPsbtResultSchema = v13.object({
581
822
  /**
582
823
  * The base64 encoded PSBT after signing.
583
824
  */
584
- psbt: v6.string(),
825
+ psbt: v13.string(),
585
826
  /**
586
827
  * The transaction id as a hex-encoded string.
587
828
  * This is only returned if the transaction was broadcast.
588
829
  **/
589
- txid: v6.optional(v6.string())
830
+ txid: v13.optional(v13.string())
590
831
  });
591
- var signPsbtRequestMessageSchema = v6.object({
832
+ var signPsbtRequestMessageSchema = v13.object({
592
833
  ...rpcRequestMessageSchema.entries,
593
- ...v6.object({
594
- method: v6.literal(signPsbtMethodName),
834
+ ...v13.object({
835
+ method: v13.literal(signPsbtMethodName),
595
836
  params: signPsbtParamsSchema,
596
- id: v6.string()
837
+ id: v13.string()
597
838
  }).entries
598
839
  });
599
840
  var getAccountsMethodName = "getAccounts";
600
- var getAccountsParamsSchema = v6.object({
841
+ var getAccountsParamsSchema = v13.object({
601
842
  /**
602
843
  * The purposes for which to generate addresses. See
603
844
  * {@linkcode AddressPurpose} for available purposes.
604
845
  */
605
- purposes: v6.array(v6.enum(AddressPurpose)),
846
+ purposes: v13.array(v13.enum(AddressPurpose)),
606
847
  /**
607
848
  * A message to be displayed to the user in the request prompt.
608
849
  */
609
- message: v6.optional(v6.string())
850
+ message: v13.optional(v13.string())
610
851
  });
611
- var getAccountsResultSchema = v6.array(
612
- v6.object({
852
+ var getAccountsResultSchema = v13.array(
853
+ v13.object({
613
854
  ...addressSchema.entries,
614
- ...v6.object({
855
+ ...v13.object({
615
856
  walletType: walletTypeSchema
616
857
  }).entries
617
858
  })
618
859
  );
619
- var getAccountsRequestMessageSchema = v6.object({
860
+ var getAccountsRequestMessageSchema = v13.object({
620
861
  ...rpcRequestMessageSchema.entries,
621
- ...v6.object({
622
- method: v6.literal(getAccountsMethodName),
862
+ ...v13.object({
863
+ method: v13.literal(getAccountsMethodName),
623
864
  params: getAccountsParamsSchema,
624
- id: v6.string()
865
+ id: v13.string()
625
866
  }).entries
626
867
  });
627
868
  var getBalanceMethodName = "getBalance";
628
- var getBalanceParamsSchema = v6.nullish(v6.null());
629
- var getBalanceResultSchema = v6.object({
869
+ var getBalanceParamsSchema = v13.nullish(v13.null());
870
+ var getBalanceResultSchema = v13.object({
630
871
  /**
631
872
  * The confirmed balance of the wallet in sats. Using a string due to chrome
632
873
  * messages not supporting bigint
633
874
  * (https://issues.chromium.org/issues/40116184).
634
875
  */
635
- confirmed: v6.string(),
876
+ confirmed: v13.string(),
636
877
  /**
637
878
  * The unconfirmed balance of the wallet in sats. Using a string due to chrome
638
879
  * messages not supporting bigint
639
880
  * (https://issues.chromium.org/issues/40116184).
640
881
  */
641
- unconfirmed: v6.string(),
882
+ unconfirmed: v13.string(),
642
883
  /**
643
884
  * The total balance (both confirmed and unconfrimed UTXOs) of the wallet in
644
885
  * sats. Using a string due to chrome messages not supporting bigint
645
886
  * (https://issues.chromium.org/issues/40116184).
646
887
  */
647
- total: v6.string()
888
+ total: v13.string()
648
889
  });
649
- var getBalanceRequestMessageSchema = v6.object({
890
+ var getBalanceRequestMessageSchema = v13.object({
650
891
  ...rpcRequestMessageSchema.entries,
651
- ...v6.object({
652
- method: v6.literal(getBalanceMethodName),
653
- id: v6.string()
892
+ ...v13.object({
893
+ method: v13.literal(getBalanceMethodName),
894
+ id: v13.string()
654
895
  }).entries
655
896
  });
656
897
 
657
898
  // src/request/types/walletMethods.ts
658
- var v7 = __toESM(require("valibot"));
659
- var import_xverse_core = require("@secretkeylabs/xverse-core");
660
- var permissionTemplate = v7.variant("type", [
661
- v7.object({
662
- ...v7.omit(import_xverse_core.permissions.resources.account.accountPermissionSchema, ["clientId", "actions"]).entries,
663
- actions: v7.partial(import_xverse_core.permissions.resources.account.accountActionsSchema)
899
+ var v14 = __toESM(require("valibot"));
900
+ var accountActionsSchema = v14.object({
901
+ read: v14.optional(v14.boolean())
902
+ });
903
+ var walletActionsSchema = v14.object({});
904
+ var accountPermissionSchema = v14.object({
905
+ type: v14.literal("account"),
906
+ resourceId: v14.string(),
907
+ clientId: v14.string(),
908
+ actions: accountActionsSchema
909
+ });
910
+ var walletPermissionSchema = v14.object({
911
+ type: v14.literal("wallet"),
912
+ resourceId: v14.string(),
913
+ clientId: v14.string(),
914
+ actions: walletActionsSchema
915
+ });
916
+ var PermissionRequestParams = v14.variant("type", [
917
+ v14.object({
918
+ ...v14.omit(accountPermissionSchema, ["clientId"]).entries
664
919
  }),
665
- v7.object({
666
- ...v7.omit(import_xverse_core.permissions.resources.wallet.walletPermissionSchema, ["clientId"]).entries,
667
- actions: v7.partial(import_xverse_core.permissions.resources.wallet.walletActionsSchema)
920
+ v14.object({
921
+ ...v14.omit(walletPermissionSchema, ["clientId"]).entries
668
922
  })
669
923
  ]);
924
+ var permission = v14.variant("type", [accountPermissionSchema, walletPermissionSchema]);
670
925
  var requestPermissionsMethodName = "wallet_requestPermissions";
671
- var requestPermissionsParamsSchema = v7.nullish(v7.array(permissionTemplate));
672
- var requestPermissionsResultSchema = v7.literal(true);
673
- var requestPermissionsRequestMessageSchema = v7.object({
926
+ var requestPermissionsParamsSchema = v14.nullish(v14.array(PermissionRequestParams));
927
+ var requestPermissionsResultSchema = v14.literal(true);
928
+ var requestPermissionsRequestMessageSchema = v14.object({
674
929
  ...rpcRequestMessageSchema.entries,
675
- ...v7.object({
676
- method: v7.literal(requestPermissionsMethodName),
930
+ ...v14.object({
931
+ method: v14.literal(requestPermissionsMethodName),
677
932
  params: requestPermissionsParamsSchema,
678
- id: v7.string()
933
+ id: v14.string()
679
934
  }).entries
680
935
  });
681
936
  var renouncePermissionsMethodName = "wallet_renouncePermissions";
682
- var renouncePermissionsParamsSchema = v7.nullish(v7.null());
683
- var renouncePermissionsResultSchema = v7.nullish(v7.null());
684
- var renouncePermissionsRequestMessageSchema = v7.object({
937
+ var renouncePermissionsParamsSchema = v14.nullish(v14.null());
938
+ var renouncePermissionsResultSchema = v14.nullish(v14.null());
939
+ var renouncePermissionsRequestMessageSchema = v14.object({
685
940
  ...rpcRequestMessageSchema.entries,
686
- ...v7.object({
687
- method: v7.literal(renouncePermissionsMethodName),
941
+ ...v14.object({
942
+ method: v14.literal(renouncePermissionsMethodName),
688
943
  params: renouncePermissionsParamsSchema,
689
- id: v7.string()
944
+ id: v14.string()
690
945
  }).entries
691
946
  });
692
947
  var disconnectMethodName = "wallet_disconnect";
693
- var disconnectParamsSchema = v7.nullish(v7.null());
694
- var disconnectResultSchema = v7.nullish(v7.null());
695
- var disconnectRequestMessageSchema = v7.object({
948
+ var disconnectParamsSchema = v14.nullish(v14.null());
949
+ var disconnectResultSchema = v14.nullish(v14.null());
950
+ var disconnectRequestMessageSchema = v14.object({
696
951
  ...rpcRequestMessageSchema.entries,
697
- ...v7.object({
698
- method: v7.literal(disconnectMethodName),
952
+ ...v14.object({
953
+ method: v14.literal(disconnectMethodName),
699
954
  params: disconnectParamsSchema,
700
- id: v7.string()
955
+ id: v14.string()
701
956
  }).entries
702
957
  });
703
958
  var getWalletTypeMethodName = "wallet_getWalletType";
704
- var getWalletTypeParamsSchema = v7.nullish(v7.null());
959
+ var getWalletTypeParamsSchema = v14.nullish(v14.null());
705
960
  var getWalletTypeResultSchema = walletTypeSchema;
706
- var getWalletTypeRequestMessageSchema = v7.object({
961
+ var getWalletTypeRequestMessageSchema = v14.object({
707
962
  ...rpcRequestMessageSchema.entries,
708
- ...v7.object({
709
- method: v7.literal(getWalletTypeMethodName),
963
+ ...v14.object({
964
+ method: v14.literal(getWalletTypeMethodName),
710
965
  params: getWalletTypeParamsSchema,
711
- id: v7.string()
966
+ id: v14.string()
712
967
  }).entries
713
968
  });
714
969
  var getCurrentPermissionsMethodName = "wallet_getCurrentPermissions";
715
- var getCurrentPermissionsParamsSchema = v7.nullish(v7.null());
716
- var getCurrentPermissionsResultSchema = v7.array(import_xverse_core.permissions.store.permission);
717
- var getCurrentPermissionsRequestMessageSchema = v7.object({
970
+ var getCurrentPermissionsParamsSchema = v14.nullish(v14.null());
971
+ var getCurrentPermissionsResultSchema = v14.array(permission);
972
+ var getCurrentPermissionsRequestMessageSchema = v14.object({
718
973
  ...rpcRequestMessageSchema.entries,
719
- ...v7.object({
720
- method: v7.literal(getCurrentPermissionsMethodName),
974
+ ...v14.object({
975
+ method: v14.literal(getCurrentPermissionsMethodName),
721
976
  params: getCurrentPermissionsParamsSchema,
722
- id: v7.string()
977
+ id: v14.string()
723
978
  }).entries
724
979
  });
725
980
  var getAccountMethodName = "wallet_getAccount";
726
- var getAccountParamsSchema = v7.nullish(v7.null());
727
- var getAccountResultSchema = v7.object({
728
- id: import_xverse_core.permissions.utils.account.accountIdSchema,
729
- addresses: v7.array(addressSchema),
981
+ var getAccountParamsSchema = v14.nullish(v14.null());
982
+ var getAccountResultSchema = v14.object({
983
+ id: v14.string(),
984
+ addresses: v14.array(addressSchema),
730
985
  walletType: walletTypeSchema
731
986
  });
732
- var getAccountRequestMessageSchema = v7.object({
987
+ var getAccountRequestMessageSchema = v14.object({
733
988
  ...rpcRequestMessageSchema.entries,
734
- ...v7.object({
735
- method: v7.literal(getAccountMethodName),
989
+ ...v14.object({
990
+ method: v14.literal(getAccountMethodName),
736
991
  params: getAccountParamsSchema,
737
- id: v7.string()
992
+ id: v14.string()
738
993
  }).entries
739
994
  });
740
995
  var connectMethodName = "wallet_connect";
741
- var connectParamsSchema = v7.nullish(
742
- v7.object({
743
- permissions: v7.optional(v7.array(permissionTemplate))
996
+ var connectParamsSchema = v14.nullish(
997
+ v14.object({
998
+ permissions: v14.optional(v14.array(PermissionRequestParams)),
999
+ addresses: v14.optional(v14.array(v14.enum(AddressPurpose))),
1000
+ message: v14.optional(
1001
+ v14.pipe(v14.string(), v14.maxLength(80, "The message must not exceed 80 characters."))
1002
+ )
744
1003
  })
745
1004
  );
746
1005
  var connectResultSchema = getAccountResultSchema;
747
- var connectRequestMessageSchema = v7.object({
1006
+ var connectRequestMessageSchema = v14.object({
748
1007
  ...rpcRequestMessageSchema.entries,
749
- ...v7.object({
750
- method: v7.literal(connectMethodName),
1008
+ ...v14.object({
1009
+ method: v14.literal(connectMethodName),
751
1010
  params: connectParamsSchema,
752
- id: v7.string()
1011
+ id: v14.string()
753
1012
  }).entries
754
1013
  });
755
1014
 
756
- // src/request/types/runesMethods.ts
757
- var v8 = __toESM(require("valibot"));
758
- var getRunesBalanceMethodName = "runes_getBalance";
759
- var getRunesBalanceParamsSchema = v8.nullish(v8.null());
760
- var getRunesBalanceResultSchema = v8.object({
761
- balances: v8.array(
762
- v8.object({
763
- runeName: v8.string(),
764
- amount: v8.string(),
765
- divisibility: v8.number(),
766
- symbol: v8.string(),
767
- inscriptionId: v8.nullish(v8.string())
1015
+ // src/request/types/runesMethods/etch.ts
1016
+ var v15 = __toESM(require("valibot"));
1017
+ var runesEtchMethodName = "runes_etch";
1018
+ var etchTermsSchema = v15.object({
1019
+ amount: v15.string(),
1020
+ cap: v15.string(),
1021
+ heightStart: v15.optional(v15.string()),
1022
+ heightEnd: v15.optional(v15.string()),
1023
+ offsetStart: v15.optional(v15.string()),
1024
+ offsetEnd: v15.optional(v15.string())
1025
+ });
1026
+ var inscriptionDetailsSchema = v15.object({
1027
+ contentType: v15.string(),
1028
+ contentBase64: v15.string()
1029
+ });
1030
+ var runesEtchParamsSchema = v15.object({
1031
+ runeName: v15.string(),
1032
+ divisibility: v15.optional(v15.number()),
1033
+ symbol: v15.optional(v15.string()),
1034
+ premine: v15.optional(v15.string()),
1035
+ isMintable: v15.boolean(),
1036
+ delegateInscriptionId: v15.optional(v15.string()),
1037
+ destinationAddress: v15.string(),
1038
+ refundAddress: v15.string(),
1039
+ feeRate: v15.number(),
1040
+ appServiceFee: v15.optional(v15.number()),
1041
+ appServiceFeeAddress: v15.optional(v15.string()),
1042
+ terms: v15.optional(etchTermsSchema),
1043
+ inscriptionDetails: v15.optional(inscriptionDetailsSchema),
1044
+ network: v15.optional(v15.enum(BitcoinNetworkType))
1045
+ });
1046
+ var runesEtchResultSchema = v15.object({
1047
+ orderId: v15.string(),
1048
+ fundTransactionId: v15.string(),
1049
+ fundingAddress: v15.string()
1050
+ });
1051
+ var runesEtchRequestMessageSchema = v15.object({
1052
+ ...rpcRequestMessageSchema.entries,
1053
+ ...v15.object({
1054
+ method: v15.literal(runesEtchMethodName),
1055
+ params: runesEtchParamsSchema,
1056
+ id: v15.string()
1057
+ }).entries
1058
+ });
1059
+
1060
+ // src/request/types/runesMethods/getBalance.ts
1061
+ var v16 = __toESM(require("valibot"));
1062
+ var runesGetBalanceMethodName = "runes_getBalance";
1063
+ var runesGetBalanceParamsSchema = v16.nullish(v16.null());
1064
+ var runesGetBalanceResultSchema = v16.object({
1065
+ balances: v16.array(
1066
+ v16.object({
1067
+ runeName: v16.string(),
1068
+ amount: v16.string(),
1069
+ divisibility: v16.number(),
1070
+ symbol: v16.string(),
1071
+ inscriptionId: v16.nullish(v16.string())
768
1072
  })
769
1073
  )
770
1074
  });
771
- var getRunesBalanceRequestMessageSchema = v8.object({
1075
+ var runesGetBalanceRequestMessageSchema = v16.object({
772
1076
  ...rpcRequestMessageSchema.entries,
773
- ...v8.object({
774
- method: v8.literal(getRunesBalanceMethodName),
775
- params: getRunesBalanceParamsSchema,
776
- id: v8.string()
1077
+ ...v16.object({
1078
+ method: v16.literal(runesGetBalanceMethodName),
1079
+ params: runesGetBalanceParamsSchema,
1080
+ id: v16.string()
777
1081
  }).entries
778
1082
  });
779
- var transferRunesMethodName = "runes_transfer";
780
- var transferRunesParamsSchema = v8.object({
781
- recipients: v8.array(
782
- v8.object({
783
- runeName: v8.string(),
784
- amount: v8.string(),
785
- address: v8.string()
1083
+
1084
+ // src/request/types/runesMethods/mint.ts
1085
+ var v17 = __toESM(require("valibot"));
1086
+ var runesMintMethodName = "runes_mint";
1087
+ var runesMintParamsSchema = v17.object({
1088
+ appServiceFee: v17.optional(v17.number()),
1089
+ appServiceFeeAddress: v17.optional(v17.string()),
1090
+ destinationAddress: v17.string(),
1091
+ feeRate: v17.number(),
1092
+ refundAddress: v17.string(),
1093
+ repeats: v17.number(),
1094
+ runeName: v17.string(),
1095
+ network: v17.optional(v17.enum(BitcoinNetworkType))
1096
+ });
1097
+ var runesMintResultSchema = v17.object({
1098
+ orderId: v17.string(),
1099
+ fundTransactionId: v17.string(),
1100
+ fundingAddress: v17.string()
1101
+ });
1102
+ var runesMintRequestMessageSchema = v17.object({
1103
+ ...rpcRequestMessageSchema.entries,
1104
+ ...v17.object({
1105
+ method: v17.literal(runesMintMethodName),
1106
+ params: runesMintParamsSchema,
1107
+ id: v17.string()
1108
+ }).entries
1109
+ });
1110
+
1111
+ // src/request/types/runesMethods/transfer.ts
1112
+ var v18 = __toESM(require("valibot"));
1113
+ var runesTransferMethodName = "runes_transfer";
1114
+ var runesTransferParamsSchema = v18.object({
1115
+ recipients: v18.array(
1116
+ v18.object({
1117
+ runeName: v18.string(),
1118
+ amount: v18.string(),
1119
+ address: v18.string()
786
1120
  })
787
1121
  )
788
1122
  });
789
- var transferRunesRequestSchema = v8.object({
1123
+ var runesTransferResultSchema = v18.object({
1124
+ txid: v18.string()
1125
+ });
1126
+ var runesTransferRequestMessageSchema = v18.object({
790
1127
  ...rpcRequestMessageSchema.entries,
791
- ...v8.object({
792
- method: v8.literal(transferRunesMethodName),
793
- params: transferRunesParamsSchema,
794
- id: v8.string()
1128
+ ...v18.object({
1129
+ method: v18.literal(runesTransferMethodName),
1130
+ params: runesTransferParamsSchema,
1131
+ id: v18.string()
795
1132
  }).entries
796
1133
  });
797
- var TransferRunesResultSchema = v8.object({
798
- txid: v8.string()
799
- });
800
1134
 
801
1135
  // src/request/types/ordinalsMethods.ts
802
- var v9 = __toESM(require("valibot"));
1136
+ var v19 = __toESM(require("valibot"));
803
1137
  var getInscriptionsMethodName = "ord_getInscriptions";
804
- var getInscriptionsParamsSchema = v9.object({
805
- offset: v9.number(),
806
- limit: v9.number()
807
- });
808
- var getInscriptionsResultSchema = v9.object({
809
- total: v9.number(),
810
- limit: v9.number(),
811
- offset: v9.number(),
812
- inscriptions: v9.array(
813
- v9.object({
814
- inscriptionId: v9.string(),
815
- inscriptionNumber: v9.string(),
816
- address: v9.string(),
817
- collectionName: v9.optional(v9.string()),
818
- postage: v9.string(),
819
- contentLength: v9.string(),
820
- contentType: v9.string(),
821
- timestamp: v9.number(),
822
- offset: v9.number(),
823
- genesisTransaction: v9.string(),
824
- output: v9.string()
1138
+ var getInscriptionsParamsSchema = v19.object({
1139
+ offset: v19.number(),
1140
+ limit: v19.number()
1141
+ });
1142
+ var getInscriptionsResultSchema = v19.object({
1143
+ total: v19.number(),
1144
+ limit: v19.number(),
1145
+ offset: v19.number(),
1146
+ inscriptions: v19.array(
1147
+ v19.object({
1148
+ inscriptionId: v19.string(),
1149
+ inscriptionNumber: v19.string(),
1150
+ address: v19.string(),
1151
+ collectionName: v19.optional(v19.string()),
1152
+ postage: v19.string(),
1153
+ contentLength: v19.string(),
1154
+ contentType: v19.string(),
1155
+ timestamp: v19.number(),
1156
+ offset: v19.number(),
1157
+ genesisTransaction: v19.string(),
1158
+ output: v19.string()
825
1159
  })
826
1160
  )
827
1161
  });
828
- var getInscriptionsSchema = v9.object({
1162
+ var getInscriptionsRequestMessageSchema = v19.object({
829
1163
  ...rpcRequestMessageSchema.entries,
830
- ...v9.object({
831
- method: v9.literal(getInscriptionsMethodName),
1164
+ ...v19.object({
1165
+ method: v19.literal(getInscriptionsMethodName),
832
1166
  params: getInscriptionsParamsSchema,
833
- id: v9.string()
1167
+ id: v19.string()
834
1168
  }).entries
835
1169
  });
836
1170
  var sendInscriptionsMethodName = "ord_sendInscriptions";
837
- var sendInscriptionsParamsSchema = v9.object({
838
- transfers: v9.array(
839
- v9.object({
840
- address: v9.string(),
841
- inscriptionId: v9.string()
1171
+ var sendInscriptionsParamsSchema = v19.object({
1172
+ transfers: v19.array(
1173
+ v19.object({
1174
+ address: v19.string(),
1175
+ inscriptionId: v19.string()
842
1176
  })
843
1177
  )
844
1178
  });
845
- var sendInscriptionsResultSchema = v9.object({
846
- txid: v9.string()
1179
+ var sendInscriptionsResultSchema = v19.object({
1180
+ txid: v19.string()
847
1181
  });
848
- var sendInscriptionsSchema = v9.object({
1182
+ var sendInscriptionsRequestMessageSchema = v19.object({
849
1183
  ...rpcRequestMessageSchema.entries,
850
- ...v9.object({
851
- method: v9.literal(sendInscriptionsMethodName),
1184
+ ...v19.object({
1185
+ method: v19.literal(sendInscriptionsMethodName),
852
1186
  params: sendInscriptionsParamsSchema,
853
- id: v9.string()
1187
+ id: v19.string()
854
1188
  }).entries
855
1189
  });
856
1190
 
@@ -867,13 +1201,13 @@ var request = async (method, params, providerId) => {
867
1201
  throw new Error("A wallet method is required");
868
1202
  }
869
1203
  const response = await provider.request(method, params);
870
- if (v10.is(rpcErrorResponseMessageSchema, response)) {
1204
+ if (v20.is(rpcErrorResponseMessageSchema, response)) {
871
1205
  return {
872
1206
  status: "error",
873
1207
  error: response.error
874
1208
  };
875
1209
  }
876
- if (v10.is(rpcSuccessResponseMessageSchema, response)) {
1210
+ if (v20.is(rpcSuccessResponseMessageSchema, response)) {
877
1211
  return {
878
1212
  status: "success",
879
1213
  result: response.result
@@ -1470,15 +1804,14 @@ var UnisatAdapter = class extends SatsConnectAdapter {
1470
1804
  autoFinalized: broadcast,
1471
1805
  toSignInputs: convertSignInputsToInputType(signInputs)
1472
1806
  });
1807
+ const signedPsbtBase64 = import_buffer.Buffer.from(signedPsbt, "hex").toString("base64");
1808
+ let txid;
1473
1809
  if (broadcast) {
1474
- const txid = await window.unisat.pushPsbt(psbtHex);
1475
- return {
1476
- psbt: signedPsbt,
1477
- txid
1478
- };
1810
+ txid = await window.unisat.pushPsbt(signedPsbt);
1479
1811
  }
1480
1812
  return {
1481
- psbt: psbtHex
1813
+ psbt: signedPsbtBase64,
1814
+ txid
1482
1815
  };
1483
1816
  }
1484
1817
  requestInternal = async (method, params) => {
@@ -1629,8 +1962,7 @@ var extractOrValidateCapabilities = (provider, reportedCapabilities) => {
1629
1962
  addListener: validateCapability("addListener")
1630
1963
  };
1631
1964
  return Object.entries(capabilityMap).reduce((acc, [capability, value]) => {
1632
- if (value)
1633
- return [...acc, capability];
1965
+ if (value) return [...acc, capability];
1634
1966
  return acc;
1635
1967
  }, []);
1636
1968
  };
@@ -1822,12 +2154,14 @@ var signMultipleTransactions = async (options) => {
1822
2154
  BitcoinNetworkType,
1823
2155
  DefaultAdaptersInfo,
1824
2156
  MessageSigningProtocols,
2157
+ PermissionRequestParams,
1825
2158
  RpcErrorCode,
1826
2159
  RpcIdSchema,
1827
2160
  SatsConnectAdapter,
1828
- TransferRunesResultSchema,
2161
+ accountActionsSchema,
1829
2162
  accountChangeEventName,
1830
2163
  accountChangeSchema,
2164
+ accountPermissionSchema,
1831
2165
  addListener,
1832
2166
  addressSchema,
1833
2167
  connectMethodName,
@@ -1872,15 +2206,11 @@ var signMultipleTransactions = async (options) => {
1872
2206
  getInfoResultSchema,
1873
2207
  getInscriptionsMethodName,
1874
2208
  getInscriptionsParamsSchema,
2209
+ getInscriptionsRequestMessageSchema,
1875
2210
  getInscriptionsResultSchema,
1876
- getInscriptionsSchema,
1877
2211
  getProviderById,
1878
2212
  getProviderOrThrow,
1879
2213
  getProviders,
1880
- getRunesBalanceMethodName,
1881
- getRunesBalanceParamsSchema,
1882
- getRunesBalanceRequestMessageSchema,
1883
- getRunesBalanceResultSchema,
1884
2214
  getSupportedWallets,
1885
2215
  getWalletTypeMethodName,
1886
2216
  getWalletTypeParamsSchema,
@@ -1889,7 +2219,7 @@ var signMultipleTransactions = async (options) => {
1889
2219
  isProviderInstalled,
1890
2220
  networkChangeEventName,
1891
2221
  networkChangeSchema,
1892
- permissionTemplate,
2222
+ permission,
1893
2223
  removeDefaultProvider,
1894
2224
  renouncePermissionsMethodName,
1895
2225
  renouncePermissionsParamsSchema,
@@ -1904,11 +2234,27 @@ var signMultipleTransactions = async (options) => {
1904
2234
  rpcRequestMessageSchema,
1905
2235
  rpcResponseMessageSchema,
1906
2236
  rpcSuccessResponseMessageSchema,
2237
+ runesEtchMethodName,
2238
+ runesEtchParamsSchema,
2239
+ runesEtchRequestMessageSchema,
2240
+ runesEtchResultSchema,
2241
+ runesGetBalanceMethodName,
2242
+ runesGetBalanceParamsSchema,
2243
+ runesGetBalanceRequestMessageSchema,
2244
+ runesGetBalanceResultSchema,
2245
+ runesMintMethodName,
2246
+ runesMintParamsSchema,
2247
+ runesMintRequestMessageSchema,
2248
+ runesMintResultSchema,
2249
+ runesTransferMethodName,
2250
+ runesTransferParamsSchema,
2251
+ runesTransferRequestMessageSchema,
2252
+ runesTransferResultSchema,
1907
2253
  sendBtcTransaction,
1908
2254
  sendInscriptionsMethodName,
1909
2255
  sendInscriptionsParamsSchema,
2256
+ sendInscriptionsRequestMessageSchema,
1910
2257
  sendInscriptionsResultSchema,
1911
- sendInscriptionsSchema,
1912
2258
  sendTransferMethodName,
1913
2259
  sendTransferParamsSchema,
1914
2260
  sendTransferRequestMessageSchema,
@@ -1929,18 +2275,37 @@ var signMultipleTransactions = async (options) => {
1929
2275
  stxCallContractParamsSchema,
1930
2276
  stxCallContractRequestMessageSchema,
1931
2277
  stxCallContractResultSchema,
2278
+ stxDeployContractMethodName,
2279
+ stxDeployContractParamsSchema,
2280
+ stxDeployContractRequestMessageSchema,
2281
+ stxDeployContractResultSchema,
2282
+ stxGetAccountsMethodName,
2283
+ stxGetAccountsParamsSchema,
2284
+ stxGetAccountsRequestMessageSchema,
2285
+ stxGetAccountsResultSchema,
1932
2286
  stxGetAddressesMethodName,
1933
2287
  stxGetAddressesParamsSchema,
1934
2288
  stxGetAddressesRequestMessageSchema,
1935
2289
  stxGetAddressesResultSchema,
2290
+ stxSignMessageMethodName,
2291
+ stxSignMessageParamsSchema,
2292
+ stxSignMessageRequestMessageSchema,
2293
+ stxSignMessageResultSchema,
2294
+ stxSignStructuredMessageMethodName,
2295
+ stxSignStructuredMessageParamsSchema,
2296
+ stxSignStructuredMessageRequestMessageSchema,
2297
+ stxSignStructuredMessageResultSchema,
1936
2298
  stxSignTransactionMethodName,
1937
2299
  stxSignTransactionParamsSchema,
1938
2300
  stxSignTransactionRequestMessageSchema,
1939
2301
  stxSignTransactionResultSchema,
1940
- transferRunesMethodName,
1941
- transferRunesParamsSchema,
1942
- transferRunesRequestSchema,
2302
+ stxTransferStxMethodName,
2303
+ stxTransferStxParamsSchema,
2304
+ stxTransferStxRequestMessageSchema,
2305
+ stxTransferStxResultSchema,
2306
+ walletActionsSchema,
1943
2307
  walletEventSchema,
2308
+ walletPermissionSchema,
1944
2309
  walletTypeSchema,
1945
2310
  walletTypes
1946
2311
  });