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