@sats-connect/core 0.4.0-c4d80ec → 0.4.0-de32322
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 +418 -171
- package/dist/index.d.ts +418 -171
- package/dist/index.js +586 -197
- package/dist/index.mjs +554 -197
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -123,6 +123,10 @@ __export(src_exports, {
|
|
|
123
123
|
sendInscriptionsParamsSchema: () => sendInscriptionsParamsSchema,
|
|
124
124
|
sendInscriptionsResultSchema: () => sendInscriptionsResultSchema,
|
|
125
125
|
sendInscriptionsSchema: () => sendInscriptionsSchema,
|
|
126
|
+
sendTransferMethodName: () => sendTransferMethodName,
|
|
127
|
+
sendTransferParamsSchema: () => sendTransferParamsSchema,
|
|
128
|
+
sendTransferRequestMessageSchema: () => sendTransferRequestMessageSchema,
|
|
129
|
+
sendTransferResultSchema: () => sendTransferResultSchema,
|
|
126
130
|
setDefaultProvider: () => setDefaultProvider,
|
|
127
131
|
signMessage: () => signMessage,
|
|
128
132
|
signMessageMethodName: () => signMessageMethodName,
|
|
@@ -130,15 +134,43 @@ __export(src_exports, {
|
|
|
130
134
|
signMessageRequestMessageSchema: () => signMessageRequestMessageSchema,
|
|
131
135
|
signMessageResultSchema: () => signMessageResultSchema,
|
|
132
136
|
signMultipleTransactions: () => signMultipleTransactions,
|
|
137
|
+
signPsbtMethodName: () => signPsbtMethodName,
|
|
138
|
+
signPsbtParamsSchema: () => signPsbtParamsSchema,
|
|
139
|
+
signPsbtRequestMessageSchema: () => signPsbtRequestMessageSchema,
|
|
140
|
+
signPsbtResultSchema: () => signPsbtResultSchema,
|
|
133
141
|
signTransaction: () => signTransaction,
|
|
142
|
+
stxCallContractMethodName: () => stxCallContractMethodName,
|
|
143
|
+
stxCallContractParamsSchema: () => stxCallContractParamsSchema,
|
|
144
|
+
stxCallContractRequestMessageSchema: () => stxCallContractRequestMessageSchema,
|
|
145
|
+
stxCallContractResultSchema: () => stxCallContractResultSchema,
|
|
146
|
+
stxDeployContractMethodName: () => stxDeployContractMethodName,
|
|
147
|
+
stxDeployContractParamsSchema: () => stxDeployContractParamsSchema,
|
|
148
|
+
stxDeployContractRequestMessageSchema: () => stxDeployContractRequestMessageSchema,
|
|
149
|
+
stxDeployContractResultSchema: () => stxDeployContractResultSchema,
|
|
150
|
+
stxGetAccountsMethodName: () => stxGetAccountsMethodName,
|
|
151
|
+
stxGetAccountsParamsSchema: () => stxGetAccountsParamsSchema,
|
|
152
|
+
stxGetAccountsRequestMessageSchema: () => stxGetAccountsRequestMessageSchema,
|
|
153
|
+
stxGetAccountsResultSchema: () => stxGetAccountsResultSchema,
|
|
134
154
|
stxGetAddressesMethodName: () => stxGetAddressesMethodName,
|
|
135
155
|
stxGetAddressesParamsSchema: () => stxGetAddressesParamsSchema,
|
|
136
156
|
stxGetAddressesRequestMessageSchema: () => stxGetAddressesRequestMessageSchema,
|
|
137
157
|
stxGetAddressesResultSchema: () => stxGetAddressesResultSchema,
|
|
158
|
+
stxSignMessageMethodName: () => stxSignMessageMethodName,
|
|
159
|
+
stxSignMessageParamsSchema: () => stxSignMessageParamsSchema,
|
|
160
|
+
stxSignMessageRequestMessageSchema: () => stxSignMessageRequestMessageSchema,
|
|
161
|
+
stxSignMessageResultSchema: () => stxSignMessageResultSchema,
|
|
162
|
+
stxSignStructuredMessageMethodName: () => stxSignStructuredMessageMethodName,
|
|
163
|
+
stxSignStructuredMessageParamsSchema: () => stxSignStructuredMessageParamsSchema,
|
|
164
|
+
stxSignStructuredMessageRequestMessageSchema: () => stxSignStructuredMessageRequestMessageSchema,
|
|
165
|
+
stxSignStructuredMessageResultSchema: () => stxSignStructuredMessageResultSchema,
|
|
138
166
|
stxSignTransactionMethodName: () => stxSignTransactionMethodName,
|
|
139
167
|
stxSignTransactionParamsSchema: () => stxSignTransactionParamsSchema,
|
|
140
168
|
stxSignTransactionRequestMessageSchema: () => stxSignTransactionRequestMessageSchema,
|
|
141
169
|
stxSignTransactionResultSchema: () => stxSignTransactionResultSchema,
|
|
170
|
+
stxTransferStxMethodName: () => stxTransferStxMethodName,
|
|
171
|
+
stxTransferStxParamsSchema: () => stxTransferStxParamsSchema,
|
|
172
|
+
stxTransferStxRequestMessageSchema: () => stxTransferStxRequestMessageSchema,
|
|
173
|
+
stxTransferStxResultSchema: () => stxTransferStxResultSchema,
|
|
142
174
|
transferRunesMethodName: () => transferRunesMethodName,
|
|
143
175
|
transferRunesParamsSchema: () => transferRunesParamsSchema,
|
|
144
176
|
transferRunesRequestSchema: () => transferRunesRequestSchema,
|
|
@@ -263,16 +295,127 @@ var rpcResponseMessageSchema = v2.union([
|
|
|
263
295
|
]);
|
|
264
296
|
|
|
265
297
|
// src/request/index.ts
|
|
266
|
-
var
|
|
298
|
+
var v17 = __toESM(require("valibot"));
|
|
299
|
+
|
|
300
|
+
// src/request/types/stxMethods/callContract.ts
|
|
301
|
+
var v3 = __toESM(require("valibot"));
|
|
302
|
+
var stxCallContractMethodName = "stx_callContract";
|
|
303
|
+
var stxCallContractParamsSchema = v3.object({
|
|
304
|
+
/**
|
|
305
|
+
* The contract principal.
|
|
306
|
+
*
|
|
307
|
+
* E.g. `"SPKE...GD5C.my-contract"`
|
|
308
|
+
*/
|
|
309
|
+
contract: v3.string(),
|
|
310
|
+
/**
|
|
311
|
+
* The name of the function to call.
|
|
312
|
+
*
|
|
313
|
+
* Note: spec changes ongoing,
|
|
314
|
+
* https://github.com/stacksgov/sips/pull/166#pullrequestreview-1914236999
|
|
315
|
+
*/
|
|
316
|
+
functionName: v3.string(),
|
|
317
|
+
/**
|
|
318
|
+
* The function's arguments. The arguments are expected to be hex-encoded
|
|
319
|
+
* strings of Clarity values.
|
|
320
|
+
*
|
|
321
|
+
* To convert Clarity values to their hex representation, the `cvToString`
|
|
322
|
+
* helper from the `@stacks/transactions` package may be helpful.
|
|
323
|
+
*
|
|
324
|
+
* ```js
|
|
325
|
+
* import { cvToString } from '@stacks/transactions';
|
|
326
|
+
*
|
|
327
|
+
* const functionArgs = [someClarityValue1, someClarityValue2];
|
|
328
|
+
* const hexArgs = functionArgs.map(cvToString);
|
|
329
|
+
* ```
|
|
330
|
+
*/
|
|
331
|
+
arguments: v3.optional(v3.array(v3.string()))
|
|
332
|
+
});
|
|
333
|
+
var stxCallContractResultSchema = v3.object({
|
|
334
|
+
/**
|
|
335
|
+
* The ID of the transaction.
|
|
336
|
+
*/
|
|
337
|
+
txid: v3.string(),
|
|
338
|
+
/**
|
|
339
|
+
* A Stacks transaction as a hex-encoded string.
|
|
340
|
+
*/
|
|
341
|
+
transaction: v3.string()
|
|
342
|
+
});
|
|
343
|
+
var stxCallContractRequestMessageSchema = v3.object({
|
|
344
|
+
...rpcRequestMessageSchema.entries,
|
|
345
|
+
...v3.object({
|
|
346
|
+
method: v3.literal(stxCallContractMethodName),
|
|
347
|
+
params: stxCallContractParamsSchema,
|
|
348
|
+
id: v3.string()
|
|
349
|
+
}).entries
|
|
350
|
+
});
|
|
267
351
|
|
|
268
|
-
// src/request/types/stxMethods.ts
|
|
352
|
+
// src/request/types/stxMethods/deployContract.ts
|
|
269
353
|
var v4 = __toESM(require("valibot"));
|
|
354
|
+
var stxDeployContractMethodName = "stx_deployContract";
|
|
355
|
+
var stxDeployContractParamsSchema = v4.object({
|
|
356
|
+
/**
|
|
357
|
+
* Name of the contract.
|
|
358
|
+
*/
|
|
359
|
+
name: v4.string(),
|
|
360
|
+
/**
|
|
361
|
+
* The source code of the Clarity contract.
|
|
362
|
+
*/
|
|
363
|
+
clarityCode: v4.string(),
|
|
364
|
+
/**
|
|
365
|
+
* The version of the Clarity contract.
|
|
366
|
+
*/
|
|
367
|
+
clarityVersion: v4.optional(v4.string())
|
|
368
|
+
});
|
|
369
|
+
var stxDeployContractResultSchema = v4.object({
|
|
370
|
+
/**
|
|
371
|
+
* The ID of the transaction.
|
|
372
|
+
*/
|
|
373
|
+
txid: v4.string(),
|
|
374
|
+
/**
|
|
375
|
+
* A Stacks transaction as a hex-encoded string.
|
|
376
|
+
*/
|
|
377
|
+
transaction: v4.string()
|
|
378
|
+
});
|
|
379
|
+
var stxDeployContractRequestMessageSchema = v4.object({
|
|
380
|
+
...rpcRequestMessageSchema.entries,
|
|
381
|
+
...v4.object({
|
|
382
|
+
method: v4.literal(stxDeployContractMethodName),
|
|
383
|
+
params: stxDeployContractParamsSchema,
|
|
384
|
+
id: v4.string()
|
|
385
|
+
}).entries
|
|
386
|
+
});
|
|
387
|
+
|
|
388
|
+
// src/request/types/stxMethods/getAccounts.ts
|
|
389
|
+
var v5 = __toESM(require("valibot"));
|
|
390
|
+
var stxGetAccountsMethodName = "stx_getAccounts";
|
|
391
|
+
var stxGetAccountsParamsSchema = v5.nullish(v5.null());
|
|
392
|
+
var stxGetAccountsResultSchema = v5.object({
|
|
393
|
+
/**
|
|
394
|
+
* The addresses generated for the given purposes.
|
|
395
|
+
*/
|
|
396
|
+
addresses: v5.array(
|
|
397
|
+
v5.object({
|
|
398
|
+
address: v5.string(),
|
|
399
|
+
publicKey: v5.string(),
|
|
400
|
+
gaiaHubUrl: v5.string(),
|
|
401
|
+
gaiaAppKey: v5.string()
|
|
402
|
+
})
|
|
403
|
+
)
|
|
404
|
+
});
|
|
405
|
+
var stxGetAccountsRequestMessageSchema = v5.object({
|
|
406
|
+
...rpcRequestMessageSchema.entries,
|
|
407
|
+
...v5.object({
|
|
408
|
+
method: v5.literal(stxGetAccountsMethodName),
|
|
409
|
+
params: stxGetAccountsParamsSchema,
|
|
410
|
+
id: v5.string()
|
|
411
|
+
}).entries
|
|
412
|
+
});
|
|
270
413
|
|
|
271
414
|
// src/addresses/index.ts
|
|
272
415
|
var import_jsontokens = require("jsontokens");
|
|
273
416
|
|
|
274
417
|
// src/addresses/types.ts
|
|
275
|
-
var
|
|
418
|
+
var v6 = __toESM(require("valibot"));
|
|
276
419
|
var AddressPurpose = /* @__PURE__ */ ((AddressPurpose2) => {
|
|
277
420
|
AddressPurpose2["Ordinals"] = "ordinals";
|
|
278
421
|
AddressPurpose2["Payment"] = "payment";
|
|
@@ -288,11 +431,11 @@ var AddressType = /* @__PURE__ */ ((AddressType3) => {
|
|
|
288
431
|
AddressType3["stacks"] = "stacks";
|
|
289
432
|
return AddressType3;
|
|
290
433
|
})(AddressType || {});
|
|
291
|
-
var addressSchema =
|
|
292
|
-
address:
|
|
293
|
-
publicKey:
|
|
294
|
-
purpose:
|
|
295
|
-
addressType:
|
|
434
|
+
var addressSchema = v6.object({
|
|
435
|
+
address: v6.string(),
|
|
436
|
+
publicKey: v6.string(),
|
|
437
|
+
purpose: v6.enum(AddressPurpose),
|
|
438
|
+
addressType: v6.enum(AddressType)
|
|
296
439
|
});
|
|
297
440
|
|
|
298
441
|
// src/addresses/index.ts
|
|
@@ -312,118 +455,269 @@ var getAddress = async (options) => {
|
|
|
312
455
|
}
|
|
313
456
|
};
|
|
314
457
|
|
|
315
|
-
// src/request/types/stxMethods.ts
|
|
458
|
+
// src/request/types/stxMethods/getAddresses.ts
|
|
459
|
+
var v7 = __toESM(require("valibot"));
|
|
316
460
|
var stxGetAddressesMethodName = "stx_getAddresses";
|
|
317
|
-
var stxGetAddressesParamsSchema =
|
|
318
|
-
|
|
461
|
+
var stxGetAddressesParamsSchema = v7.nullish(
|
|
462
|
+
v7.object({
|
|
319
463
|
/**
|
|
320
464
|
* A message to be displayed to the user in the request prompt.
|
|
321
465
|
*/
|
|
322
|
-
message:
|
|
466
|
+
message: v7.optional(v7.string())
|
|
323
467
|
})
|
|
324
468
|
);
|
|
325
|
-
var stxGetAddressesResultSchema =
|
|
469
|
+
var stxGetAddressesResultSchema = v7.object({
|
|
326
470
|
/**
|
|
327
471
|
* The addresses generated for the given purposes.
|
|
328
472
|
*/
|
|
329
|
-
addresses:
|
|
473
|
+
addresses: v7.array(addressSchema)
|
|
330
474
|
});
|
|
331
|
-
var stxGetAddressesRequestMessageSchema =
|
|
475
|
+
var stxGetAddressesRequestMessageSchema = v7.object({
|
|
332
476
|
...rpcRequestMessageSchema.entries,
|
|
333
|
-
...
|
|
334
|
-
method:
|
|
477
|
+
...v7.object({
|
|
478
|
+
method: v7.literal(stxGetAddressesMethodName),
|
|
335
479
|
params: stxGetAddressesParamsSchema,
|
|
336
|
-
id:
|
|
480
|
+
id: v7.string()
|
|
481
|
+
}).entries
|
|
482
|
+
});
|
|
483
|
+
|
|
484
|
+
// src/request/types/stxMethods/signMessage.ts
|
|
485
|
+
var v8 = __toESM(require("valibot"));
|
|
486
|
+
var stxSignMessageMethodName = "stx_signMessage";
|
|
487
|
+
var stxSignMessageParamsSchema = v8.object({
|
|
488
|
+
/**
|
|
489
|
+
* The message to sign.
|
|
490
|
+
*/
|
|
491
|
+
message: v8.string(),
|
|
492
|
+
/**
|
|
493
|
+
* The public key to sign the message with.
|
|
494
|
+
*/
|
|
495
|
+
publicKey: v8.string(),
|
|
496
|
+
/**
|
|
497
|
+
* The format version of the parameter.
|
|
498
|
+
*/
|
|
499
|
+
parameterFormatVersion: v8.optional(v8.number())
|
|
500
|
+
});
|
|
501
|
+
var stxSignMessageResultSchema = v8.object({
|
|
502
|
+
/**
|
|
503
|
+
* The signature of the message.
|
|
504
|
+
*/
|
|
505
|
+
signature: v8.string(),
|
|
506
|
+
/**
|
|
507
|
+
* The public key used to sign the message.
|
|
508
|
+
*/
|
|
509
|
+
publicKey: v8.string()
|
|
510
|
+
});
|
|
511
|
+
var stxSignMessageRequestMessageSchema = v8.object({
|
|
512
|
+
...rpcRequestMessageSchema.entries,
|
|
513
|
+
...v8.object({
|
|
514
|
+
method: v8.literal(stxSignMessageMethodName),
|
|
515
|
+
params: stxSignMessageParamsSchema,
|
|
516
|
+
id: v8.string()
|
|
517
|
+
}).entries
|
|
518
|
+
});
|
|
519
|
+
|
|
520
|
+
// src/request/types/stxMethods/signStructuredMessage.ts
|
|
521
|
+
var v9 = __toESM(require("valibot"));
|
|
522
|
+
var stxSignStructuredMessageMethodName = "stx_signStructuredMessage";
|
|
523
|
+
var stxSignStructuredMessageParamsSchema = v9.object({
|
|
524
|
+
/**
|
|
525
|
+
* The domain to be signed.
|
|
526
|
+
*/
|
|
527
|
+
domain: v9.string(),
|
|
528
|
+
/**
|
|
529
|
+
* Message payload to be signed.
|
|
530
|
+
*/
|
|
531
|
+
message: v9.string(),
|
|
532
|
+
/**
|
|
533
|
+
* The format version of the parameter.
|
|
534
|
+
*/
|
|
535
|
+
parameterFormatVersion: v9.optional(v9.number()),
|
|
536
|
+
/**
|
|
537
|
+
* The public key to sign the message with.
|
|
538
|
+
*/
|
|
539
|
+
publicKey: v9.optional(v9.string())
|
|
540
|
+
});
|
|
541
|
+
var stxSignStructuredMessageResultSchema = v9.object({
|
|
542
|
+
/**
|
|
543
|
+
* Signature of the message.
|
|
544
|
+
*/
|
|
545
|
+
signature: v9.string(),
|
|
546
|
+
/**
|
|
547
|
+
* Public key as hex-encoded string.
|
|
548
|
+
*/
|
|
549
|
+
publicKey: v9.string()
|
|
550
|
+
});
|
|
551
|
+
var stxSignStructuredMessageRequestMessageSchema = v9.object({
|
|
552
|
+
...rpcRequestMessageSchema.entries,
|
|
553
|
+
...v9.object({
|
|
554
|
+
method: v9.literal(stxSignStructuredMessageMethodName),
|
|
555
|
+
params: stxSignStructuredMessageParamsSchema,
|
|
556
|
+
id: v9.string()
|
|
337
557
|
}).entries
|
|
338
558
|
});
|
|
559
|
+
|
|
560
|
+
// src/request/types/stxMethods/signTransaction.ts
|
|
561
|
+
var v10 = __toESM(require("valibot"));
|
|
339
562
|
var stxSignTransactionMethodName = "stx_signTransaction";
|
|
340
|
-
var stxSignTransactionParamsSchema =
|
|
563
|
+
var stxSignTransactionParamsSchema = v10.object({
|
|
341
564
|
/**
|
|
342
565
|
* The transaction to sign as a hex-encoded string.
|
|
343
566
|
*/
|
|
344
|
-
transaction:
|
|
567
|
+
transaction: v10.string(),
|
|
345
568
|
/**
|
|
346
569
|
* The public key to sign the transaction with. The wallet may use any key
|
|
347
570
|
* when not provided.
|
|
348
571
|
*/
|
|
349
|
-
pubkey:
|
|
572
|
+
pubkey: v10.optional(v10.string()),
|
|
350
573
|
/**
|
|
351
574
|
* Whether to broadcast the transaction after signing. Defaults to `true`.
|
|
352
575
|
*/
|
|
353
|
-
broadcast:
|
|
576
|
+
broadcast: v10.optional(v10.boolean())
|
|
354
577
|
});
|
|
355
|
-
var stxSignTransactionResultSchema =
|
|
578
|
+
var stxSignTransactionResultSchema = v10.object({
|
|
356
579
|
/**
|
|
357
580
|
* The signed transaction as a hex-encoded string.
|
|
358
581
|
*/
|
|
359
|
-
transaction:
|
|
582
|
+
transaction: v10.string()
|
|
360
583
|
});
|
|
361
|
-
var stxSignTransactionRequestMessageSchema =
|
|
584
|
+
var stxSignTransactionRequestMessageSchema = v10.object({
|
|
362
585
|
...rpcRequestMessageSchema.entries,
|
|
363
|
-
...
|
|
364
|
-
method:
|
|
586
|
+
...v10.object({
|
|
587
|
+
method: v10.literal(stxSignTransactionMethodName),
|
|
365
588
|
params: stxSignTransactionParamsSchema,
|
|
366
|
-
id:
|
|
589
|
+
id: v10.string()
|
|
590
|
+
}).entries
|
|
591
|
+
});
|
|
592
|
+
|
|
593
|
+
// src/request/types/stxMethods/transferStx.ts
|
|
594
|
+
var v11 = __toESM(require("valibot"));
|
|
595
|
+
var stxTransferStxMethodName = "stx_transferStx";
|
|
596
|
+
var stxTransferStxParamsSchema = v11.object({
|
|
597
|
+
/**
|
|
598
|
+
* Amount of STX tokens to transfer in microstacks as a string. Anything
|
|
599
|
+
* parseable by `BigInt` is acceptable.
|
|
600
|
+
*
|
|
601
|
+
* Example,
|
|
602
|
+
*
|
|
603
|
+
* ```js
|
|
604
|
+
* const amount1 = 1234;
|
|
605
|
+
* const amount2 = 1234n;
|
|
606
|
+
* const amount3 = '1234';
|
|
607
|
+
* ```
|
|
608
|
+
*/
|
|
609
|
+
amount: v11.union([v11.number(), v11.string()]),
|
|
610
|
+
/**
|
|
611
|
+
* The recipeint's principal.
|
|
612
|
+
*/
|
|
613
|
+
recipient: v11.string(),
|
|
614
|
+
/**
|
|
615
|
+
* A string representing the memo.
|
|
616
|
+
*/
|
|
617
|
+
memo: v11.optional(v11.string()),
|
|
618
|
+
/**
|
|
619
|
+
* Version of parameter format.
|
|
620
|
+
*/
|
|
621
|
+
version: v11.optional(v11.string()),
|
|
622
|
+
/**
|
|
623
|
+
* The mode of the post conditions.
|
|
624
|
+
*/
|
|
625
|
+
postConditionMode: v11.optional(v11.number()),
|
|
626
|
+
/**
|
|
627
|
+
* A hex-encoded string representing the post conditions.
|
|
628
|
+
*
|
|
629
|
+
* A post condition may be converted to it's hex representation using the `serializePostCondition` helper from the `@stacks/transactions` package,
|
|
630
|
+
*
|
|
631
|
+
* ```js
|
|
632
|
+
* import { serializePostCondition } from '@stacks/transactions';
|
|
633
|
+
*
|
|
634
|
+
* const postCondition = somePostCondition;
|
|
635
|
+
* const hexPostCondition = serializePostCondition(postCondition).toString('hex');
|
|
636
|
+
* ```
|
|
637
|
+
*/
|
|
638
|
+
postConditions: v11.optional(v11.array(v11.string())),
|
|
639
|
+
/**
|
|
640
|
+
* The public key to sign the transaction with. The wallet may use any key
|
|
641
|
+
* when not provided.
|
|
642
|
+
*/
|
|
643
|
+
pubkey: v11.optional(v11.string())
|
|
644
|
+
});
|
|
645
|
+
var stxTransferStxResultSchema = v11.object({
|
|
646
|
+
/**
|
|
647
|
+
* The ID of the transaction.
|
|
648
|
+
*/
|
|
649
|
+
txid: v11.string(),
|
|
650
|
+
/**
|
|
651
|
+
* A Stacks transaction as a hex-encoded string.
|
|
652
|
+
*/
|
|
653
|
+
transaction: v11.string()
|
|
654
|
+
});
|
|
655
|
+
var stxTransferStxRequestMessageSchema = v11.object({
|
|
656
|
+
...rpcRequestMessageSchema.entries,
|
|
657
|
+
...v11.object({
|
|
658
|
+
method: v11.literal(stxTransferStxMethodName),
|
|
659
|
+
params: stxTransferStxParamsSchema,
|
|
660
|
+
id: v11.string()
|
|
367
661
|
}).entries
|
|
368
662
|
});
|
|
369
663
|
|
|
370
664
|
// src/request/types/btcMethods.ts
|
|
371
|
-
var
|
|
665
|
+
var v13 = __toESM(require("valibot"));
|
|
372
666
|
|
|
373
667
|
// src/request/types/common.ts
|
|
374
|
-
var
|
|
668
|
+
var v12 = __toESM(require("valibot"));
|
|
375
669
|
var walletTypes = ["software", "ledger"];
|
|
376
|
-
var walletTypeSchema =
|
|
670
|
+
var walletTypeSchema = v12.picklist(walletTypes);
|
|
377
671
|
|
|
378
672
|
// src/request/types/btcMethods.ts
|
|
379
673
|
var getInfoMethodName = "getInfo";
|
|
380
|
-
var getInfoParamsSchema =
|
|
381
|
-
var getInfoResultSchema =
|
|
674
|
+
var getInfoParamsSchema = v13.nullish(v13.null());
|
|
675
|
+
var getInfoResultSchema = v13.object({
|
|
382
676
|
/**
|
|
383
677
|
* Version of the wallet.
|
|
384
678
|
*/
|
|
385
|
-
version:
|
|
679
|
+
version: v13.string(),
|
|
386
680
|
/**
|
|
387
681
|
* [WBIP](https://wbips.netlify.app/wbips/WBIP002) methods supported by the wallet.
|
|
388
682
|
*/
|
|
389
|
-
methods:
|
|
683
|
+
methods: v13.optional(v13.array(v13.string())),
|
|
390
684
|
/**
|
|
391
685
|
* List of WBIP standards supported by the wallet. Not currently used.
|
|
392
686
|
*/
|
|
393
|
-
supports:
|
|
687
|
+
supports: v13.array(v13.string())
|
|
394
688
|
});
|
|
395
|
-
var getInfoRequestMessageSchema =
|
|
689
|
+
var getInfoRequestMessageSchema = v13.object({
|
|
396
690
|
...rpcRequestMessageSchema.entries,
|
|
397
|
-
...
|
|
398
|
-
method:
|
|
691
|
+
...v13.object({
|
|
692
|
+
method: v13.literal(getInfoMethodName),
|
|
399
693
|
params: getInfoParamsSchema,
|
|
400
|
-
id:
|
|
694
|
+
id: v13.string()
|
|
401
695
|
}).entries
|
|
402
696
|
});
|
|
403
697
|
var getAddressesMethodName = "getAddresses";
|
|
404
|
-
var getAddressesParamsSchema =
|
|
698
|
+
var getAddressesParamsSchema = v13.object({
|
|
405
699
|
/**
|
|
406
700
|
* The purposes for which to generate addresses. See
|
|
407
701
|
* {@linkcode AddressPurpose} for available purposes.
|
|
408
702
|
*/
|
|
409
|
-
purposes:
|
|
703
|
+
purposes: v13.array(v13.enum(AddressPurpose)),
|
|
410
704
|
/**
|
|
411
705
|
* A message to be displayed to the user in the request prompt.
|
|
412
706
|
*/
|
|
413
|
-
message:
|
|
707
|
+
message: v13.optional(v13.string())
|
|
414
708
|
});
|
|
415
|
-
var getAddressesResultSchema =
|
|
709
|
+
var getAddressesResultSchema = v13.object({
|
|
416
710
|
/**
|
|
417
711
|
* The addresses generated for the given purposes.
|
|
418
712
|
*/
|
|
419
|
-
addresses:
|
|
713
|
+
addresses: v13.array(addressSchema)
|
|
420
714
|
});
|
|
421
|
-
var getAddressesRequestMessageSchema =
|
|
715
|
+
var getAddressesRequestMessageSchema = v13.object({
|
|
422
716
|
...rpcRequestMessageSchema.entries,
|
|
423
|
-
...
|
|
424
|
-
method:
|
|
717
|
+
...v13.object({
|
|
718
|
+
method: v13.literal(getAddressesMethodName),
|
|
425
719
|
params: getAddressesParamsSchema,
|
|
426
|
-
id:
|
|
720
|
+
id: v13.string()
|
|
427
721
|
}).entries
|
|
428
722
|
});
|
|
429
723
|
var signMessageMethodName = "signMessage";
|
|
@@ -432,301 +726,364 @@ var MessageSigningProtocols = /* @__PURE__ */ ((MessageSigningProtocols2) => {
|
|
|
432
726
|
MessageSigningProtocols2["BIP322"] = "BIP322";
|
|
433
727
|
return MessageSigningProtocols2;
|
|
434
728
|
})(MessageSigningProtocols || {});
|
|
435
|
-
var signMessageParamsSchema =
|
|
729
|
+
var signMessageParamsSchema = v13.object({
|
|
436
730
|
/**
|
|
437
731
|
* The address used for signing.
|
|
438
732
|
**/
|
|
439
|
-
address:
|
|
733
|
+
address: v13.string(),
|
|
440
734
|
/**
|
|
441
735
|
* The message to sign.
|
|
442
736
|
**/
|
|
443
|
-
message:
|
|
737
|
+
message: v13.string(),
|
|
444
738
|
/**
|
|
445
739
|
* The protocol to use for signing the message.
|
|
446
740
|
*/
|
|
447
|
-
protocol:
|
|
741
|
+
protocol: v13.optional(v13.enum(MessageSigningProtocols))
|
|
448
742
|
});
|
|
449
|
-
var signMessageResultSchema =
|
|
743
|
+
var signMessageResultSchema = v13.object({
|
|
450
744
|
/**
|
|
451
745
|
* The signature of the message.
|
|
452
746
|
*/
|
|
453
|
-
signature:
|
|
747
|
+
signature: v13.string(),
|
|
454
748
|
/**
|
|
455
749
|
* hash of the message.
|
|
456
750
|
*/
|
|
457
|
-
messageHash:
|
|
751
|
+
messageHash: v13.string(),
|
|
458
752
|
/**
|
|
459
753
|
* The address used for signing.
|
|
460
754
|
*/
|
|
461
|
-
address:
|
|
755
|
+
address: v13.string(),
|
|
462
756
|
/**
|
|
463
757
|
* The protocol to use for signing the message.
|
|
464
758
|
*/
|
|
465
|
-
protocol:
|
|
759
|
+
protocol: v13.enum(MessageSigningProtocols)
|
|
466
760
|
});
|
|
467
|
-
var signMessageRequestMessageSchema =
|
|
761
|
+
var signMessageRequestMessageSchema = v13.object({
|
|
468
762
|
...rpcRequestMessageSchema.entries,
|
|
469
|
-
...
|
|
470
|
-
method:
|
|
763
|
+
...v13.object({
|
|
764
|
+
method: v13.literal(signMessageMethodName),
|
|
471
765
|
params: signMessageParamsSchema,
|
|
472
|
-
id:
|
|
766
|
+
id: v13.string()
|
|
767
|
+
}).entries
|
|
768
|
+
});
|
|
769
|
+
var sendTransferMethodName = "sendTransfer";
|
|
770
|
+
var sendTransferParamsSchema = v13.object({
|
|
771
|
+
/**
|
|
772
|
+
* Array of recipients to send to.
|
|
773
|
+
* The amount to send to each recipient is in satoshis.
|
|
774
|
+
*/
|
|
775
|
+
recipients: v13.array(
|
|
776
|
+
v13.object({
|
|
777
|
+
address: v13.string(),
|
|
778
|
+
amount: v13.number()
|
|
779
|
+
})
|
|
780
|
+
)
|
|
781
|
+
});
|
|
782
|
+
var sendTransferResultSchema = v13.object({
|
|
783
|
+
/**
|
|
784
|
+
* The transaction id as a hex-encoded string.
|
|
785
|
+
*/
|
|
786
|
+
txid: v13.string()
|
|
787
|
+
});
|
|
788
|
+
var sendTransferRequestMessageSchema = v13.object({
|
|
789
|
+
...rpcRequestMessageSchema.entries,
|
|
790
|
+
...v13.object({
|
|
791
|
+
method: v13.literal(sendTransferMethodName),
|
|
792
|
+
params: sendTransferParamsSchema,
|
|
793
|
+
id: v13.string()
|
|
794
|
+
}).entries
|
|
795
|
+
});
|
|
796
|
+
var signPsbtMethodName = "signPsbt";
|
|
797
|
+
var signPsbtParamsSchema = v13.object({
|
|
798
|
+
/**
|
|
799
|
+
* The base64 encoded PSBT to sign.
|
|
800
|
+
*/
|
|
801
|
+
psbt: v13.string(),
|
|
802
|
+
/**
|
|
803
|
+
* The inputs to sign.
|
|
804
|
+
* The key is the address and the value is an array of indexes of the inputs to sign.
|
|
805
|
+
*/
|
|
806
|
+
signInputs: v13.record(v13.string(), v13.array(v13.number())),
|
|
807
|
+
allowedSignHash: v13.optional(v13.number()),
|
|
808
|
+
/**
|
|
809
|
+
* Whether to broadcast the transaction after signing.
|
|
810
|
+
**/
|
|
811
|
+
broadcast: v13.optional(v13.boolean())
|
|
812
|
+
});
|
|
813
|
+
var signPsbtResultSchema = v13.object({
|
|
814
|
+
/**
|
|
815
|
+
* The base64 encoded PSBT after signing.
|
|
816
|
+
*/
|
|
817
|
+
psbt: v13.string(),
|
|
818
|
+
/**
|
|
819
|
+
* The transaction id as a hex-encoded string.
|
|
820
|
+
* This is only returned if the transaction was broadcast.
|
|
821
|
+
**/
|
|
822
|
+
txid: v13.optional(v13.string())
|
|
823
|
+
});
|
|
824
|
+
var signPsbtRequestMessageSchema = v13.object({
|
|
825
|
+
...rpcRequestMessageSchema.entries,
|
|
826
|
+
...v13.object({
|
|
827
|
+
method: v13.literal(signPsbtMethodName),
|
|
828
|
+
params: signPsbtParamsSchema,
|
|
829
|
+
id: v13.string()
|
|
473
830
|
}).entries
|
|
474
831
|
});
|
|
475
832
|
var getAccountsMethodName = "getAccounts";
|
|
476
|
-
var getAccountsParamsSchema =
|
|
833
|
+
var getAccountsParamsSchema = v13.object({
|
|
477
834
|
/**
|
|
478
835
|
* The purposes for which to generate addresses. See
|
|
479
836
|
* {@linkcode AddressPurpose} for available purposes.
|
|
480
837
|
*/
|
|
481
|
-
purposes:
|
|
838
|
+
purposes: v13.array(v13.enum(AddressPurpose)),
|
|
482
839
|
/**
|
|
483
840
|
* A message to be displayed to the user in the request prompt.
|
|
484
841
|
*/
|
|
485
|
-
message:
|
|
842
|
+
message: v13.optional(v13.string())
|
|
486
843
|
});
|
|
487
|
-
var getAccountsResultSchema =
|
|
488
|
-
|
|
844
|
+
var getAccountsResultSchema = v13.array(
|
|
845
|
+
v13.object({
|
|
489
846
|
...addressSchema.entries,
|
|
490
|
-
...
|
|
847
|
+
...v13.object({
|
|
491
848
|
walletType: walletTypeSchema
|
|
492
849
|
}).entries
|
|
493
850
|
})
|
|
494
851
|
);
|
|
495
|
-
var getAccountsRequestMessageSchema =
|
|
852
|
+
var getAccountsRequestMessageSchema = v13.object({
|
|
496
853
|
...rpcRequestMessageSchema.entries,
|
|
497
|
-
...
|
|
498
|
-
method:
|
|
854
|
+
...v13.object({
|
|
855
|
+
method: v13.literal(getAccountsMethodName),
|
|
499
856
|
params: getAccountsParamsSchema,
|
|
500
|
-
id:
|
|
857
|
+
id: v13.string()
|
|
501
858
|
}).entries
|
|
502
859
|
});
|
|
503
860
|
var getBalanceMethodName = "getBalance";
|
|
504
|
-
var getBalanceParamsSchema =
|
|
505
|
-
var getBalanceResultSchema =
|
|
861
|
+
var getBalanceParamsSchema = v13.nullish(v13.null());
|
|
862
|
+
var getBalanceResultSchema = v13.object({
|
|
506
863
|
/**
|
|
507
864
|
* The confirmed balance of the wallet in sats. Using a string due to chrome
|
|
508
865
|
* messages not supporting bigint
|
|
509
866
|
* (https://issues.chromium.org/issues/40116184).
|
|
510
867
|
*/
|
|
511
|
-
confirmed:
|
|
868
|
+
confirmed: v13.string(),
|
|
512
869
|
/**
|
|
513
870
|
* The unconfirmed balance of the wallet in sats. Using a string due to chrome
|
|
514
871
|
* messages not supporting bigint
|
|
515
872
|
* (https://issues.chromium.org/issues/40116184).
|
|
516
873
|
*/
|
|
517
|
-
unconfirmed:
|
|
874
|
+
unconfirmed: v13.string(),
|
|
518
875
|
/**
|
|
519
876
|
* The total balance (both confirmed and unconfrimed UTXOs) of the wallet in
|
|
520
877
|
* sats. Using a string due to chrome messages not supporting bigint
|
|
521
878
|
* (https://issues.chromium.org/issues/40116184).
|
|
522
879
|
*/
|
|
523
|
-
total:
|
|
880
|
+
total: v13.string()
|
|
524
881
|
});
|
|
525
|
-
var getBalanceRequestMessageSchema =
|
|
882
|
+
var getBalanceRequestMessageSchema = v13.object({
|
|
526
883
|
...rpcRequestMessageSchema.entries,
|
|
527
|
-
...
|
|
528
|
-
method:
|
|
529
|
-
id:
|
|
884
|
+
...v13.object({
|
|
885
|
+
method: v13.literal(getBalanceMethodName),
|
|
886
|
+
id: v13.string()
|
|
530
887
|
}).entries
|
|
531
888
|
});
|
|
532
889
|
|
|
533
890
|
// src/request/types/walletMethods.ts
|
|
534
|
-
var
|
|
891
|
+
var v14 = __toESM(require("valibot"));
|
|
535
892
|
var import_xverse_core = require("@secretkeylabs/xverse-core");
|
|
536
|
-
var permissionTemplate =
|
|
537
|
-
|
|
538
|
-
...
|
|
539
|
-
actions:
|
|
893
|
+
var permissionTemplate = v14.variant("type", [
|
|
894
|
+
v14.object({
|
|
895
|
+
...v14.omit(import_xverse_core.permissions.resources.account.accountPermissionSchema, ["clientId", "actions"]).entries,
|
|
896
|
+
actions: v14.partial(import_xverse_core.permissions.resources.account.accountActionsSchema)
|
|
540
897
|
}),
|
|
541
|
-
|
|
542
|
-
...
|
|
543
|
-
actions:
|
|
898
|
+
v14.object({
|
|
899
|
+
...v14.omit(import_xverse_core.permissions.resources.wallet.walletPermissionSchema, ["clientId"]).entries,
|
|
900
|
+
actions: v14.partial(import_xverse_core.permissions.resources.wallet.walletActionsSchema)
|
|
544
901
|
})
|
|
545
902
|
]);
|
|
546
903
|
var requestPermissionsMethodName = "wallet_requestPermissions";
|
|
547
|
-
var requestPermissionsParamsSchema =
|
|
548
|
-
var requestPermissionsResultSchema =
|
|
549
|
-
var requestPermissionsRequestMessageSchema =
|
|
904
|
+
var requestPermissionsParamsSchema = v14.nullish(v14.array(permissionTemplate));
|
|
905
|
+
var requestPermissionsResultSchema = v14.literal(true);
|
|
906
|
+
var requestPermissionsRequestMessageSchema = v14.object({
|
|
550
907
|
...rpcRequestMessageSchema.entries,
|
|
551
|
-
...
|
|
552
|
-
method:
|
|
908
|
+
...v14.object({
|
|
909
|
+
method: v14.literal(requestPermissionsMethodName),
|
|
553
910
|
params: requestPermissionsParamsSchema,
|
|
554
|
-
id:
|
|
911
|
+
id: v14.string()
|
|
555
912
|
}).entries
|
|
556
913
|
});
|
|
557
914
|
var renouncePermissionsMethodName = "wallet_renouncePermissions";
|
|
558
|
-
var renouncePermissionsParamsSchema =
|
|
559
|
-
var renouncePermissionsResultSchema =
|
|
560
|
-
var renouncePermissionsRequestMessageSchema =
|
|
915
|
+
var renouncePermissionsParamsSchema = v14.nullish(v14.null());
|
|
916
|
+
var renouncePermissionsResultSchema = v14.nullish(v14.null());
|
|
917
|
+
var renouncePermissionsRequestMessageSchema = v14.object({
|
|
561
918
|
...rpcRequestMessageSchema.entries,
|
|
562
|
-
...
|
|
563
|
-
method:
|
|
919
|
+
...v14.object({
|
|
920
|
+
method: v14.literal(renouncePermissionsMethodName),
|
|
564
921
|
params: renouncePermissionsParamsSchema,
|
|
565
|
-
id:
|
|
922
|
+
id: v14.string()
|
|
566
923
|
}).entries
|
|
567
924
|
});
|
|
568
925
|
var disconnectMethodName = "wallet_disconnect";
|
|
569
|
-
var disconnectParamsSchema =
|
|
570
|
-
var disconnectResultSchema =
|
|
571
|
-
var disconnectRequestMessageSchema =
|
|
926
|
+
var disconnectParamsSchema = v14.nullish(v14.null());
|
|
927
|
+
var disconnectResultSchema = v14.nullish(v14.null());
|
|
928
|
+
var disconnectRequestMessageSchema = v14.object({
|
|
572
929
|
...rpcRequestMessageSchema.entries,
|
|
573
|
-
...
|
|
574
|
-
method:
|
|
930
|
+
...v14.object({
|
|
931
|
+
method: v14.literal(disconnectMethodName),
|
|
575
932
|
params: disconnectParamsSchema,
|
|
576
|
-
id:
|
|
933
|
+
id: v14.string()
|
|
577
934
|
}).entries
|
|
578
935
|
});
|
|
579
936
|
var getWalletTypeMethodName = "wallet_getWalletType";
|
|
580
|
-
var getWalletTypeParamsSchema =
|
|
937
|
+
var getWalletTypeParamsSchema = v14.nullish(v14.null());
|
|
581
938
|
var getWalletTypeResultSchema = walletTypeSchema;
|
|
582
|
-
var getWalletTypeRequestMessageSchema =
|
|
939
|
+
var getWalletTypeRequestMessageSchema = v14.object({
|
|
583
940
|
...rpcRequestMessageSchema.entries,
|
|
584
|
-
...
|
|
585
|
-
method:
|
|
941
|
+
...v14.object({
|
|
942
|
+
method: v14.literal(getWalletTypeMethodName),
|
|
586
943
|
params: getWalletTypeParamsSchema,
|
|
587
|
-
id:
|
|
944
|
+
id: v14.string()
|
|
588
945
|
}).entries
|
|
589
946
|
});
|
|
590
947
|
var getCurrentPermissionsMethodName = "wallet_getCurrentPermissions";
|
|
591
|
-
var getCurrentPermissionsParamsSchema =
|
|
592
|
-
var getCurrentPermissionsResultSchema =
|
|
593
|
-
var getCurrentPermissionsRequestMessageSchema =
|
|
948
|
+
var getCurrentPermissionsParamsSchema = v14.nullish(v14.null());
|
|
949
|
+
var getCurrentPermissionsResultSchema = v14.array(import_xverse_core.permissions.store.permission);
|
|
950
|
+
var getCurrentPermissionsRequestMessageSchema = v14.object({
|
|
594
951
|
...rpcRequestMessageSchema.entries,
|
|
595
|
-
...
|
|
596
|
-
method:
|
|
952
|
+
...v14.object({
|
|
953
|
+
method: v14.literal(getCurrentPermissionsMethodName),
|
|
597
954
|
params: getCurrentPermissionsParamsSchema,
|
|
598
|
-
id:
|
|
955
|
+
id: v14.string()
|
|
599
956
|
}).entries
|
|
600
957
|
});
|
|
601
958
|
var getAccountMethodName = "wallet_getAccount";
|
|
602
|
-
var getAccountParamsSchema =
|
|
603
|
-
var getAccountResultSchema =
|
|
959
|
+
var getAccountParamsSchema = v14.nullish(v14.null());
|
|
960
|
+
var getAccountResultSchema = v14.object({
|
|
604
961
|
id: import_xverse_core.permissions.utils.account.accountIdSchema,
|
|
605
|
-
addresses:
|
|
962
|
+
addresses: v14.array(addressSchema),
|
|
606
963
|
walletType: walletTypeSchema
|
|
607
964
|
});
|
|
608
|
-
var getAccountRequestMessageSchema =
|
|
965
|
+
var getAccountRequestMessageSchema = v14.object({
|
|
609
966
|
...rpcRequestMessageSchema.entries,
|
|
610
|
-
...
|
|
611
|
-
method:
|
|
967
|
+
...v14.object({
|
|
968
|
+
method: v14.literal(getAccountMethodName),
|
|
612
969
|
params: getAccountParamsSchema,
|
|
613
|
-
id:
|
|
970
|
+
id: v14.string()
|
|
614
971
|
}).entries
|
|
615
972
|
});
|
|
616
973
|
var connectMethodName = "wallet_connect";
|
|
617
|
-
var connectParamsSchema =
|
|
618
|
-
|
|
619
|
-
permissions:
|
|
974
|
+
var connectParamsSchema = v14.nullish(
|
|
975
|
+
v14.object({
|
|
976
|
+
permissions: v14.optional(v14.array(permissionTemplate))
|
|
620
977
|
})
|
|
621
978
|
);
|
|
622
979
|
var connectResultSchema = getAccountResultSchema;
|
|
623
|
-
var connectRequestMessageSchema =
|
|
980
|
+
var connectRequestMessageSchema = v14.object({
|
|
624
981
|
...rpcRequestMessageSchema.entries,
|
|
625
|
-
...
|
|
626
|
-
method:
|
|
982
|
+
...v14.object({
|
|
983
|
+
method: v14.literal(connectMethodName),
|
|
627
984
|
params: connectParamsSchema,
|
|
628
|
-
id:
|
|
985
|
+
id: v14.string()
|
|
629
986
|
}).entries
|
|
630
987
|
});
|
|
631
988
|
|
|
632
989
|
// src/request/types/runesMethods.ts
|
|
633
|
-
var
|
|
990
|
+
var v15 = __toESM(require("valibot"));
|
|
634
991
|
var getRunesBalanceMethodName = "runes_getBalance";
|
|
635
|
-
var getRunesBalanceParamsSchema =
|
|
636
|
-
var getRunesBalanceResultSchema =
|
|
637
|
-
balances:
|
|
638
|
-
|
|
639
|
-
runeName:
|
|
640
|
-
amount:
|
|
641
|
-
divisibility:
|
|
642
|
-
symbol:
|
|
643
|
-
inscriptionId:
|
|
992
|
+
var getRunesBalanceParamsSchema = v15.nullish(v15.null());
|
|
993
|
+
var getRunesBalanceResultSchema = v15.object({
|
|
994
|
+
balances: v15.array(
|
|
995
|
+
v15.object({
|
|
996
|
+
runeName: v15.string(),
|
|
997
|
+
amount: v15.string(),
|
|
998
|
+
divisibility: v15.number(),
|
|
999
|
+
symbol: v15.string(),
|
|
1000
|
+
inscriptionId: v15.nullish(v15.string())
|
|
644
1001
|
})
|
|
645
1002
|
)
|
|
646
1003
|
});
|
|
647
|
-
var getRunesBalanceRequestMessageSchema =
|
|
1004
|
+
var getRunesBalanceRequestMessageSchema = v15.object({
|
|
648
1005
|
...rpcRequestMessageSchema.entries,
|
|
649
|
-
...
|
|
650
|
-
method:
|
|
1006
|
+
...v15.object({
|
|
1007
|
+
method: v15.literal(getRunesBalanceMethodName),
|
|
651
1008
|
params: getRunesBalanceParamsSchema,
|
|
652
|
-
id:
|
|
1009
|
+
id: v15.string()
|
|
653
1010
|
}).entries
|
|
654
1011
|
});
|
|
655
1012
|
var transferRunesMethodName = "runes_transfer";
|
|
656
|
-
var transferRunesParamsSchema =
|
|
657
|
-
recipients:
|
|
658
|
-
|
|
659
|
-
runeName:
|
|
660
|
-
amount:
|
|
661
|
-
address:
|
|
1013
|
+
var transferRunesParamsSchema = v15.object({
|
|
1014
|
+
recipients: v15.array(
|
|
1015
|
+
v15.object({
|
|
1016
|
+
runeName: v15.string(),
|
|
1017
|
+
amount: v15.string(),
|
|
1018
|
+
address: v15.string()
|
|
662
1019
|
})
|
|
663
1020
|
)
|
|
664
1021
|
});
|
|
665
|
-
var transferRunesRequestSchema =
|
|
1022
|
+
var transferRunesRequestSchema = v15.object({
|
|
666
1023
|
...rpcRequestMessageSchema.entries,
|
|
667
|
-
...
|
|
668
|
-
method:
|
|
1024
|
+
...v15.object({
|
|
1025
|
+
method: v15.literal(transferRunesMethodName),
|
|
669
1026
|
params: transferRunesParamsSchema,
|
|
670
|
-
id:
|
|
1027
|
+
id: v15.string()
|
|
671
1028
|
}).entries
|
|
672
1029
|
});
|
|
673
|
-
var TransferRunesResultSchema =
|
|
674
|
-
txid:
|
|
1030
|
+
var TransferRunesResultSchema = v15.object({
|
|
1031
|
+
txid: v15.string()
|
|
675
1032
|
});
|
|
676
1033
|
|
|
677
1034
|
// src/request/types/ordinalsMethods.ts
|
|
678
|
-
var
|
|
1035
|
+
var v16 = __toESM(require("valibot"));
|
|
679
1036
|
var getInscriptionsMethodName = "ord_getInscriptions";
|
|
680
|
-
var getInscriptionsParamsSchema =
|
|
681
|
-
offset:
|
|
682
|
-
limit:
|
|
683
|
-
});
|
|
684
|
-
var getInscriptionsResultSchema =
|
|
685
|
-
total:
|
|
686
|
-
limit:
|
|
687
|
-
offset:
|
|
688
|
-
inscriptions:
|
|
689
|
-
|
|
690
|
-
inscriptionId:
|
|
691
|
-
inscriptionNumber:
|
|
692
|
-
address:
|
|
693
|
-
collectionName:
|
|
694
|
-
postage:
|
|
695
|
-
contentLength:
|
|
696
|
-
contentType:
|
|
697
|
-
timestamp:
|
|
698
|
-
offset:
|
|
699
|
-
genesisTransaction:
|
|
700
|
-
output:
|
|
1037
|
+
var getInscriptionsParamsSchema = v16.object({
|
|
1038
|
+
offset: v16.number(),
|
|
1039
|
+
limit: v16.number()
|
|
1040
|
+
});
|
|
1041
|
+
var getInscriptionsResultSchema = v16.object({
|
|
1042
|
+
total: v16.number(),
|
|
1043
|
+
limit: v16.number(),
|
|
1044
|
+
offset: v16.number(),
|
|
1045
|
+
inscriptions: v16.array(
|
|
1046
|
+
v16.object({
|
|
1047
|
+
inscriptionId: v16.string(),
|
|
1048
|
+
inscriptionNumber: v16.string(),
|
|
1049
|
+
address: v16.string(),
|
|
1050
|
+
collectionName: v16.optional(v16.string()),
|
|
1051
|
+
postage: v16.string(),
|
|
1052
|
+
contentLength: v16.string(),
|
|
1053
|
+
contentType: v16.string(),
|
|
1054
|
+
timestamp: v16.number(),
|
|
1055
|
+
offset: v16.number(),
|
|
1056
|
+
genesisTransaction: v16.string(),
|
|
1057
|
+
output: v16.string()
|
|
701
1058
|
})
|
|
702
1059
|
)
|
|
703
1060
|
});
|
|
704
|
-
var getInscriptionsSchema =
|
|
1061
|
+
var getInscriptionsSchema = v16.object({
|
|
705
1062
|
...rpcRequestMessageSchema.entries,
|
|
706
|
-
...
|
|
707
|
-
method:
|
|
1063
|
+
...v16.object({
|
|
1064
|
+
method: v16.literal(getInscriptionsMethodName),
|
|
708
1065
|
params: getInscriptionsParamsSchema,
|
|
709
|
-
id:
|
|
1066
|
+
id: v16.string()
|
|
710
1067
|
}).entries
|
|
711
1068
|
});
|
|
712
1069
|
var sendInscriptionsMethodName = "ord_sendInscriptions";
|
|
713
|
-
var sendInscriptionsParamsSchema =
|
|
714
|
-
transfers:
|
|
715
|
-
|
|
716
|
-
address:
|
|
717
|
-
inscriptionId:
|
|
1070
|
+
var sendInscriptionsParamsSchema = v16.object({
|
|
1071
|
+
transfers: v16.array(
|
|
1072
|
+
v16.object({
|
|
1073
|
+
address: v16.string(),
|
|
1074
|
+
inscriptionId: v16.string()
|
|
718
1075
|
})
|
|
719
1076
|
)
|
|
720
1077
|
});
|
|
721
|
-
var sendInscriptionsResultSchema =
|
|
722
|
-
txid:
|
|
1078
|
+
var sendInscriptionsResultSchema = v16.object({
|
|
1079
|
+
txid: v16.string()
|
|
723
1080
|
});
|
|
724
|
-
var sendInscriptionsSchema =
|
|
1081
|
+
var sendInscriptionsSchema = v16.object({
|
|
725
1082
|
...rpcRequestMessageSchema.entries,
|
|
726
|
-
...
|
|
727
|
-
method:
|
|
1083
|
+
...v16.object({
|
|
1084
|
+
method: v16.literal(sendInscriptionsMethodName),
|
|
728
1085
|
params: sendInscriptionsParamsSchema,
|
|
729
|
-
id:
|
|
1086
|
+
id: v16.string()
|
|
730
1087
|
}).entries
|
|
731
1088
|
});
|
|
732
1089
|
|
|
@@ -743,13 +1100,13 @@ var request = async (method, params, providerId) => {
|
|
|
743
1100
|
throw new Error("A wallet method is required");
|
|
744
1101
|
}
|
|
745
1102
|
const response = await provider.request(method, params);
|
|
746
|
-
if (
|
|
1103
|
+
if (v17.is(rpcErrorResponseMessageSchema, response)) {
|
|
747
1104
|
return {
|
|
748
1105
|
status: "error",
|
|
749
1106
|
error: response.error
|
|
750
1107
|
};
|
|
751
1108
|
}
|
|
752
|
-
if (
|
|
1109
|
+
if (v17.is(rpcSuccessResponseMessageSchema, response)) {
|
|
753
1110
|
return {
|
|
754
1111
|
status: "success",
|
|
755
1112
|
result: response.result
|
|
@@ -1785,6 +2142,10 @@ var signMultipleTransactions = async (options) => {
|
|
|
1785
2142
|
sendInscriptionsParamsSchema,
|
|
1786
2143
|
sendInscriptionsResultSchema,
|
|
1787
2144
|
sendInscriptionsSchema,
|
|
2145
|
+
sendTransferMethodName,
|
|
2146
|
+
sendTransferParamsSchema,
|
|
2147
|
+
sendTransferRequestMessageSchema,
|
|
2148
|
+
sendTransferResultSchema,
|
|
1788
2149
|
setDefaultProvider,
|
|
1789
2150
|
signMessage,
|
|
1790
2151
|
signMessageMethodName,
|
|
@@ -1792,15 +2153,43 @@ var signMultipleTransactions = async (options) => {
|
|
|
1792
2153
|
signMessageRequestMessageSchema,
|
|
1793
2154
|
signMessageResultSchema,
|
|
1794
2155
|
signMultipleTransactions,
|
|
2156
|
+
signPsbtMethodName,
|
|
2157
|
+
signPsbtParamsSchema,
|
|
2158
|
+
signPsbtRequestMessageSchema,
|
|
2159
|
+
signPsbtResultSchema,
|
|
1795
2160
|
signTransaction,
|
|
2161
|
+
stxCallContractMethodName,
|
|
2162
|
+
stxCallContractParamsSchema,
|
|
2163
|
+
stxCallContractRequestMessageSchema,
|
|
2164
|
+
stxCallContractResultSchema,
|
|
2165
|
+
stxDeployContractMethodName,
|
|
2166
|
+
stxDeployContractParamsSchema,
|
|
2167
|
+
stxDeployContractRequestMessageSchema,
|
|
2168
|
+
stxDeployContractResultSchema,
|
|
2169
|
+
stxGetAccountsMethodName,
|
|
2170
|
+
stxGetAccountsParamsSchema,
|
|
2171
|
+
stxGetAccountsRequestMessageSchema,
|
|
2172
|
+
stxGetAccountsResultSchema,
|
|
1796
2173
|
stxGetAddressesMethodName,
|
|
1797
2174
|
stxGetAddressesParamsSchema,
|
|
1798
2175
|
stxGetAddressesRequestMessageSchema,
|
|
1799
2176
|
stxGetAddressesResultSchema,
|
|
2177
|
+
stxSignMessageMethodName,
|
|
2178
|
+
stxSignMessageParamsSchema,
|
|
2179
|
+
stxSignMessageRequestMessageSchema,
|
|
2180
|
+
stxSignMessageResultSchema,
|
|
2181
|
+
stxSignStructuredMessageMethodName,
|
|
2182
|
+
stxSignStructuredMessageParamsSchema,
|
|
2183
|
+
stxSignStructuredMessageRequestMessageSchema,
|
|
2184
|
+
stxSignStructuredMessageResultSchema,
|
|
1800
2185
|
stxSignTransactionMethodName,
|
|
1801
2186
|
stxSignTransactionParamsSchema,
|
|
1802
2187
|
stxSignTransactionRequestMessageSchema,
|
|
1803
2188
|
stxSignTransactionResultSchema,
|
|
2189
|
+
stxTransferStxMethodName,
|
|
2190
|
+
stxTransferStxParamsSchema,
|
|
2191
|
+
stxTransferStxRequestMessageSchema,
|
|
2192
|
+
stxTransferStxResultSchema,
|
|
1804
2193
|
transferRunesMethodName,
|
|
1805
2194
|
transferRunesParamsSchema,
|
|
1806
2195
|
transferRunesRequestSchema,
|