@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.d.mts +212 -22
- package/dist/index.d.ts +212 -22
- package/dist/index.js +892 -727
- package/dist/index.mjs +875 -727
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -40,6 +40,7 @@ __export(index_exports, {
|
|
|
40
40
|
RpcErrorCode: () => RpcErrorCode,
|
|
41
41
|
RpcIdSchema: () => RpcIdSchema,
|
|
42
42
|
SatsConnectAdapter: () => SatsConnectAdapter,
|
|
43
|
+
SparkNetworkType: () => SparkNetworkType,
|
|
43
44
|
StacksNetworkType: () => StacksNetworkType,
|
|
44
45
|
StarknetNetworkType: () => StarknetNetworkType,
|
|
45
46
|
accountActionsSchema: () => accountActionsSchema,
|
|
@@ -171,6 +172,22 @@ __export(index_exports, {
|
|
|
171
172
|
signPsbtRequestMessageSchema: () => signPsbtRequestMessageSchema,
|
|
172
173
|
signPsbtResultSchema: () => signPsbtResultSchema,
|
|
173
174
|
signTransaction: () => signTransaction,
|
|
175
|
+
sparkGetAddressesMethodName: () => sparkGetAddressesMethodName,
|
|
176
|
+
sparkGetAddressesParamsSchema: () => sparkGetAddressesParamsSchema,
|
|
177
|
+
sparkGetAddressesRequestMessageSchema: () => sparkGetAddressesRequestMessageSchema,
|
|
178
|
+
sparkGetAddressesResultSchema: () => sparkGetAddressesResultSchema,
|
|
179
|
+
sparkGetBalanceMethodName: () => sparkGetBalanceMethodName,
|
|
180
|
+
sparkGetBalanceParamsSchema: () => sparkGetBalanceParamsSchema,
|
|
181
|
+
sparkGetBalanceRequestMessageSchema: () => sparkGetBalanceRequestMessageSchema,
|
|
182
|
+
sparkGetBalanceResultSchema: () => sparkGetBalanceResultSchema,
|
|
183
|
+
sparkTransferMethodName: () => sparkTransferMethodName,
|
|
184
|
+
sparkTransferParamsSchema: () => sparkTransferParamsSchema,
|
|
185
|
+
sparkTransferRequestMessageSchema: () => sparkTransferRequestMessageSchema,
|
|
186
|
+
sparkTransferResultSchema: () => sparkTransferResultSchema,
|
|
187
|
+
sparkTransferTokenMethodName: () => sparkTransferTokenMethodName,
|
|
188
|
+
sparkTransferTokenParamsSchema: () => sparkTransferTokenParamsSchema,
|
|
189
|
+
sparkTransferTokenRequestMessageSchema: () => sparkTransferTokenRequestMessageSchema,
|
|
190
|
+
sparkTransferTokenResultSchema: () => sparkTransferTokenResultSchema,
|
|
174
191
|
stxCallContractMethodName: () => stxCallContractMethodName,
|
|
175
192
|
stxCallContractParamsSchema: () => stxCallContractParamsSchema,
|
|
176
193
|
stxCallContractRequestMessageSchema: () => stxCallContractRequestMessageSchema,
|
|
@@ -234,6 +251,8 @@ var AddressPurpose = /* @__PURE__ */ ((AddressPurpose2) => {
|
|
|
234
251
|
AddressPurpose2["Ordinals"] = "ordinals";
|
|
235
252
|
AddressPurpose2["Payment"] = "payment";
|
|
236
253
|
AddressPurpose2["Stacks"] = "stacks";
|
|
254
|
+
AddressPurpose2["Starknet"] = "starknet";
|
|
255
|
+
AddressPurpose2["Spark"] = "spark";
|
|
237
256
|
return AddressPurpose2;
|
|
238
257
|
})(AddressPurpose || {});
|
|
239
258
|
var AddressType = /* @__PURE__ */ ((AddressType3) => {
|
|
@@ -243,6 +262,8 @@ var AddressType = /* @__PURE__ */ ((AddressType3) => {
|
|
|
243
262
|
AddressType3["p2wsh"] = "p2wsh";
|
|
244
263
|
AddressType3["p2tr"] = "p2tr";
|
|
245
264
|
AddressType3["stacks"] = "stacks";
|
|
265
|
+
AddressType3["starknet"] = "starknet";
|
|
266
|
+
AddressType3["spark"] = "spark";
|
|
246
267
|
return AddressType3;
|
|
247
268
|
})(AddressType || {});
|
|
248
269
|
var addressSchema = v2.object({
|
|
@@ -290,6 +311,11 @@ var StarknetNetworkType = /* @__PURE__ */ ((StarknetNetworkType2) => {
|
|
|
290
311
|
StarknetNetworkType2["Sepolia"] = "sepolia";
|
|
291
312
|
return StarknetNetworkType2;
|
|
292
313
|
})(StarknetNetworkType || {});
|
|
314
|
+
var SparkNetworkType = /* @__PURE__ */ ((SparkNetworkType2) => {
|
|
315
|
+
SparkNetworkType2["Mainnet"] = "mainnet";
|
|
316
|
+
SparkNetworkType2["Regtest"] = "regtest";
|
|
317
|
+
return SparkNetworkType2;
|
|
318
|
+
})(SparkNetworkType || {});
|
|
293
319
|
var RpcIdSchema = v3.optional(v3.union([v3.string(), v3.number(), v3.null()]));
|
|
294
320
|
var rpcRequestMessageSchema = v3.object({
|
|
295
321
|
jsonrpc: v3.literal("2.0"),
|
|
@@ -400,523 +426,1041 @@ function getSupportedWallets() {
|
|
|
400
426
|
}
|
|
401
427
|
|
|
402
428
|
// src/request/index.ts
|
|
403
|
-
var
|
|
404
|
-
|
|
405
|
-
// src/request/types/stxMethods/callContract.ts
|
|
406
|
-
var v5 = __toESM(require("valibot"));
|
|
407
|
-
var stxCallContractMethodName = "stx_callContract";
|
|
408
|
-
var stxCallContractParamsSchema = v5.object({
|
|
409
|
-
/**
|
|
410
|
-
* The contract principal.
|
|
411
|
-
*
|
|
412
|
-
* E.g. `"SPKE...GD5C.my-contract"`
|
|
413
|
-
*/
|
|
414
|
-
contract: v5.string(),
|
|
415
|
-
/**
|
|
416
|
-
* The name of the function to call.
|
|
417
|
-
*
|
|
418
|
-
* Note: spec changes ongoing,
|
|
419
|
-
* https://github.com/stacksgov/sips/pull/166#pullrequestreview-1914236999
|
|
420
|
-
*/
|
|
421
|
-
functionName: v5.string(),
|
|
422
|
-
/**
|
|
423
|
-
* @deprecated in favor of `functionArgs` for @stacks/connect compatibility
|
|
424
|
-
*/
|
|
425
|
-
arguments: v5.optional(v5.array(v5.string())),
|
|
426
|
-
/**
|
|
427
|
-
* The function's arguments. The arguments are expected to be hex-encoded
|
|
428
|
-
* strings of Clarity values.
|
|
429
|
-
*
|
|
430
|
-
* To convert Clarity values to their hex representation, the `cvToHex`
|
|
431
|
-
* helper from the `@stacks/transactions` package may be helpful.
|
|
432
|
-
*
|
|
433
|
-
* ```js
|
|
434
|
-
* import { cvToHex } from '@stacks/transactions';
|
|
435
|
-
*
|
|
436
|
-
* const functionArgs = [someClarityValue1, someClarityValue2];
|
|
437
|
-
* const hexArgs = functionArgs.map(cvToHex);
|
|
438
|
-
* ```
|
|
439
|
-
*/
|
|
440
|
-
functionArgs: v5.optional(v5.array(v5.string())),
|
|
441
|
-
/**
|
|
442
|
-
* The post conditions to apply to the contract call.
|
|
443
|
-
*/
|
|
444
|
-
postConditions: v5.optional(v5.array(v5.string())),
|
|
445
|
-
/**
|
|
446
|
-
* The mode to apply to the post conditions.
|
|
447
|
-
*/
|
|
448
|
-
postConditionMode: v5.optional(v5.union([v5.literal("allow"), v5.literal("deny")]))
|
|
449
|
-
});
|
|
450
|
-
var stxCallContractResultSchema = v5.object({
|
|
451
|
-
/**
|
|
452
|
-
* The ID of the transaction.
|
|
453
|
-
*/
|
|
454
|
-
txid: v5.string(),
|
|
455
|
-
/**
|
|
456
|
-
* A Stacks transaction as a hex-encoded string.
|
|
457
|
-
*/
|
|
458
|
-
transaction: v5.string()
|
|
459
|
-
});
|
|
460
|
-
var stxCallContractRequestMessageSchema = v5.object({
|
|
461
|
-
...rpcRequestMessageSchema.entries,
|
|
462
|
-
...v5.object({
|
|
463
|
-
method: v5.literal(stxCallContractMethodName),
|
|
464
|
-
params: stxCallContractParamsSchema,
|
|
465
|
-
id: v5.string()
|
|
466
|
-
}).entries
|
|
467
|
-
});
|
|
429
|
+
var v25 = __toESM(require("valibot"));
|
|
468
430
|
|
|
469
|
-
// src/request/types/
|
|
431
|
+
// src/request/types/btcMethods.ts
|
|
470
432
|
var v6 = __toESM(require("valibot"));
|
|
471
|
-
var stxDeployContractMethodName = "stx_deployContract";
|
|
472
|
-
var stxDeployContractParamsSchema = v6.object({
|
|
473
|
-
/**
|
|
474
|
-
* Name of the contract.
|
|
475
|
-
*/
|
|
476
|
-
name: v6.string(),
|
|
477
|
-
/**
|
|
478
|
-
* The source code of the Clarity contract.
|
|
479
|
-
*/
|
|
480
|
-
clarityCode: v6.string(),
|
|
481
|
-
/**
|
|
482
|
-
* The version of the Clarity contract.
|
|
483
|
-
*/
|
|
484
|
-
clarityVersion: v6.optional(v6.number()),
|
|
485
|
-
/**
|
|
486
|
-
* The post conditions to apply to the contract call.
|
|
487
|
-
*/
|
|
488
|
-
postConditions: v6.optional(v6.array(v6.string())),
|
|
489
|
-
/**
|
|
490
|
-
* The mode to apply to the post conditions.
|
|
491
|
-
*/
|
|
492
|
-
postConditionMode: v6.optional(v6.union([v6.literal("allow"), v6.literal("deny")]))
|
|
493
|
-
});
|
|
494
|
-
var stxDeployContractResultSchema = v6.object({
|
|
495
|
-
/**
|
|
496
|
-
* The ID of the transaction.
|
|
497
|
-
*/
|
|
498
|
-
txid: v6.string(),
|
|
499
|
-
/**
|
|
500
|
-
* A Stacks transaction as a hex-encoded string.
|
|
501
|
-
*/
|
|
502
|
-
transaction: v6.string()
|
|
503
|
-
});
|
|
504
|
-
var stxDeployContractRequestMessageSchema = v6.object({
|
|
505
|
-
...rpcRequestMessageSchema.entries,
|
|
506
|
-
...v6.object({
|
|
507
|
-
method: v6.literal(stxDeployContractMethodName),
|
|
508
|
-
params: stxDeployContractParamsSchema,
|
|
509
|
-
id: v6.string()
|
|
510
|
-
}).entries
|
|
511
|
-
});
|
|
512
|
-
|
|
513
|
-
// src/request/types/stxMethods/getAccounts.ts
|
|
514
|
-
var v8 = __toESM(require("valibot"));
|
|
515
433
|
|
|
516
434
|
// src/request/types/walletMethods.ts
|
|
517
|
-
var
|
|
518
|
-
var accountActionsSchema =
|
|
519
|
-
read:
|
|
435
|
+
var v5 = __toESM(require("valibot"));
|
|
436
|
+
var accountActionsSchema = v5.object({
|
|
437
|
+
read: v5.optional(v5.boolean())
|
|
520
438
|
});
|
|
521
|
-
var walletActionsSchema =
|
|
522
|
-
readNetwork:
|
|
439
|
+
var walletActionsSchema = v5.object({
|
|
440
|
+
readNetwork: v5.optional(v5.boolean())
|
|
523
441
|
});
|
|
524
|
-
var accountPermissionSchema =
|
|
525
|
-
type:
|
|
526
|
-
resourceId:
|
|
527
|
-
clientId:
|
|
442
|
+
var accountPermissionSchema = v5.object({
|
|
443
|
+
type: v5.literal("account"),
|
|
444
|
+
resourceId: v5.string(),
|
|
445
|
+
clientId: v5.string(),
|
|
528
446
|
actions: accountActionsSchema
|
|
529
447
|
});
|
|
530
|
-
var walletPermissionSchema =
|
|
531
|
-
type:
|
|
532
|
-
resourceId:
|
|
533
|
-
clientId:
|
|
448
|
+
var walletPermissionSchema = v5.object({
|
|
449
|
+
type: v5.literal("wallet"),
|
|
450
|
+
resourceId: v5.string(),
|
|
451
|
+
clientId: v5.string(),
|
|
534
452
|
actions: walletActionsSchema
|
|
535
453
|
});
|
|
536
|
-
var PermissionRequestParams =
|
|
537
|
-
|
|
538
|
-
...
|
|
454
|
+
var PermissionRequestParams = v5.variant("type", [
|
|
455
|
+
v5.object({
|
|
456
|
+
...v5.omit(accountPermissionSchema, ["clientId"]).entries
|
|
539
457
|
}),
|
|
540
|
-
|
|
541
|
-
...
|
|
458
|
+
v5.object({
|
|
459
|
+
...v5.omit(walletPermissionSchema, ["clientId"]).entries
|
|
542
460
|
})
|
|
543
461
|
]);
|
|
544
|
-
var permission =
|
|
462
|
+
var permission = v5.variant("type", [accountPermissionSchema, walletPermissionSchema]);
|
|
545
463
|
var requestPermissionsMethodName = "wallet_requestPermissions";
|
|
546
|
-
var requestPermissionsParamsSchema =
|
|
547
|
-
var requestPermissionsResultSchema =
|
|
548
|
-
var requestPermissionsRequestMessageSchema =
|
|
464
|
+
var requestPermissionsParamsSchema = v5.nullish(v5.array(PermissionRequestParams));
|
|
465
|
+
var requestPermissionsResultSchema = v5.literal(true);
|
|
466
|
+
var requestPermissionsRequestMessageSchema = v5.object({
|
|
549
467
|
...rpcRequestMessageSchema.entries,
|
|
550
|
-
...
|
|
551
|
-
method:
|
|
468
|
+
...v5.object({
|
|
469
|
+
method: v5.literal(requestPermissionsMethodName),
|
|
552
470
|
params: requestPermissionsParamsSchema,
|
|
553
|
-
id:
|
|
471
|
+
id: v5.string()
|
|
554
472
|
}).entries
|
|
555
473
|
});
|
|
556
474
|
var renouncePermissionsMethodName = "wallet_renouncePermissions";
|
|
557
|
-
var renouncePermissionsParamsSchema =
|
|
558
|
-
var renouncePermissionsResultSchema =
|
|
559
|
-
var renouncePermissionsRequestMessageSchema =
|
|
475
|
+
var renouncePermissionsParamsSchema = v5.nullish(v5.null());
|
|
476
|
+
var renouncePermissionsResultSchema = v5.nullish(v5.null());
|
|
477
|
+
var renouncePermissionsRequestMessageSchema = v5.object({
|
|
560
478
|
...rpcRequestMessageSchema.entries,
|
|
561
|
-
...
|
|
562
|
-
method:
|
|
479
|
+
...v5.object({
|
|
480
|
+
method: v5.literal(renouncePermissionsMethodName),
|
|
563
481
|
params: renouncePermissionsParamsSchema,
|
|
564
|
-
id:
|
|
482
|
+
id: v5.string()
|
|
565
483
|
}).entries
|
|
566
484
|
});
|
|
567
485
|
var disconnectMethodName = "wallet_disconnect";
|
|
568
|
-
var disconnectParamsSchema =
|
|
569
|
-
var disconnectResultSchema =
|
|
570
|
-
var disconnectRequestMessageSchema =
|
|
486
|
+
var disconnectParamsSchema = v5.nullish(v5.null());
|
|
487
|
+
var disconnectResultSchema = v5.nullish(v5.null());
|
|
488
|
+
var disconnectRequestMessageSchema = v5.object({
|
|
571
489
|
...rpcRequestMessageSchema.entries,
|
|
572
|
-
...
|
|
573
|
-
method:
|
|
490
|
+
...v5.object({
|
|
491
|
+
method: v5.literal(disconnectMethodName),
|
|
574
492
|
params: disconnectParamsSchema,
|
|
575
|
-
id:
|
|
493
|
+
id: v5.string()
|
|
576
494
|
}).entries
|
|
577
495
|
});
|
|
578
496
|
var getWalletTypeMethodName = "wallet_getWalletType";
|
|
579
|
-
var getWalletTypeParamsSchema =
|
|
497
|
+
var getWalletTypeParamsSchema = v5.nullish(v5.null());
|
|
580
498
|
var getWalletTypeResultSchema = walletTypeSchema;
|
|
581
|
-
var getWalletTypeRequestMessageSchema =
|
|
499
|
+
var getWalletTypeRequestMessageSchema = v5.object({
|
|
582
500
|
...rpcRequestMessageSchema.entries,
|
|
583
|
-
...
|
|
584
|
-
method:
|
|
501
|
+
...v5.object({
|
|
502
|
+
method: v5.literal(getWalletTypeMethodName),
|
|
585
503
|
params: getWalletTypeParamsSchema,
|
|
586
|
-
id:
|
|
504
|
+
id: v5.string()
|
|
587
505
|
}).entries
|
|
588
506
|
});
|
|
589
507
|
var getCurrentPermissionsMethodName = "wallet_getCurrentPermissions";
|
|
590
|
-
var getCurrentPermissionsParamsSchema =
|
|
591
|
-
var getCurrentPermissionsResultSchema =
|
|
592
|
-
var getCurrentPermissionsRequestMessageSchema =
|
|
508
|
+
var getCurrentPermissionsParamsSchema = v5.nullish(v5.null());
|
|
509
|
+
var getCurrentPermissionsResultSchema = v5.array(permission);
|
|
510
|
+
var getCurrentPermissionsRequestMessageSchema = v5.object({
|
|
593
511
|
...rpcRequestMessageSchema.entries,
|
|
594
|
-
...
|
|
595
|
-
method:
|
|
512
|
+
...v5.object({
|
|
513
|
+
method: v5.literal(getCurrentPermissionsMethodName),
|
|
596
514
|
params: getCurrentPermissionsParamsSchema,
|
|
597
|
-
id:
|
|
515
|
+
id: v5.string()
|
|
598
516
|
}).entries
|
|
599
517
|
});
|
|
600
518
|
var getNetworkMethodName = "wallet_getNetwork";
|
|
601
|
-
var getNetworkParamsSchema =
|
|
602
|
-
var getNetworkResultSchema =
|
|
603
|
-
bitcoin:
|
|
604
|
-
name:
|
|
519
|
+
var getNetworkParamsSchema = v5.nullish(v5.null());
|
|
520
|
+
var getNetworkResultSchema = v5.object({
|
|
521
|
+
bitcoin: v5.object({
|
|
522
|
+
name: v5.enum(BitcoinNetworkType)
|
|
605
523
|
}),
|
|
606
|
-
stacks:
|
|
607
|
-
name:
|
|
524
|
+
stacks: v5.object({
|
|
525
|
+
name: v5.enum(StacksNetworkType)
|
|
526
|
+
}),
|
|
527
|
+
spark: v5.object({
|
|
528
|
+
name: v5.enum(SparkNetworkType)
|
|
608
529
|
})
|
|
609
530
|
});
|
|
610
|
-
var getNetworkRequestMessageSchema =
|
|
531
|
+
var getNetworkRequestMessageSchema = v5.object({
|
|
611
532
|
...rpcRequestMessageSchema.entries,
|
|
612
|
-
...
|
|
613
|
-
method:
|
|
533
|
+
...v5.object({
|
|
534
|
+
method: v5.literal(getNetworkMethodName),
|
|
614
535
|
params: getNetworkParamsSchema,
|
|
615
|
-
id:
|
|
536
|
+
id: v5.string()
|
|
616
537
|
}).entries
|
|
617
538
|
});
|
|
618
539
|
var changeNetworkMethodName = "wallet_changeNetwork";
|
|
619
|
-
var changeNetworkParamsSchema =
|
|
620
|
-
name:
|
|
540
|
+
var changeNetworkParamsSchema = v5.object({
|
|
541
|
+
name: v5.enum(BitcoinNetworkType)
|
|
621
542
|
});
|
|
622
|
-
var changeNetworkResultSchema =
|
|
623
|
-
var changeNetworkRequestMessageSchema =
|
|
543
|
+
var changeNetworkResultSchema = v5.nullish(v5.null());
|
|
544
|
+
var changeNetworkRequestMessageSchema = v5.object({
|
|
624
545
|
...rpcRequestMessageSchema.entries,
|
|
625
|
-
...
|
|
626
|
-
method:
|
|
546
|
+
...v5.object({
|
|
547
|
+
method: v5.literal(changeNetworkMethodName),
|
|
627
548
|
params: changeNetworkParamsSchema,
|
|
628
|
-
id:
|
|
549
|
+
id: v5.string()
|
|
629
550
|
}).entries
|
|
630
551
|
});
|
|
631
552
|
var changeNetworkByIdMethodName = "wallet_changeNetworkById";
|
|
632
|
-
var changeNetworkByIdParamsSchema =
|
|
633
|
-
id:
|
|
553
|
+
var changeNetworkByIdParamsSchema = v5.object({
|
|
554
|
+
id: v5.string()
|
|
634
555
|
});
|
|
635
|
-
var changeNetworkByIdResultSchema =
|
|
636
|
-
var changeNetworkByIdRequestMessageSchema =
|
|
556
|
+
var changeNetworkByIdResultSchema = v5.nullish(v5.null());
|
|
557
|
+
var changeNetworkByIdRequestMessageSchema = v5.object({
|
|
637
558
|
...rpcRequestMessageSchema.entries,
|
|
638
|
-
...
|
|
639
|
-
method:
|
|
559
|
+
...v5.object({
|
|
560
|
+
method: v5.literal(changeNetworkByIdMethodName),
|
|
640
561
|
params: changeNetworkByIdParamsSchema,
|
|
641
|
-
id:
|
|
562
|
+
id: v5.string()
|
|
642
563
|
}).entries
|
|
643
564
|
});
|
|
644
565
|
var getAccountMethodName = "wallet_getAccount";
|
|
645
|
-
var getAccountParamsSchema =
|
|
646
|
-
var getAccountResultSchema =
|
|
647
|
-
id:
|
|
648
|
-
addresses:
|
|
566
|
+
var getAccountParamsSchema = v5.nullish(v5.null());
|
|
567
|
+
var getAccountResultSchema = v5.object({
|
|
568
|
+
id: v5.string(),
|
|
569
|
+
addresses: v5.array(addressSchema),
|
|
649
570
|
walletType: walletTypeSchema,
|
|
650
571
|
network: getNetworkResultSchema
|
|
651
572
|
});
|
|
652
|
-
var getAccountRequestMessageSchema =
|
|
573
|
+
var getAccountRequestMessageSchema = v5.object({
|
|
653
574
|
...rpcRequestMessageSchema.entries,
|
|
654
|
-
...
|
|
655
|
-
method:
|
|
575
|
+
...v5.object({
|
|
576
|
+
method: v5.literal(getAccountMethodName),
|
|
656
577
|
params: getAccountParamsSchema,
|
|
657
|
-
id:
|
|
578
|
+
id: v5.string()
|
|
658
579
|
}).entries
|
|
659
580
|
});
|
|
660
581
|
var connectMethodName = "wallet_connect";
|
|
661
|
-
var connectParamsSchema =
|
|
662
|
-
|
|
663
|
-
permissions:
|
|
664
|
-
addresses:
|
|
665
|
-
message:
|
|
666
|
-
|
|
582
|
+
var connectParamsSchema = v5.nullish(
|
|
583
|
+
v5.object({
|
|
584
|
+
permissions: v5.optional(v5.array(PermissionRequestParams)),
|
|
585
|
+
addresses: v5.optional(v5.array(v5.enum(AddressPurpose))),
|
|
586
|
+
message: v5.optional(
|
|
587
|
+
v5.pipe(v5.string(), v5.maxLength(80, "The message must not exceed 80 characters."))
|
|
667
588
|
),
|
|
668
|
-
network:
|
|
589
|
+
network: v5.optional(v5.enum(BitcoinNetworkType))
|
|
669
590
|
})
|
|
670
591
|
);
|
|
671
|
-
var connectResultSchema =
|
|
672
|
-
id:
|
|
673
|
-
addresses:
|
|
592
|
+
var connectResultSchema = v5.object({
|
|
593
|
+
id: v5.string(),
|
|
594
|
+
addresses: v5.array(addressSchema),
|
|
674
595
|
walletType: walletTypeSchema,
|
|
675
596
|
network: getNetworkResultSchema
|
|
676
597
|
});
|
|
677
|
-
var connectRequestMessageSchema =
|
|
598
|
+
var connectRequestMessageSchema = v5.object({
|
|
678
599
|
...rpcRequestMessageSchema.entries,
|
|
679
|
-
...
|
|
680
|
-
method:
|
|
600
|
+
...v5.object({
|
|
601
|
+
method: v5.literal(connectMethodName),
|
|
681
602
|
params: connectParamsSchema,
|
|
682
|
-
id:
|
|
603
|
+
id: v5.string()
|
|
683
604
|
}).entries
|
|
684
605
|
});
|
|
685
606
|
var addNetworkMethodName = "wallet_addNetwork";
|
|
686
|
-
var addNetworkParamsSchema =
|
|
687
|
-
|
|
688
|
-
chain:
|
|
689
|
-
type:
|
|
690
|
-
name:
|
|
691
|
-
rpcUrl:
|
|
692
|
-
rpcFallbackUrl:
|
|
693
|
-
indexerUrl:
|
|
694
|
-
blockExplorerUrl:
|
|
695
|
-
switch:
|
|
607
|
+
var addNetworkParamsSchema = v5.variant("chain", [
|
|
608
|
+
v5.object({
|
|
609
|
+
chain: v5.literal("bitcoin"),
|
|
610
|
+
type: v5.enum(BitcoinNetworkType),
|
|
611
|
+
name: v5.string(),
|
|
612
|
+
rpcUrl: v5.string(),
|
|
613
|
+
rpcFallbackUrl: v5.optional(v5.string()),
|
|
614
|
+
indexerUrl: v5.optional(v5.string()),
|
|
615
|
+
blockExplorerUrl: v5.optional(v5.string()),
|
|
616
|
+
switch: v5.optional(v5.boolean())
|
|
696
617
|
}),
|
|
697
|
-
|
|
698
|
-
chain:
|
|
699
|
-
name:
|
|
700
|
-
type:
|
|
701
|
-
rpcUrl:
|
|
702
|
-
blockExplorerUrl:
|
|
703
|
-
switch:
|
|
618
|
+
v5.object({
|
|
619
|
+
chain: v5.literal("stacks"),
|
|
620
|
+
name: v5.string(),
|
|
621
|
+
type: v5.enum(StacksNetworkType),
|
|
622
|
+
rpcUrl: v5.string(),
|
|
623
|
+
blockExplorerUrl: v5.optional(v5.string()),
|
|
624
|
+
switch: v5.optional(v5.boolean())
|
|
704
625
|
}),
|
|
705
|
-
|
|
706
|
-
chain:
|
|
707
|
-
name:
|
|
708
|
-
type:
|
|
709
|
-
rpcUrl:
|
|
710
|
-
blockExplorerUrl:
|
|
711
|
-
switch:
|
|
626
|
+
v5.object({
|
|
627
|
+
chain: v5.literal("starknet"),
|
|
628
|
+
name: v5.string(),
|
|
629
|
+
type: v5.enum(StarknetNetworkType),
|
|
630
|
+
rpcUrl: v5.string(),
|
|
631
|
+
blockExplorerUrl: v5.optional(v5.string()),
|
|
632
|
+
switch: v5.optional(v5.boolean())
|
|
712
633
|
})
|
|
713
634
|
]);
|
|
714
|
-
var addNetworkRequestMessageSchema =
|
|
635
|
+
var addNetworkRequestMessageSchema = v5.object({
|
|
715
636
|
...rpcRequestMessageSchema.entries,
|
|
716
|
-
...
|
|
717
|
-
method:
|
|
637
|
+
...v5.object({
|
|
638
|
+
method: v5.literal(addNetworkMethodName),
|
|
718
639
|
params: addNetworkParamsSchema,
|
|
719
|
-
id:
|
|
640
|
+
id: v5.string()
|
|
720
641
|
}).entries
|
|
721
642
|
});
|
|
722
|
-
var addNetworkResultSchema =
|
|
723
|
-
id:
|
|
643
|
+
var addNetworkResultSchema = v5.object({
|
|
644
|
+
id: v5.string()
|
|
724
645
|
});
|
|
725
646
|
|
|
726
|
-
// src/request/types/
|
|
727
|
-
var
|
|
728
|
-
var
|
|
729
|
-
var
|
|
647
|
+
// src/request/types/btcMethods.ts
|
|
648
|
+
var getInfoMethodName = "getInfo";
|
|
649
|
+
var getInfoParamsSchema = v6.nullish(v6.null());
|
|
650
|
+
var getInfoResultSchema = v6.object({
|
|
651
|
+
/**
|
|
652
|
+
* Version of the wallet.
|
|
653
|
+
*/
|
|
654
|
+
version: v6.string(),
|
|
655
|
+
/**
|
|
656
|
+
* [WBIP](https://wbips.netlify.app/wbips/WBIP002) methods supported by the wallet.
|
|
657
|
+
*/
|
|
658
|
+
methods: v6.optional(v6.array(v6.string())),
|
|
659
|
+
/**
|
|
660
|
+
* List of WBIP standards supported by the wallet. Not currently used.
|
|
661
|
+
*/
|
|
662
|
+
supports: v6.array(v6.string())
|
|
663
|
+
});
|
|
664
|
+
var getInfoRequestMessageSchema = v6.object({
|
|
665
|
+
...rpcRequestMessageSchema.entries,
|
|
666
|
+
...v6.object({
|
|
667
|
+
method: v6.literal(getInfoMethodName),
|
|
668
|
+
params: getInfoParamsSchema,
|
|
669
|
+
id: v6.string()
|
|
670
|
+
}).entries
|
|
671
|
+
});
|
|
672
|
+
var getAddressesMethodName = "getAddresses";
|
|
673
|
+
var getAddressesParamsSchema = v6.object({
|
|
674
|
+
/**
|
|
675
|
+
* The purposes for which to generate addresses. See
|
|
676
|
+
* {@linkcode AddressPurpose} for available purposes.
|
|
677
|
+
*/
|
|
678
|
+
purposes: v6.array(v6.enum(AddressPurpose)),
|
|
679
|
+
/**
|
|
680
|
+
* A message to be displayed to the user in the request prompt.
|
|
681
|
+
*/
|
|
682
|
+
message: v6.optional(v6.string())
|
|
683
|
+
});
|
|
684
|
+
var getAddressesResultSchema = v6.object({
|
|
730
685
|
/**
|
|
731
686
|
* The addresses generated for the given purposes.
|
|
732
687
|
*/
|
|
733
|
-
addresses:
|
|
734
|
-
v8.object({
|
|
735
|
-
address: v8.string(),
|
|
736
|
-
publicKey: v8.string(),
|
|
737
|
-
gaiaHubUrl: v8.string(),
|
|
738
|
-
gaiaAppKey: v8.string()
|
|
739
|
-
})
|
|
740
|
-
),
|
|
688
|
+
addresses: v6.array(addressSchema),
|
|
741
689
|
network: getNetworkResultSchema
|
|
742
690
|
});
|
|
743
|
-
var
|
|
691
|
+
var getAddressesRequestMessageSchema = v6.object({
|
|
744
692
|
...rpcRequestMessageSchema.entries,
|
|
745
|
-
...
|
|
746
|
-
method:
|
|
747
|
-
params:
|
|
748
|
-
id:
|
|
693
|
+
...v6.object({
|
|
694
|
+
method: v6.literal(getAddressesMethodName),
|
|
695
|
+
params: getAddressesParamsSchema,
|
|
696
|
+
id: v6.string()
|
|
749
697
|
}).entries
|
|
750
698
|
});
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
699
|
+
var signMessageMethodName = "signMessage";
|
|
700
|
+
var MessageSigningProtocols = /* @__PURE__ */ ((MessageSigningProtocols2) => {
|
|
701
|
+
MessageSigningProtocols2["ECDSA"] = "ECDSA";
|
|
702
|
+
MessageSigningProtocols2["BIP322"] = "BIP322";
|
|
703
|
+
return MessageSigningProtocols2;
|
|
704
|
+
})(MessageSigningProtocols || {});
|
|
705
|
+
var signMessageParamsSchema = v6.object({
|
|
706
|
+
/**
|
|
707
|
+
* The address used for signing.
|
|
708
|
+
**/
|
|
709
|
+
address: v6.string(),
|
|
710
|
+
/**
|
|
711
|
+
* The message to sign.
|
|
712
|
+
**/
|
|
713
|
+
message: v6.string(),
|
|
714
|
+
/**
|
|
715
|
+
* The protocol to use for signing the message.
|
|
716
|
+
*/
|
|
717
|
+
protocol: v6.optional(v6.enum(MessageSigningProtocols))
|
|
718
|
+
});
|
|
719
|
+
var signMessageResultSchema = v6.object({
|
|
720
|
+
/**
|
|
721
|
+
* The signature of the message.
|
|
722
|
+
*/
|
|
723
|
+
signature: v6.string(),
|
|
724
|
+
/**
|
|
725
|
+
* hash of the message.
|
|
726
|
+
*/
|
|
727
|
+
messageHash: v6.string(),
|
|
728
|
+
/**
|
|
729
|
+
* The address used for signing.
|
|
730
|
+
*/
|
|
731
|
+
address: v6.string(),
|
|
732
|
+
/**
|
|
733
|
+
* The protocol to use for signing the message.
|
|
734
|
+
*/
|
|
735
|
+
protocol: v6.enum(MessageSigningProtocols)
|
|
736
|
+
});
|
|
737
|
+
var signMessageRequestMessageSchema = v6.object({
|
|
738
|
+
...rpcRequestMessageSchema.entries,
|
|
739
|
+
...v6.object({
|
|
740
|
+
method: v6.literal(signMessageMethodName),
|
|
741
|
+
params: signMessageParamsSchema,
|
|
742
|
+
id: v6.string()
|
|
743
|
+
}).entries
|
|
744
|
+
});
|
|
745
|
+
var sendTransferMethodName = "sendTransfer";
|
|
746
|
+
var sendTransferParamsSchema = v6.object({
|
|
747
|
+
/**
|
|
748
|
+
* Array of recipients to send to.
|
|
749
|
+
* The amount to send to each recipient is in satoshis.
|
|
750
|
+
*/
|
|
751
|
+
recipients: v6.array(
|
|
752
|
+
v6.object({
|
|
753
|
+
address: v6.string(),
|
|
754
|
+
amount: v6.number()
|
|
755
|
+
})
|
|
756
|
+
)
|
|
757
|
+
});
|
|
758
|
+
var sendTransferResultSchema = v6.object({
|
|
759
|
+
/**
|
|
760
|
+
* The transaction id as a hex-encoded string.
|
|
761
|
+
*/
|
|
762
|
+
txid: v6.string()
|
|
763
|
+
});
|
|
764
|
+
var sendTransferRequestMessageSchema = v6.object({
|
|
765
|
+
...rpcRequestMessageSchema.entries,
|
|
766
|
+
...v6.object({
|
|
767
|
+
method: v6.literal(sendTransferMethodName),
|
|
768
|
+
params: sendTransferParamsSchema,
|
|
769
|
+
id: v6.string()
|
|
770
|
+
}).entries
|
|
771
|
+
});
|
|
772
|
+
var signPsbtMethodName = "signPsbt";
|
|
773
|
+
var signPsbtParamsSchema = v6.object({
|
|
774
|
+
/**
|
|
775
|
+
* The base64 encoded PSBT to sign.
|
|
776
|
+
*/
|
|
777
|
+
psbt: v6.string(),
|
|
778
|
+
/**
|
|
779
|
+
* The inputs to sign.
|
|
780
|
+
* The key is the address and the value is an array of indexes of the inputs to sign.
|
|
781
|
+
*/
|
|
782
|
+
signInputs: v6.optional(v6.record(v6.string(), v6.array(v6.number()))),
|
|
783
|
+
/**
|
|
784
|
+
* Whether to broadcast the transaction after signing.
|
|
785
|
+
**/
|
|
786
|
+
broadcast: v6.optional(v6.boolean())
|
|
787
|
+
});
|
|
788
|
+
var signPsbtResultSchema = v6.object({
|
|
789
|
+
/**
|
|
790
|
+
* The base64 encoded PSBT after signing.
|
|
791
|
+
*/
|
|
792
|
+
psbt: v6.string(),
|
|
793
|
+
/**
|
|
794
|
+
* The transaction id as a hex-encoded string.
|
|
795
|
+
* This is only returned if the transaction was broadcast.
|
|
796
|
+
**/
|
|
797
|
+
txid: v6.optional(v6.string())
|
|
798
|
+
});
|
|
799
|
+
var signPsbtRequestMessageSchema = v6.object({
|
|
800
|
+
...rpcRequestMessageSchema.entries,
|
|
801
|
+
...v6.object({
|
|
802
|
+
method: v6.literal(signPsbtMethodName),
|
|
803
|
+
params: signPsbtParamsSchema,
|
|
804
|
+
id: v6.string()
|
|
805
|
+
}).entries
|
|
806
|
+
});
|
|
807
|
+
var getAccountsMethodName = "getAccounts";
|
|
808
|
+
var getAccountsParamsSchema = v6.object({
|
|
809
|
+
/**
|
|
810
|
+
* The purposes for which to generate addresses. See
|
|
811
|
+
* {@linkcode AddressPurpose} for available purposes.
|
|
812
|
+
*/
|
|
813
|
+
purposes: v6.array(v6.enum(AddressPurpose)),
|
|
814
|
+
/**
|
|
815
|
+
* A message to be displayed to the user in the request prompt.
|
|
816
|
+
*/
|
|
817
|
+
message: v6.optional(v6.string())
|
|
818
|
+
});
|
|
819
|
+
var getAccountsResultSchema = v6.array(
|
|
820
|
+
v6.object({
|
|
821
|
+
...addressSchema.entries,
|
|
822
|
+
...v6.object({
|
|
823
|
+
walletType: walletTypeSchema
|
|
824
|
+
}).entries
|
|
825
|
+
})
|
|
826
|
+
);
|
|
827
|
+
var getAccountsRequestMessageSchema = v6.object({
|
|
828
|
+
...rpcRequestMessageSchema.entries,
|
|
829
|
+
...v6.object({
|
|
830
|
+
method: v6.literal(getAccountsMethodName),
|
|
831
|
+
params: getAccountsParamsSchema,
|
|
832
|
+
id: v6.string()
|
|
833
|
+
}).entries
|
|
834
|
+
});
|
|
835
|
+
var getBalanceMethodName = "getBalance";
|
|
836
|
+
var getBalanceParamsSchema = v6.nullish(v6.null());
|
|
837
|
+
var getBalanceResultSchema = v6.object({
|
|
838
|
+
/**
|
|
839
|
+
* The confirmed balance of the wallet in sats. Using a string due to chrome
|
|
840
|
+
* messages not supporting bigint
|
|
841
|
+
* (https://issues.chromium.org/issues/40116184).
|
|
842
|
+
*/
|
|
843
|
+
confirmed: v6.string(),
|
|
844
|
+
/**
|
|
845
|
+
* The unconfirmed balance of the wallet in sats. Using a string due to chrome
|
|
846
|
+
* messages not supporting bigint
|
|
847
|
+
* (https://issues.chromium.org/issues/40116184).
|
|
848
|
+
*/
|
|
849
|
+
unconfirmed: v6.string(),
|
|
850
|
+
/**
|
|
851
|
+
* The total balance (both confirmed and unconfrimed UTXOs) of the wallet in
|
|
852
|
+
* sats. Using a string due to chrome messages not supporting bigint
|
|
853
|
+
* (https://issues.chromium.org/issues/40116184).
|
|
854
|
+
*/
|
|
855
|
+
total: v6.string()
|
|
856
|
+
});
|
|
857
|
+
var getBalanceRequestMessageSchema = v6.object({
|
|
858
|
+
...rpcRequestMessageSchema.entries,
|
|
859
|
+
...v6.object({
|
|
860
|
+
method: v6.literal(getBalanceMethodName),
|
|
861
|
+
id: v6.string()
|
|
862
|
+
}).entries
|
|
863
|
+
});
|
|
864
|
+
|
|
865
|
+
// src/request/types/ordinalsMethods.ts
|
|
866
|
+
var v7 = __toESM(require("valibot"));
|
|
867
|
+
var getInscriptionsMethodName = "ord_getInscriptions";
|
|
868
|
+
var getInscriptionsParamsSchema = v7.object({
|
|
869
|
+
offset: v7.number(),
|
|
870
|
+
limit: v7.number()
|
|
871
|
+
});
|
|
872
|
+
var getInscriptionsResultSchema = v7.object({
|
|
873
|
+
total: v7.number(),
|
|
874
|
+
limit: v7.number(),
|
|
875
|
+
offset: v7.number(),
|
|
876
|
+
inscriptions: v7.array(
|
|
877
|
+
v7.object({
|
|
878
|
+
inscriptionId: v7.string(),
|
|
879
|
+
inscriptionNumber: v7.string(),
|
|
880
|
+
address: v7.string(),
|
|
881
|
+
collectionName: v7.optional(v7.string()),
|
|
882
|
+
postage: v7.string(),
|
|
883
|
+
contentLength: v7.string(),
|
|
884
|
+
contentType: v7.string(),
|
|
885
|
+
timestamp: v7.number(),
|
|
886
|
+
offset: v7.number(),
|
|
887
|
+
genesisTransaction: v7.string(),
|
|
888
|
+
output: v7.string()
|
|
889
|
+
})
|
|
890
|
+
)
|
|
891
|
+
});
|
|
892
|
+
var getInscriptionsRequestMessageSchema = v7.object({
|
|
893
|
+
...rpcRequestMessageSchema.entries,
|
|
894
|
+
...v7.object({
|
|
895
|
+
method: v7.literal(getInscriptionsMethodName),
|
|
896
|
+
params: getInscriptionsParamsSchema,
|
|
897
|
+
id: v7.string()
|
|
898
|
+
}).entries
|
|
899
|
+
});
|
|
900
|
+
var sendInscriptionsMethodName = "ord_sendInscriptions";
|
|
901
|
+
var sendInscriptionsParamsSchema = v7.object({
|
|
902
|
+
transfers: v7.array(
|
|
903
|
+
v7.object({
|
|
904
|
+
address: v7.string(),
|
|
905
|
+
inscriptionId: v7.string()
|
|
906
|
+
})
|
|
907
|
+
)
|
|
908
|
+
});
|
|
909
|
+
var sendInscriptionsResultSchema = v7.object({
|
|
910
|
+
txid: v7.string()
|
|
911
|
+
});
|
|
912
|
+
var sendInscriptionsRequestMessageSchema = v7.object({
|
|
913
|
+
...rpcRequestMessageSchema.entries,
|
|
914
|
+
...v7.object({
|
|
915
|
+
method: v7.literal(sendInscriptionsMethodName),
|
|
916
|
+
params: sendInscriptionsParamsSchema,
|
|
917
|
+
id: v7.string()
|
|
918
|
+
}).entries
|
|
919
|
+
});
|
|
920
|
+
|
|
921
|
+
// src/request/types/runesMethods/etch.ts
|
|
922
|
+
var v8 = __toESM(require("valibot"));
|
|
923
|
+
var runesEtchMethodName = "runes_etch";
|
|
924
|
+
var etchTermsSchema = v8.object({
|
|
925
|
+
amount: v8.string(),
|
|
926
|
+
cap: v8.string(),
|
|
927
|
+
heightStart: v8.optional(v8.string()),
|
|
928
|
+
heightEnd: v8.optional(v8.string()),
|
|
929
|
+
offsetStart: v8.optional(v8.string()),
|
|
930
|
+
offsetEnd: v8.optional(v8.string())
|
|
931
|
+
});
|
|
932
|
+
var inscriptionDetailsSchema = v8.object({
|
|
933
|
+
contentType: v8.string(),
|
|
934
|
+
contentBase64: v8.string()
|
|
935
|
+
});
|
|
936
|
+
var runesEtchParamsSchema = v8.object({
|
|
937
|
+
runeName: v8.string(),
|
|
938
|
+
divisibility: v8.optional(v8.number()),
|
|
939
|
+
symbol: v8.optional(v8.string()),
|
|
940
|
+
premine: v8.optional(v8.string()),
|
|
941
|
+
isMintable: v8.boolean(),
|
|
942
|
+
delegateInscriptionId: v8.optional(v8.string()),
|
|
943
|
+
destinationAddress: v8.string(),
|
|
944
|
+
refundAddress: v8.string(),
|
|
945
|
+
feeRate: v8.number(),
|
|
946
|
+
appServiceFee: v8.optional(v8.number()),
|
|
947
|
+
appServiceFeeAddress: v8.optional(v8.string()),
|
|
948
|
+
terms: v8.optional(etchTermsSchema),
|
|
949
|
+
inscriptionDetails: v8.optional(inscriptionDetailsSchema),
|
|
950
|
+
network: v8.optional(v8.enum(BitcoinNetworkType))
|
|
951
|
+
});
|
|
952
|
+
var runesEtchResultSchema = v8.object({
|
|
953
|
+
orderId: v8.string(),
|
|
954
|
+
fundTransactionId: v8.string(),
|
|
955
|
+
fundingAddress: v8.string()
|
|
956
|
+
});
|
|
957
|
+
var runesEtchRequestMessageSchema = v8.object({
|
|
958
|
+
...rpcRequestMessageSchema.entries,
|
|
959
|
+
...v8.object({
|
|
960
|
+
method: v8.literal(runesEtchMethodName),
|
|
961
|
+
params: runesEtchParamsSchema,
|
|
962
|
+
id: v8.string()
|
|
963
|
+
}).entries
|
|
964
|
+
});
|
|
965
|
+
|
|
966
|
+
// src/request/types/runesMethods/getBalance.ts
|
|
967
|
+
var v9 = __toESM(require("valibot"));
|
|
968
|
+
var runesGetBalanceMethodName = "runes_getBalance";
|
|
969
|
+
var runesGetBalanceParamsSchema = v9.nullish(v9.null());
|
|
970
|
+
var runesGetBalanceResultSchema = v9.object({
|
|
971
|
+
balances: v9.array(
|
|
972
|
+
v9.object({
|
|
973
|
+
runeName: v9.string(),
|
|
974
|
+
amount: v9.string(),
|
|
975
|
+
divisibility: v9.number(),
|
|
976
|
+
symbol: v9.string(),
|
|
977
|
+
inscriptionId: v9.nullish(v9.string()),
|
|
978
|
+
spendableBalance: v9.string()
|
|
979
|
+
})
|
|
980
|
+
)
|
|
981
|
+
});
|
|
982
|
+
var runesGetBalanceRequestMessageSchema = v9.object({
|
|
983
|
+
...rpcRequestMessageSchema.entries,
|
|
984
|
+
...v9.object({
|
|
985
|
+
method: v9.literal(runesGetBalanceMethodName),
|
|
986
|
+
params: runesGetBalanceParamsSchema,
|
|
987
|
+
id: v9.string()
|
|
988
|
+
}).entries
|
|
989
|
+
});
|
|
990
|
+
|
|
991
|
+
// src/request/types/runesMethods/mint.ts
|
|
992
|
+
var v10 = __toESM(require("valibot"));
|
|
993
|
+
var runesMintMethodName = "runes_mint";
|
|
994
|
+
var runesMintParamsSchema = v10.object({
|
|
995
|
+
appServiceFee: v10.optional(v10.number()),
|
|
996
|
+
appServiceFeeAddress: v10.optional(v10.string()),
|
|
997
|
+
destinationAddress: v10.string(),
|
|
998
|
+
feeRate: v10.number(),
|
|
999
|
+
refundAddress: v10.string(),
|
|
1000
|
+
repeats: v10.number(),
|
|
1001
|
+
runeName: v10.string(),
|
|
1002
|
+
network: v10.optional(v10.enum(BitcoinNetworkType))
|
|
1003
|
+
});
|
|
1004
|
+
var runesMintResultSchema = v10.object({
|
|
1005
|
+
orderId: v10.string(),
|
|
1006
|
+
fundTransactionId: v10.string(),
|
|
1007
|
+
fundingAddress: v10.string()
|
|
1008
|
+
});
|
|
1009
|
+
var runesMintRequestMessageSchema = v10.object({
|
|
1010
|
+
...rpcRequestMessageSchema.entries,
|
|
1011
|
+
...v10.object({
|
|
1012
|
+
method: v10.literal(runesMintMethodName),
|
|
1013
|
+
params: runesMintParamsSchema,
|
|
1014
|
+
id: v10.string()
|
|
1015
|
+
}).entries
|
|
1016
|
+
});
|
|
1017
|
+
|
|
1018
|
+
// src/request/types/runesMethods/transfer.ts
|
|
1019
|
+
var v11 = __toESM(require("valibot"));
|
|
1020
|
+
var runesTransferMethodName = "runes_transfer";
|
|
1021
|
+
var runesTransferParamsSchema = v11.object({
|
|
1022
|
+
recipients: v11.array(
|
|
1023
|
+
v11.object({
|
|
1024
|
+
runeName: v11.string(),
|
|
1025
|
+
amount: v11.string(),
|
|
1026
|
+
address: v11.string()
|
|
1027
|
+
})
|
|
1028
|
+
)
|
|
1029
|
+
});
|
|
1030
|
+
var runesTransferResultSchema = v11.object({
|
|
1031
|
+
txid: v11.string()
|
|
1032
|
+
});
|
|
1033
|
+
var runesTransferRequestMessageSchema = v11.object({
|
|
1034
|
+
...rpcRequestMessageSchema.entries,
|
|
1035
|
+
...v11.object({
|
|
1036
|
+
method: v11.literal(runesTransferMethodName),
|
|
1037
|
+
params: runesTransferParamsSchema,
|
|
1038
|
+
id: v11.string()
|
|
1039
|
+
}).entries
|
|
1040
|
+
});
|
|
1041
|
+
|
|
1042
|
+
// src/request/types/sparkMethods/getAddresses.ts
|
|
1043
|
+
var v12 = __toESM(require("valibot"));
|
|
1044
|
+
var sparkGetAddressesMethodName = "spark_getAddresses";
|
|
1045
|
+
var sparkGetAddressesParamsSchema = v12.nullish(
|
|
1046
|
+
v12.object({
|
|
1047
|
+
/**
|
|
1048
|
+
* A message to be displayed to the user in the request prompt.
|
|
1049
|
+
*/
|
|
1050
|
+
message: v12.optional(v12.string())
|
|
1051
|
+
})
|
|
1052
|
+
);
|
|
1053
|
+
var sparkGetAddressesResultSchema = v12.object({
|
|
1054
|
+
/**
|
|
1055
|
+
* The addresses generated for the given purposes.
|
|
1056
|
+
*/
|
|
1057
|
+
addresses: v12.array(addressSchema),
|
|
1058
|
+
network: getNetworkResultSchema
|
|
1059
|
+
});
|
|
1060
|
+
var sparkGetAddressesRequestMessageSchema = v12.object({
|
|
1061
|
+
...rpcRequestMessageSchema.entries,
|
|
1062
|
+
...v12.object({
|
|
1063
|
+
method: v12.literal(sparkGetAddressesMethodName),
|
|
1064
|
+
params: sparkGetAddressesParamsSchema,
|
|
1065
|
+
id: v12.string()
|
|
1066
|
+
}).entries
|
|
1067
|
+
});
|
|
1068
|
+
|
|
1069
|
+
// src/request/types/sparkMethods/getBalance.ts
|
|
1070
|
+
var v13 = __toESM(require("valibot"));
|
|
1071
|
+
var sparkGetBalanceMethodName = "spark_getBalance";
|
|
1072
|
+
var sparkGetBalanceParamsSchema = v13.nullish(v13.null());
|
|
1073
|
+
var sparkGetBalanceResultSchema = v13.object({
|
|
1074
|
+
/**
|
|
1075
|
+
* The Spark Bitcoin address balance in sats in string form.
|
|
1076
|
+
*/
|
|
1077
|
+
balance: v13.string(),
|
|
1078
|
+
tokenBalances: v13.array(
|
|
1079
|
+
v13.object({
|
|
1080
|
+
/* The address balance of the token in string form as it can overflow a js number */
|
|
1081
|
+
balance: v13.string(),
|
|
1082
|
+
tokenMetadata: v13.object({
|
|
1083
|
+
tokenIdentifier: v13.string(),
|
|
1084
|
+
tokenName: v13.string(),
|
|
1085
|
+
tokenTicker: v13.string(),
|
|
1086
|
+
decimals: v13.number(),
|
|
1087
|
+
maxSupply: v13.string()
|
|
1088
|
+
})
|
|
1089
|
+
})
|
|
1090
|
+
)
|
|
1091
|
+
});
|
|
1092
|
+
var sparkGetBalanceRequestMessageSchema = v13.object({
|
|
1093
|
+
...rpcRequestMessageSchema.entries,
|
|
1094
|
+
...v13.object({
|
|
1095
|
+
method: v13.literal(sparkGetBalanceMethodName),
|
|
1096
|
+
params: sparkGetBalanceParamsSchema,
|
|
1097
|
+
id: v13.string()
|
|
1098
|
+
}).entries
|
|
1099
|
+
});
|
|
1100
|
+
|
|
1101
|
+
// src/request/types/sparkMethods/transfer.ts
|
|
1102
|
+
var v14 = __toESM(require("valibot"));
|
|
1103
|
+
var sparkTransferMethodName = "spark_transfer";
|
|
1104
|
+
var sparkTransferParamsSchema = v14.object({
|
|
1105
|
+
/**
|
|
1106
|
+
* Amount of SATS to transfer as a string or number.
|
|
1107
|
+
*/
|
|
1108
|
+
amountSats: v14.union([v14.number(), v14.string()]),
|
|
1109
|
+
/**
|
|
1110
|
+
* The recipient's spark address.
|
|
1111
|
+
*/
|
|
1112
|
+
receiverSparkAddress: v14.string()
|
|
1113
|
+
});
|
|
1114
|
+
var sparkTransferResultSchema = v14.object({
|
|
1115
|
+
/**
|
|
1116
|
+
* The ID of the transaction.
|
|
1117
|
+
*/
|
|
1118
|
+
id: v14.string()
|
|
1119
|
+
});
|
|
1120
|
+
var sparkTransferRequestMessageSchema = v14.object({
|
|
1121
|
+
...rpcRequestMessageSchema.entries,
|
|
1122
|
+
...v14.object({
|
|
1123
|
+
method: v14.literal(sparkTransferMethodName),
|
|
1124
|
+
params: sparkTransferParamsSchema,
|
|
1125
|
+
id: v14.string()
|
|
1126
|
+
}).entries
|
|
1127
|
+
});
|
|
1128
|
+
|
|
1129
|
+
// src/request/types/sparkMethods/transferToken.ts
|
|
1130
|
+
var v15 = __toESM(require("valibot"));
|
|
1131
|
+
var sparkTransferTokenMethodName = "spark_transferToken";
|
|
1132
|
+
var sparkTransferTokenParamsSchema = v15.object({
|
|
1133
|
+
/**
|
|
1134
|
+
* Amount of units of the token to transfer as a string or number.
|
|
1135
|
+
*/
|
|
1136
|
+
tokenAmount: v15.union([v15.number(), v15.string()]),
|
|
1137
|
+
/**
|
|
1138
|
+
* The Bech32m token identifier.
|
|
1139
|
+
*/
|
|
1140
|
+
tokenIdentifier: v15.string(),
|
|
1141
|
+
/**
|
|
1142
|
+
* The recipient's spark address.
|
|
1143
|
+
*/
|
|
1144
|
+
receiverSparkAddress: v15.string()
|
|
1145
|
+
});
|
|
1146
|
+
var sparkTransferTokenResultSchema = v15.object({
|
|
1147
|
+
/**
|
|
1148
|
+
* The ID of the transaction.
|
|
1149
|
+
*/
|
|
1150
|
+
id: v15.string()
|
|
1151
|
+
});
|
|
1152
|
+
var sparkTransferTokenRequestMessageSchema = v15.object({
|
|
1153
|
+
...rpcRequestMessageSchema.entries,
|
|
1154
|
+
...v15.object({
|
|
1155
|
+
method: v15.literal(sparkTransferTokenMethodName),
|
|
1156
|
+
params: sparkTransferTokenParamsSchema,
|
|
1157
|
+
id: v15.string()
|
|
1158
|
+
}).entries
|
|
1159
|
+
});
|
|
1160
|
+
|
|
1161
|
+
// src/request/types/stxMethods/callContract.ts
|
|
1162
|
+
var v16 = __toESM(require("valibot"));
|
|
1163
|
+
var stxCallContractMethodName = "stx_callContract";
|
|
1164
|
+
var stxCallContractParamsSchema = v16.object({
|
|
1165
|
+
/**
|
|
1166
|
+
* The contract principal.
|
|
1167
|
+
*
|
|
1168
|
+
* E.g. `"SPKE...GD5C.my-contract"`
|
|
1169
|
+
*/
|
|
1170
|
+
contract: v16.string(),
|
|
1171
|
+
/**
|
|
1172
|
+
* The name of the function to call.
|
|
1173
|
+
*
|
|
1174
|
+
* Note: spec changes ongoing,
|
|
1175
|
+
* https://github.com/stacksgov/sips/pull/166#pullrequestreview-1914236999
|
|
1176
|
+
*/
|
|
1177
|
+
functionName: v16.string(),
|
|
1178
|
+
/**
|
|
1179
|
+
* @deprecated in favor of `functionArgs` for @stacks/connect compatibility
|
|
1180
|
+
*/
|
|
1181
|
+
arguments: v16.optional(v16.array(v16.string())),
|
|
1182
|
+
/**
|
|
1183
|
+
* The function's arguments. The arguments are expected to be hex-encoded
|
|
1184
|
+
* strings of Clarity values.
|
|
1185
|
+
*
|
|
1186
|
+
* To convert Clarity values to their hex representation, the `cvToHex`
|
|
1187
|
+
* helper from the `@stacks/transactions` package may be helpful.
|
|
1188
|
+
*
|
|
1189
|
+
* ```js
|
|
1190
|
+
* import { cvToHex } from '@stacks/transactions';
|
|
1191
|
+
*
|
|
1192
|
+
* const functionArgs = [someClarityValue1, someClarityValue2];
|
|
1193
|
+
* const hexArgs = functionArgs.map(cvToHex);
|
|
1194
|
+
* ```
|
|
1195
|
+
*/
|
|
1196
|
+
functionArgs: v16.optional(v16.array(v16.string())),
|
|
1197
|
+
/**
|
|
1198
|
+
* The post conditions to apply to the contract call.
|
|
1199
|
+
*/
|
|
1200
|
+
postConditions: v16.optional(v16.array(v16.string())),
|
|
1201
|
+
/**
|
|
1202
|
+
* The mode to apply to the post conditions.
|
|
1203
|
+
*/
|
|
1204
|
+
postConditionMode: v16.optional(v16.union([v16.literal("allow"), v16.literal("deny")]))
|
|
1205
|
+
});
|
|
1206
|
+
var stxCallContractResultSchema = v16.object({
|
|
1207
|
+
/**
|
|
1208
|
+
* The ID of the transaction.
|
|
1209
|
+
*/
|
|
1210
|
+
txid: v16.string(),
|
|
1211
|
+
/**
|
|
1212
|
+
* A Stacks transaction as a hex-encoded string.
|
|
1213
|
+
*/
|
|
1214
|
+
transaction: v16.string()
|
|
1215
|
+
});
|
|
1216
|
+
var stxCallContractRequestMessageSchema = v16.object({
|
|
1217
|
+
...rpcRequestMessageSchema.entries,
|
|
1218
|
+
...v16.object({
|
|
1219
|
+
method: v16.literal(stxCallContractMethodName),
|
|
1220
|
+
params: stxCallContractParamsSchema,
|
|
1221
|
+
id: v16.string()
|
|
1222
|
+
}).entries
|
|
1223
|
+
});
|
|
1224
|
+
|
|
1225
|
+
// src/request/types/stxMethods/deployContract.ts
|
|
1226
|
+
var v17 = __toESM(require("valibot"));
|
|
1227
|
+
var stxDeployContractMethodName = "stx_deployContract";
|
|
1228
|
+
var stxDeployContractParamsSchema = v17.object({
|
|
1229
|
+
/**
|
|
1230
|
+
* Name of the contract.
|
|
1231
|
+
*/
|
|
1232
|
+
name: v17.string(),
|
|
1233
|
+
/**
|
|
1234
|
+
* The source code of the Clarity contract.
|
|
1235
|
+
*/
|
|
1236
|
+
clarityCode: v17.string(),
|
|
1237
|
+
/**
|
|
1238
|
+
* The version of the Clarity contract.
|
|
1239
|
+
*/
|
|
1240
|
+
clarityVersion: v17.optional(v17.number()),
|
|
1241
|
+
/**
|
|
1242
|
+
* The post conditions to apply to the contract call.
|
|
1243
|
+
*/
|
|
1244
|
+
postConditions: v17.optional(v17.array(v17.string())),
|
|
1245
|
+
/**
|
|
1246
|
+
* The mode to apply to the post conditions.
|
|
1247
|
+
*/
|
|
1248
|
+
postConditionMode: v17.optional(v17.union([v17.literal("allow"), v17.literal("deny")]))
|
|
1249
|
+
});
|
|
1250
|
+
var stxDeployContractResultSchema = v17.object({
|
|
1251
|
+
/**
|
|
1252
|
+
* The ID of the transaction.
|
|
1253
|
+
*/
|
|
1254
|
+
txid: v17.string(),
|
|
1255
|
+
/**
|
|
1256
|
+
* A Stacks transaction as a hex-encoded string.
|
|
1257
|
+
*/
|
|
1258
|
+
transaction: v17.string()
|
|
1259
|
+
});
|
|
1260
|
+
var stxDeployContractRequestMessageSchema = v17.object({
|
|
1261
|
+
...rpcRequestMessageSchema.entries,
|
|
1262
|
+
...v17.object({
|
|
1263
|
+
method: v17.literal(stxDeployContractMethodName),
|
|
1264
|
+
params: stxDeployContractParamsSchema,
|
|
1265
|
+
id: v17.string()
|
|
1266
|
+
}).entries
|
|
1267
|
+
});
|
|
1268
|
+
|
|
1269
|
+
// src/request/types/stxMethods/getAccounts.ts
|
|
1270
|
+
var v18 = __toESM(require("valibot"));
|
|
1271
|
+
var stxGetAccountsMethodName = "stx_getAccounts";
|
|
1272
|
+
var stxGetAccountsParamsSchema = v18.nullish(v18.null());
|
|
1273
|
+
var stxGetAccountsResultSchema = v18.object({
|
|
1274
|
+
/**
|
|
1275
|
+
* The addresses generated for the given purposes.
|
|
1276
|
+
*/
|
|
1277
|
+
addresses: v18.array(
|
|
1278
|
+
v18.object({
|
|
1279
|
+
address: v18.string(),
|
|
1280
|
+
publicKey: v18.string(),
|
|
1281
|
+
gaiaHubUrl: v18.string(),
|
|
1282
|
+
gaiaAppKey: v18.string()
|
|
1283
|
+
})
|
|
1284
|
+
),
|
|
1285
|
+
network: getNetworkResultSchema
|
|
1286
|
+
});
|
|
1287
|
+
var stxGetAccountsRequestMessageSchema = v18.object({
|
|
1288
|
+
...rpcRequestMessageSchema.entries,
|
|
1289
|
+
...v18.object({
|
|
1290
|
+
method: v18.literal(stxGetAccountsMethodName),
|
|
1291
|
+
params: stxGetAccountsParamsSchema,
|
|
1292
|
+
id: v18.string()
|
|
1293
|
+
}).entries
|
|
1294
|
+
});
|
|
1295
|
+
|
|
1296
|
+
// src/request/types/stxMethods/getAddresses.ts
|
|
1297
|
+
var v19 = __toESM(require("valibot"));
|
|
754
1298
|
var stxGetAddressesMethodName = "stx_getAddresses";
|
|
755
|
-
var stxGetAddressesParamsSchema =
|
|
756
|
-
|
|
1299
|
+
var stxGetAddressesParamsSchema = v19.nullish(
|
|
1300
|
+
v19.object({
|
|
757
1301
|
/**
|
|
758
1302
|
* A message to be displayed to the user in the request prompt.
|
|
759
1303
|
*/
|
|
760
|
-
message:
|
|
1304
|
+
message: v19.optional(v19.string())
|
|
761
1305
|
})
|
|
762
1306
|
);
|
|
763
|
-
var stxGetAddressesResultSchema =
|
|
1307
|
+
var stxGetAddressesResultSchema = v19.object({
|
|
764
1308
|
/**
|
|
765
1309
|
* The addresses generated for the given purposes.
|
|
766
1310
|
*/
|
|
767
|
-
addresses:
|
|
1311
|
+
addresses: v19.array(addressSchema),
|
|
768
1312
|
network: getNetworkResultSchema
|
|
769
1313
|
});
|
|
770
|
-
var stxGetAddressesRequestMessageSchema =
|
|
1314
|
+
var stxGetAddressesRequestMessageSchema = v19.object({
|
|
771
1315
|
...rpcRequestMessageSchema.entries,
|
|
772
|
-
...
|
|
773
|
-
method:
|
|
1316
|
+
...v19.object({
|
|
1317
|
+
method: v19.literal(stxGetAddressesMethodName),
|
|
774
1318
|
params: stxGetAddressesParamsSchema,
|
|
775
|
-
id:
|
|
1319
|
+
id: v19.string()
|
|
776
1320
|
}).entries
|
|
777
1321
|
});
|
|
778
1322
|
|
|
779
1323
|
// src/request/types/stxMethods/signMessage.ts
|
|
780
|
-
var
|
|
1324
|
+
var v20 = __toESM(require("valibot"));
|
|
781
1325
|
var stxSignMessageMethodName = "stx_signMessage";
|
|
782
|
-
var stxSignMessageParamsSchema =
|
|
1326
|
+
var stxSignMessageParamsSchema = v20.object({
|
|
783
1327
|
/**
|
|
784
1328
|
* The message to sign.
|
|
785
1329
|
*/
|
|
786
|
-
message:
|
|
1330
|
+
message: v20.string()
|
|
787
1331
|
});
|
|
788
|
-
var stxSignMessageResultSchema =
|
|
1332
|
+
var stxSignMessageResultSchema = v20.object({
|
|
789
1333
|
/**
|
|
790
1334
|
* The signature of the message.
|
|
791
1335
|
*/
|
|
792
|
-
signature:
|
|
1336
|
+
signature: v20.string(),
|
|
793
1337
|
/**
|
|
794
1338
|
* The public key used to sign the message.
|
|
795
1339
|
*/
|
|
796
|
-
publicKey:
|
|
1340
|
+
publicKey: v20.string()
|
|
797
1341
|
});
|
|
798
|
-
var stxSignMessageRequestMessageSchema =
|
|
1342
|
+
var stxSignMessageRequestMessageSchema = v20.object({
|
|
799
1343
|
...rpcRequestMessageSchema.entries,
|
|
800
|
-
...
|
|
801
|
-
method:
|
|
1344
|
+
...v20.object({
|
|
1345
|
+
method: v20.literal(stxSignMessageMethodName),
|
|
802
1346
|
params: stxSignMessageParamsSchema,
|
|
803
|
-
id:
|
|
1347
|
+
id: v20.string()
|
|
804
1348
|
}).entries
|
|
805
1349
|
});
|
|
806
1350
|
|
|
807
1351
|
// src/request/types/stxMethods/signStructuredMessage.ts
|
|
808
|
-
var
|
|
1352
|
+
var v21 = __toESM(require("valibot"));
|
|
809
1353
|
var stxSignStructuredMessageMethodName = "stx_signStructuredMessage";
|
|
810
|
-
var stxSignStructuredMessageParamsSchema =
|
|
1354
|
+
var stxSignStructuredMessageParamsSchema = v21.object({
|
|
811
1355
|
/**
|
|
812
1356
|
* The domain to be signed.
|
|
813
1357
|
*/
|
|
814
|
-
domain:
|
|
1358
|
+
domain: v21.string(),
|
|
815
1359
|
/**
|
|
816
1360
|
* Message payload to be signed.
|
|
817
1361
|
*/
|
|
818
|
-
message:
|
|
1362
|
+
message: v21.string(),
|
|
819
1363
|
/**
|
|
820
1364
|
* The public key to sign the message with.
|
|
821
1365
|
*/
|
|
822
|
-
publicKey:
|
|
1366
|
+
publicKey: v21.optional(v21.string())
|
|
823
1367
|
});
|
|
824
|
-
var stxSignStructuredMessageResultSchema =
|
|
1368
|
+
var stxSignStructuredMessageResultSchema = v21.object({
|
|
825
1369
|
/**
|
|
826
1370
|
* Signature of the message.
|
|
827
1371
|
*/
|
|
828
|
-
signature:
|
|
1372
|
+
signature: v21.string(),
|
|
829
1373
|
/**
|
|
830
1374
|
* Public key as hex-encoded string.
|
|
831
1375
|
*/
|
|
832
|
-
publicKey:
|
|
1376
|
+
publicKey: v21.string()
|
|
833
1377
|
});
|
|
834
|
-
var stxSignStructuredMessageRequestMessageSchema =
|
|
1378
|
+
var stxSignStructuredMessageRequestMessageSchema = v21.object({
|
|
835
1379
|
...rpcRequestMessageSchema.entries,
|
|
836
|
-
...
|
|
837
|
-
method:
|
|
1380
|
+
...v21.object({
|
|
1381
|
+
method: v21.literal(stxSignStructuredMessageMethodName),
|
|
838
1382
|
params: stxSignStructuredMessageParamsSchema,
|
|
839
|
-
id:
|
|
1383
|
+
id: v21.string()
|
|
840
1384
|
}).entries
|
|
841
1385
|
});
|
|
842
1386
|
|
|
843
1387
|
// src/request/types/stxMethods/signTransaction.ts
|
|
844
|
-
var
|
|
1388
|
+
var v22 = __toESM(require("valibot"));
|
|
845
1389
|
var stxSignTransactionMethodName = "stx_signTransaction";
|
|
846
|
-
var stxSignTransactionParamsSchema =
|
|
1390
|
+
var stxSignTransactionParamsSchema = v22.object({
|
|
847
1391
|
/**
|
|
848
1392
|
* The transaction to sign as a hex-encoded string.
|
|
849
1393
|
*/
|
|
850
|
-
transaction:
|
|
1394
|
+
transaction: v22.string(),
|
|
851
1395
|
/**
|
|
852
1396
|
* The public key to sign the transaction with. The wallet may use any key
|
|
853
1397
|
* when not provided.
|
|
854
1398
|
*/
|
|
855
|
-
pubkey:
|
|
1399
|
+
pubkey: v22.optional(v22.string()),
|
|
856
1400
|
/**
|
|
857
1401
|
* Whether to broadcast the transaction after signing. Defaults to `true`.
|
|
858
1402
|
*/
|
|
859
|
-
broadcast:
|
|
1403
|
+
broadcast: v22.optional(v22.boolean())
|
|
860
1404
|
});
|
|
861
|
-
var stxSignTransactionResultSchema =
|
|
1405
|
+
var stxSignTransactionResultSchema = v22.object({
|
|
862
1406
|
/**
|
|
863
1407
|
* The signed transaction as a hex-encoded string.
|
|
864
1408
|
*/
|
|
865
|
-
transaction:
|
|
1409
|
+
transaction: v22.string()
|
|
866
1410
|
});
|
|
867
|
-
var stxSignTransactionRequestMessageSchema =
|
|
1411
|
+
var stxSignTransactionRequestMessageSchema = v22.object({
|
|
868
1412
|
...rpcRequestMessageSchema.entries,
|
|
869
|
-
...
|
|
870
|
-
method:
|
|
1413
|
+
...v22.object({
|
|
1414
|
+
method: v22.literal(stxSignTransactionMethodName),
|
|
871
1415
|
params: stxSignTransactionParamsSchema,
|
|
872
|
-
id:
|
|
1416
|
+
id: v22.string()
|
|
873
1417
|
}).entries
|
|
874
1418
|
});
|
|
875
1419
|
|
|
876
1420
|
// src/request/types/stxMethods/signTransactions.ts
|
|
877
|
-
var
|
|
1421
|
+
var v23 = __toESM(require("valibot"));
|
|
878
1422
|
var stxSignTransactionsMethodName = "stx_signTransactions";
|
|
879
|
-
var stxSignTransactionsParamsSchema =
|
|
1423
|
+
var stxSignTransactionsParamsSchema = v23.object({
|
|
880
1424
|
/**
|
|
881
1425
|
* The transactions to sign as hex-encoded strings.
|
|
882
1426
|
*/
|
|
883
|
-
transactions:
|
|
884
|
-
|
|
885
|
-
|
|
886
|
-
|
|
887
|
-
|
|
1427
|
+
transactions: v23.pipe(
|
|
1428
|
+
v23.array(
|
|
1429
|
+
v23.pipe(
|
|
1430
|
+
v23.string(),
|
|
1431
|
+
v23.check((hex) => {
|
|
888
1432
|
return true;
|
|
889
1433
|
}, "Invalid hex-encoded Stacks transaction.")
|
|
890
1434
|
)
|
|
891
1435
|
),
|
|
892
|
-
|
|
1436
|
+
v23.minLength(1)
|
|
893
1437
|
),
|
|
894
1438
|
/**
|
|
895
1439
|
* Whether the signed transactions should be broadcast after signing. Defaults
|
|
896
1440
|
* to `true`.
|
|
897
1441
|
*/
|
|
898
|
-
broadcast:
|
|
1442
|
+
broadcast: v23.optional(v23.boolean())
|
|
899
1443
|
});
|
|
900
|
-
var stxSignTransactionsResultSchema =
|
|
1444
|
+
var stxSignTransactionsResultSchema = v23.object({
|
|
901
1445
|
/**
|
|
902
1446
|
* The signed transactions as hex-encoded strings, in the same order as in the
|
|
903
1447
|
* sign request.
|
|
904
1448
|
*/
|
|
905
|
-
transactions:
|
|
1449
|
+
transactions: v23.array(v23.string())
|
|
906
1450
|
});
|
|
907
|
-
var stxSignTransactionsRequestMessageSchema =
|
|
1451
|
+
var stxSignTransactionsRequestMessageSchema = v23.object({
|
|
908
1452
|
...rpcRequestMessageSchema.entries,
|
|
909
|
-
...
|
|
910
|
-
method:
|
|
1453
|
+
...v23.object({
|
|
1454
|
+
method: v23.literal(stxSignTransactionsMethodName),
|
|
911
1455
|
params: stxSignTransactionsParamsSchema,
|
|
912
|
-
id:
|
|
1456
|
+
id: v23.string()
|
|
913
1457
|
}).entries
|
|
914
1458
|
});
|
|
915
1459
|
|
|
916
1460
|
// src/request/types/stxMethods/transferStx.ts
|
|
917
|
-
var
|
|
1461
|
+
var v24 = __toESM(require("valibot"));
|
|
918
1462
|
var stxTransferStxMethodName = "stx_transferStx";
|
|
919
|
-
var stxTransferStxParamsSchema =
|
|
1463
|
+
var stxTransferStxParamsSchema = v24.object({
|
|
920
1464
|
/**
|
|
921
1465
|
* Amount of STX tokens to transfer in microstacks as a string. Anything
|
|
922
1466
|
* parseable by `BigInt` is acceptable.
|
|
@@ -929,23 +1473,23 @@ var stxTransferStxParamsSchema = v14.object({
|
|
|
929
1473
|
* const amount3 = '1234';
|
|
930
1474
|
* ```
|
|
931
1475
|
*/
|
|
932
|
-
amount:
|
|
1476
|
+
amount: v24.union([v24.number(), v24.string()]),
|
|
933
1477
|
/**
|
|
934
|
-
* The
|
|
1478
|
+
* The recipient's principal.
|
|
935
1479
|
*/
|
|
936
|
-
recipient:
|
|
1480
|
+
recipient: v24.string(),
|
|
937
1481
|
/**
|
|
938
1482
|
* A string representing the memo.
|
|
939
1483
|
*/
|
|
940
|
-
memo:
|
|
1484
|
+
memo: v24.optional(v24.string()),
|
|
941
1485
|
/**
|
|
942
1486
|
* Version of parameter format.
|
|
943
1487
|
*/
|
|
944
|
-
version:
|
|
1488
|
+
version: v24.optional(v24.string()),
|
|
945
1489
|
/**
|
|
946
1490
|
* The mode of the post conditions.
|
|
947
1491
|
*/
|
|
948
|
-
postConditionMode:
|
|
1492
|
+
postConditionMode: v24.optional(v24.number()),
|
|
949
1493
|
/**
|
|
950
1494
|
* A hex-encoded string representing the post conditions.
|
|
951
1495
|
*
|
|
@@ -958,425 +1502,29 @@ var stxTransferStxParamsSchema = v14.object({
|
|
|
958
1502
|
* const hexPostCondition = serializePostCondition(postCondition).toString('hex');
|
|
959
1503
|
* ```
|
|
960
1504
|
*/
|
|
961
|
-
postConditions:
|
|
1505
|
+
postConditions: v24.optional(v24.array(v24.string())),
|
|
962
1506
|
/**
|
|
963
1507
|
* The public key to sign the transaction with. The wallet may use any key
|
|
964
1508
|
* when not provided.
|
|
965
1509
|
*/
|
|
966
|
-
pubkey:
|
|
1510
|
+
pubkey: v24.optional(v24.string())
|
|
967
1511
|
});
|
|
968
|
-
var stxTransferStxResultSchema =
|
|
1512
|
+
var stxTransferStxResultSchema = v24.object({
|
|
969
1513
|
/**
|
|
970
1514
|
* The ID of the transaction.
|
|
971
1515
|
*/
|
|
972
|
-
txid:
|
|
1516
|
+
txid: v24.string(),
|
|
973
1517
|
/**
|
|
974
1518
|
* A Stacks transaction as a hex-encoded string.
|
|
975
1519
|
*/
|
|
976
|
-
transaction:
|
|
1520
|
+
transaction: v24.string()
|
|
977
1521
|
});
|
|
978
|
-
var stxTransferStxRequestMessageSchema =
|
|
1522
|
+
var stxTransferStxRequestMessageSchema = v24.object({
|
|
979
1523
|
...rpcRequestMessageSchema.entries,
|
|
980
|
-
...
|
|
981
|
-
method:
|
|
1524
|
+
...v24.object({
|
|
1525
|
+
method: v24.literal(stxTransferStxMethodName),
|
|
982
1526
|
params: stxTransferStxParamsSchema,
|
|
983
|
-
id:
|
|
984
|
-
}).entries
|
|
985
|
-
});
|
|
986
|
-
|
|
987
|
-
// src/request/types/btcMethods.ts
|
|
988
|
-
var v15 = __toESM(require("valibot"));
|
|
989
|
-
var getInfoMethodName = "getInfo";
|
|
990
|
-
var getInfoParamsSchema = v15.nullish(v15.null());
|
|
991
|
-
var getInfoResultSchema = v15.object({
|
|
992
|
-
/**
|
|
993
|
-
* Version of the wallet.
|
|
994
|
-
*/
|
|
995
|
-
version: v15.string(),
|
|
996
|
-
/**
|
|
997
|
-
* [WBIP](https://wbips.netlify.app/wbips/WBIP002) methods supported by the wallet.
|
|
998
|
-
*/
|
|
999
|
-
methods: v15.optional(v15.array(v15.string())),
|
|
1000
|
-
/**
|
|
1001
|
-
* List of WBIP standards supported by the wallet. Not currently used.
|
|
1002
|
-
*/
|
|
1003
|
-
supports: v15.array(v15.string())
|
|
1004
|
-
});
|
|
1005
|
-
var getInfoRequestMessageSchema = v15.object({
|
|
1006
|
-
...rpcRequestMessageSchema.entries,
|
|
1007
|
-
...v15.object({
|
|
1008
|
-
method: v15.literal(getInfoMethodName),
|
|
1009
|
-
params: getInfoParamsSchema,
|
|
1010
|
-
id: v15.string()
|
|
1011
|
-
}).entries
|
|
1012
|
-
});
|
|
1013
|
-
var getAddressesMethodName = "getAddresses";
|
|
1014
|
-
var getAddressesParamsSchema = v15.object({
|
|
1015
|
-
/**
|
|
1016
|
-
* The purposes for which to generate addresses. See
|
|
1017
|
-
* {@linkcode AddressPurpose} for available purposes.
|
|
1018
|
-
*/
|
|
1019
|
-
purposes: v15.array(v15.enum(AddressPurpose)),
|
|
1020
|
-
/**
|
|
1021
|
-
* A message to be displayed to the user in the request prompt.
|
|
1022
|
-
*/
|
|
1023
|
-
message: v15.optional(v15.string())
|
|
1024
|
-
});
|
|
1025
|
-
var getAddressesResultSchema = v15.object({
|
|
1026
|
-
/**
|
|
1027
|
-
* The addresses generated for the given purposes.
|
|
1028
|
-
*/
|
|
1029
|
-
addresses: v15.array(addressSchema),
|
|
1030
|
-
network: getNetworkResultSchema
|
|
1031
|
-
});
|
|
1032
|
-
var getAddressesRequestMessageSchema = v15.object({
|
|
1033
|
-
...rpcRequestMessageSchema.entries,
|
|
1034
|
-
...v15.object({
|
|
1035
|
-
method: v15.literal(getAddressesMethodName),
|
|
1036
|
-
params: getAddressesParamsSchema,
|
|
1037
|
-
id: v15.string()
|
|
1038
|
-
}).entries
|
|
1039
|
-
});
|
|
1040
|
-
var signMessageMethodName = "signMessage";
|
|
1041
|
-
var MessageSigningProtocols = /* @__PURE__ */ ((MessageSigningProtocols2) => {
|
|
1042
|
-
MessageSigningProtocols2["ECDSA"] = "ECDSA";
|
|
1043
|
-
MessageSigningProtocols2["BIP322"] = "BIP322";
|
|
1044
|
-
return MessageSigningProtocols2;
|
|
1045
|
-
})(MessageSigningProtocols || {});
|
|
1046
|
-
var signMessageParamsSchema = v15.object({
|
|
1047
|
-
/**
|
|
1048
|
-
* The address used for signing.
|
|
1049
|
-
**/
|
|
1050
|
-
address: v15.string(),
|
|
1051
|
-
/**
|
|
1052
|
-
* The message to sign.
|
|
1053
|
-
**/
|
|
1054
|
-
message: v15.string(),
|
|
1055
|
-
/**
|
|
1056
|
-
* The protocol to use for signing the message.
|
|
1057
|
-
*/
|
|
1058
|
-
protocol: v15.optional(v15.enum(MessageSigningProtocols))
|
|
1059
|
-
});
|
|
1060
|
-
var signMessageResultSchema = v15.object({
|
|
1061
|
-
/**
|
|
1062
|
-
* The signature of the message.
|
|
1063
|
-
*/
|
|
1064
|
-
signature: v15.string(),
|
|
1065
|
-
/**
|
|
1066
|
-
* hash of the message.
|
|
1067
|
-
*/
|
|
1068
|
-
messageHash: v15.string(),
|
|
1069
|
-
/**
|
|
1070
|
-
* The address used for signing.
|
|
1071
|
-
*/
|
|
1072
|
-
address: v15.string(),
|
|
1073
|
-
/**
|
|
1074
|
-
* The protocol to use for signing the message.
|
|
1075
|
-
*/
|
|
1076
|
-
protocol: v15.enum(MessageSigningProtocols)
|
|
1077
|
-
});
|
|
1078
|
-
var signMessageRequestMessageSchema = v15.object({
|
|
1079
|
-
...rpcRequestMessageSchema.entries,
|
|
1080
|
-
...v15.object({
|
|
1081
|
-
method: v15.literal(signMessageMethodName),
|
|
1082
|
-
params: signMessageParamsSchema,
|
|
1083
|
-
id: v15.string()
|
|
1084
|
-
}).entries
|
|
1085
|
-
});
|
|
1086
|
-
var sendTransferMethodName = "sendTransfer";
|
|
1087
|
-
var sendTransferParamsSchema = v15.object({
|
|
1088
|
-
/**
|
|
1089
|
-
* Array of recipients to send to.
|
|
1090
|
-
* The amount to send to each recipient is in satoshis.
|
|
1091
|
-
*/
|
|
1092
|
-
recipients: v15.array(
|
|
1093
|
-
v15.object({
|
|
1094
|
-
address: v15.string(),
|
|
1095
|
-
amount: v15.number()
|
|
1096
|
-
})
|
|
1097
|
-
)
|
|
1098
|
-
});
|
|
1099
|
-
var sendTransferResultSchema = v15.object({
|
|
1100
|
-
/**
|
|
1101
|
-
* The transaction id as a hex-encoded string.
|
|
1102
|
-
*/
|
|
1103
|
-
txid: v15.string()
|
|
1104
|
-
});
|
|
1105
|
-
var sendTransferRequestMessageSchema = v15.object({
|
|
1106
|
-
...rpcRequestMessageSchema.entries,
|
|
1107
|
-
...v15.object({
|
|
1108
|
-
method: v15.literal(sendTransferMethodName),
|
|
1109
|
-
params: sendTransferParamsSchema,
|
|
1110
|
-
id: v15.string()
|
|
1111
|
-
}).entries
|
|
1112
|
-
});
|
|
1113
|
-
var signPsbtMethodName = "signPsbt";
|
|
1114
|
-
var signPsbtParamsSchema = v15.object({
|
|
1115
|
-
/**
|
|
1116
|
-
* The base64 encoded PSBT to sign.
|
|
1117
|
-
*/
|
|
1118
|
-
psbt: v15.string(),
|
|
1119
|
-
/**
|
|
1120
|
-
* The inputs to sign.
|
|
1121
|
-
* The key is the address and the value is an array of indexes of the inputs to sign.
|
|
1122
|
-
*/
|
|
1123
|
-
signInputs: v15.optional(v15.record(v15.string(), v15.array(v15.number()))),
|
|
1124
|
-
/**
|
|
1125
|
-
* Whether to broadcast the transaction after signing.
|
|
1126
|
-
**/
|
|
1127
|
-
broadcast: v15.optional(v15.boolean())
|
|
1128
|
-
});
|
|
1129
|
-
var signPsbtResultSchema = v15.object({
|
|
1130
|
-
/**
|
|
1131
|
-
* The base64 encoded PSBT after signing.
|
|
1132
|
-
*/
|
|
1133
|
-
psbt: v15.string(),
|
|
1134
|
-
/**
|
|
1135
|
-
* The transaction id as a hex-encoded string.
|
|
1136
|
-
* This is only returned if the transaction was broadcast.
|
|
1137
|
-
**/
|
|
1138
|
-
txid: v15.optional(v15.string())
|
|
1139
|
-
});
|
|
1140
|
-
var signPsbtRequestMessageSchema = v15.object({
|
|
1141
|
-
...rpcRequestMessageSchema.entries,
|
|
1142
|
-
...v15.object({
|
|
1143
|
-
method: v15.literal(signPsbtMethodName),
|
|
1144
|
-
params: signPsbtParamsSchema,
|
|
1145
|
-
id: v15.string()
|
|
1146
|
-
}).entries
|
|
1147
|
-
});
|
|
1148
|
-
var getAccountsMethodName = "getAccounts";
|
|
1149
|
-
var getAccountsParamsSchema = v15.object({
|
|
1150
|
-
/**
|
|
1151
|
-
* The purposes for which to generate addresses. See
|
|
1152
|
-
* {@linkcode AddressPurpose} for available purposes.
|
|
1153
|
-
*/
|
|
1154
|
-
purposes: v15.array(v15.enum(AddressPurpose)),
|
|
1155
|
-
/**
|
|
1156
|
-
* A message to be displayed to the user in the request prompt.
|
|
1157
|
-
*/
|
|
1158
|
-
message: v15.optional(v15.string())
|
|
1159
|
-
});
|
|
1160
|
-
var getAccountsResultSchema = v15.array(
|
|
1161
|
-
v15.object({
|
|
1162
|
-
...addressSchema.entries,
|
|
1163
|
-
...v15.object({
|
|
1164
|
-
walletType: walletTypeSchema
|
|
1165
|
-
}).entries
|
|
1166
|
-
})
|
|
1167
|
-
);
|
|
1168
|
-
var getAccountsRequestMessageSchema = v15.object({
|
|
1169
|
-
...rpcRequestMessageSchema.entries,
|
|
1170
|
-
...v15.object({
|
|
1171
|
-
method: v15.literal(getAccountsMethodName),
|
|
1172
|
-
params: getAccountsParamsSchema,
|
|
1173
|
-
id: v15.string()
|
|
1174
|
-
}).entries
|
|
1175
|
-
});
|
|
1176
|
-
var getBalanceMethodName = "getBalance";
|
|
1177
|
-
var getBalanceParamsSchema = v15.nullish(v15.null());
|
|
1178
|
-
var getBalanceResultSchema = v15.object({
|
|
1179
|
-
/**
|
|
1180
|
-
* The confirmed balance of the wallet in sats. Using a string due to chrome
|
|
1181
|
-
* messages not supporting bigint
|
|
1182
|
-
* (https://issues.chromium.org/issues/40116184).
|
|
1183
|
-
*/
|
|
1184
|
-
confirmed: v15.string(),
|
|
1185
|
-
/**
|
|
1186
|
-
* The unconfirmed balance of the wallet in sats. Using a string due to chrome
|
|
1187
|
-
* messages not supporting bigint
|
|
1188
|
-
* (https://issues.chromium.org/issues/40116184).
|
|
1189
|
-
*/
|
|
1190
|
-
unconfirmed: v15.string(),
|
|
1191
|
-
/**
|
|
1192
|
-
* The total balance (both confirmed and unconfrimed UTXOs) of the wallet in
|
|
1193
|
-
* sats. Using a string due to chrome messages not supporting bigint
|
|
1194
|
-
* (https://issues.chromium.org/issues/40116184).
|
|
1195
|
-
*/
|
|
1196
|
-
total: v15.string()
|
|
1197
|
-
});
|
|
1198
|
-
var getBalanceRequestMessageSchema = v15.object({
|
|
1199
|
-
...rpcRequestMessageSchema.entries,
|
|
1200
|
-
...v15.object({
|
|
1201
|
-
method: v15.literal(getBalanceMethodName),
|
|
1202
|
-
id: v15.string()
|
|
1203
|
-
}).entries
|
|
1204
|
-
});
|
|
1205
|
-
|
|
1206
|
-
// src/request/types/runesMethods/etch.ts
|
|
1207
|
-
var v16 = __toESM(require("valibot"));
|
|
1208
|
-
var runesEtchMethodName = "runes_etch";
|
|
1209
|
-
var etchTermsSchema = v16.object({
|
|
1210
|
-
amount: v16.string(),
|
|
1211
|
-
cap: v16.string(),
|
|
1212
|
-
heightStart: v16.optional(v16.string()),
|
|
1213
|
-
heightEnd: v16.optional(v16.string()),
|
|
1214
|
-
offsetStart: v16.optional(v16.string()),
|
|
1215
|
-
offsetEnd: v16.optional(v16.string())
|
|
1216
|
-
});
|
|
1217
|
-
var inscriptionDetailsSchema = v16.object({
|
|
1218
|
-
contentType: v16.string(),
|
|
1219
|
-
contentBase64: v16.string()
|
|
1220
|
-
});
|
|
1221
|
-
var runesEtchParamsSchema = v16.object({
|
|
1222
|
-
runeName: v16.string(),
|
|
1223
|
-
divisibility: v16.optional(v16.number()),
|
|
1224
|
-
symbol: v16.optional(v16.string()),
|
|
1225
|
-
premine: v16.optional(v16.string()),
|
|
1226
|
-
isMintable: v16.boolean(),
|
|
1227
|
-
delegateInscriptionId: v16.optional(v16.string()),
|
|
1228
|
-
destinationAddress: v16.string(),
|
|
1229
|
-
refundAddress: v16.string(),
|
|
1230
|
-
feeRate: v16.number(),
|
|
1231
|
-
appServiceFee: v16.optional(v16.number()),
|
|
1232
|
-
appServiceFeeAddress: v16.optional(v16.string()),
|
|
1233
|
-
terms: v16.optional(etchTermsSchema),
|
|
1234
|
-
inscriptionDetails: v16.optional(inscriptionDetailsSchema),
|
|
1235
|
-
network: v16.optional(v16.enum(BitcoinNetworkType))
|
|
1236
|
-
});
|
|
1237
|
-
var runesEtchResultSchema = v16.object({
|
|
1238
|
-
orderId: v16.string(),
|
|
1239
|
-
fundTransactionId: v16.string(),
|
|
1240
|
-
fundingAddress: v16.string()
|
|
1241
|
-
});
|
|
1242
|
-
var runesEtchRequestMessageSchema = v16.object({
|
|
1243
|
-
...rpcRequestMessageSchema.entries,
|
|
1244
|
-
...v16.object({
|
|
1245
|
-
method: v16.literal(runesEtchMethodName),
|
|
1246
|
-
params: runesEtchParamsSchema,
|
|
1247
|
-
id: v16.string()
|
|
1248
|
-
}).entries
|
|
1249
|
-
});
|
|
1250
|
-
|
|
1251
|
-
// src/request/types/runesMethods/getBalance.ts
|
|
1252
|
-
var v17 = __toESM(require("valibot"));
|
|
1253
|
-
var runesGetBalanceMethodName = "runes_getBalance";
|
|
1254
|
-
var runesGetBalanceParamsSchema = v17.nullish(v17.null());
|
|
1255
|
-
var runesGetBalanceResultSchema = v17.object({
|
|
1256
|
-
balances: v17.array(
|
|
1257
|
-
v17.object({
|
|
1258
|
-
runeName: v17.string(),
|
|
1259
|
-
amount: v17.string(),
|
|
1260
|
-
divisibility: v17.number(),
|
|
1261
|
-
symbol: v17.string(),
|
|
1262
|
-
inscriptionId: v17.nullish(v17.string()),
|
|
1263
|
-
spendableBalance: v17.string()
|
|
1264
|
-
})
|
|
1265
|
-
)
|
|
1266
|
-
});
|
|
1267
|
-
var runesGetBalanceRequestMessageSchema = v17.object({
|
|
1268
|
-
...rpcRequestMessageSchema.entries,
|
|
1269
|
-
...v17.object({
|
|
1270
|
-
method: v17.literal(runesGetBalanceMethodName),
|
|
1271
|
-
params: runesGetBalanceParamsSchema,
|
|
1272
|
-
id: v17.string()
|
|
1273
|
-
}).entries
|
|
1274
|
-
});
|
|
1275
|
-
|
|
1276
|
-
// src/request/types/runesMethods/mint.ts
|
|
1277
|
-
var v18 = __toESM(require("valibot"));
|
|
1278
|
-
var runesMintMethodName = "runes_mint";
|
|
1279
|
-
var runesMintParamsSchema = v18.object({
|
|
1280
|
-
appServiceFee: v18.optional(v18.number()),
|
|
1281
|
-
appServiceFeeAddress: v18.optional(v18.string()),
|
|
1282
|
-
destinationAddress: v18.string(),
|
|
1283
|
-
feeRate: v18.number(),
|
|
1284
|
-
refundAddress: v18.string(),
|
|
1285
|
-
repeats: v18.number(),
|
|
1286
|
-
runeName: v18.string(),
|
|
1287
|
-
network: v18.optional(v18.enum(BitcoinNetworkType))
|
|
1288
|
-
});
|
|
1289
|
-
var runesMintResultSchema = v18.object({
|
|
1290
|
-
orderId: v18.string(),
|
|
1291
|
-
fundTransactionId: v18.string(),
|
|
1292
|
-
fundingAddress: v18.string()
|
|
1293
|
-
});
|
|
1294
|
-
var runesMintRequestMessageSchema = v18.object({
|
|
1295
|
-
...rpcRequestMessageSchema.entries,
|
|
1296
|
-
...v18.object({
|
|
1297
|
-
method: v18.literal(runesMintMethodName),
|
|
1298
|
-
params: runesMintParamsSchema,
|
|
1299
|
-
id: v18.string()
|
|
1300
|
-
}).entries
|
|
1301
|
-
});
|
|
1302
|
-
|
|
1303
|
-
// src/request/types/runesMethods/transfer.ts
|
|
1304
|
-
var v19 = __toESM(require("valibot"));
|
|
1305
|
-
var runesTransferMethodName = "runes_transfer";
|
|
1306
|
-
var runesTransferParamsSchema = v19.object({
|
|
1307
|
-
recipients: v19.array(
|
|
1308
|
-
v19.object({
|
|
1309
|
-
runeName: v19.string(),
|
|
1310
|
-
amount: v19.string(),
|
|
1311
|
-
address: v19.string()
|
|
1312
|
-
})
|
|
1313
|
-
)
|
|
1314
|
-
});
|
|
1315
|
-
var runesTransferResultSchema = v19.object({
|
|
1316
|
-
txid: v19.string()
|
|
1317
|
-
});
|
|
1318
|
-
var runesTransferRequestMessageSchema = v19.object({
|
|
1319
|
-
...rpcRequestMessageSchema.entries,
|
|
1320
|
-
...v19.object({
|
|
1321
|
-
method: v19.literal(runesTransferMethodName),
|
|
1322
|
-
params: runesTransferParamsSchema,
|
|
1323
|
-
id: v19.string()
|
|
1324
|
-
}).entries
|
|
1325
|
-
});
|
|
1326
|
-
|
|
1327
|
-
// src/request/types/ordinalsMethods.ts
|
|
1328
|
-
var v20 = __toESM(require("valibot"));
|
|
1329
|
-
var getInscriptionsMethodName = "ord_getInscriptions";
|
|
1330
|
-
var getInscriptionsParamsSchema = v20.object({
|
|
1331
|
-
offset: v20.number(),
|
|
1332
|
-
limit: v20.number()
|
|
1333
|
-
});
|
|
1334
|
-
var getInscriptionsResultSchema = v20.object({
|
|
1335
|
-
total: v20.number(),
|
|
1336
|
-
limit: v20.number(),
|
|
1337
|
-
offset: v20.number(),
|
|
1338
|
-
inscriptions: v20.array(
|
|
1339
|
-
v20.object({
|
|
1340
|
-
inscriptionId: v20.string(),
|
|
1341
|
-
inscriptionNumber: v20.string(),
|
|
1342
|
-
address: v20.string(),
|
|
1343
|
-
collectionName: v20.optional(v20.string()),
|
|
1344
|
-
postage: v20.string(),
|
|
1345
|
-
contentLength: v20.string(),
|
|
1346
|
-
contentType: v20.string(),
|
|
1347
|
-
timestamp: v20.number(),
|
|
1348
|
-
offset: v20.number(),
|
|
1349
|
-
genesisTransaction: v20.string(),
|
|
1350
|
-
output: v20.string()
|
|
1351
|
-
})
|
|
1352
|
-
)
|
|
1353
|
-
});
|
|
1354
|
-
var getInscriptionsRequestMessageSchema = v20.object({
|
|
1355
|
-
...rpcRequestMessageSchema.entries,
|
|
1356
|
-
...v20.object({
|
|
1357
|
-
method: v20.literal(getInscriptionsMethodName),
|
|
1358
|
-
params: getInscriptionsParamsSchema,
|
|
1359
|
-
id: v20.string()
|
|
1360
|
-
}).entries
|
|
1361
|
-
});
|
|
1362
|
-
var sendInscriptionsMethodName = "ord_sendInscriptions";
|
|
1363
|
-
var sendInscriptionsParamsSchema = v20.object({
|
|
1364
|
-
transfers: v20.array(
|
|
1365
|
-
v20.object({
|
|
1366
|
-
address: v20.string(),
|
|
1367
|
-
inscriptionId: v20.string()
|
|
1368
|
-
})
|
|
1369
|
-
)
|
|
1370
|
-
});
|
|
1371
|
-
var sendInscriptionsResultSchema = v20.object({
|
|
1372
|
-
txid: v20.string()
|
|
1373
|
-
});
|
|
1374
|
-
var sendInscriptionsRequestMessageSchema = v20.object({
|
|
1375
|
-
...rpcRequestMessageSchema.entries,
|
|
1376
|
-
...v20.object({
|
|
1377
|
-
method: v20.literal(sendInscriptionsMethodName),
|
|
1378
|
-
params: sendInscriptionsParamsSchema,
|
|
1379
|
-
id: v20.string()
|
|
1527
|
+
id: v24.string()
|
|
1380
1528
|
}).entries
|
|
1381
1529
|
});
|
|
1382
1530
|
|
|
@@ -1393,13 +1541,13 @@ var request = async (method, params, providerId) => {
|
|
|
1393
1541
|
throw new Error("A wallet method is required");
|
|
1394
1542
|
}
|
|
1395
1543
|
const response = await provider.request(method, params);
|
|
1396
|
-
if (
|
|
1544
|
+
if (v25.is(rpcErrorResponseMessageSchema, response)) {
|
|
1397
1545
|
return {
|
|
1398
1546
|
status: "error",
|
|
1399
1547
|
error: response.error
|
|
1400
1548
|
};
|
|
1401
1549
|
}
|
|
1402
|
-
if (
|
|
1550
|
+
if (v25.is(rpcSuccessResponseMessageSchema, response)) {
|
|
1403
1551
|
return {
|
|
1404
1552
|
status: "success",
|
|
1405
1553
|
result: response.result
|
|
@@ -1962,7 +2110,7 @@ var UnisatAdapter = class extends SatsConnectAdapter {
|
|
|
1962
2110
|
id = DefaultAdaptersInfo.unisat.id;
|
|
1963
2111
|
async getAccounts(params) {
|
|
1964
2112
|
const { purposes } = params;
|
|
1965
|
-
if (purposes.includes("stacks" /* Stacks */)) {
|
|
2113
|
+
if (purposes.includes("stacks" /* Stacks */) || purposes.includes("starknet" /* Starknet */) || purposes.includes("spark" /* Spark */)) {
|
|
1966
2114
|
throw new Error("Only bitcoin addresses are supported");
|
|
1967
2115
|
}
|
|
1968
2116
|
const accounts = await window.unisat.requestAccounts();
|
|
@@ -2422,6 +2570,7 @@ var signMultipleTransactions = async (options) => {
|
|
|
2422
2570
|
RpcErrorCode,
|
|
2423
2571
|
RpcIdSchema,
|
|
2424
2572
|
SatsConnectAdapter,
|
|
2573
|
+
SparkNetworkType,
|
|
2425
2574
|
StacksNetworkType,
|
|
2426
2575
|
StarknetNetworkType,
|
|
2427
2576
|
accountActionsSchema,
|
|
@@ -2553,6 +2702,22 @@ var signMultipleTransactions = async (options) => {
|
|
|
2553
2702
|
signPsbtRequestMessageSchema,
|
|
2554
2703
|
signPsbtResultSchema,
|
|
2555
2704
|
signTransaction,
|
|
2705
|
+
sparkGetAddressesMethodName,
|
|
2706
|
+
sparkGetAddressesParamsSchema,
|
|
2707
|
+
sparkGetAddressesRequestMessageSchema,
|
|
2708
|
+
sparkGetAddressesResultSchema,
|
|
2709
|
+
sparkGetBalanceMethodName,
|
|
2710
|
+
sparkGetBalanceParamsSchema,
|
|
2711
|
+
sparkGetBalanceRequestMessageSchema,
|
|
2712
|
+
sparkGetBalanceResultSchema,
|
|
2713
|
+
sparkTransferMethodName,
|
|
2714
|
+
sparkTransferParamsSchema,
|
|
2715
|
+
sparkTransferRequestMessageSchema,
|
|
2716
|
+
sparkTransferResultSchema,
|
|
2717
|
+
sparkTransferTokenMethodName,
|
|
2718
|
+
sparkTransferTokenParamsSchema,
|
|
2719
|
+
sparkTransferTokenRequestMessageSchema,
|
|
2720
|
+
sparkTransferTokenResultSchema,
|
|
2556
2721
|
stxCallContractMethodName,
|
|
2557
2722
|
stxCallContractParamsSchema,
|
|
2558
2723
|
stxCallContractRequestMessageSchema,
|