@sats-connect/core 0.16.0-2dd02aa → 0.16.0-aa348f8
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 +306 -217
- package/dist/index.d.ts +306 -217
- package/dist/index.js +861 -747
- package/dist/index.mjs +849 -747
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// src/request/index.ts
|
|
2
|
-
import * as
|
|
2
|
+
import * as v62 from "valibot";
|
|
3
3
|
|
|
4
4
|
// src/provider/types.ts
|
|
5
5
|
import * as v4 from "valibot";
|
|
@@ -281,922 +281,1012 @@ var getAccountsRequestMessageSchema = v5.object({
|
|
|
281
281
|
});
|
|
282
282
|
|
|
283
283
|
// src/request/types/btcMethods/getAddresses.ts
|
|
284
|
-
import * as
|
|
284
|
+
import * as v21 from "valibot";
|
|
285
285
|
|
|
286
|
-
// src/request/types/walletMethods.ts
|
|
286
|
+
// src/request/types/walletMethods/addNetwork.ts
|
|
287
287
|
import * as v6 from "valibot";
|
|
288
|
-
var
|
|
289
|
-
|
|
290
|
-
});
|
|
291
|
-
var walletActionsSchema = v6.object({
|
|
292
|
-
readNetwork: v6.optional(v6.boolean())
|
|
293
|
-
});
|
|
294
|
-
var accountPermissionSchema = v6.object({
|
|
295
|
-
type: v6.literal("account"),
|
|
296
|
-
resourceId: v6.string(),
|
|
297
|
-
clientId: v6.string(),
|
|
298
|
-
actions: accountActionsSchema
|
|
299
|
-
});
|
|
300
|
-
var walletPermissionSchema = v6.object({
|
|
301
|
-
type: v6.literal("wallet"),
|
|
302
|
-
resourceId: v6.string(),
|
|
303
|
-
clientId: v6.string(),
|
|
304
|
-
actions: walletActionsSchema
|
|
305
|
-
});
|
|
306
|
-
var PermissionRequestParams = v6.variant("type", [
|
|
288
|
+
var addNetworkMethodName = "wallet_addNetwork";
|
|
289
|
+
var addNetworkParamsSchema = v6.variant("chain", [
|
|
307
290
|
v6.object({
|
|
308
|
-
|
|
291
|
+
chain: v6.literal("bitcoin"),
|
|
292
|
+
type: v6.enum(BitcoinNetworkType),
|
|
293
|
+
name: v6.string(),
|
|
294
|
+
rpcUrl: v6.string(),
|
|
295
|
+
rpcFallbackUrl: v6.optional(v6.string()),
|
|
296
|
+
indexerUrl: v6.optional(v6.string()),
|
|
297
|
+
blockExplorerUrl: v6.optional(v6.string()),
|
|
298
|
+
switch: v6.optional(v6.boolean())
|
|
299
|
+
}),
|
|
300
|
+
v6.object({
|
|
301
|
+
chain: v6.literal("stacks"),
|
|
302
|
+
name: v6.string(),
|
|
303
|
+
type: v6.enum(StacksNetworkType),
|
|
304
|
+
rpcUrl: v6.string(),
|
|
305
|
+
blockExplorerUrl: v6.optional(v6.string()),
|
|
306
|
+
switch: v6.optional(v6.boolean())
|
|
309
307
|
}),
|
|
310
308
|
v6.object({
|
|
311
|
-
|
|
309
|
+
chain: v6.literal("starknet"),
|
|
310
|
+
name: v6.string(),
|
|
311
|
+
type: v6.enum(StarknetNetworkType),
|
|
312
|
+
rpcUrl: v6.string(),
|
|
313
|
+
blockExplorerUrl: v6.optional(v6.string()),
|
|
314
|
+
switch: v6.optional(v6.boolean())
|
|
312
315
|
})
|
|
313
316
|
]);
|
|
314
|
-
var
|
|
315
|
-
var requestPermissionsMethodName = "wallet_requestPermissions";
|
|
316
|
-
var requestPermissionsParamsSchema = v6.nullish(v6.array(PermissionRequestParams));
|
|
317
|
-
var requestPermissionsResultSchema = v6.literal(true);
|
|
318
|
-
var requestPermissionsRequestMessageSchema = v6.object({
|
|
317
|
+
var addNetworkRequestMessageSchema = v6.object({
|
|
319
318
|
...rpcRequestMessageSchema.entries,
|
|
320
319
|
...v6.object({
|
|
321
|
-
method: v6.literal(
|
|
322
|
-
params:
|
|
320
|
+
method: v6.literal(addNetworkMethodName),
|
|
321
|
+
params: addNetworkParamsSchema,
|
|
323
322
|
id: v6.string()
|
|
324
323
|
}).entries
|
|
325
324
|
});
|
|
326
|
-
var
|
|
327
|
-
|
|
328
|
-
var renouncePermissionsResultSchema = v6.nullish(v6.null());
|
|
329
|
-
var renouncePermissionsRequestMessageSchema = v6.object({
|
|
330
|
-
...rpcRequestMessageSchema.entries,
|
|
331
|
-
...v6.object({
|
|
332
|
-
method: v6.literal(renouncePermissionsMethodName),
|
|
333
|
-
params: renouncePermissionsParamsSchema,
|
|
334
|
-
id: v6.string()
|
|
335
|
-
}).entries
|
|
325
|
+
var addNetworkResultSchema = v6.object({
|
|
326
|
+
id: v6.string()
|
|
336
327
|
});
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
var
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
method: v6.literal(disconnectMethodName),
|
|
344
|
-
params: disconnectParamsSchema,
|
|
345
|
-
id: v6.string()
|
|
346
|
-
}).entries
|
|
328
|
+
|
|
329
|
+
// src/request/types/walletMethods/changeNetwork.ts
|
|
330
|
+
import * as v7 from "valibot";
|
|
331
|
+
var changeNetworkMethodName = "wallet_changeNetwork";
|
|
332
|
+
var changeNetworkParamsSchema = v7.object({
|
|
333
|
+
name: v7.enum(BitcoinNetworkType)
|
|
347
334
|
});
|
|
348
|
-
var
|
|
349
|
-
var
|
|
350
|
-
var getWalletTypeResultSchema = walletTypeSchema;
|
|
351
|
-
var getWalletTypeRequestMessageSchema = v6.object({
|
|
335
|
+
var changeNetworkResultSchema = v7.nullish(v7.null());
|
|
336
|
+
var changeNetworkRequestMessageSchema = v7.object({
|
|
352
337
|
...rpcRequestMessageSchema.entries,
|
|
353
|
-
...
|
|
354
|
-
method:
|
|
355
|
-
params:
|
|
356
|
-
id:
|
|
338
|
+
...v7.object({
|
|
339
|
+
method: v7.literal(changeNetworkMethodName),
|
|
340
|
+
params: changeNetworkParamsSchema,
|
|
341
|
+
id: v7.string()
|
|
357
342
|
}).entries
|
|
358
343
|
});
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
var
|
|
344
|
+
|
|
345
|
+
// src/request/types/walletMethods/changeNetworkById.ts
|
|
346
|
+
import * as v8 from "valibot";
|
|
347
|
+
var changeNetworkByIdMethodName = "wallet_changeNetworkById";
|
|
348
|
+
var changeNetworkByIdParamsSchema = v8.object({
|
|
349
|
+
id: v8.string()
|
|
350
|
+
});
|
|
351
|
+
var changeNetworkByIdResultSchema = v8.nullish(v8.null());
|
|
352
|
+
var changeNetworkByIdRequestMessageSchema = v8.object({
|
|
363
353
|
...rpcRequestMessageSchema.entries,
|
|
364
|
-
...
|
|
365
|
-
method:
|
|
366
|
-
params:
|
|
367
|
-
id:
|
|
354
|
+
...v8.object({
|
|
355
|
+
method: v8.literal(changeNetworkByIdMethodName),
|
|
356
|
+
params: changeNetworkByIdParamsSchema,
|
|
357
|
+
id: v8.string()
|
|
368
358
|
}).entries
|
|
369
359
|
});
|
|
360
|
+
|
|
361
|
+
// src/request/types/walletMethods/common.ts
|
|
362
|
+
import * as v9 from "valibot";
|
|
363
|
+
var accountActionsSchema = v9.object({
|
|
364
|
+
read: v9.optional(v9.boolean())
|
|
365
|
+
});
|
|
366
|
+
var walletActionsSchema = v9.object({
|
|
367
|
+
readNetwork: v9.optional(v9.boolean())
|
|
368
|
+
});
|
|
369
|
+
var accountPermissionSchema = v9.object({
|
|
370
|
+
type: v9.literal("account"),
|
|
371
|
+
resourceId: v9.string(),
|
|
372
|
+
clientId: v9.string(),
|
|
373
|
+
actions: accountActionsSchema
|
|
374
|
+
});
|
|
375
|
+
var walletPermissionSchema = v9.object({
|
|
376
|
+
type: v9.literal("wallet"),
|
|
377
|
+
resourceId: v9.string(),
|
|
378
|
+
clientId: v9.string(),
|
|
379
|
+
actions: walletActionsSchema
|
|
380
|
+
});
|
|
381
|
+
var PermissionRequestParams = v9.variant("type", [
|
|
382
|
+
v9.object({
|
|
383
|
+
...v9.omit(accountPermissionSchema, ["clientId"]).entries
|
|
384
|
+
}),
|
|
385
|
+
v9.object({
|
|
386
|
+
...v9.omit(walletPermissionSchema, ["clientId"]).entries
|
|
387
|
+
})
|
|
388
|
+
]);
|
|
389
|
+
var permission = v9.variant("type", [accountPermissionSchema, walletPermissionSchema]);
|
|
390
|
+
|
|
391
|
+
// src/request/types/walletMethods/connect.ts
|
|
392
|
+
import * as v11 from "valibot";
|
|
393
|
+
|
|
394
|
+
// src/request/types/walletMethods/getNetwork.ts
|
|
395
|
+
import * as v10 from "valibot";
|
|
370
396
|
var getNetworkMethodName = "wallet_getNetwork";
|
|
371
|
-
var getNetworkParamsSchema =
|
|
372
|
-
var getNetworkResultSchema =
|
|
373
|
-
bitcoin:
|
|
374
|
-
name:
|
|
397
|
+
var getNetworkParamsSchema = v10.nullish(v10.null());
|
|
398
|
+
var getNetworkResultSchema = v10.object({
|
|
399
|
+
bitcoin: v10.object({
|
|
400
|
+
name: v10.enum(BitcoinNetworkType)
|
|
375
401
|
}),
|
|
376
|
-
stacks:
|
|
377
|
-
name:
|
|
402
|
+
stacks: v10.object({
|
|
403
|
+
name: v10.enum(StacksNetworkType)
|
|
378
404
|
}),
|
|
379
|
-
spark:
|
|
380
|
-
name:
|
|
405
|
+
spark: v10.object({
|
|
406
|
+
name: v10.enum(SparkNetworkType)
|
|
381
407
|
})
|
|
382
408
|
});
|
|
383
|
-
var getNetworkRequestMessageSchema =
|
|
409
|
+
var getNetworkRequestMessageSchema = v10.object({
|
|
384
410
|
...rpcRequestMessageSchema.entries,
|
|
385
|
-
...
|
|
386
|
-
method:
|
|
411
|
+
...v10.object({
|
|
412
|
+
method: v10.literal(getNetworkMethodName),
|
|
387
413
|
params: getNetworkParamsSchema,
|
|
388
|
-
id:
|
|
414
|
+
id: v10.string()
|
|
389
415
|
}).entries
|
|
390
416
|
});
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
417
|
+
|
|
418
|
+
// src/request/types/walletMethods/connect.ts
|
|
419
|
+
var connectMethodName = "wallet_connect";
|
|
420
|
+
var connectParamsSchema = v11.nullish(
|
|
421
|
+
v11.object({
|
|
422
|
+
permissions: v11.optional(v11.array(PermissionRequestParams)),
|
|
423
|
+
addresses: v11.optional(v11.array(v11.enum(AddressPurpose))),
|
|
424
|
+
message: v11.optional(
|
|
425
|
+
v11.pipe(v11.string(), v11.maxLength(80, "The message must not exceed 80 characters."))
|
|
426
|
+
),
|
|
427
|
+
network: v11.optional(v11.enum(BitcoinNetworkType))
|
|
428
|
+
})
|
|
429
|
+
);
|
|
430
|
+
var connectResultSchema = v11.object({
|
|
431
|
+
id: v11.string(),
|
|
432
|
+
addresses: v11.array(addressSchema),
|
|
433
|
+
walletType: walletTypeSchema,
|
|
434
|
+
network: getNetworkResultSchema
|
|
394
435
|
});
|
|
395
|
-
var
|
|
396
|
-
var changeNetworkRequestMessageSchema = v6.object({
|
|
436
|
+
var connectRequestMessageSchema = v11.object({
|
|
397
437
|
...rpcRequestMessageSchema.entries,
|
|
398
|
-
...
|
|
399
|
-
method:
|
|
400
|
-
params:
|
|
401
|
-
id:
|
|
438
|
+
...v11.object({
|
|
439
|
+
method: v11.literal(connectMethodName),
|
|
440
|
+
params: connectParamsSchema,
|
|
441
|
+
id: v11.string()
|
|
402
442
|
}).entries
|
|
403
443
|
});
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
var
|
|
409
|
-
var
|
|
444
|
+
|
|
445
|
+
// src/request/types/walletMethods/disconnect.ts
|
|
446
|
+
import * as v12 from "valibot";
|
|
447
|
+
var disconnectMethodName = "wallet_disconnect";
|
|
448
|
+
var disconnectParamsSchema = v12.nullish(v12.null());
|
|
449
|
+
var disconnectResultSchema = v12.nullish(v12.null());
|
|
450
|
+
var disconnectRequestMessageSchema = v12.object({
|
|
410
451
|
...rpcRequestMessageSchema.entries,
|
|
411
|
-
...
|
|
412
|
-
method:
|
|
413
|
-
params:
|
|
414
|
-
id:
|
|
452
|
+
...v12.object({
|
|
453
|
+
method: v12.literal(disconnectMethodName),
|
|
454
|
+
params: disconnectParamsSchema,
|
|
455
|
+
id: v12.string()
|
|
415
456
|
}).entries
|
|
416
457
|
});
|
|
458
|
+
|
|
459
|
+
// src/request/types/walletMethods/getAccount.ts
|
|
460
|
+
import * as v13 from "valibot";
|
|
417
461
|
var getAccountMethodName = "wallet_getAccount";
|
|
418
|
-
var getAccountParamsSchema =
|
|
419
|
-
var getAccountResultSchema =
|
|
420
|
-
id:
|
|
421
|
-
addresses:
|
|
462
|
+
var getAccountParamsSchema = v13.nullish(v13.null());
|
|
463
|
+
var getAccountResultSchema = v13.object({
|
|
464
|
+
id: v13.string(),
|
|
465
|
+
addresses: v13.array(addressSchema),
|
|
422
466
|
walletType: walletTypeSchema,
|
|
423
467
|
network: getNetworkResultSchema
|
|
424
468
|
});
|
|
425
|
-
var getAccountRequestMessageSchema =
|
|
469
|
+
var getAccountRequestMessageSchema = v13.object({
|
|
426
470
|
...rpcRequestMessageSchema.entries,
|
|
427
|
-
...
|
|
428
|
-
method:
|
|
471
|
+
...v13.object({
|
|
472
|
+
method: v13.literal(getAccountMethodName),
|
|
429
473
|
params: getAccountParamsSchema,
|
|
430
|
-
id:
|
|
474
|
+
id: v13.string()
|
|
431
475
|
}).entries
|
|
432
476
|
});
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
addresses: v6.array(addressSchema),
|
|
447
|
-
walletType: walletTypeSchema,
|
|
448
|
-
network: getNetworkResultSchema
|
|
477
|
+
|
|
478
|
+
// src/request/types/walletMethods/getCurrentPermissions.ts
|
|
479
|
+
import * as v14 from "valibot";
|
|
480
|
+
var getCurrentPermissionsMethodName = "wallet_getCurrentPermissions";
|
|
481
|
+
var getCurrentPermissionsParamsSchema = v14.nullish(v14.null());
|
|
482
|
+
var getCurrentPermissionsResultSchema = v14.array(permission);
|
|
483
|
+
var getCurrentPermissionsRequestMessageSchema = v14.object({
|
|
484
|
+
...rpcRequestMessageSchema.entries,
|
|
485
|
+
...v14.object({
|
|
486
|
+
method: v14.literal(getCurrentPermissionsMethodName),
|
|
487
|
+
params: getCurrentPermissionsParamsSchema,
|
|
488
|
+
id: v14.string()
|
|
489
|
+
}).entries
|
|
449
490
|
});
|
|
450
|
-
|
|
491
|
+
|
|
492
|
+
// src/request/types/walletMethods/getWalletType.ts
|
|
493
|
+
import * as v15 from "valibot";
|
|
494
|
+
var getWalletTypeMethodName = "wallet_getWalletType";
|
|
495
|
+
var getWalletTypeParamsSchema = v15.nullish(v15.null());
|
|
496
|
+
var getWalletTypeResultSchema = walletTypeSchema;
|
|
497
|
+
var getWalletTypeRequestMessageSchema = v15.object({
|
|
451
498
|
...rpcRequestMessageSchema.entries,
|
|
452
|
-
...
|
|
453
|
-
method:
|
|
454
|
-
params:
|
|
455
|
-
id:
|
|
499
|
+
...v15.object({
|
|
500
|
+
method: v15.literal(getWalletTypeMethodName),
|
|
501
|
+
params: getWalletTypeParamsSchema,
|
|
502
|
+
id: v15.string()
|
|
456
503
|
}).entries
|
|
457
504
|
});
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
switch: v6.optional(v6.boolean())
|
|
469
|
-
}),
|
|
470
|
-
v6.object({
|
|
471
|
-
chain: v6.literal("stacks"),
|
|
472
|
-
name: v6.string(),
|
|
473
|
-
type: v6.enum(StacksNetworkType),
|
|
474
|
-
rpcUrl: v6.string(),
|
|
475
|
-
blockExplorerUrl: v6.optional(v6.string()),
|
|
476
|
-
switch: v6.optional(v6.boolean())
|
|
477
|
-
}),
|
|
478
|
-
v6.object({
|
|
479
|
-
chain: v6.literal("starknet"),
|
|
480
|
-
name: v6.string(),
|
|
481
|
-
type: v6.enum(StarknetNetworkType),
|
|
482
|
-
rpcUrl: v6.string(),
|
|
483
|
-
blockExplorerUrl: v6.optional(v6.string()),
|
|
484
|
-
switch: v6.optional(v6.boolean())
|
|
485
|
-
})
|
|
486
|
-
]);
|
|
487
|
-
var addNetworkRequestMessageSchema = v6.object({
|
|
505
|
+
|
|
506
|
+
// src/request/types/walletMethods/openBridge.ts
|
|
507
|
+
import * as v16 from "valibot";
|
|
508
|
+
var openBridgeMethodName = "wallet_openBridge";
|
|
509
|
+
var openBridgeParamsSchema = v16.object({
|
|
510
|
+
fromAsset: v16.string(),
|
|
511
|
+
toAsset: v16.string()
|
|
512
|
+
});
|
|
513
|
+
var openBridgeResultSchema = v16.nullish(v16.null());
|
|
514
|
+
var openBridgeRequestMessageSchema = v16.object({
|
|
488
515
|
...rpcRequestMessageSchema.entries,
|
|
489
|
-
...
|
|
490
|
-
method:
|
|
491
|
-
params:
|
|
492
|
-
id:
|
|
516
|
+
...v16.object({
|
|
517
|
+
method: v16.literal(openBridgeMethodName),
|
|
518
|
+
params: openBridgeParamsSchema,
|
|
519
|
+
id: v16.string()
|
|
493
520
|
}).entries
|
|
494
521
|
});
|
|
495
|
-
|
|
496
|
-
|
|
522
|
+
|
|
523
|
+
// src/request/types/walletMethods/openBuy.ts
|
|
524
|
+
import * as v17 from "valibot";
|
|
525
|
+
var openBuyMethodName = "wallet_openBuy";
|
|
526
|
+
var openBuyParamsSchema = v17.object({
|
|
527
|
+
asset: v17.string()
|
|
528
|
+
});
|
|
529
|
+
var openBuyResultSchema = v17.nullish(v17.null());
|
|
530
|
+
var openBuyRequestMessageSchema = v17.object({
|
|
531
|
+
...rpcRequestMessageSchema.entries,
|
|
532
|
+
...v17.object({
|
|
533
|
+
method: v17.literal(openBuyMethodName),
|
|
534
|
+
params: openBuyParamsSchema,
|
|
535
|
+
id: v17.string()
|
|
536
|
+
}).entries
|
|
537
|
+
});
|
|
538
|
+
|
|
539
|
+
// src/request/types/walletMethods/openReceive.ts
|
|
540
|
+
import * as v18 from "valibot";
|
|
541
|
+
var openReceiveMethodName = "wallet_openReceive";
|
|
542
|
+
var openReceiveParamsSchema = v18.object({
|
|
543
|
+
address: v18.string()
|
|
544
|
+
});
|
|
545
|
+
var openReceiveResultSchema = addressSchema;
|
|
546
|
+
var openReceiveRequestMessageSchema = v18.object({
|
|
547
|
+
...rpcRequestMessageSchema.entries,
|
|
548
|
+
...v18.object({
|
|
549
|
+
method: v18.literal(openReceiveMethodName),
|
|
550
|
+
params: openReceiveParamsSchema,
|
|
551
|
+
id: v18.string()
|
|
552
|
+
}).entries
|
|
553
|
+
});
|
|
554
|
+
|
|
555
|
+
// src/request/types/walletMethods/renouncePermissions.ts
|
|
556
|
+
import * as v19 from "valibot";
|
|
557
|
+
var renouncePermissionsMethodName = "wallet_renouncePermissions";
|
|
558
|
+
var renouncePermissionsParamsSchema = v19.nullish(v19.null());
|
|
559
|
+
var renouncePermissionsResultSchema = v19.nullish(v19.null());
|
|
560
|
+
var renouncePermissionsRequestMessageSchema = v19.object({
|
|
561
|
+
...rpcRequestMessageSchema.entries,
|
|
562
|
+
...v19.object({
|
|
563
|
+
method: v19.literal(renouncePermissionsMethodName),
|
|
564
|
+
params: renouncePermissionsParamsSchema,
|
|
565
|
+
id: v19.string()
|
|
566
|
+
}).entries
|
|
567
|
+
});
|
|
568
|
+
|
|
569
|
+
// src/request/types/walletMethods/requestPermissions.ts
|
|
570
|
+
import * as v20 from "valibot";
|
|
571
|
+
var requestPermissionsMethodName = "wallet_requestPermissions";
|
|
572
|
+
var requestPermissionsParamsSchema = v20.nullish(v20.array(PermissionRequestParams));
|
|
573
|
+
var requestPermissionsResultSchema = v20.literal(true);
|
|
574
|
+
var requestPermissionsRequestMessageSchema = v20.object({
|
|
575
|
+
...rpcRequestMessageSchema.entries,
|
|
576
|
+
...v20.object({
|
|
577
|
+
method: v20.literal(requestPermissionsMethodName),
|
|
578
|
+
params: requestPermissionsParamsSchema,
|
|
579
|
+
id: v20.string()
|
|
580
|
+
}).entries
|
|
497
581
|
});
|
|
498
582
|
|
|
499
583
|
// src/request/types/btcMethods/getAddresses.ts
|
|
500
584
|
var getAddressesMethodName = "getAddresses";
|
|
501
|
-
var getAddressesParamsSchema =
|
|
585
|
+
var getAddressesParamsSchema = v21.object({
|
|
502
586
|
/**
|
|
503
587
|
* The purposes for which to generate addresses. See
|
|
504
588
|
* {@linkcode AddressPurpose} for available purposes.
|
|
505
589
|
*/
|
|
506
|
-
purposes:
|
|
590
|
+
purposes: v21.array(v21.enum(AddressPurpose)),
|
|
507
591
|
/**
|
|
508
592
|
* A message to be displayed to the user in the request prompt.
|
|
509
593
|
*/
|
|
510
|
-
message:
|
|
594
|
+
message: v21.optional(v21.string())
|
|
511
595
|
});
|
|
512
|
-
var getAddressesResultSchema =
|
|
596
|
+
var getAddressesResultSchema = v21.object({
|
|
513
597
|
/**
|
|
514
598
|
* The addresses generated for the given purposes.
|
|
515
599
|
*/
|
|
516
|
-
addresses:
|
|
600
|
+
addresses: v21.array(addressSchema),
|
|
517
601
|
network: getNetworkResultSchema
|
|
518
602
|
});
|
|
519
|
-
var getAddressesRequestMessageSchema =
|
|
603
|
+
var getAddressesRequestMessageSchema = v21.object({
|
|
520
604
|
...rpcRequestMessageSchema.entries,
|
|
521
|
-
...
|
|
522
|
-
method:
|
|
605
|
+
...v21.object({
|
|
606
|
+
method: v21.literal(getAddressesMethodName),
|
|
523
607
|
params: getAddressesParamsSchema,
|
|
524
|
-
id:
|
|
608
|
+
id: v21.string()
|
|
525
609
|
}).entries
|
|
526
610
|
});
|
|
527
611
|
|
|
528
612
|
// src/request/types/btcMethods/getBalance.ts
|
|
529
|
-
import * as
|
|
613
|
+
import * as v22 from "valibot";
|
|
530
614
|
var getBalanceMethodName = "getBalance";
|
|
531
|
-
var getBalanceParamsSchema =
|
|
532
|
-
var getBalanceResultSchema =
|
|
615
|
+
var getBalanceParamsSchema = v22.nullish(v22.null());
|
|
616
|
+
var getBalanceResultSchema = v22.object({
|
|
533
617
|
/**
|
|
534
618
|
* The confirmed balance of the wallet in sats. Using a string due to chrome
|
|
535
619
|
* messages not supporting bigint
|
|
536
620
|
* (https://issues.chromium.org/issues/40116184).
|
|
537
621
|
*/
|
|
538
|
-
confirmed:
|
|
622
|
+
confirmed: v22.string(),
|
|
539
623
|
/**
|
|
540
624
|
* The unconfirmed balance of the wallet in sats. Using a string due to chrome
|
|
541
625
|
* messages not supporting bigint
|
|
542
626
|
* (https://issues.chromium.org/issues/40116184).
|
|
543
627
|
*/
|
|
544
|
-
unconfirmed:
|
|
628
|
+
unconfirmed: v22.string(),
|
|
545
629
|
/**
|
|
546
630
|
* The total balance (both confirmed and unconfrimed UTXOs) of the wallet in
|
|
547
631
|
* sats. Using a string due to chrome messages not supporting bigint
|
|
548
632
|
* (https://issues.chromium.org/issues/40116184).
|
|
549
633
|
*/
|
|
550
|
-
total:
|
|
634
|
+
total: v22.string()
|
|
551
635
|
});
|
|
552
|
-
var getBalanceRequestMessageSchema =
|
|
636
|
+
var getBalanceRequestMessageSchema = v22.object({
|
|
553
637
|
...rpcRequestMessageSchema.entries,
|
|
554
|
-
...
|
|
555
|
-
method:
|
|
556
|
-
id:
|
|
638
|
+
...v22.object({
|
|
639
|
+
method: v22.literal(getBalanceMethodName),
|
|
640
|
+
id: v22.string()
|
|
557
641
|
}).entries
|
|
558
642
|
});
|
|
559
643
|
|
|
560
644
|
// src/request/types/btcMethods/getInfo.ts
|
|
561
|
-
import * as
|
|
645
|
+
import * as v23 from "valibot";
|
|
562
646
|
var ProviderPlatform = /* @__PURE__ */ ((ProviderPlatform2) => {
|
|
563
647
|
ProviderPlatform2["Web"] = "web";
|
|
564
648
|
ProviderPlatform2["Mobile"] = "mobile";
|
|
565
649
|
return ProviderPlatform2;
|
|
566
650
|
})(ProviderPlatform || {});
|
|
567
651
|
var getInfoMethodName = "getInfo";
|
|
568
|
-
var getInfoParamsSchema =
|
|
569
|
-
var getInfoResultSchema =
|
|
652
|
+
var getInfoParamsSchema = v23.nullish(v23.null());
|
|
653
|
+
var getInfoResultSchema = v23.object({
|
|
570
654
|
/**
|
|
571
655
|
* Version of the wallet.
|
|
572
656
|
*/
|
|
573
|
-
version:
|
|
657
|
+
version: v23.string(),
|
|
574
658
|
/**
|
|
575
659
|
* The platform the wallet is running on (web or mobile).
|
|
576
660
|
*/
|
|
577
|
-
platform:
|
|
661
|
+
platform: v23.optional(v23.enum(ProviderPlatform)),
|
|
578
662
|
/**
|
|
579
663
|
* [WBIP](https://wbips.netlify.app/wbips/WBIP002) methods supported by the wallet.
|
|
580
664
|
*/
|
|
581
|
-
methods:
|
|
665
|
+
methods: v23.optional(v23.array(v23.string())),
|
|
582
666
|
/**
|
|
583
667
|
* List of WBIP standards supported by the wallet. Not currently used.
|
|
584
668
|
*/
|
|
585
|
-
supports:
|
|
669
|
+
supports: v23.array(v23.string())
|
|
586
670
|
});
|
|
587
|
-
var getInfoRequestMessageSchema =
|
|
671
|
+
var getInfoRequestMessageSchema = v23.object({
|
|
588
672
|
...rpcRequestMessageSchema.entries,
|
|
589
|
-
...
|
|
590
|
-
method:
|
|
673
|
+
...v23.object({
|
|
674
|
+
method: v23.literal(getInfoMethodName),
|
|
591
675
|
params: getInfoParamsSchema,
|
|
592
|
-
id:
|
|
676
|
+
id: v23.string()
|
|
593
677
|
}).entries
|
|
594
678
|
});
|
|
595
679
|
|
|
596
680
|
// src/request/types/btcMethods/sendTransfer.ts
|
|
597
|
-
import * as
|
|
681
|
+
import * as v24 from "valibot";
|
|
598
682
|
var sendTransferMethodName = "sendTransfer";
|
|
599
|
-
var sendTransferParamsSchema =
|
|
683
|
+
var sendTransferParamsSchema = v24.object({
|
|
600
684
|
/**
|
|
601
685
|
* Array of recipients to send to.
|
|
602
686
|
* The amount to send to each recipient is in satoshis.
|
|
603
687
|
*/
|
|
604
|
-
recipients:
|
|
605
|
-
|
|
606
|
-
address:
|
|
607
|
-
amount:
|
|
688
|
+
recipients: v24.array(
|
|
689
|
+
v24.object({
|
|
690
|
+
address: v24.string(),
|
|
691
|
+
amount: v24.number()
|
|
608
692
|
})
|
|
609
693
|
)
|
|
610
694
|
});
|
|
611
|
-
var sendTransferResultSchema =
|
|
695
|
+
var sendTransferResultSchema = v24.object({
|
|
612
696
|
/**
|
|
613
697
|
* The transaction id as a hex-encoded string.
|
|
614
698
|
*/
|
|
615
|
-
txid:
|
|
699
|
+
txid: v24.string()
|
|
616
700
|
});
|
|
617
|
-
var sendTransferRequestMessageSchema =
|
|
701
|
+
var sendTransferRequestMessageSchema = v24.object({
|
|
618
702
|
...rpcRequestMessageSchema.entries,
|
|
619
|
-
...
|
|
620
|
-
method:
|
|
703
|
+
...v24.object({
|
|
704
|
+
method: v24.literal(sendTransferMethodName),
|
|
621
705
|
params: sendTransferParamsSchema,
|
|
622
|
-
id:
|
|
706
|
+
id: v24.string()
|
|
623
707
|
}).entries
|
|
624
708
|
});
|
|
625
709
|
|
|
626
710
|
// src/request/types/btcMethods/signMessage.ts
|
|
627
|
-
import * as
|
|
711
|
+
import * as v25 from "valibot";
|
|
628
712
|
var signMessageMethodName = "signMessage";
|
|
629
|
-
var signMessageParamsSchema =
|
|
713
|
+
var signMessageParamsSchema = v25.object({
|
|
630
714
|
/**
|
|
631
715
|
* The address used for signing.
|
|
632
716
|
**/
|
|
633
|
-
address:
|
|
717
|
+
address: v25.string(),
|
|
634
718
|
/**
|
|
635
719
|
* The message to sign.
|
|
636
720
|
**/
|
|
637
|
-
message:
|
|
721
|
+
message: v25.string(),
|
|
638
722
|
/**
|
|
639
|
-
* The protocol to
|
|
723
|
+
* The protocol to used to sign the message.
|
|
724
|
+
*
|
|
725
|
+
* If not specified, defaults to ECDSA if signing with a P2WPKH or P2SH address,
|
|
726
|
+
* and to BIP322 if signing with a taproot address.
|
|
640
727
|
*/
|
|
641
|
-
protocol:
|
|
728
|
+
protocol: v25.optional(v25.enum(MessageSigningProtocols))
|
|
642
729
|
});
|
|
643
|
-
var signMessageResultSchema =
|
|
730
|
+
var signMessageResultSchema = v25.object({
|
|
644
731
|
/**
|
|
645
732
|
* The signature of the message.
|
|
646
733
|
*/
|
|
647
|
-
signature:
|
|
734
|
+
signature: v25.string(),
|
|
648
735
|
/**
|
|
649
736
|
* hash of the message.
|
|
650
737
|
*/
|
|
651
|
-
messageHash:
|
|
738
|
+
messageHash: v25.string(),
|
|
652
739
|
/**
|
|
653
740
|
* The address used for signing.
|
|
654
741
|
*/
|
|
655
|
-
address:
|
|
742
|
+
address: v25.string(),
|
|
656
743
|
/**
|
|
657
744
|
* The protocol to use for signing the message.
|
|
658
745
|
*/
|
|
659
|
-
protocol:
|
|
746
|
+
protocol: v25.enum(MessageSigningProtocols)
|
|
660
747
|
});
|
|
661
|
-
var signMessageRequestMessageSchema =
|
|
748
|
+
var signMessageRequestMessageSchema = v25.object({
|
|
662
749
|
...rpcRequestMessageSchema.entries,
|
|
663
|
-
...
|
|
664
|
-
method:
|
|
750
|
+
...v25.object({
|
|
751
|
+
method: v25.literal(signMessageMethodName),
|
|
665
752
|
params: signMessageParamsSchema,
|
|
666
|
-
id:
|
|
753
|
+
id: v25.string()
|
|
667
754
|
}).entries
|
|
668
755
|
});
|
|
669
756
|
|
|
670
757
|
// src/request/types/btcMethods/signMultipleMessages.ts
|
|
671
|
-
import * as
|
|
758
|
+
import * as v26 from "valibot";
|
|
672
759
|
var signMultipleMessagesMethodName = "signMultipleMessages";
|
|
673
|
-
var signMultipleMessagesParamsSchema =
|
|
674
|
-
|
|
760
|
+
var signMultipleMessagesParamsSchema = v26.array(
|
|
761
|
+
v26.object({
|
|
675
762
|
/**
|
|
676
763
|
* The address used for signing.
|
|
677
764
|
**/
|
|
678
|
-
address:
|
|
765
|
+
address: v26.string(),
|
|
679
766
|
/**
|
|
680
767
|
* The message to sign.
|
|
681
768
|
**/
|
|
682
|
-
message:
|
|
769
|
+
message: v26.string(),
|
|
683
770
|
/**
|
|
684
|
-
* The protocol to
|
|
771
|
+
* The protocol to used to sign the message.
|
|
772
|
+
*
|
|
773
|
+
* If not specified, defaults to ECDSA if signing with a P2WPKH or P2SH address,
|
|
774
|
+
* and to BIP322 if signing with a taproot address.
|
|
685
775
|
*/
|
|
686
|
-
protocol:
|
|
776
|
+
protocol: v26.optional(v26.enum(MessageSigningProtocols))
|
|
687
777
|
})
|
|
688
778
|
);
|
|
689
|
-
var signMultipleMessagesResultSchema =
|
|
690
|
-
|
|
779
|
+
var signMultipleMessagesResultSchema = v26.array(
|
|
780
|
+
v26.object({
|
|
691
781
|
/**
|
|
692
782
|
* The signature of the message.
|
|
693
783
|
*/
|
|
694
|
-
signature:
|
|
784
|
+
signature: v26.string(),
|
|
695
785
|
/**
|
|
696
786
|
* The original message which was signed.
|
|
697
787
|
*/
|
|
698
|
-
message:
|
|
788
|
+
message: v26.string(),
|
|
699
789
|
/**
|
|
700
790
|
* Hash of the message.
|
|
701
791
|
*/
|
|
702
|
-
messageHash:
|
|
792
|
+
messageHash: v26.string(),
|
|
703
793
|
/**
|
|
704
794
|
* The address used for signing.
|
|
705
795
|
*/
|
|
706
|
-
address:
|
|
796
|
+
address: v26.string(),
|
|
707
797
|
/**
|
|
708
798
|
* The protocol to use for signing the message.
|
|
709
799
|
*/
|
|
710
|
-
protocol:
|
|
800
|
+
protocol: v26.enum(MessageSigningProtocols)
|
|
711
801
|
})
|
|
712
802
|
);
|
|
713
|
-
var signMultipleMessagesRequestMessageSchema =
|
|
803
|
+
var signMultipleMessagesRequestMessageSchema = v26.object({
|
|
714
804
|
...rpcRequestMessageSchema.entries,
|
|
715
|
-
...
|
|
716
|
-
method:
|
|
805
|
+
...v26.object({
|
|
806
|
+
method: v26.literal(signMultipleMessagesMethodName),
|
|
717
807
|
params: signMultipleMessagesParamsSchema,
|
|
718
|
-
id:
|
|
808
|
+
id: v26.string()
|
|
719
809
|
}).entries
|
|
720
810
|
});
|
|
721
811
|
|
|
722
812
|
// src/request/types/btcMethods/signPSBT.ts
|
|
723
|
-
import * as
|
|
813
|
+
import * as v27 from "valibot";
|
|
724
814
|
var signPsbtMethodName = "signPsbt";
|
|
725
|
-
var signPsbtParamsSchema =
|
|
815
|
+
var signPsbtParamsSchema = v27.object({
|
|
726
816
|
/**
|
|
727
817
|
* The base64 encoded PSBT to sign.
|
|
728
818
|
*/
|
|
729
|
-
psbt:
|
|
819
|
+
psbt: v27.string(),
|
|
730
820
|
/**
|
|
731
821
|
* The inputs to sign.
|
|
732
822
|
* The key is the address and the value is an array of indexes of the inputs to sign.
|
|
733
823
|
*/
|
|
734
|
-
signInputs:
|
|
824
|
+
signInputs: v27.optional(v27.record(v27.string(), v27.array(v27.number()))),
|
|
735
825
|
/**
|
|
736
826
|
* Whether to broadcast the transaction after signing.
|
|
737
827
|
**/
|
|
738
|
-
broadcast:
|
|
828
|
+
broadcast: v27.optional(v27.boolean())
|
|
739
829
|
});
|
|
740
|
-
var signPsbtResultSchema =
|
|
830
|
+
var signPsbtResultSchema = v27.object({
|
|
741
831
|
/**
|
|
742
832
|
* The base64 encoded PSBT after signing.
|
|
743
833
|
*/
|
|
744
|
-
psbt:
|
|
834
|
+
psbt: v27.string(),
|
|
745
835
|
/**
|
|
746
836
|
* The transaction id as a hex-encoded string.
|
|
747
837
|
* This is only returned if the transaction was broadcast.
|
|
748
838
|
**/
|
|
749
|
-
txid:
|
|
839
|
+
txid: v27.optional(v27.string())
|
|
750
840
|
});
|
|
751
|
-
var signPsbtRequestMessageSchema =
|
|
841
|
+
var signPsbtRequestMessageSchema = v27.object({
|
|
752
842
|
...rpcRequestMessageSchema.entries,
|
|
753
|
-
...
|
|
754
|
-
method:
|
|
843
|
+
...v27.object({
|
|
844
|
+
method: v27.literal(signPsbtMethodName),
|
|
755
845
|
params: signPsbtParamsSchema,
|
|
756
|
-
id:
|
|
846
|
+
id: v27.string()
|
|
757
847
|
}).entries
|
|
758
848
|
});
|
|
759
849
|
|
|
760
850
|
// src/request/types/ordinalsMethods.ts
|
|
761
|
-
import * as
|
|
851
|
+
import * as v28 from "valibot";
|
|
762
852
|
var getInscriptionsMethodName = "ord_getInscriptions";
|
|
763
|
-
var getInscriptionsParamsSchema =
|
|
764
|
-
offset:
|
|
765
|
-
limit:
|
|
766
|
-
});
|
|
767
|
-
var getInscriptionsResultSchema =
|
|
768
|
-
total:
|
|
769
|
-
limit:
|
|
770
|
-
offset:
|
|
771
|
-
inscriptions:
|
|
772
|
-
|
|
773
|
-
inscriptionId:
|
|
774
|
-
inscriptionNumber:
|
|
775
|
-
address:
|
|
776
|
-
collectionName:
|
|
777
|
-
postage:
|
|
778
|
-
contentLength:
|
|
779
|
-
contentType:
|
|
780
|
-
timestamp:
|
|
781
|
-
offset:
|
|
782
|
-
genesisTransaction:
|
|
783
|
-
output:
|
|
853
|
+
var getInscriptionsParamsSchema = v28.object({
|
|
854
|
+
offset: v28.number(),
|
|
855
|
+
limit: v28.number()
|
|
856
|
+
});
|
|
857
|
+
var getInscriptionsResultSchema = v28.object({
|
|
858
|
+
total: v28.number(),
|
|
859
|
+
limit: v28.number(),
|
|
860
|
+
offset: v28.number(),
|
|
861
|
+
inscriptions: v28.array(
|
|
862
|
+
v28.object({
|
|
863
|
+
inscriptionId: v28.string(),
|
|
864
|
+
inscriptionNumber: v28.string(),
|
|
865
|
+
address: v28.string(),
|
|
866
|
+
collectionName: v28.optional(v28.string()),
|
|
867
|
+
postage: v28.string(),
|
|
868
|
+
contentLength: v28.string(),
|
|
869
|
+
contentType: v28.string(),
|
|
870
|
+
timestamp: v28.number(),
|
|
871
|
+
offset: v28.number(),
|
|
872
|
+
genesisTransaction: v28.string(),
|
|
873
|
+
output: v28.string()
|
|
784
874
|
})
|
|
785
875
|
)
|
|
786
876
|
});
|
|
787
|
-
var getInscriptionsRequestMessageSchema =
|
|
877
|
+
var getInscriptionsRequestMessageSchema = v28.object({
|
|
788
878
|
...rpcRequestMessageSchema.entries,
|
|
789
|
-
...
|
|
790
|
-
method:
|
|
879
|
+
...v28.object({
|
|
880
|
+
method: v28.literal(getInscriptionsMethodName),
|
|
791
881
|
params: getInscriptionsParamsSchema,
|
|
792
|
-
id:
|
|
882
|
+
id: v28.string()
|
|
793
883
|
}).entries
|
|
794
884
|
});
|
|
795
885
|
var sendInscriptionsMethodName = "ord_sendInscriptions";
|
|
796
|
-
var sendInscriptionsParamsSchema =
|
|
797
|
-
transfers:
|
|
798
|
-
|
|
799
|
-
address:
|
|
800
|
-
inscriptionId:
|
|
886
|
+
var sendInscriptionsParamsSchema = v28.object({
|
|
887
|
+
transfers: v28.array(
|
|
888
|
+
v28.object({
|
|
889
|
+
address: v28.string(),
|
|
890
|
+
inscriptionId: v28.string()
|
|
801
891
|
})
|
|
802
892
|
)
|
|
803
893
|
});
|
|
804
|
-
var sendInscriptionsResultSchema =
|
|
805
|
-
txid:
|
|
894
|
+
var sendInscriptionsResultSchema = v28.object({
|
|
895
|
+
txid: v28.string()
|
|
806
896
|
});
|
|
807
|
-
var sendInscriptionsRequestMessageSchema =
|
|
897
|
+
var sendInscriptionsRequestMessageSchema = v28.object({
|
|
808
898
|
...rpcRequestMessageSchema.entries,
|
|
809
|
-
...
|
|
810
|
-
method:
|
|
899
|
+
...v28.object({
|
|
900
|
+
method: v28.literal(sendInscriptionsMethodName),
|
|
811
901
|
params: sendInscriptionsParamsSchema,
|
|
812
|
-
id:
|
|
902
|
+
id: v28.string()
|
|
813
903
|
}).entries
|
|
814
904
|
});
|
|
815
905
|
|
|
816
906
|
// src/request/types/runesMethods/etch.ts
|
|
817
|
-
import * as
|
|
907
|
+
import * as v29 from "valibot";
|
|
818
908
|
var runesEtchMethodName = "runes_etch";
|
|
819
|
-
var etchTermsSchema =
|
|
820
|
-
amount:
|
|
821
|
-
cap:
|
|
822
|
-
heightStart:
|
|
823
|
-
heightEnd:
|
|
824
|
-
offsetStart:
|
|
825
|
-
offsetEnd:
|
|
826
|
-
});
|
|
827
|
-
var inscriptionDetailsSchema =
|
|
828
|
-
contentType:
|
|
829
|
-
contentBase64:
|
|
830
|
-
});
|
|
831
|
-
var runesEtchParamsSchema =
|
|
832
|
-
runeName:
|
|
833
|
-
divisibility:
|
|
834
|
-
symbol:
|
|
835
|
-
premine:
|
|
836
|
-
isMintable:
|
|
837
|
-
delegateInscriptionId:
|
|
838
|
-
destinationAddress:
|
|
839
|
-
refundAddress:
|
|
840
|
-
feeRate:
|
|
841
|
-
appServiceFee:
|
|
842
|
-
appServiceFeeAddress:
|
|
843
|
-
terms:
|
|
844
|
-
inscriptionDetails:
|
|
845
|
-
network:
|
|
846
|
-
});
|
|
847
|
-
var runesEtchResultSchema =
|
|
848
|
-
orderId:
|
|
849
|
-
fundTransactionId:
|
|
850
|
-
fundingAddress:
|
|
851
|
-
});
|
|
852
|
-
var runesEtchRequestMessageSchema =
|
|
909
|
+
var etchTermsSchema = v29.object({
|
|
910
|
+
amount: v29.string(),
|
|
911
|
+
cap: v29.string(),
|
|
912
|
+
heightStart: v29.optional(v29.string()),
|
|
913
|
+
heightEnd: v29.optional(v29.string()),
|
|
914
|
+
offsetStart: v29.optional(v29.string()),
|
|
915
|
+
offsetEnd: v29.optional(v29.string())
|
|
916
|
+
});
|
|
917
|
+
var inscriptionDetailsSchema = v29.object({
|
|
918
|
+
contentType: v29.string(),
|
|
919
|
+
contentBase64: v29.string()
|
|
920
|
+
});
|
|
921
|
+
var runesEtchParamsSchema = v29.object({
|
|
922
|
+
runeName: v29.string(),
|
|
923
|
+
divisibility: v29.optional(v29.number()),
|
|
924
|
+
symbol: v29.optional(v29.string()),
|
|
925
|
+
premine: v29.optional(v29.string()),
|
|
926
|
+
isMintable: v29.boolean(),
|
|
927
|
+
delegateInscriptionId: v29.optional(v29.string()),
|
|
928
|
+
destinationAddress: v29.string(),
|
|
929
|
+
refundAddress: v29.string(),
|
|
930
|
+
feeRate: v29.number(),
|
|
931
|
+
appServiceFee: v29.optional(v29.number()),
|
|
932
|
+
appServiceFeeAddress: v29.optional(v29.string()),
|
|
933
|
+
terms: v29.optional(etchTermsSchema),
|
|
934
|
+
inscriptionDetails: v29.optional(inscriptionDetailsSchema),
|
|
935
|
+
network: v29.optional(v29.enum(BitcoinNetworkType))
|
|
936
|
+
});
|
|
937
|
+
var runesEtchResultSchema = v29.object({
|
|
938
|
+
orderId: v29.string(),
|
|
939
|
+
fundTransactionId: v29.string(),
|
|
940
|
+
fundingAddress: v29.string()
|
|
941
|
+
});
|
|
942
|
+
var runesEtchRequestMessageSchema = v29.object({
|
|
853
943
|
...rpcRequestMessageSchema.entries,
|
|
854
|
-
...
|
|
855
|
-
method:
|
|
944
|
+
...v29.object({
|
|
945
|
+
method: v29.literal(runesEtchMethodName),
|
|
856
946
|
params: runesEtchParamsSchema,
|
|
857
|
-
id:
|
|
947
|
+
id: v29.string()
|
|
858
948
|
}).entries
|
|
859
949
|
});
|
|
860
950
|
|
|
861
951
|
// src/request/types/runesMethods/getBalance.ts
|
|
862
|
-
import * as
|
|
952
|
+
import * as v30 from "valibot";
|
|
863
953
|
var runesGetBalanceMethodName = "runes_getBalance";
|
|
864
|
-
var runesGetBalanceParamsSchema =
|
|
865
|
-
var runesGetBalanceResultSchema =
|
|
866
|
-
balances:
|
|
867
|
-
|
|
868
|
-
runeName:
|
|
869
|
-
amount:
|
|
870
|
-
divisibility:
|
|
871
|
-
symbol:
|
|
872
|
-
inscriptionId:
|
|
873
|
-
spendableBalance:
|
|
954
|
+
var runesGetBalanceParamsSchema = v30.nullish(v30.null());
|
|
955
|
+
var runesGetBalanceResultSchema = v30.object({
|
|
956
|
+
balances: v30.array(
|
|
957
|
+
v30.object({
|
|
958
|
+
runeName: v30.string(),
|
|
959
|
+
amount: v30.string(),
|
|
960
|
+
divisibility: v30.number(),
|
|
961
|
+
symbol: v30.string(),
|
|
962
|
+
inscriptionId: v30.nullish(v30.string()),
|
|
963
|
+
spendableBalance: v30.string()
|
|
874
964
|
})
|
|
875
965
|
)
|
|
876
966
|
});
|
|
877
|
-
var runesGetBalanceRequestMessageSchema =
|
|
967
|
+
var runesGetBalanceRequestMessageSchema = v30.object({
|
|
878
968
|
...rpcRequestMessageSchema.entries,
|
|
879
|
-
...
|
|
880
|
-
method:
|
|
969
|
+
...v30.object({
|
|
970
|
+
method: v30.literal(runesGetBalanceMethodName),
|
|
881
971
|
params: runesGetBalanceParamsSchema,
|
|
882
|
-
id:
|
|
972
|
+
id: v30.string()
|
|
883
973
|
}).entries
|
|
884
974
|
});
|
|
885
975
|
|
|
886
976
|
// src/request/types/runesMethods/mint.ts
|
|
887
|
-
import * as
|
|
977
|
+
import * as v31 from "valibot";
|
|
888
978
|
var runesMintMethodName = "runes_mint";
|
|
889
|
-
var runesMintParamsSchema =
|
|
890
|
-
appServiceFee:
|
|
891
|
-
appServiceFeeAddress:
|
|
892
|
-
destinationAddress:
|
|
893
|
-
feeRate:
|
|
894
|
-
refundAddress:
|
|
895
|
-
repeats:
|
|
896
|
-
runeName:
|
|
897
|
-
network:
|
|
898
|
-
});
|
|
899
|
-
var runesMintResultSchema =
|
|
900
|
-
orderId:
|
|
901
|
-
fundTransactionId:
|
|
902
|
-
fundingAddress:
|
|
903
|
-
});
|
|
904
|
-
var runesMintRequestMessageSchema =
|
|
979
|
+
var runesMintParamsSchema = v31.object({
|
|
980
|
+
appServiceFee: v31.optional(v31.number()),
|
|
981
|
+
appServiceFeeAddress: v31.optional(v31.string()),
|
|
982
|
+
destinationAddress: v31.string(),
|
|
983
|
+
feeRate: v31.number(),
|
|
984
|
+
refundAddress: v31.string(),
|
|
985
|
+
repeats: v31.number(),
|
|
986
|
+
runeName: v31.string(),
|
|
987
|
+
network: v31.optional(v31.enum(BitcoinNetworkType))
|
|
988
|
+
});
|
|
989
|
+
var runesMintResultSchema = v31.object({
|
|
990
|
+
orderId: v31.string(),
|
|
991
|
+
fundTransactionId: v31.string(),
|
|
992
|
+
fundingAddress: v31.string()
|
|
993
|
+
});
|
|
994
|
+
var runesMintRequestMessageSchema = v31.object({
|
|
905
995
|
...rpcRequestMessageSchema.entries,
|
|
906
|
-
...
|
|
907
|
-
method:
|
|
996
|
+
...v31.object({
|
|
997
|
+
method: v31.literal(runesMintMethodName),
|
|
908
998
|
params: runesMintParamsSchema,
|
|
909
|
-
id:
|
|
999
|
+
id: v31.string()
|
|
910
1000
|
}).entries
|
|
911
1001
|
});
|
|
912
1002
|
|
|
913
1003
|
// src/request/types/runesMethods/transfer.ts
|
|
914
|
-
import * as
|
|
1004
|
+
import * as v32 from "valibot";
|
|
915
1005
|
var runesTransferMethodName = "runes_transfer";
|
|
916
|
-
var runesTransferParamsSchema =
|
|
917
|
-
recipients:
|
|
918
|
-
|
|
919
|
-
runeName:
|
|
920
|
-
amount:
|
|
921
|
-
address:
|
|
1006
|
+
var runesTransferParamsSchema = v32.object({
|
|
1007
|
+
recipients: v32.array(
|
|
1008
|
+
v32.object({
|
|
1009
|
+
runeName: v32.string(),
|
|
1010
|
+
amount: v32.string(),
|
|
1011
|
+
address: v32.string()
|
|
922
1012
|
})
|
|
923
1013
|
)
|
|
924
1014
|
});
|
|
925
|
-
var runesTransferResultSchema =
|
|
926
|
-
txid:
|
|
1015
|
+
var runesTransferResultSchema = v32.object({
|
|
1016
|
+
txid: v32.string()
|
|
927
1017
|
});
|
|
928
|
-
var runesTransferRequestMessageSchema =
|
|
1018
|
+
var runesTransferRequestMessageSchema = v32.object({
|
|
929
1019
|
...rpcRequestMessageSchema.entries,
|
|
930
|
-
...
|
|
931
|
-
method:
|
|
1020
|
+
...v32.object({
|
|
1021
|
+
method: v32.literal(runesTransferMethodName),
|
|
932
1022
|
params: runesTransferParamsSchema,
|
|
933
|
-
id:
|
|
1023
|
+
id: v32.string()
|
|
934
1024
|
}).entries
|
|
935
1025
|
});
|
|
936
1026
|
|
|
937
1027
|
// src/request/types/sparkMethods/flashnetMethods/clawbackFunds.ts
|
|
938
|
-
import * as
|
|
1028
|
+
import * as v33 from "valibot";
|
|
939
1029
|
var sparkFlashnetClawbackFundsMethodName = "spark_flashnet_clawbackFunds";
|
|
940
|
-
var sparkFlashnetClawbackFundsParamsSchema =
|
|
941
|
-
sparkTransferId:
|
|
942
|
-
lpIdentityPublicKey:
|
|
943
|
-
});
|
|
944
|
-
var sparkFlashnetClawbackFundsResultSchema =
|
|
945
|
-
requestId:
|
|
946
|
-
accepted:
|
|
947
|
-
internalRequestId:
|
|
948
|
-
sparkStatusTrackingId:
|
|
949
|
-
error:
|
|
950
|
-
});
|
|
951
|
-
var sparkFlashnetClawbackFundsRequestMessageSchema =
|
|
1030
|
+
var sparkFlashnetClawbackFundsParamsSchema = v33.object({
|
|
1031
|
+
sparkTransferId: v33.string(),
|
|
1032
|
+
lpIdentityPublicKey: v33.string()
|
|
1033
|
+
});
|
|
1034
|
+
var sparkFlashnetClawbackFundsResultSchema = v33.object({
|
|
1035
|
+
requestId: v33.string(),
|
|
1036
|
+
accepted: v33.boolean(),
|
|
1037
|
+
internalRequestId: v33.optional(v33.string()),
|
|
1038
|
+
sparkStatusTrackingId: v33.optional(v33.string()),
|
|
1039
|
+
error: v33.optional(v33.string())
|
|
1040
|
+
});
|
|
1041
|
+
var sparkFlashnetClawbackFundsRequestMessageSchema = v33.object({
|
|
952
1042
|
...rpcRequestMessageSchema.entries,
|
|
953
|
-
...
|
|
954
|
-
method:
|
|
1043
|
+
...v33.object({
|
|
1044
|
+
method: v33.literal(sparkFlashnetClawbackFundsMethodName),
|
|
955
1045
|
params: sparkFlashnetClawbackFundsParamsSchema,
|
|
956
|
-
id:
|
|
1046
|
+
id: v33.string()
|
|
957
1047
|
}).entries
|
|
958
1048
|
});
|
|
959
1049
|
|
|
960
1050
|
// src/request/types/sparkMethods/flashnetMethods/executeRouteSwap.ts
|
|
961
|
-
import * as
|
|
1051
|
+
import * as v34 from "valibot";
|
|
962
1052
|
var sparkFlashnetExecuteRouteSwapMethodName = "spark_flashnet_executeRouteSwap";
|
|
963
|
-
var sparkFlashnetExecuteRouteSwapParamsSchema =
|
|
964
|
-
hops:
|
|
965
|
-
|
|
966
|
-
poolId:
|
|
967
|
-
assetInAddress:
|
|
968
|
-
assetOutAddress:
|
|
969
|
-
hopIntegratorFeeRateBps:
|
|
1053
|
+
var sparkFlashnetExecuteRouteSwapParamsSchema = v34.object({
|
|
1054
|
+
hops: v34.array(
|
|
1055
|
+
v34.object({
|
|
1056
|
+
poolId: v34.string(),
|
|
1057
|
+
assetInAddress: v34.string(),
|
|
1058
|
+
assetOutAddress: v34.string(),
|
|
1059
|
+
hopIntegratorFeeRateBps: v34.optional(v34.number())
|
|
970
1060
|
})
|
|
971
1061
|
),
|
|
972
|
-
initialAssetAddress:
|
|
973
|
-
inputAmount:
|
|
974
|
-
maxRouteSlippageBps:
|
|
975
|
-
minAmountOut:
|
|
976
|
-
integratorFeeRateBps:
|
|
977
|
-
integratorPublicKey:
|
|
978
|
-
});
|
|
979
|
-
var sparkFlashnetExecuteRouteSwapResultSchema =
|
|
980
|
-
requestId:
|
|
981
|
-
accepted:
|
|
982
|
-
outputAmount:
|
|
983
|
-
executionPrice:
|
|
984
|
-
finalOutboundTransferId:
|
|
985
|
-
error:
|
|
986
|
-
});
|
|
987
|
-
var sparkFlashnetExecuteRouteSwapRequestMessageSchema =
|
|
1062
|
+
initialAssetAddress: v34.string(),
|
|
1063
|
+
inputAmount: v34.string(),
|
|
1064
|
+
maxRouteSlippageBps: v34.string(),
|
|
1065
|
+
minAmountOut: v34.optional(v34.string()),
|
|
1066
|
+
integratorFeeRateBps: v34.optional(v34.number()),
|
|
1067
|
+
integratorPublicKey: v34.optional(v34.string())
|
|
1068
|
+
});
|
|
1069
|
+
var sparkFlashnetExecuteRouteSwapResultSchema = v34.object({
|
|
1070
|
+
requestId: v34.string(),
|
|
1071
|
+
accepted: v34.boolean(),
|
|
1072
|
+
outputAmount: v34.string(),
|
|
1073
|
+
executionPrice: v34.string(),
|
|
1074
|
+
finalOutboundTransferId: v34.string(),
|
|
1075
|
+
error: v34.optional(v34.string())
|
|
1076
|
+
});
|
|
1077
|
+
var sparkFlashnetExecuteRouteSwapRequestMessageSchema = v34.object({
|
|
988
1078
|
...rpcRequestMessageSchema.entries,
|
|
989
|
-
...
|
|
990
|
-
method:
|
|
1079
|
+
...v34.object({
|
|
1080
|
+
method: v34.literal(sparkFlashnetExecuteRouteSwapMethodName),
|
|
991
1081
|
params: sparkFlashnetExecuteRouteSwapParamsSchema,
|
|
992
|
-
id:
|
|
1082
|
+
id: v34.string()
|
|
993
1083
|
}).entries
|
|
994
1084
|
});
|
|
995
1085
|
|
|
996
1086
|
// src/request/types/sparkMethods/flashnetMethods/executeSwap.ts
|
|
997
|
-
import * as
|
|
1087
|
+
import * as v35 from "valibot";
|
|
998
1088
|
var sparkFlashnetExecuteSwapMethodName = "spark_flashnet_executeSwap";
|
|
999
|
-
var sparkFlashnetExecuteSwapParamsSchema =
|
|
1000
|
-
poolId:
|
|
1001
|
-
assetInAddress:
|
|
1002
|
-
assetOutAddress:
|
|
1003
|
-
amountIn:
|
|
1004
|
-
maxSlippageBps:
|
|
1005
|
-
minAmountOut:
|
|
1006
|
-
integratorFeeRateBps:
|
|
1007
|
-
integratorPublicKey:
|
|
1008
|
-
});
|
|
1009
|
-
var sparkFlashnetExecuteSwapResultSchema =
|
|
1010
|
-
requestId:
|
|
1011
|
-
accepted:
|
|
1012
|
-
amountOut:
|
|
1013
|
-
feeAmount:
|
|
1014
|
-
executionPrice:
|
|
1015
|
-
assetOutAddress:
|
|
1016
|
-
assetInAddress:
|
|
1017
|
-
outboundTransferId:
|
|
1018
|
-
error:
|
|
1019
|
-
});
|
|
1020
|
-
var sparkFlashnetExecuteSwapRequestMessageSchema =
|
|
1089
|
+
var sparkFlashnetExecuteSwapParamsSchema = v35.object({
|
|
1090
|
+
poolId: v35.string(),
|
|
1091
|
+
assetInAddress: v35.string(),
|
|
1092
|
+
assetOutAddress: v35.string(),
|
|
1093
|
+
amountIn: v35.string(),
|
|
1094
|
+
maxSlippageBps: v35.number(),
|
|
1095
|
+
minAmountOut: v35.optional(v35.string()),
|
|
1096
|
+
integratorFeeRateBps: v35.optional(v35.number()),
|
|
1097
|
+
integratorPublicKey: v35.optional(v35.string())
|
|
1098
|
+
});
|
|
1099
|
+
var sparkFlashnetExecuteSwapResultSchema = v35.object({
|
|
1100
|
+
requestId: v35.string(),
|
|
1101
|
+
accepted: v35.boolean(),
|
|
1102
|
+
amountOut: v35.optional(v35.string()),
|
|
1103
|
+
feeAmount: v35.optional(v35.string()),
|
|
1104
|
+
executionPrice: v35.optional(v35.string()),
|
|
1105
|
+
assetOutAddress: v35.optional(v35.string()),
|
|
1106
|
+
assetInAddress: v35.optional(v35.string()),
|
|
1107
|
+
outboundTransferId: v35.optional(v35.string()),
|
|
1108
|
+
error: v35.optional(v35.string())
|
|
1109
|
+
});
|
|
1110
|
+
var sparkFlashnetExecuteSwapRequestMessageSchema = v35.object({
|
|
1021
1111
|
...rpcRequestMessageSchema.entries,
|
|
1022
|
-
...
|
|
1023
|
-
method:
|
|
1112
|
+
...v35.object({
|
|
1113
|
+
method: v35.literal(sparkFlashnetExecuteSwapMethodName),
|
|
1024
1114
|
params: sparkFlashnetExecuteSwapParamsSchema,
|
|
1025
|
-
id:
|
|
1115
|
+
id: v35.string()
|
|
1026
1116
|
}).entries
|
|
1027
1117
|
});
|
|
1028
1118
|
|
|
1029
1119
|
// src/request/types/sparkMethods/flashnetMethods/getClawbackEligibleTransfers.ts
|
|
1030
|
-
import * as
|
|
1120
|
+
import * as v36 from "valibot";
|
|
1031
1121
|
var sparkGetClawbackEligibleTransfersMethodName = "spark_flashnet_getClawbackEligibleTransfers";
|
|
1032
|
-
var sparkGetClawbackEligibleTransfersParamsSchema =
|
|
1033
|
-
var sparkGetClawbackEligibleTransfersResultSchema =
|
|
1034
|
-
eligibleTransfers:
|
|
1035
|
-
|
|
1036
|
-
txId:
|
|
1037
|
-
createdAt:
|
|
1038
|
-
lpIdentityPublicKey:
|
|
1122
|
+
var sparkGetClawbackEligibleTransfersParamsSchema = v36.nullish(v36.null());
|
|
1123
|
+
var sparkGetClawbackEligibleTransfersResultSchema = v36.object({
|
|
1124
|
+
eligibleTransfers: v36.array(
|
|
1125
|
+
v36.object({
|
|
1126
|
+
txId: v36.string(),
|
|
1127
|
+
createdAt: v36.string(),
|
|
1128
|
+
lpIdentityPublicKey: v36.string()
|
|
1039
1129
|
})
|
|
1040
1130
|
)
|
|
1041
1131
|
});
|
|
1042
|
-
var sparkGetClawbackEligibleTransfersRequestMessageSchema =
|
|
1132
|
+
var sparkGetClawbackEligibleTransfersRequestMessageSchema = v36.object({
|
|
1043
1133
|
...rpcRequestMessageSchema.entries,
|
|
1044
|
-
...
|
|
1045
|
-
method:
|
|
1134
|
+
...v36.object({
|
|
1135
|
+
method: v36.literal(sparkGetClawbackEligibleTransfersMethodName),
|
|
1046
1136
|
params: sparkGetClawbackEligibleTransfersParamsSchema,
|
|
1047
|
-
id:
|
|
1137
|
+
id: v36.string()
|
|
1048
1138
|
}).entries
|
|
1049
1139
|
});
|
|
1050
1140
|
|
|
1051
1141
|
// src/request/types/sparkMethods/flashnetMethods/getJwt.ts
|
|
1052
|
-
import * as
|
|
1142
|
+
import * as v37 from "valibot";
|
|
1053
1143
|
var sparkFlashnetGetJwtMethodName = "spark_flashnet_getJwt";
|
|
1054
|
-
var sparkFlashnetGetJwtParamsSchema =
|
|
1055
|
-
var sparkFlashnetGetJwtResultSchema =
|
|
1144
|
+
var sparkFlashnetGetJwtParamsSchema = v37.null();
|
|
1145
|
+
var sparkFlashnetGetJwtResultSchema = v37.object({
|
|
1056
1146
|
/**
|
|
1057
1147
|
* The JWT token for authenticated requests to the Flashnet API.
|
|
1058
1148
|
*/
|
|
1059
|
-
jwt:
|
|
1149
|
+
jwt: v37.string()
|
|
1060
1150
|
});
|
|
1061
|
-
var sparkFlashnetGetJwtRequestMessageSchema =
|
|
1151
|
+
var sparkFlashnetGetJwtRequestMessageSchema = v37.object({
|
|
1062
1152
|
...rpcRequestMessageSchema.entries,
|
|
1063
|
-
...
|
|
1064
|
-
method:
|
|
1153
|
+
...v37.object({
|
|
1154
|
+
method: v37.literal(sparkFlashnetGetJwtMethodName),
|
|
1065
1155
|
params: sparkFlashnetGetJwtParamsSchema,
|
|
1066
|
-
id:
|
|
1156
|
+
id: v37.string()
|
|
1067
1157
|
}).entries
|
|
1068
1158
|
});
|
|
1069
1159
|
|
|
1070
1160
|
// src/request/types/sparkMethods/flashnetMethods/intents/addLiquidity.ts
|
|
1071
|
-
import * as
|
|
1072
|
-
var sparkFlashnetAddLiquidityIntentSchema =
|
|
1073
|
-
type:
|
|
1074
|
-
data:
|
|
1075
|
-
userPublicKey:
|
|
1076
|
-
poolId:
|
|
1077
|
-
assetAAmount:
|
|
1078
|
-
assetBAmount:
|
|
1079
|
-
assetAMinAmountIn:
|
|
1080
|
-
assetBMinAmountIn:
|
|
1081
|
-
assetATransferId:
|
|
1082
|
-
assetBTransferId:
|
|
1083
|
-
nonce:
|
|
1161
|
+
import * as v38 from "valibot";
|
|
1162
|
+
var sparkFlashnetAddLiquidityIntentSchema = v38.object({
|
|
1163
|
+
type: v38.literal("addLiquidity"),
|
|
1164
|
+
data: v38.object({
|
|
1165
|
+
userPublicKey: v38.string(),
|
|
1166
|
+
poolId: v38.string(),
|
|
1167
|
+
assetAAmount: v38.string(),
|
|
1168
|
+
assetBAmount: v38.string(),
|
|
1169
|
+
assetAMinAmountIn: v38.string(),
|
|
1170
|
+
assetBMinAmountIn: v38.string(),
|
|
1171
|
+
assetATransferId: v38.string(),
|
|
1172
|
+
assetBTransferId: v38.string(),
|
|
1173
|
+
nonce: v38.string()
|
|
1084
1174
|
})
|
|
1085
1175
|
});
|
|
1086
1176
|
|
|
1087
1177
|
// src/request/types/sparkMethods/flashnetMethods/intents/clawback.ts
|
|
1088
|
-
import * as
|
|
1089
|
-
var sparkFlashnetClawbackIntentSchema =
|
|
1090
|
-
type:
|
|
1091
|
-
data:
|
|
1092
|
-
senderPublicKey:
|
|
1093
|
-
sparkTransferId:
|
|
1094
|
-
lpIdentityPublicKey:
|
|
1095
|
-
nonce:
|
|
1178
|
+
import * as v39 from "valibot";
|
|
1179
|
+
var sparkFlashnetClawbackIntentSchema = v39.object({
|
|
1180
|
+
type: v39.literal("clawback"),
|
|
1181
|
+
data: v39.object({
|
|
1182
|
+
senderPublicKey: v39.string(),
|
|
1183
|
+
sparkTransferId: v39.string(),
|
|
1184
|
+
lpIdentityPublicKey: v39.string(),
|
|
1185
|
+
nonce: v39.string()
|
|
1096
1186
|
})
|
|
1097
1187
|
});
|
|
1098
1188
|
|
|
1099
1189
|
// src/request/types/sparkMethods/flashnetMethods/intents/confirmInitialDeposit.ts
|
|
1100
|
-
import * as
|
|
1101
|
-
var sparkFlashnetConfirmInitialDepositIntentSchema =
|
|
1102
|
-
type:
|
|
1103
|
-
data:
|
|
1104
|
-
poolId:
|
|
1105
|
-
assetASparkTransferId:
|
|
1106
|
-
poolOwnerPublicKey:
|
|
1107
|
-
nonce:
|
|
1190
|
+
import * as v40 from "valibot";
|
|
1191
|
+
var sparkFlashnetConfirmInitialDepositIntentSchema = v40.object({
|
|
1192
|
+
type: v40.literal("confirmInitialDeposit"),
|
|
1193
|
+
data: v40.object({
|
|
1194
|
+
poolId: v40.string(),
|
|
1195
|
+
assetASparkTransferId: v40.string(),
|
|
1196
|
+
poolOwnerPublicKey: v40.string(),
|
|
1197
|
+
nonce: v40.string()
|
|
1108
1198
|
})
|
|
1109
1199
|
});
|
|
1110
1200
|
|
|
1111
1201
|
// src/request/types/sparkMethods/flashnetMethods/intents/createConstantProductPool.ts
|
|
1112
|
-
import * as
|
|
1113
|
-
var sparkFlashnetCreateConstantProductPoolIntentSchema =
|
|
1114
|
-
type:
|
|
1115
|
-
data:
|
|
1116
|
-
poolOwnerPublicKey:
|
|
1117
|
-
assetAAddress:
|
|
1118
|
-
assetBAddress:
|
|
1119
|
-
lpFeeRateBps:
|
|
1120
|
-
totalHostFeeRateBps:
|
|
1121
|
-
nonce:
|
|
1202
|
+
import * as v41 from "valibot";
|
|
1203
|
+
var sparkFlashnetCreateConstantProductPoolIntentSchema = v41.object({
|
|
1204
|
+
type: v41.literal("createConstantProductPool"),
|
|
1205
|
+
data: v41.object({
|
|
1206
|
+
poolOwnerPublicKey: v41.string(),
|
|
1207
|
+
assetAAddress: v41.string(),
|
|
1208
|
+
assetBAddress: v41.string(),
|
|
1209
|
+
lpFeeRateBps: v41.union([v41.number(), v41.string()]),
|
|
1210
|
+
totalHostFeeRateBps: v41.union([v41.number(), v41.string()]),
|
|
1211
|
+
nonce: v41.string()
|
|
1122
1212
|
})
|
|
1123
1213
|
});
|
|
1124
1214
|
|
|
1125
1215
|
// src/request/types/sparkMethods/flashnetMethods/intents/createSingleSidedPool.ts
|
|
1126
|
-
import * as
|
|
1127
|
-
var sparkFlashnetCreateSingleSidedPoolIntentSchema =
|
|
1128
|
-
type:
|
|
1129
|
-
data:
|
|
1130
|
-
assetAAddress:
|
|
1131
|
-
assetBAddress:
|
|
1132
|
-
assetAInitialReserve:
|
|
1133
|
-
virtualReserveA:
|
|
1134
|
-
virtualReserveB:
|
|
1135
|
-
threshold:
|
|
1136
|
-
lpFeeRateBps:
|
|
1137
|
-
totalHostFeeRateBps:
|
|
1138
|
-
poolOwnerPublicKey:
|
|
1139
|
-
nonce:
|
|
1216
|
+
import * as v42 from "valibot";
|
|
1217
|
+
var sparkFlashnetCreateSingleSidedPoolIntentSchema = v42.object({
|
|
1218
|
+
type: v42.literal("createSingleSidedPool"),
|
|
1219
|
+
data: v42.object({
|
|
1220
|
+
assetAAddress: v42.string(),
|
|
1221
|
+
assetBAddress: v42.string(),
|
|
1222
|
+
assetAInitialReserve: v42.string(),
|
|
1223
|
+
virtualReserveA: v42.union([v42.number(), v42.string()]),
|
|
1224
|
+
virtualReserveB: v42.union([v42.number(), v42.string()]),
|
|
1225
|
+
threshold: v42.union([v42.number(), v42.string()]),
|
|
1226
|
+
lpFeeRateBps: v42.union([v42.number(), v42.string()]),
|
|
1227
|
+
totalHostFeeRateBps: v42.union([v42.number(), v42.string()]),
|
|
1228
|
+
poolOwnerPublicKey: v42.string(),
|
|
1229
|
+
nonce: v42.string()
|
|
1140
1230
|
})
|
|
1141
1231
|
});
|
|
1142
1232
|
|
|
1143
1233
|
// src/request/types/sparkMethods/flashnetMethods/intents/removeLiquidity.ts
|
|
1144
|
-
import * as
|
|
1145
|
-
var sparkFlashnetRemoveLiquidityIntentSchema =
|
|
1146
|
-
type:
|
|
1147
|
-
data:
|
|
1148
|
-
userPublicKey:
|
|
1149
|
-
poolId:
|
|
1150
|
-
lpTokensToRemove:
|
|
1151
|
-
nonce:
|
|
1234
|
+
import * as v43 from "valibot";
|
|
1235
|
+
var sparkFlashnetRemoveLiquidityIntentSchema = v43.object({
|
|
1236
|
+
type: v43.literal("removeLiquidity"),
|
|
1237
|
+
data: v43.object({
|
|
1238
|
+
userPublicKey: v43.string(),
|
|
1239
|
+
poolId: v43.string(),
|
|
1240
|
+
lpTokensToRemove: v43.string(),
|
|
1241
|
+
nonce: v43.string()
|
|
1152
1242
|
})
|
|
1153
1243
|
});
|
|
1154
1244
|
|
|
1155
1245
|
// src/request/types/sparkMethods/flashnetMethods/intents/routeSwap.ts
|
|
1156
|
-
import * as
|
|
1157
|
-
var sparkFlashnetRouteSwapIntentSchema =
|
|
1158
|
-
type:
|
|
1159
|
-
data:
|
|
1160
|
-
userPublicKey:
|
|
1161
|
-
initialSparkTransferId:
|
|
1162
|
-
hops:
|
|
1163
|
-
|
|
1164
|
-
poolId:
|
|
1165
|
-
inputAssetAddress:
|
|
1166
|
-
outputAssetAddress:
|
|
1167
|
-
hopIntegratorFeeRateBps:
|
|
1246
|
+
import * as v44 from "valibot";
|
|
1247
|
+
var sparkFlashnetRouteSwapIntentSchema = v44.object({
|
|
1248
|
+
type: v44.literal("executeRouteSwap"),
|
|
1249
|
+
data: v44.object({
|
|
1250
|
+
userPublicKey: v44.string(),
|
|
1251
|
+
initialSparkTransferId: v44.string(),
|
|
1252
|
+
hops: v44.array(
|
|
1253
|
+
v44.object({
|
|
1254
|
+
poolId: v44.string(),
|
|
1255
|
+
inputAssetAddress: v44.string(),
|
|
1256
|
+
outputAssetAddress: v44.string(),
|
|
1257
|
+
hopIntegratorFeeRateBps: v44.optional(v44.union([v44.number(), v44.string()]))
|
|
1168
1258
|
})
|
|
1169
1259
|
),
|
|
1170
|
-
inputAmount:
|
|
1171
|
-
maxRouteSlippageBps:
|
|
1172
|
-
minAmountOut:
|
|
1173
|
-
defaultIntegratorFeeRateBps:
|
|
1174
|
-
nonce:
|
|
1260
|
+
inputAmount: v44.string(),
|
|
1261
|
+
maxRouteSlippageBps: v44.union([v44.number(), v44.string()]),
|
|
1262
|
+
minAmountOut: v44.string(),
|
|
1263
|
+
defaultIntegratorFeeRateBps: v44.optional(v44.union([v44.number(), v44.string()])),
|
|
1264
|
+
nonce: v44.string()
|
|
1175
1265
|
})
|
|
1176
1266
|
});
|
|
1177
1267
|
|
|
1178
1268
|
// src/request/types/sparkMethods/flashnetMethods/intents/swap.ts
|
|
1179
|
-
import * as
|
|
1180
|
-
var sparkFlashnetSwapIntentSchema =
|
|
1181
|
-
type:
|
|
1182
|
-
data:
|
|
1183
|
-
userPublicKey:
|
|
1184
|
-
poolId:
|
|
1185
|
-
transferId:
|
|
1186
|
-
assetInAddress:
|
|
1187
|
-
assetOutAddress:
|
|
1188
|
-
amountIn:
|
|
1189
|
-
maxSlippageBps:
|
|
1190
|
-
minAmountOut:
|
|
1191
|
-
totalIntegratorFeeRateBps:
|
|
1192
|
-
nonce:
|
|
1269
|
+
import * as v45 from "valibot";
|
|
1270
|
+
var sparkFlashnetSwapIntentSchema = v45.object({
|
|
1271
|
+
type: v45.literal("executeSwap"),
|
|
1272
|
+
data: v45.object({
|
|
1273
|
+
userPublicKey: v45.string(),
|
|
1274
|
+
poolId: v45.string(),
|
|
1275
|
+
transferId: v45.string(),
|
|
1276
|
+
assetInAddress: v45.string(),
|
|
1277
|
+
assetOutAddress: v45.string(),
|
|
1278
|
+
amountIn: v45.string(),
|
|
1279
|
+
maxSlippageBps: v45.union([v45.number(), v45.string()]),
|
|
1280
|
+
minAmountOut: v45.string(),
|
|
1281
|
+
totalIntegratorFeeRateBps: v45.optional(v45.union([v45.number(), v45.string()])),
|
|
1282
|
+
nonce: v45.string()
|
|
1193
1283
|
})
|
|
1194
1284
|
});
|
|
1195
1285
|
|
|
1196
1286
|
// src/request/types/sparkMethods/flashnetMethods/signIntent.ts
|
|
1197
|
-
import * as
|
|
1287
|
+
import * as v46 from "valibot";
|
|
1198
1288
|
var sparkFlashnetSignIntentMethodName = "spark_flashnet_signIntent";
|
|
1199
|
-
var sparkFlashnetSignIntentParamsSchema =
|
|
1289
|
+
var sparkFlashnetSignIntentParamsSchema = v46.union([
|
|
1200
1290
|
sparkFlashnetSwapIntentSchema,
|
|
1201
1291
|
sparkFlashnetRouteSwapIntentSchema,
|
|
1202
1292
|
sparkFlashnetAddLiquidityIntentSchema,
|
|
@@ -1206,109 +1296,109 @@ var sparkFlashnetSignIntentParamsSchema = v32.union([
|
|
|
1206
1296
|
sparkFlashnetCreateSingleSidedPoolIntentSchema,
|
|
1207
1297
|
sparkFlashnetRemoveLiquidityIntentSchema
|
|
1208
1298
|
]);
|
|
1209
|
-
var sparkFlashnetSignIntentResultSchema =
|
|
1299
|
+
var sparkFlashnetSignIntentResultSchema = v46.object({
|
|
1210
1300
|
/**
|
|
1211
1301
|
* The signed intent as a hex string.
|
|
1212
1302
|
*/
|
|
1213
|
-
signature:
|
|
1303
|
+
signature: v46.string()
|
|
1214
1304
|
});
|
|
1215
|
-
var sparkFlashnetSignIntentRequestMessageSchema =
|
|
1305
|
+
var sparkFlashnetSignIntentRequestMessageSchema = v46.object({
|
|
1216
1306
|
...rpcRequestMessageSchema.entries,
|
|
1217
|
-
...
|
|
1218
|
-
method:
|
|
1307
|
+
...v46.object({
|
|
1308
|
+
method: v46.literal(sparkFlashnetSignIntentMethodName),
|
|
1219
1309
|
params: sparkFlashnetSignIntentParamsSchema,
|
|
1220
|
-
id:
|
|
1310
|
+
id: v46.string()
|
|
1221
1311
|
}).entries
|
|
1222
1312
|
});
|
|
1223
1313
|
|
|
1224
1314
|
// src/request/types/sparkMethods/flashnetMethods/signStructuredMessage.ts
|
|
1225
|
-
import * as
|
|
1315
|
+
import * as v47 from "valibot";
|
|
1226
1316
|
var sparkFlashnetSignStructuredMessageMethodName = "spark_flashnet_signStructuredMessage";
|
|
1227
|
-
var sparkFlashnetSignStructuredMessageParamsSchema =
|
|
1228
|
-
message:
|
|
1317
|
+
var sparkFlashnetSignStructuredMessageParamsSchema = v47.object({
|
|
1318
|
+
message: v47.string()
|
|
1229
1319
|
});
|
|
1230
|
-
var sparkFlashnetSignStructuredMessageResultSchema =
|
|
1231
|
-
message:
|
|
1232
|
-
signature:
|
|
1320
|
+
var sparkFlashnetSignStructuredMessageResultSchema = v47.object({
|
|
1321
|
+
message: v47.string(),
|
|
1322
|
+
signature: v47.string()
|
|
1233
1323
|
});
|
|
1234
|
-
var sparkFlashnetSignStructuredMessageRequestMessageSchema =
|
|
1324
|
+
var sparkFlashnetSignStructuredMessageRequestMessageSchema = v47.object({
|
|
1235
1325
|
...rpcRequestMessageSchema.entries,
|
|
1236
|
-
...
|
|
1237
|
-
method:
|
|
1326
|
+
...v47.object({
|
|
1327
|
+
method: v47.literal(sparkFlashnetSignStructuredMessageMethodName),
|
|
1238
1328
|
params: sparkFlashnetSignStructuredMessageParamsSchema,
|
|
1239
|
-
id:
|
|
1329
|
+
id: v47.string()
|
|
1240
1330
|
}).entries
|
|
1241
1331
|
});
|
|
1242
1332
|
|
|
1243
1333
|
// src/request/types/sparkMethods/getAddresses.ts
|
|
1244
|
-
import * as
|
|
1334
|
+
import * as v48 from "valibot";
|
|
1245
1335
|
var sparkGetAddressesMethodName = "spark_getAddresses";
|
|
1246
|
-
var sparkGetAddressesParamsSchema =
|
|
1247
|
-
|
|
1336
|
+
var sparkGetAddressesParamsSchema = v48.nullish(
|
|
1337
|
+
v48.object({
|
|
1248
1338
|
/**
|
|
1249
1339
|
* A message to be displayed to the user in the request prompt.
|
|
1250
1340
|
*/
|
|
1251
|
-
message:
|
|
1341
|
+
message: v48.optional(v48.string())
|
|
1252
1342
|
})
|
|
1253
1343
|
);
|
|
1254
|
-
var sparkGetAddressesResultSchema =
|
|
1344
|
+
var sparkGetAddressesResultSchema = v48.object({
|
|
1255
1345
|
/**
|
|
1256
1346
|
* The addresses generated for the given purposes.
|
|
1257
1347
|
*/
|
|
1258
|
-
addresses:
|
|
1348
|
+
addresses: v48.array(addressSchema),
|
|
1259
1349
|
network: getNetworkResultSchema
|
|
1260
1350
|
});
|
|
1261
|
-
var sparkGetAddressesRequestMessageSchema =
|
|
1351
|
+
var sparkGetAddressesRequestMessageSchema = v48.object({
|
|
1262
1352
|
...rpcRequestMessageSchema.entries,
|
|
1263
|
-
...
|
|
1264
|
-
method:
|
|
1353
|
+
...v48.object({
|
|
1354
|
+
method: v48.literal(sparkGetAddressesMethodName),
|
|
1265
1355
|
params: sparkGetAddressesParamsSchema,
|
|
1266
|
-
id:
|
|
1356
|
+
id: v48.string()
|
|
1267
1357
|
}).entries
|
|
1268
1358
|
});
|
|
1269
1359
|
|
|
1270
1360
|
// src/request/types/sparkMethods/getBalance.ts
|
|
1271
|
-
import * as
|
|
1361
|
+
import * as v49 from "valibot";
|
|
1272
1362
|
var sparkGetBalanceMethodName = "spark_getBalance";
|
|
1273
|
-
var sparkGetBalanceParamsSchema =
|
|
1274
|
-
var sparkGetBalanceResultSchema =
|
|
1363
|
+
var sparkGetBalanceParamsSchema = v49.nullish(v49.null());
|
|
1364
|
+
var sparkGetBalanceResultSchema = v49.object({
|
|
1275
1365
|
/**
|
|
1276
1366
|
* The Spark Bitcoin address balance in sats in string form.
|
|
1277
1367
|
*/
|
|
1278
|
-
balance:
|
|
1279
|
-
tokenBalances:
|
|
1280
|
-
|
|
1368
|
+
balance: v49.string(),
|
|
1369
|
+
tokenBalances: v49.array(
|
|
1370
|
+
v49.object({
|
|
1281
1371
|
/* The address balance of the token in string form as it can overflow a js number */
|
|
1282
|
-
balance:
|
|
1283
|
-
tokenMetadata:
|
|
1284
|
-
tokenIdentifier:
|
|
1285
|
-
tokenName:
|
|
1286
|
-
tokenTicker:
|
|
1287
|
-
decimals:
|
|
1288
|
-
maxSupply:
|
|
1372
|
+
balance: v49.string(),
|
|
1373
|
+
tokenMetadata: v49.object({
|
|
1374
|
+
tokenIdentifier: v49.string(),
|
|
1375
|
+
tokenName: v49.string(),
|
|
1376
|
+
tokenTicker: v49.string(),
|
|
1377
|
+
decimals: v49.number(),
|
|
1378
|
+
maxSupply: v49.string()
|
|
1289
1379
|
})
|
|
1290
1380
|
})
|
|
1291
1381
|
)
|
|
1292
1382
|
});
|
|
1293
|
-
var sparkGetBalanceRequestMessageSchema =
|
|
1383
|
+
var sparkGetBalanceRequestMessageSchema = v49.object({
|
|
1294
1384
|
...rpcRequestMessageSchema.entries,
|
|
1295
|
-
...
|
|
1296
|
-
method:
|
|
1385
|
+
...v49.object({
|
|
1386
|
+
method: v49.literal(sparkGetBalanceMethodName),
|
|
1297
1387
|
params: sparkGetBalanceParamsSchema,
|
|
1298
|
-
id:
|
|
1388
|
+
id: v49.string()
|
|
1299
1389
|
}).entries
|
|
1300
1390
|
});
|
|
1301
1391
|
|
|
1302
1392
|
// src/request/types/sparkMethods/signMessage.ts
|
|
1303
|
-
import * as
|
|
1393
|
+
import * as v50 from "valibot";
|
|
1304
1394
|
var sparkSignMessageMethodName = "spark_signMessage";
|
|
1305
|
-
var sparkSignMessageParamsSchema =
|
|
1395
|
+
var sparkSignMessageParamsSchema = v50.object({
|
|
1306
1396
|
/**
|
|
1307
1397
|
* The message to sign. The message should only consist of valid UTF-8 characters.
|
|
1308
1398
|
*/
|
|
1309
|
-
message:
|
|
1399
|
+
message: v50.string()
|
|
1310
1400
|
});
|
|
1311
|
-
var sparkSignMessageResultSchema =
|
|
1401
|
+
var sparkSignMessageResultSchema = v50.object({
|
|
1312
1402
|
/**
|
|
1313
1403
|
* The signature, encoded in base64, of the message hash.
|
|
1314
1404
|
*
|
|
@@ -1316,98 +1406,98 @@ var sparkSignMessageResultSchema = v36.object({
|
|
|
1316
1406
|
* and the resulting byte array is hashed with SHA256 before signing
|
|
1317
1407
|
* with the private key.
|
|
1318
1408
|
*/
|
|
1319
|
-
signature:
|
|
1409
|
+
signature: v50.string()
|
|
1320
1410
|
});
|
|
1321
|
-
var sparkSignMessageRequestMessageSchema =
|
|
1411
|
+
var sparkSignMessageRequestMessageSchema = v50.object({
|
|
1322
1412
|
...rpcRequestMessageSchema.entries,
|
|
1323
|
-
...
|
|
1324
|
-
method:
|
|
1413
|
+
...v50.object({
|
|
1414
|
+
method: v50.literal(sparkSignMessageMethodName),
|
|
1325
1415
|
params: sparkSignMessageParamsSchema,
|
|
1326
|
-
id:
|
|
1416
|
+
id: v50.string()
|
|
1327
1417
|
}).entries
|
|
1328
1418
|
});
|
|
1329
1419
|
|
|
1330
1420
|
// src/request/types/sparkMethods/transfer.ts
|
|
1331
|
-
import * as
|
|
1421
|
+
import * as v51 from "valibot";
|
|
1332
1422
|
var sparkTransferMethodName = "spark_transfer";
|
|
1333
|
-
var sparkTransferParamsSchema =
|
|
1423
|
+
var sparkTransferParamsSchema = v51.object({
|
|
1334
1424
|
/**
|
|
1335
1425
|
* Amount of SATS to transfer as a string or number.
|
|
1336
1426
|
*/
|
|
1337
|
-
amountSats:
|
|
1427
|
+
amountSats: v51.union([v51.number(), v51.string()]),
|
|
1338
1428
|
/**
|
|
1339
1429
|
* The recipient's spark address.
|
|
1340
1430
|
*/
|
|
1341
|
-
receiverSparkAddress:
|
|
1431
|
+
receiverSparkAddress: v51.string()
|
|
1342
1432
|
});
|
|
1343
|
-
var sparkTransferResultSchema =
|
|
1433
|
+
var sparkTransferResultSchema = v51.object({
|
|
1344
1434
|
/**
|
|
1345
1435
|
* The ID of the transaction.
|
|
1346
1436
|
*/
|
|
1347
|
-
id:
|
|
1437
|
+
id: v51.string()
|
|
1348
1438
|
});
|
|
1349
|
-
var sparkTransferRequestMessageSchema =
|
|
1439
|
+
var sparkTransferRequestMessageSchema = v51.object({
|
|
1350
1440
|
...rpcRequestMessageSchema.entries,
|
|
1351
|
-
...
|
|
1352
|
-
method:
|
|
1441
|
+
...v51.object({
|
|
1442
|
+
method: v51.literal(sparkTransferMethodName),
|
|
1353
1443
|
params: sparkTransferParamsSchema,
|
|
1354
|
-
id:
|
|
1444
|
+
id: v51.string()
|
|
1355
1445
|
}).entries
|
|
1356
1446
|
});
|
|
1357
1447
|
|
|
1358
1448
|
// src/request/types/sparkMethods/transferToken.ts
|
|
1359
|
-
import * as
|
|
1449
|
+
import * as v52 from "valibot";
|
|
1360
1450
|
var sparkTransferTokenMethodName = "spark_transferToken";
|
|
1361
|
-
var sparkTransferTokenParamsSchema =
|
|
1451
|
+
var sparkTransferTokenParamsSchema = v52.object({
|
|
1362
1452
|
/**
|
|
1363
1453
|
* Amount of units of the token to transfer as a string or number.
|
|
1364
1454
|
*/
|
|
1365
|
-
tokenAmount:
|
|
1455
|
+
tokenAmount: v52.union([v52.number(), v52.string()]),
|
|
1366
1456
|
/**
|
|
1367
1457
|
* The Bech32m token identifier.
|
|
1368
1458
|
*/
|
|
1369
|
-
tokenIdentifier:
|
|
1459
|
+
tokenIdentifier: v52.string(),
|
|
1370
1460
|
/**
|
|
1371
1461
|
* The recipient's spark address.
|
|
1372
1462
|
*/
|
|
1373
|
-
receiverSparkAddress:
|
|
1463
|
+
receiverSparkAddress: v52.string()
|
|
1374
1464
|
});
|
|
1375
|
-
var sparkTransferTokenResultSchema =
|
|
1465
|
+
var sparkTransferTokenResultSchema = v52.object({
|
|
1376
1466
|
/**
|
|
1377
1467
|
* The ID of the transaction.
|
|
1378
1468
|
*/
|
|
1379
|
-
id:
|
|
1469
|
+
id: v52.string()
|
|
1380
1470
|
});
|
|
1381
|
-
var sparkTransferTokenRequestMessageSchema =
|
|
1471
|
+
var sparkTransferTokenRequestMessageSchema = v52.object({
|
|
1382
1472
|
...rpcRequestMessageSchema.entries,
|
|
1383
|
-
...
|
|
1384
|
-
method:
|
|
1473
|
+
...v52.object({
|
|
1474
|
+
method: v52.literal(sparkTransferTokenMethodName),
|
|
1385
1475
|
params: sparkTransferTokenParamsSchema,
|
|
1386
|
-
id:
|
|
1476
|
+
id: v52.string()
|
|
1387
1477
|
}).entries
|
|
1388
1478
|
});
|
|
1389
1479
|
|
|
1390
1480
|
// src/request/types/stxMethods/callContract.ts
|
|
1391
|
-
import * as
|
|
1481
|
+
import * as v53 from "valibot";
|
|
1392
1482
|
var stxCallContractMethodName = "stx_callContract";
|
|
1393
|
-
var stxCallContractParamsSchema =
|
|
1483
|
+
var stxCallContractParamsSchema = v53.object({
|
|
1394
1484
|
/**
|
|
1395
1485
|
* The contract principal.
|
|
1396
1486
|
*
|
|
1397
1487
|
* E.g. `"SPKE...GD5C.my-contract"`
|
|
1398
1488
|
*/
|
|
1399
|
-
contract:
|
|
1489
|
+
contract: v53.string(),
|
|
1400
1490
|
/**
|
|
1401
1491
|
* The name of the function to call.
|
|
1402
1492
|
*
|
|
1403
1493
|
* Note: spec changes ongoing,
|
|
1404
1494
|
* https://github.com/stacksgov/sips/pull/166#pullrequestreview-1914236999
|
|
1405
1495
|
*/
|
|
1406
|
-
functionName:
|
|
1496
|
+
functionName: v53.string(),
|
|
1407
1497
|
/**
|
|
1408
1498
|
* @deprecated in favor of `functionArgs` for @stacks/connect compatibility
|
|
1409
1499
|
*/
|
|
1410
|
-
arguments:
|
|
1500
|
+
arguments: v53.optional(v53.array(v53.string())),
|
|
1411
1501
|
/**
|
|
1412
1502
|
* The function's arguments. The arguments are expected to be hex-encoded
|
|
1413
1503
|
* strings of Clarity values.
|
|
@@ -1422,274 +1512,274 @@ var stxCallContractParamsSchema = v39.object({
|
|
|
1422
1512
|
* const hexArgs = functionArgs.map(cvToHex);
|
|
1423
1513
|
* ```
|
|
1424
1514
|
*/
|
|
1425
|
-
functionArgs:
|
|
1515
|
+
functionArgs: v53.optional(v53.array(v53.string())),
|
|
1426
1516
|
/**
|
|
1427
1517
|
* The post conditions to apply to the contract call.
|
|
1428
1518
|
*/
|
|
1429
|
-
postConditions:
|
|
1519
|
+
postConditions: v53.optional(v53.array(v53.string())),
|
|
1430
1520
|
/**
|
|
1431
1521
|
* The mode to apply to the post conditions.
|
|
1432
1522
|
*/
|
|
1433
|
-
postConditionMode:
|
|
1523
|
+
postConditionMode: v53.optional(v53.union([v53.literal("allow"), v53.literal("deny")]))
|
|
1434
1524
|
});
|
|
1435
|
-
var stxCallContractResultSchema =
|
|
1525
|
+
var stxCallContractResultSchema = v53.object({
|
|
1436
1526
|
/**
|
|
1437
1527
|
* The ID of the transaction.
|
|
1438
1528
|
*/
|
|
1439
|
-
txid:
|
|
1529
|
+
txid: v53.string(),
|
|
1440
1530
|
/**
|
|
1441
1531
|
* A Stacks transaction as a hex-encoded string.
|
|
1442
1532
|
*/
|
|
1443
|
-
transaction:
|
|
1533
|
+
transaction: v53.string()
|
|
1444
1534
|
});
|
|
1445
|
-
var stxCallContractRequestMessageSchema =
|
|
1535
|
+
var stxCallContractRequestMessageSchema = v53.object({
|
|
1446
1536
|
...rpcRequestMessageSchema.entries,
|
|
1447
|
-
...
|
|
1448
|
-
method:
|
|
1537
|
+
...v53.object({
|
|
1538
|
+
method: v53.literal(stxCallContractMethodName),
|
|
1449
1539
|
params: stxCallContractParamsSchema,
|
|
1450
|
-
id:
|
|
1540
|
+
id: v53.string()
|
|
1451
1541
|
}).entries
|
|
1452
1542
|
});
|
|
1453
1543
|
|
|
1454
1544
|
// src/request/types/stxMethods/deployContract.ts
|
|
1455
|
-
import * as
|
|
1545
|
+
import * as v54 from "valibot";
|
|
1456
1546
|
var stxDeployContractMethodName = "stx_deployContract";
|
|
1457
|
-
var stxDeployContractParamsSchema =
|
|
1547
|
+
var stxDeployContractParamsSchema = v54.object({
|
|
1458
1548
|
/**
|
|
1459
1549
|
* Name of the contract.
|
|
1460
1550
|
*/
|
|
1461
|
-
name:
|
|
1551
|
+
name: v54.string(),
|
|
1462
1552
|
/**
|
|
1463
1553
|
* The source code of the Clarity contract.
|
|
1464
1554
|
*/
|
|
1465
|
-
clarityCode:
|
|
1555
|
+
clarityCode: v54.string(),
|
|
1466
1556
|
/**
|
|
1467
1557
|
* The version of the Clarity contract.
|
|
1468
1558
|
*/
|
|
1469
|
-
clarityVersion:
|
|
1559
|
+
clarityVersion: v54.optional(v54.number()),
|
|
1470
1560
|
/**
|
|
1471
1561
|
* The post conditions to apply to the contract call.
|
|
1472
1562
|
*/
|
|
1473
|
-
postConditions:
|
|
1563
|
+
postConditions: v54.optional(v54.array(v54.string())),
|
|
1474
1564
|
/**
|
|
1475
1565
|
* The mode to apply to the post conditions.
|
|
1476
1566
|
*/
|
|
1477
|
-
postConditionMode:
|
|
1567
|
+
postConditionMode: v54.optional(v54.union([v54.literal("allow"), v54.literal("deny")]))
|
|
1478
1568
|
});
|
|
1479
|
-
var stxDeployContractResultSchema =
|
|
1569
|
+
var stxDeployContractResultSchema = v54.object({
|
|
1480
1570
|
/**
|
|
1481
1571
|
* The ID of the transaction.
|
|
1482
1572
|
*/
|
|
1483
|
-
txid:
|
|
1573
|
+
txid: v54.string(),
|
|
1484
1574
|
/**
|
|
1485
1575
|
* A Stacks transaction as a hex-encoded string.
|
|
1486
1576
|
*/
|
|
1487
|
-
transaction:
|
|
1577
|
+
transaction: v54.string()
|
|
1488
1578
|
});
|
|
1489
|
-
var stxDeployContractRequestMessageSchema =
|
|
1579
|
+
var stxDeployContractRequestMessageSchema = v54.object({
|
|
1490
1580
|
...rpcRequestMessageSchema.entries,
|
|
1491
|
-
...
|
|
1492
|
-
method:
|
|
1581
|
+
...v54.object({
|
|
1582
|
+
method: v54.literal(stxDeployContractMethodName),
|
|
1493
1583
|
params: stxDeployContractParamsSchema,
|
|
1494
|
-
id:
|
|
1584
|
+
id: v54.string()
|
|
1495
1585
|
}).entries
|
|
1496
1586
|
});
|
|
1497
1587
|
|
|
1498
1588
|
// src/request/types/stxMethods/getAccounts.ts
|
|
1499
|
-
import * as
|
|
1589
|
+
import * as v55 from "valibot";
|
|
1500
1590
|
var stxGetAccountsMethodName = "stx_getAccounts";
|
|
1501
|
-
var stxGetAccountsParamsSchema =
|
|
1502
|
-
var stxGetAccountsResultSchema =
|
|
1591
|
+
var stxGetAccountsParamsSchema = v55.nullish(v55.null());
|
|
1592
|
+
var stxGetAccountsResultSchema = v55.object({
|
|
1503
1593
|
/**
|
|
1504
1594
|
* The addresses generated for the given purposes.
|
|
1505
1595
|
*/
|
|
1506
|
-
addresses:
|
|
1507
|
-
|
|
1508
|
-
address:
|
|
1509
|
-
publicKey:
|
|
1510
|
-
gaiaHubUrl:
|
|
1511
|
-
gaiaAppKey:
|
|
1596
|
+
addresses: v55.array(
|
|
1597
|
+
v55.object({
|
|
1598
|
+
address: v55.string(),
|
|
1599
|
+
publicKey: v55.string(),
|
|
1600
|
+
gaiaHubUrl: v55.string(),
|
|
1601
|
+
gaiaAppKey: v55.string()
|
|
1512
1602
|
})
|
|
1513
1603
|
),
|
|
1514
1604
|
network: getNetworkResultSchema
|
|
1515
1605
|
});
|
|
1516
|
-
var stxGetAccountsRequestMessageSchema =
|
|
1606
|
+
var stxGetAccountsRequestMessageSchema = v55.object({
|
|
1517
1607
|
...rpcRequestMessageSchema.entries,
|
|
1518
|
-
...
|
|
1519
|
-
method:
|
|
1608
|
+
...v55.object({
|
|
1609
|
+
method: v55.literal(stxGetAccountsMethodName),
|
|
1520
1610
|
params: stxGetAccountsParamsSchema,
|
|
1521
|
-
id:
|
|
1611
|
+
id: v55.string()
|
|
1522
1612
|
}).entries
|
|
1523
1613
|
});
|
|
1524
1614
|
|
|
1525
1615
|
// src/request/types/stxMethods/getAddresses.ts
|
|
1526
|
-
import * as
|
|
1616
|
+
import * as v56 from "valibot";
|
|
1527
1617
|
var stxGetAddressesMethodName = "stx_getAddresses";
|
|
1528
|
-
var stxGetAddressesParamsSchema =
|
|
1529
|
-
|
|
1618
|
+
var stxGetAddressesParamsSchema = v56.nullish(
|
|
1619
|
+
v56.object({
|
|
1530
1620
|
/**
|
|
1531
1621
|
* A message to be displayed to the user in the request prompt.
|
|
1532
1622
|
*/
|
|
1533
|
-
message:
|
|
1623
|
+
message: v56.optional(v56.string())
|
|
1534
1624
|
})
|
|
1535
1625
|
);
|
|
1536
|
-
var stxGetAddressesResultSchema =
|
|
1626
|
+
var stxGetAddressesResultSchema = v56.object({
|
|
1537
1627
|
/**
|
|
1538
1628
|
* The addresses generated for the given purposes.
|
|
1539
1629
|
*/
|
|
1540
|
-
addresses:
|
|
1630
|
+
addresses: v56.array(addressSchema),
|
|
1541
1631
|
network: getNetworkResultSchema
|
|
1542
1632
|
});
|
|
1543
|
-
var stxGetAddressesRequestMessageSchema =
|
|
1633
|
+
var stxGetAddressesRequestMessageSchema = v56.object({
|
|
1544
1634
|
...rpcRequestMessageSchema.entries,
|
|
1545
|
-
...
|
|
1546
|
-
method:
|
|
1635
|
+
...v56.object({
|
|
1636
|
+
method: v56.literal(stxGetAddressesMethodName),
|
|
1547
1637
|
params: stxGetAddressesParamsSchema,
|
|
1548
|
-
id:
|
|
1638
|
+
id: v56.string()
|
|
1549
1639
|
}).entries
|
|
1550
1640
|
});
|
|
1551
1641
|
|
|
1552
1642
|
// src/request/types/stxMethods/signMessage.ts
|
|
1553
|
-
import * as
|
|
1643
|
+
import * as v57 from "valibot";
|
|
1554
1644
|
var stxSignMessageMethodName = "stx_signMessage";
|
|
1555
|
-
var stxSignMessageParamsSchema =
|
|
1645
|
+
var stxSignMessageParamsSchema = v57.object({
|
|
1556
1646
|
/**
|
|
1557
1647
|
* The message to sign.
|
|
1558
1648
|
*/
|
|
1559
|
-
message:
|
|
1649
|
+
message: v57.string()
|
|
1560
1650
|
});
|
|
1561
|
-
var stxSignMessageResultSchema =
|
|
1651
|
+
var stxSignMessageResultSchema = v57.object({
|
|
1562
1652
|
/**
|
|
1563
1653
|
* The signature of the message.
|
|
1564
1654
|
*/
|
|
1565
|
-
signature:
|
|
1655
|
+
signature: v57.string(),
|
|
1566
1656
|
/**
|
|
1567
1657
|
* The public key used to sign the message.
|
|
1568
1658
|
*/
|
|
1569
|
-
publicKey:
|
|
1659
|
+
publicKey: v57.string()
|
|
1570
1660
|
});
|
|
1571
|
-
var stxSignMessageRequestMessageSchema =
|
|
1661
|
+
var stxSignMessageRequestMessageSchema = v57.object({
|
|
1572
1662
|
...rpcRequestMessageSchema.entries,
|
|
1573
|
-
...
|
|
1574
|
-
method:
|
|
1663
|
+
...v57.object({
|
|
1664
|
+
method: v57.literal(stxSignMessageMethodName),
|
|
1575
1665
|
params: stxSignMessageParamsSchema,
|
|
1576
|
-
id:
|
|
1666
|
+
id: v57.string()
|
|
1577
1667
|
}).entries
|
|
1578
1668
|
});
|
|
1579
1669
|
|
|
1580
1670
|
// src/request/types/stxMethods/signStructuredMessage.ts
|
|
1581
|
-
import * as
|
|
1671
|
+
import * as v58 from "valibot";
|
|
1582
1672
|
var stxSignStructuredMessageMethodName = "stx_signStructuredMessage";
|
|
1583
|
-
var stxSignStructuredMessageParamsSchema =
|
|
1673
|
+
var stxSignStructuredMessageParamsSchema = v58.object({
|
|
1584
1674
|
/**
|
|
1585
1675
|
* The domain to be signed.
|
|
1586
1676
|
*/
|
|
1587
|
-
domain:
|
|
1677
|
+
domain: v58.string(),
|
|
1588
1678
|
/**
|
|
1589
1679
|
* Message payload to be signed.
|
|
1590
1680
|
*/
|
|
1591
|
-
message:
|
|
1681
|
+
message: v58.string(),
|
|
1592
1682
|
/**
|
|
1593
1683
|
* The public key to sign the message with.
|
|
1594
1684
|
*/
|
|
1595
|
-
publicKey:
|
|
1685
|
+
publicKey: v58.optional(v58.string())
|
|
1596
1686
|
});
|
|
1597
|
-
var stxSignStructuredMessageResultSchema =
|
|
1687
|
+
var stxSignStructuredMessageResultSchema = v58.object({
|
|
1598
1688
|
/**
|
|
1599
1689
|
* Signature of the message.
|
|
1600
1690
|
*/
|
|
1601
|
-
signature:
|
|
1691
|
+
signature: v58.string(),
|
|
1602
1692
|
/**
|
|
1603
1693
|
* Public key as hex-encoded string.
|
|
1604
1694
|
*/
|
|
1605
|
-
publicKey:
|
|
1695
|
+
publicKey: v58.string()
|
|
1606
1696
|
});
|
|
1607
|
-
var stxSignStructuredMessageRequestMessageSchema =
|
|
1697
|
+
var stxSignStructuredMessageRequestMessageSchema = v58.object({
|
|
1608
1698
|
...rpcRequestMessageSchema.entries,
|
|
1609
|
-
...
|
|
1610
|
-
method:
|
|
1699
|
+
...v58.object({
|
|
1700
|
+
method: v58.literal(stxSignStructuredMessageMethodName),
|
|
1611
1701
|
params: stxSignStructuredMessageParamsSchema,
|
|
1612
|
-
id:
|
|
1702
|
+
id: v58.string()
|
|
1613
1703
|
}).entries
|
|
1614
1704
|
});
|
|
1615
1705
|
|
|
1616
1706
|
// src/request/types/stxMethods/signTransaction.ts
|
|
1617
|
-
import * as
|
|
1707
|
+
import * as v59 from "valibot";
|
|
1618
1708
|
var stxSignTransactionMethodName = "stx_signTransaction";
|
|
1619
|
-
var stxSignTransactionParamsSchema =
|
|
1709
|
+
var stxSignTransactionParamsSchema = v59.object({
|
|
1620
1710
|
/**
|
|
1621
1711
|
* The transaction to sign as a hex-encoded string.
|
|
1622
1712
|
*/
|
|
1623
|
-
transaction:
|
|
1713
|
+
transaction: v59.string(),
|
|
1624
1714
|
/**
|
|
1625
1715
|
* The public key to sign the transaction with. The wallet may use any key
|
|
1626
1716
|
* when not provided.
|
|
1627
1717
|
*/
|
|
1628
|
-
pubkey:
|
|
1718
|
+
pubkey: v59.optional(v59.string()),
|
|
1629
1719
|
/**
|
|
1630
1720
|
* Whether to broadcast the transaction after signing. Defaults to `true`.
|
|
1631
1721
|
*/
|
|
1632
|
-
broadcast:
|
|
1722
|
+
broadcast: v59.optional(v59.boolean())
|
|
1633
1723
|
});
|
|
1634
|
-
var stxSignTransactionResultSchema =
|
|
1724
|
+
var stxSignTransactionResultSchema = v59.object({
|
|
1635
1725
|
/**
|
|
1636
1726
|
* The signed transaction as a hex-encoded string.
|
|
1637
1727
|
*/
|
|
1638
|
-
transaction:
|
|
1728
|
+
transaction: v59.string()
|
|
1639
1729
|
});
|
|
1640
|
-
var stxSignTransactionRequestMessageSchema =
|
|
1730
|
+
var stxSignTransactionRequestMessageSchema = v59.object({
|
|
1641
1731
|
...rpcRequestMessageSchema.entries,
|
|
1642
|
-
...
|
|
1643
|
-
method:
|
|
1732
|
+
...v59.object({
|
|
1733
|
+
method: v59.literal(stxSignTransactionMethodName),
|
|
1644
1734
|
params: stxSignTransactionParamsSchema,
|
|
1645
|
-
id:
|
|
1735
|
+
id: v59.string()
|
|
1646
1736
|
}).entries
|
|
1647
1737
|
});
|
|
1648
1738
|
|
|
1649
1739
|
// src/request/types/stxMethods/signTransactions.ts
|
|
1650
|
-
import * as
|
|
1740
|
+
import * as v60 from "valibot";
|
|
1651
1741
|
var stxSignTransactionsMethodName = "stx_signTransactions";
|
|
1652
|
-
var stxSignTransactionsParamsSchema =
|
|
1742
|
+
var stxSignTransactionsParamsSchema = v60.object({
|
|
1653
1743
|
/**
|
|
1654
1744
|
* The transactions to sign as hex-encoded strings.
|
|
1655
1745
|
*/
|
|
1656
|
-
transactions:
|
|
1657
|
-
|
|
1658
|
-
|
|
1659
|
-
|
|
1660
|
-
|
|
1746
|
+
transactions: v60.pipe(
|
|
1747
|
+
v60.array(
|
|
1748
|
+
v60.pipe(
|
|
1749
|
+
v60.string(),
|
|
1750
|
+
v60.check((hex) => {
|
|
1661
1751
|
return true;
|
|
1662
1752
|
}, "Invalid hex-encoded Stacks transaction.")
|
|
1663
1753
|
)
|
|
1664
1754
|
),
|
|
1665
|
-
|
|
1755
|
+
v60.minLength(1)
|
|
1666
1756
|
),
|
|
1667
1757
|
/**
|
|
1668
1758
|
* Whether the signed transactions should be broadcast after signing. Defaults
|
|
1669
1759
|
* to `true`.
|
|
1670
1760
|
*/
|
|
1671
|
-
broadcast:
|
|
1761
|
+
broadcast: v60.optional(v60.boolean())
|
|
1672
1762
|
});
|
|
1673
|
-
var stxSignTransactionsResultSchema =
|
|
1763
|
+
var stxSignTransactionsResultSchema = v60.object({
|
|
1674
1764
|
/**
|
|
1675
1765
|
* The signed transactions as hex-encoded strings, in the same order as in the
|
|
1676
1766
|
* sign request.
|
|
1677
1767
|
*/
|
|
1678
|
-
transactions:
|
|
1768
|
+
transactions: v60.array(v60.string())
|
|
1679
1769
|
});
|
|
1680
|
-
var stxSignTransactionsRequestMessageSchema =
|
|
1770
|
+
var stxSignTransactionsRequestMessageSchema = v60.object({
|
|
1681
1771
|
...rpcRequestMessageSchema.entries,
|
|
1682
|
-
...
|
|
1683
|
-
method:
|
|
1772
|
+
...v60.object({
|
|
1773
|
+
method: v60.literal(stxSignTransactionsMethodName),
|
|
1684
1774
|
params: stxSignTransactionsParamsSchema,
|
|
1685
|
-
id:
|
|
1775
|
+
id: v60.string()
|
|
1686
1776
|
}).entries
|
|
1687
1777
|
});
|
|
1688
1778
|
|
|
1689
1779
|
// src/request/types/stxMethods/transferStx.ts
|
|
1690
|
-
import * as
|
|
1780
|
+
import * as v61 from "valibot";
|
|
1691
1781
|
var stxTransferStxMethodName = "stx_transferStx";
|
|
1692
|
-
var stxTransferStxParamsSchema =
|
|
1782
|
+
var stxTransferStxParamsSchema = v61.object({
|
|
1693
1783
|
/**
|
|
1694
1784
|
* Amount of STX tokens to transfer in microstacks as a string. Anything
|
|
1695
1785
|
* parseable by `BigInt` is acceptable.
|
|
@@ -1702,23 +1792,23 @@ var stxTransferStxParamsSchema = v47.object({
|
|
|
1702
1792
|
* const amount3 = '1234';
|
|
1703
1793
|
* ```
|
|
1704
1794
|
*/
|
|
1705
|
-
amount:
|
|
1795
|
+
amount: v61.union([v61.number(), v61.string()]),
|
|
1706
1796
|
/**
|
|
1707
1797
|
* The recipient's principal.
|
|
1708
1798
|
*/
|
|
1709
|
-
recipient:
|
|
1799
|
+
recipient: v61.string(),
|
|
1710
1800
|
/**
|
|
1711
1801
|
* A string representing the memo.
|
|
1712
1802
|
*/
|
|
1713
|
-
memo:
|
|
1803
|
+
memo: v61.optional(v61.string()),
|
|
1714
1804
|
/**
|
|
1715
1805
|
* Version of parameter format.
|
|
1716
1806
|
*/
|
|
1717
|
-
version:
|
|
1807
|
+
version: v61.optional(v61.string()),
|
|
1718
1808
|
/**
|
|
1719
1809
|
* The mode of the post conditions.
|
|
1720
1810
|
*/
|
|
1721
|
-
postConditionMode:
|
|
1811
|
+
postConditionMode: v61.optional(v61.number()),
|
|
1722
1812
|
/**
|
|
1723
1813
|
* A hex-encoded string representing the post conditions.
|
|
1724
1814
|
*
|
|
@@ -1731,29 +1821,29 @@ var stxTransferStxParamsSchema = v47.object({
|
|
|
1731
1821
|
* const hexPostCondition = serializePostCondition(postCondition).toString('hex');
|
|
1732
1822
|
* ```
|
|
1733
1823
|
*/
|
|
1734
|
-
postConditions:
|
|
1824
|
+
postConditions: v61.optional(v61.array(v61.string())),
|
|
1735
1825
|
/**
|
|
1736
1826
|
* The public key to sign the transaction with. The wallet may use any key
|
|
1737
1827
|
* when not provided.
|
|
1738
1828
|
*/
|
|
1739
|
-
pubkey:
|
|
1829
|
+
pubkey: v61.optional(v61.string())
|
|
1740
1830
|
});
|
|
1741
|
-
var stxTransferStxResultSchema =
|
|
1831
|
+
var stxTransferStxResultSchema = v61.object({
|
|
1742
1832
|
/**
|
|
1743
1833
|
* The ID of the transaction.
|
|
1744
1834
|
*/
|
|
1745
|
-
txid:
|
|
1835
|
+
txid: v61.string(),
|
|
1746
1836
|
/**
|
|
1747
1837
|
* A Stacks transaction as a hex-encoded string.
|
|
1748
1838
|
*/
|
|
1749
|
-
transaction:
|
|
1839
|
+
transaction: v61.string()
|
|
1750
1840
|
});
|
|
1751
|
-
var stxTransferStxRequestMessageSchema =
|
|
1841
|
+
var stxTransferStxRequestMessageSchema = v61.object({
|
|
1752
1842
|
...rpcRequestMessageSchema.entries,
|
|
1753
|
-
...
|
|
1754
|
-
method:
|
|
1843
|
+
...v61.object({
|
|
1844
|
+
method: v61.literal(stxTransferStxMethodName),
|
|
1755
1845
|
params: stxTransferStxParamsSchema,
|
|
1756
|
-
id:
|
|
1846
|
+
id: v61.string()
|
|
1757
1847
|
}).entries
|
|
1758
1848
|
});
|
|
1759
1849
|
|
|
@@ -1761,13 +1851,13 @@ var stxTransferStxRequestMessageSchema = v47.object({
|
|
|
1761
1851
|
var cache = {};
|
|
1762
1852
|
var requestInternal = async (provider, method, params) => {
|
|
1763
1853
|
const response = await provider.request(method, params);
|
|
1764
|
-
if (
|
|
1854
|
+
if (v62.is(rpcErrorResponseMessageSchema, response)) {
|
|
1765
1855
|
return {
|
|
1766
1856
|
status: "error",
|
|
1767
1857
|
error: response.error
|
|
1768
1858
|
};
|
|
1769
1859
|
}
|
|
1770
|
-
if (
|
|
1860
|
+
if (v62.is(rpcSuccessResponseMessageSchema, response)) {
|
|
1771
1861
|
return {
|
|
1772
1862
|
status: "success",
|
|
1773
1863
|
result: response.result
|
|
@@ -2903,6 +2993,18 @@ export {
|
|
|
2903
2993
|
isProviderInstalled,
|
|
2904
2994
|
networkChangeEventName,
|
|
2905
2995
|
networkChangeSchema,
|
|
2996
|
+
openBridgeMethodName,
|
|
2997
|
+
openBridgeParamsSchema,
|
|
2998
|
+
openBridgeRequestMessageSchema,
|
|
2999
|
+
openBridgeResultSchema,
|
|
3000
|
+
openBuyMethodName,
|
|
3001
|
+
openBuyParamsSchema,
|
|
3002
|
+
openBuyRequestMessageSchema,
|
|
3003
|
+
openBuyResultSchema,
|
|
3004
|
+
openReceiveMethodName,
|
|
3005
|
+
openReceiveParamsSchema,
|
|
3006
|
+
openReceiveRequestMessageSchema,
|
|
3007
|
+
openReceiveResultSchema,
|
|
2906
3008
|
permission,
|
|
2907
3009
|
removeDefaultProvider,
|
|
2908
3010
|
renouncePermissionsMethodName,
|