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