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