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