@sats-connect/core 0.13.1-49d1c59 → 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 +289 -214
- package/dist/index.d.ts +289 -214
- package/dist/index.js +826 -732
- package/dist/index.mjs +818 -732
- 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
|
-
var walletActionsSchema = v5.object({
|
|
254
|
-
readNetwork: v5.optional(v5.boolean())
|
|
255
|
-
});
|
|
256
|
-
var accountPermissionSchema = v5.object({
|
|
257
|
-
type: v5.literal("account"),
|
|
258
|
-
resourceId: v5.string(),
|
|
259
|
-
clientId: v5.string(),
|
|
260
|
-
actions: accountActionsSchema
|
|
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", [
|
|
269
252
|
v5.object({
|
|
270
|
-
|
|
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())
|
|
271
261
|
}),
|
|
272
262
|
v5.object({
|
|
273
|
-
|
|
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())
|
|
269
|
+
}),
|
|
270
|
+
v5.object({
|
|
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,604 +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
|
-
|
|
963
|
-
|
|
964
|
-
|
|
965
|
-
|
|
966
|
-
|
|
967
|
-
)
|
|
968
|
-
|
|
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()
|
|
1043
|
+
})
|
|
1044
|
+
)
|
|
1045
|
+
});
|
|
1046
|
+
var sparkGetClawbackEligibleTransfersRequestMessageSchema = v28.object({
|
|
969
1047
|
...rpcRequestMessageSchema.entries,
|
|
970
|
-
...
|
|
971
|
-
method:
|
|
1048
|
+
...v28.object({
|
|
1049
|
+
method: v28.literal(sparkGetClawbackEligibleTransfersMethodName),
|
|
972
1050
|
params: sparkGetClawbackEligibleTransfersParamsSchema,
|
|
973
|
-
id:
|
|
1051
|
+
id: v28.string()
|
|
974
1052
|
}).entries
|
|
975
1053
|
});
|
|
976
1054
|
|
|
977
1055
|
// src/request/types/sparkMethods/flashnetMethods/getJwt.ts
|
|
978
|
-
import * as
|
|
1056
|
+
import * as v29 from "valibot";
|
|
979
1057
|
var sparkFlashnetGetJwtMethodName = "spark_flashnet_getJwt";
|
|
980
|
-
var sparkFlashnetGetJwtParamsSchema =
|
|
981
|
-
var sparkFlashnetGetJwtResultSchema =
|
|
1058
|
+
var sparkFlashnetGetJwtParamsSchema = v29.null();
|
|
1059
|
+
var sparkFlashnetGetJwtResultSchema = v29.object({
|
|
982
1060
|
/**
|
|
983
1061
|
* The JWT token for authenticated requests to the Flashnet API.
|
|
984
1062
|
*/
|
|
985
|
-
jwt:
|
|
1063
|
+
jwt: v29.string()
|
|
986
1064
|
});
|
|
987
|
-
var sparkFlashnetGetJwtRequestMessageSchema =
|
|
1065
|
+
var sparkFlashnetGetJwtRequestMessageSchema = v29.object({
|
|
988
1066
|
...rpcRequestMessageSchema.entries,
|
|
989
|
-
...
|
|
990
|
-
method:
|
|
1067
|
+
...v29.object({
|
|
1068
|
+
method: v29.literal(sparkFlashnetGetJwtMethodName),
|
|
991
1069
|
params: sparkFlashnetGetJwtParamsSchema,
|
|
992
|
-
id:
|
|
1070
|
+
id: v29.string()
|
|
993
1071
|
}).entries
|
|
994
1072
|
});
|
|
995
1073
|
|
|
996
1074
|
// 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:
|
|
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()
|
|
1010
1088
|
})
|
|
1011
1089
|
});
|
|
1012
1090
|
|
|
1013
1091
|
// 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:
|
|
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()
|
|
1022
1100
|
})
|
|
1023
1101
|
});
|
|
1024
1102
|
|
|
1025
1103
|
// 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:
|
|
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()
|
|
1034
1112
|
})
|
|
1035
1113
|
});
|
|
1036
1114
|
|
|
1037
1115
|
// 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:
|
|
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()
|
|
1048
1126
|
})
|
|
1049
1127
|
});
|
|
1050
1128
|
|
|
1051
1129
|
// 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:
|
|
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()
|
|
1066
1144
|
})
|
|
1067
1145
|
});
|
|
1068
1146
|
|
|
1069
1147
|
// 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:
|
|
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()
|
|
1078
1156
|
})
|
|
1079
1157
|
});
|
|
1080
1158
|
|
|
1081
1159
|
// 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:
|
|
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()]))
|
|
1094
1172
|
})
|
|
1095
1173
|
),
|
|
1096
|
-
inputAmount:
|
|
1097
|
-
maxRouteSlippageBps:
|
|
1098
|
-
minAmountOut:
|
|
1099
|
-
defaultIntegratorFeeRateBps:
|
|
1100
|
-
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()
|
|
1101
1179
|
})
|
|
1102
1180
|
});
|
|
1103
1181
|
|
|
1104
1182
|
// 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:
|
|
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()
|
|
1119
1197
|
})
|
|
1120
1198
|
});
|
|
1121
1199
|
|
|
1122
1200
|
// src/request/types/sparkMethods/flashnetMethods/signIntent.ts
|
|
1123
|
-
import * as
|
|
1201
|
+
import * as v38 from "valibot";
|
|
1124
1202
|
var sparkFlashnetSignIntentMethodName = "spark_flashnet_signIntent";
|
|
1125
|
-
var sparkFlashnetSignIntentParamsSchema =
|
|
1203
|
+
var sparkFlashnetSignIntentParamsSchema = v38.union([
|
|
1126
1204
|
sparkFlashnetSwapIntentSchema,
|
|
1127
1205
|
sparkFlashnetRouteSwapIntentSchema,
|
|
1128
1206
|
sparkFlashnetAddLiquidityIntentSchema,
|
|
@@ -1132,109 +1210,109 @@ var sparkFlashnetSignIntentParamsSchema = v25.union([
|
|
|
1132
1210
|
sparkFlashnetCreateSingleSidedPoolIntentSchema,
|
|
1133
1211
|
sparkFlashnetRemoveLiquidityIntentSchema
|
|
1134
1212
|
]);
|
|
1135
|
-
var sparkFlashnetSignIntentResultSchema =
|
|
1213
|
+
var sparkFlashnetSignIntentResultSchema = v38.object({
|
|
1136
1214
|
/**
|
|
1137
1215
|
* The signed intent as a hex string.
|
|
1138
1216
|
*/
|
|
1139
|
-
signature:
|
|
1217
|
+
signature: v38.string()
|
|
1140
1218
|
});
|
|
1141
|
-
var sparkFlashnetSignIntentRequestMessageSchema =
|
|
1219
|
+
var sparkFlashnetSignIntentRequestMessageSchema = v38.object({
|
|
1142
1220
|
...rpcRequestMessageSchema.entries,
|
|
1143
|
-
...
|
|
1144
|
-
method:
|
|
1221
|
+
...v38.object({
|
|
1222
|
+
method: v38.literal(sparkFlashnetSignIntentMethodName),
|
|
1145
1223
|
params: sparkFlashnetSignIntentParamsSchema,
|
|
1146
|
-
id:
|
|
1224
|
+
id: v38.string()
|
|
1147
1225
|
}).entries
|
|
1148
1226
|
});
|
|
1149
1227
|
|
|
1150
1228
|
// src/request/types/sparkMethods/flashnetMethods/signStructuredMessage.ts
|
|
1151
|
-
import * as
|
|
1229
|
+
import * as v39 from "valibot";
|
|
1152
1230
|
var sparkFlashnetSignStructuredMessageMethodName = "spark_flashnet_signStructuredMessage";
|
|
1153
|
-
var sparkFlashnetSignStructuredMessageParamsSchema =
|
|
1154
|
-
message:
|
|
1231
|
+
var sparkFlashnetSignStructuredMessageParamsSchema = v39.object({
|
|
1232
|
+
message: v39.string()
|
|
1155
1233
|
});
|
|
1156
|
-
var sparkFlashnetSignStructuredMessageResultSchema =
|
|
1157
|
-
message:
|
|
1158
|
-
signature:
|
|
1234
|
+
var sparkFlashnetSignStructuredMessageResultSchema = v39.object({
|
|
1235
|
+
message: v39.string(),
|
|
1236
|
+
signature: v39.string()
|
|
1159
1237
|
});
|
|
1160
|
-
var sparkFlashnetSignStructuredMessageRequestMessageSchema =
|
|
1238
|
+
var sparkFlashnetSignStructuredMessageRequestMessageSchema = v39.object({
|
|
1161
1239
|
...rpcRequestMessageSchema.entries,
|
|
1162
|
-
...
|
|
1163
|
-
method:
|
|
1240
|
+
...v39.object({
|
|
1241
|
+
method: v39.literal(sparkFlashnetSignStructuredMessageMethodName),
|
|
1164
1242
|
params: sparkFlashnetSignStructuredMessageParamsSchema,
|
|
1165
|
-
id:
|
|
1243
|
+
id: v39.string()
|
|
1166
1244
|
}).entries
|
|
1167
1245
|
});
|
|
1168
1246
|
|
|
1169
1247
|
// src/request/types/sparkMethods/getAddresses.ts
|
|
1170
|
-
import * as
|
|
1248
|
+
import * as v40 from "valibot";
|
|
1171
1249
|
var sparkGetAddressesMethodName = "spark_getAddresses";
|
|
1172
|
-
var sparkGetAddressesParamsSchema =
|
|
1173
|
-
|
|
1250
|
+
var sparkGetAddressesParamsSchema = v40.nullish(
|
|
1251
|
+
v40.object({
|
|
1174
1252
|
/**
|
|
1175
1253
|
* A message to be displayed to the user in the request prompt.
|
|
1176
1254
|
*/
|
|
1177
|
-
message:
|
|
1255
|
+
message: v40.optional(v40.string())
|
|
1178
1256
|
})
|
|
1179
1257
|
);
|
|
1180
|
-
var sparkGetAddressesResultSchema =
|
|
1258
|
+
var sparkGetAddressesResultSchema = v40.object({
|
|
1181
1259
|
/**
|
|
1182
1260
|
* The addresses generated for the given purposes.
|
|
1183
1261
|
*/
|
|
1184
|
-
addresses:
|
|
1262
|
+
addresses: v40.array(addressSchema),
|
|
1185
1263
|
network: getNetworkResultSchema
|
|
1186
1264
|
});
|
|
1187
|
-
var sparkGetAddressesRequestMessageSchema =
|
|
1265
|
+
var sparkGetAddressesRequestMessageSchema = v40.object({
|
|
1188
1266
|
...rpcRequestMessageSchema.entries,
|
|
1189
|
-
...
|
|
1190
|
-
method:
|
|
1267
|
+
...v40.object({
|
|
1268
|
+
method: v40.literal(sparkGetAddressesMethodName),
|
|
1191
1269
|
params: sparkGetAddressesParamsSchema,
|
|
1192
|
-
id:
|
|
1270
|
+
id: v40.string()
|
|
1193
1271
|
}).entries
|
|
1194
1272
|
});
|
|
1195
1273
|
|
|
1196
1274
|
// src/request/types/sparkMethods/getBalance.ts
|
|
1197
|
-
import * as
|
|
1275
|
+
import * as v41 from "valibot";
|
|
1198
1276
|
var sparkGetBalanceMethodName = "spark_getBalance";
|
|
1199
|
-
var sparkGetBalanceParamsSchema =
|
|
1200
|
-
var sparkGetBalanceResultSchema =
|
|
1277
|
+
var sparkGetBalanceParamsSchema = v41.nullish(v41.null());
|
|
1278
|
+
var sparkGetBalanceResultSchema = v41.object({
|
|
1201
1279
|
/**
|
|
1202
1280
|
* The Spark Bitcoin address balance in sats in string form.
|
|
1203
1281
|
*/
|
|
1204
|
-
balance:
|
|
1205
|
-
tokenBalances:
|
|
1206
|
-
|
|
1282
|
+
balance: v41.string(),
|
|
1283
|
+
tokenBalances: v41.array(
|
|
1284
|
+
v41.object({
|
|
1207
1285
|
/* 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:
|
|
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()
|
|
1215
1293
|
})
|
|
1216
1294
|
})
|
|
1217
1295
|
)
|
|
1218
1296
|
});
|
|
1219
|
-
var sparkGetBalanceRequestMessageSchema =
|
|
1297
|
+
var sparkGetBalanceRequestMessageSchema = v41.object({
|
|
1220
1298
|
...rpcRequestMessageSchema.entries,
|
|
1221
|
-
...
|
|
1222
|
-
method:
|
|
1299
|
+
...v41.object({
|
|
1300
|
+
method: v41.literal(sparkGetBalanceMethodName),
|
|
1223
1301
|
params: sparkGetBalanceParamsSchema,
|
|
1224
|
-
id:
|
|
1302
|
+
id: v41.string()
|
|
1225
1303
|
}).entries
|
|
1226
1304
|
});
|
|
1227
1305
|
|
|
1228
1306
|
// src/request/types/sparkMethods/signMessage.ts
|
|
1229
|
-
import * as
|
|
1307
|
+
import * as v42 from "valibot";
|
|
1230
1308
|
var sparkSignMessageMethodName = "spark_signMessage";
|
|
1231
|
-
var sparkSignMessageParamsSchema =
|
|
1309
|
+
var sparkSignMessageParamsSchema = v42.object({
|
|
1232
1310
|
/**
|
|
1233
1311
|
* The message to sign. The message should only consist of valid UTF-8 characters.
|
|
1234
1312
|
*/
|
|
1235
|
-
message:
|
|
1313
|
+
message: v42.string()
|
|
1236
1314
|
});
|
|
1237
|
-
var sparkSignMessageResultSchema =
|
|
1315
|
+
var sparkSignMessageResultSchema = v42.object({
|
|
1238
1316
|
/**
|
|
1239
1317
|
* The signature, encoded in base64, of the message hash.
|
|
1240
1318
|
*
|
|
@@ -1242,98 +1320,98 @@ var sparkSignMessageResultSchema = v29.object({
|
|
|
1242
1320
|
* and the resulting byte array is hashed with SHA256 before signing
|
|
1243
1321
|
* with the private key.
|
|
1244
1322
|
*/
|
|
1245
|
-
signature:
|
|
1323
|
+
signature: v42.string()
|
|
1246
1324
|
});
|
|
1247
|
-
var sparkSignMessageRequestMessageSchema =
|
|
1325
|
+
var sparkSignMessageRequestMessageSchema = v42.object({
|
|
1248
1326
|
...rpcRequestMessageSchema.entries,
|
|
1249
|
-
...
|
|
1250
|
-
method:
|
|
1327
|
+
...v42.object({
|
|
1328
|
+
method: v42.literal(sparkSignMessageMethodName),
|
|
1251
1329
|
params: sparkSignMessageParamsSchema,
|
|
1252
|
-
id:
|
|
1330
|
+
id: v42.string()
|
|
1253
1331
|
}).entries
|
|
1254
1332
|
});
|
|
1255
1333
|
|
|
1256
1334
|
// src/request/types/sparkMethods/transfer.ts
|
|
1257
|
-
import * as
|
|
1335
|
+
import * as v43 from "valibot";
|
|
1258
1336
|
var sparkTransferMethodName = "spark_transfer";
|
|
1259
|
-
var sparkTransferParamsSchema =
|
|
1337
|
+
var sparkTransferParamsSchema = v43.object({
|
|
1260
1338
|
/**
|
|
1261
1339
|
* Amount of SATS to transfer as a string or number.
|
|
1262
1340
|
*/
|
|
1263
|
-
amountSats:
|
|
1341
|
+
amountSats: v43.union([v43.number(), v43.string()]),
|
|
1264
1342
|
/**
|
|
1265
1343
|
* The recipient's spark address.
|
|
1266
1344
|
*/
|
|
1267
|
-
receiverSparkAddress:
|
|
1345
|
+
receiverSparkAddress: v43.string()
|
|
1268
1346
|
});
|
|
1269
|
-
var sparkTransferResultSchema =
|
|
1347
|
+
var sparkTransferResultSchema = v43.object({
|
|
1270
1348
|
/**
|
|
1271
1349
|
* The ID of the transaction.
|
|
1272
1350
|
*/
|
|
1273
|
-
id:
|
|
1351
|
+
id: v43.string()
|
|
1274
1352
|
});
|
|
1275
|
-
var sparkTransferRequestMessageSchema =
|
|
1353
|
+
var sparkTransferRequestMessageSchema = v43.object({
|
|
1276
1354
|
...rpcRequestMessageSchema.entries,
|
|
1277
|
-
...
|
|
1278
|
-
method:
|
|
1355
|
+
...v43.object({
|
|
1356
|
+
method: v43.literal(sparkTransferMethodName),
|
|
1279
1357
|
params: sparkTransferParamsSchema,
|
|
1280
|
-
id:
|
|
1358
|
+
id: v43.string()
|
|
1281
1359
|
}).entries
|
|
1282
1360
|
});
|
|
1283
1361
|
|
|
1284
1362
|
// src/request/types/sparkMethods/transferToken.ts
|
|
1285
|
-
import * as
|
|
1363
|
+
import * as v44 from "valibot";
|
|
1286
1364
|
var sparkTransferTokenMethodName = "spark_transferToken";
|
|
1287
|
-
var sparkTransferTokenParamsSchema =
|
|
1365
|
+
var sparkTransferTokenParamsSchema = v44.object({
|
|
1288
1366
|
/**
|
|
1289
1367
|
* Amount of units of the token to transfer as a string or number.
|
|
1290
1368
|
*/
|
|
1291
|
-
tokenAmount:
|
|
1369
|
+
tokenAmount: v44.union([v44.number(), v44.string()]),
|
|
1292
1370
|
/**
|
|
1293
1371
|
* The Bech32m token identifier.
|
|
1294
1372
|
*/
|
|
1295
|
-
tokenIdentifier:
|
|
1373
|
+
tokenIdentifier: v44.string(),
|
|
1296
1374
|
/**
|
|
1297
1375
|
* The recipient's spark address.
|
|
1298
1376
|
*/
|
|
1299
|
-
receiverSparkAddress:
|
|
1377
|
+
receiverSparkAddress: v44.string()
|
|
1300
1378
|
});
|
|
1301
|
-
var sparkTransferTokenResultSchema =
|
|
1379
|
+
var sparkTransferTokenResultSchema = v44.object({
|
|
1302
1380
|
/**
|
|
1303
1381
|
* The ID of the transaction.
|
|
1304
1382
|
*/
|
|
1305
|
-
id:
|
|
1383
|
+
id: v44.string()
|
|
1306
1384
|
});
|
|
1307
|
-
var sparkTransferTokenRequestMessageSchema =
|
|
1385
|
+
var sparkTransferTokenRequestMessageSchema = v44.object({
|
|
1308
1386
|
...rpcRequestMessageSchema.entries,
|
|
1309
|
-
...
|
|
1310
|
-
method:
|
|
1387
|
+
...v44.object({
|
|
1388
|
+
method: v44.literal(sparkTransferTokenMethodName),
|
|
1311
1389
|
params: sparkTransferTokenParamsSchema,
|
|
1312
|
-
id:
|
|
1390
|
+
id: v44.string()
|
|
1313
1391
|
}).entries
|
|
1314
1392
|
});
|
|
1315
1393
|
|
|
1316
1394
|
// src/request/types/stxMethods/callContract.ts
|
|
1317
|
-
import * as
|
|
1395
|
+
import * as v45 from "valibot";
|
|
1318
1396
|
var stxCallContractMethodName = "stx_callContract";
|
|
1319
|
-
var stxCallContractParamsSchema =
|
|
1397
|
+
var stxCallContractParamsSchema = v45.object({
|
|
1320
1398
|
/**
|
|
1321
1399
|
* The contract principal.
|
|
1322
1400
|
*
|
|
1323
1401
|
* E.g. `"SPKE...GD5C.my-contract"`
|
|
1324
1402
|
*/
|
|
1325
|
-
contract:
|
|
1403
|
+
contract: v45.string(),
|
|
1326
1404
|
/**
|
|
1327
1405
|
* The name of the function to call.
|
|
1328
1406
|
*
|
|
1329
1407
|
* Note: spec changes ongoing,
|
|
1330
1408
|
* https://github.com/stacksgov/sips/pull/166#pullrequestreview-1914236999
|
|
1331
1409
|
*/
|
|
1332
|
-
functionName:
|
|
1410
|
+
functionName: v45.string(),
|
|
1333
1411
|
/**
|
|
1334
1412
|
* @deprecated in favor of `functionArgs` for @stacks/connect compatibility
|
|
1335
1413
|
*/
|
|
1336
|
-
arguments:
|
|
1414
|
+
arguments: v45.optional(v45.array(v45.string())),
|
|
1337
1415
|
/**
|
|
1338
1416
|
* The function's arguments. The arguments are expected to be hex-encoded
|
|
1339
1417
|
* strings of Clarity values.
|
|
@@ -1348,274 +1426,274 @@ var stxCallContractParamsSchema = v32.object({
|
|
|
1348
1426
|
* const hexArgs = functionArgs.map(cvToHex);
|
|
1349
1427
|
* ```
|
|
1350
1428
|
*/
|
|
1351
|
-
functionArgs:
|
|
1429
|
+
functionArgs: v45.optional(v45.array(v45.string())),
|
|
1352
1430
|
/**
|
|
1353
1431
|
* The post conditions to apply to the contract call.
|
|
1354
1432
|
*/
|
|
1355
|
-
postConditions:
|
|
1433
|
+
postConditions: v45.optional(v45.array(v45.string())),
|
|
1356
1434
|
/**
|
|
1357
1435
|
* The mode to apply to the post conditions.
|
|
1358
1436
|
*/
|
|
1359
|
-
postConditionMode:
|
|
1437
|
+
postConditionMode: v45.optional(v45.union([v45.literal("allow"), v45.literal("deny")]))
|
|
1360
1438
|
});
|
|
1361
|
-
var stxCallContractResultSchema =
|
|
1439
|
+
var stxCallContractResultSchema = v45.object({
|
|
1362
1440
|
/**
|
|
1363
1441
|
* The ID of the transaction.
|
|
1364
1442
|
*/
|
|
1365
|
-
txid:
|
|
1443
|
+
txid: v45.string(),
|
|
1366
1444
|
/**
|
|
1367
1445
|
* A Stacks transaction as a hex-encoded string.
|
|
1368
1446
|
*/
|
|
1369
|
-
transaction:
|
|
1447
|
+
transaction: v45.string()
|
|
1370
1448
|
});
|
|
1371
|
-
var stxCallContractRequestMessageSchema =
|
|
1449
|
+
var stxCallContractRequestMessageSchema = v45.object({
|
|
1372
1450
|
...rpcRequestMessageSchema.entries,
|
|
1373
|
-
...
|
|
1374
|
-
method:
|
|
1451
|
+
...v45.object({
|
|
1452
|
+
method: v45.literal(stxCallContractMethodName),
|
|
1375
1453
|
params: stxCallContractParamsSchema,
|
|
1376
|
-
id:
|
|
1454
|
+
id: v45.string()
|
|
1377
1455
|
}).entries
|
|
1378
1456
|
});
|
|
1379
1457
|
|
|
1380
1458
|
// src/request/types/stxMethods/deployContract.ts
|
|
1381
|
-
import * as
|
|
1459
|
+
import * as v46 from "valibot";
|
|
1382
1460
|
var stxDeployContractMethodName = "stx_deployContract";
|
|
1383
|
-
var stxDeployContractParamsSchema =
|
|
1461
|
+
var stxDeployContractParamsSchema = v46.object({
|
|
1384
1462
|
/**
|
|
1385
1463
|
* Name of the contract.
|
|
1386
1464
|
*/
|
|
1387
|
-
name:
|
|
1465
|
+
name: v46.string(),
|
|
1388
1466
|
/**
|
|
1389
1467
|
* The source code of the Clarity contract.
|
|
1390
1468
|
*/
|
|
1391
|
-
clarityCode:
|
|
1469
|
+
clarityCode: v46.string(),
|
|
1392
1470
|
/**
|
|
1393
1471
|
* The version of the Clarity contract.
|
|
1394
1472
|
*/
|
|
1395
|
-
clarityVersion:
|
|
1473
|
+
clarityVersion: v46.optional(v46.number()),
|
|
1396
1474
|
/**
|
|
1397
1475
|
* The post conditions to apply to the contract call.
|
|
1398
1476
|
*/
|
|
1399
|
-
postConditions:
|
|
1477
|
+
postConditions: v46.optional(v46.array(v46.string())),
|
|
1400
1478
|
/**
|
|
1401
1479
|
* The mode to apply to the post conditions.
|
|
1402
1480
|
*/
|
|
1403
|
-
postConditionMode:
|
|
1481
|
+
postConditionMode: v46.optional(v46.union([v46.literal("allow"), v46.literal("deny")]))
|
|
1404
1482
|
});
|
|
1405
|
-
var stxDeployContractResultSchema =
|
|
1483
|
+
var stxDeployContractResultSchema = v46.object({
|
|
1406
1484
|
/**
|
|
1407
1485
|
* The ID of the transaction.
|
|
1408
1486
|
*/
|
|
1409
|
-
txid:
|
|
1487
|
+
txid: v46.string(),
|
|
1410
1488
|
/**
|
|
1411
1489
|
* A Stacks transaction as a hex-encoded string.
|
|
1412
1490
|
*/
|
|
1413
|
-
transaction:
|
|
1491
|
+
transaction: v46.string()
|
|
1414
1492
|
});
|
|
1415
|
-
var stxDeployContractRequestMessageSchema =
|
|
1493
|
+
var stxDeployContractRequestMessageSchema = v46.object({
|
|
1416
1494
|
...rpcRequestMessageSchema.entries,
|
|
1417
|
-
...
|
|
1418
|
-
method:
|
|
1495
|
+
...v46.object({
|
|
1496
|
+
method: v46.literal(stxDeployContractMethodName),
|
|
1419
1497
|
params: stxDeployContractParamsSchema,
|
|
1420
|
-
id:
|
|
1498
|
+
id: v46.string()
|
|
1421
1499
|
}).entries
|
|
1422
1500
|
});
|
|
1423
1501
|
|
|
1424
1502
|
// src/request/types/stxMethods/getAccounts.ts
|
|
1425
|
-
import * as
|
|
1503
|
+
import * as v47 from "valibot";
|
|
1426
1504
|
var stxGetAccountsMethodName = "stx_getAccounts";
|
|
1427
|
-
var stxGetAccountsParamsSchema =
|
|
1428
|
-
var stxGetAccountsResultSchema =
|
|
1505
|
+
var stxGetAccountsParamsSchema = v47.nullish(v47.null());
|
|
1506
|
+
var stxGetAccountsResultSchema = v47.object({
|
|
1429
1507
|
/**
|
|
1430
1508
|
* The addresses generated for the given purposes.
|
|
1431
1509
|
*/
|
|
1432
|
-
addresses:
|
|
1433
|
-
|
|
1434
|
-
address:
|
|
1435
|
-
publicKey:
|
|
1436
|
-
gaiaHubUrl:
|
|
1437
|
-
gaiaAppKey:
|
|
1510
|
+
addresses: v47.array(
|
|
1511
|
+
v47.object({
|
|
1512
|
+
address: v47.string(),
|
|
1513
|
+
publicKey: v47.string(),
|
|
1514
|
+
gaiaHubUrl: v47.string(),
|
|
1515
|
+
gaiaAppKey: v47.string()
|
|
1438
1516
|
})
|
|
1439
1517
|
),
|
|
1440
1518
|
network: getNetworkResultSchema
|
|
1441
1519
|
});
|
|
1442
|
-
var stxGetAccountsRequestMessageSchema =
|
|
1520
|
+
var stxGetAccountsRequestMessageSchema = v47.object({
|
|
1443
1521
|
...rpcRequestMessageSchema.entries,
|
|
1444
|
-
...
|
|
1445
|
-
method:
|
|
1522
|
+
...v47.object({
|
|
1523
|
+
method: v47.literal(stxGetAccountsMethodName),
|
|
1446
1524
|
params: stxGetAccountsParamsSchema,
|
|
1447
|
-
id:
|
|
1525
|
+
id: v47.string()
|
|
1448
1526
|
}).entries
|
|
1449
1527
|
});
|
|
1450
1528
|
|
|
1451
1529
|
// src/request/types/stxMethods/getAddresses.ts
|
|
1452
|
-
import * as
|
|
1530
|
+
import * as v48 from "valibot";
|
|
1453
1531
|
var stxGetAddressesMethodName = "stx_getAddresses";
|
|
1454
|
-
var stxGetAddressesParamsSchema =
|
|
1455
|
-
|
|
1532
|
+
var stxGetAddressesParamsSchema = v48.nullish(
|
|
1533
|
+
v48.object({
|
|
1456
1534
|
/**
|
|
1457
1535
|
* A message to be displayed to the user in the request prompt.
|
|
1458
1536
|
*/
|
|
1459
|
-
message:
|
|
1537
|
+
message: v48.optional(v48.string())
|
|
1460
1538
|
})
|
|
1461
1539
|
);
|
|
1462
|
-
var stxGetAddressesResultSchema =
|
|
1540
|
+
var stxGetAddressesResultSchema = v48.object({
|
|
1463
1541
|
/**
|
|
1464
1542
|
* The addresses generated for the given purposes.
|
|
1465
1543
|
*/
|
|
1466
|
-
addresses:
|
|
1544
|
+
addresses: v48.array(addressSchema),
|
|
1467
1545
|
network: getNetworkResultSchema
|
|
1468
1546
|
});
|
|
1469
|
-
var stxGetAddressesRequestMessageSchema =
|
|
1547
|
+
var stxGetAddressesRequestMessageSchema = v48.object({
|
|
1470
1548
|
...rpcRequestMessageSchema.entries,
|
|
1471
|
-
...
|
|
1472
|
-
method:
|
|
1549
|
+
...v48.object({
|
|
1550
|
+
method: v48.literal(stxGetAddressesMethodName),
|
|
1473
1551
|
params: stxGetAddressesParamsSchema,
|
|
1474
|
-
id:
|
|
1552
|
+
id: v48.string()
|
|
1475
1553
|
}).entries
|
|
1476
1554
|
});
|
|
1477
1555
|
|
|
1478
1556
|
// src/request/types/stxMethods/signMessage.ts
|
|
1479
|
-
import * as
|
|
1557
|
+
import * as v49 from "valibot";
|
|
1480
1558
|
var stxSignMessageMethodName = "stx_signMessage";
|
|
1481
|
-
var stxSignMessageParamsSchema =
|
|
1559
|
+
var stxSignMessageParamsSchema = v49.object({
|
|
1482
1560
|
/**
|
|
1483
1561
|
* The message to sign.
|
|
1484
1562
|
*/
|
|
1485
|
-
message:
|
|
1563
|
+
message: v49.string()
|
|
1486
1564
|
});
|
|
1487
|
-
var stxSignMessageResultSchema =
|
|
1565
|
+
var stxSignMessageResultSchema = v49.object({
|
|
1488
1566
|
/**
|
|
1489
1567
|
* The signature of the message.
|
|
1490
1568
|
*/
|
|
1491
|
-
signature:
|
|
1569
|
+
signature: v49.string(),
|
|
1492
1570
|
/**
|
|
1493
1571
|
* The public key used to sign the message.
|
|
1494
1572
|
*/
|
|
1495
|
-
publicKey:
|
|
1573
|
+
publicKey: v49.string()
|
|
1496
1574
|
});
|
|
1497
|
-
var stxSignMessageRequestMessageSchema =
|
|
1575
|
+
var stxSignMessageRequestMessageSchema = v49.object({
|
|
1498
1576
|
...rpcRequestMessageSchema.entries,
|
|
1499
|
-
...
|
|
1500
|
-
method:
|
|
1577
|
+
...v49.object({
|
|
1578
|
+
method: v49.literal(stxSignMessageMethodName),
|
|
1501
1579
|
params: stxSignMessageParamsSchema,
|
|
1502
|
-
id:
|
|
1580
|
+
id: v49.string()
|
|
1503
1581
|
}).entries
|
|
1504
1582
|
});
|
|
1505
1583
|
|
|
1506
1584
|
// src/request/types/stxMethods/signStructuredMessage.ts
|
|
1507
|
-
import * as
|
|
1585
|
+
import * as v50 from "valibot";
|
|
1508
1586
|
var stxSignStructuredMessageMethodName = "stx_signStructuredMessage";
|
|
1509
|
-
var stxSignStructuredMessageParamsSchema =
|
|
1587
|
+
var stxSignStructuredMessageParamsSchema = v50.object({
|
|
1510
1588
|
/**
|
|
1511
1589
|
* The domain to be signed.
|
|
1512
1590
|
*/
|
|
1513
|
-
domain:
|
|
1591
|
+
domain: v50.string(),
|
|
1514
1592
|
/**
|
|
1515
1593
|
* Message payload to be signed.
|
|
1516
1594
|
*/
|
|
1517
|
-
message:
|
|
1595
|
+
message: v50.string(),
|
|
1518
1596
|
/**
|
|
1519
1597
|
* The public key to sign the message with.
|
|
1520
1598
|
*/
|
|
1521
|
-
publicKey:
|
|
1599
|
+
publicKey: v50.optional(v50.string())
|
|
1522
1600
|
});
|
|
1523
|
-
var stxSignStructuredMessageResultSchema =
|
|
1601
|
+
var stxSignStructuredMessageResultSchema = v50.object({
|
|
1524
1602
|
/**
|
|
1525
1603
|
* Signature of the message.
|
|
1526
1604
|
*/
|
|
1527
|
-
signature:
|
|
1605
|
+
signature: v50.string(),
|
|
1528
1606
|
/**
|
|
1529
1607
|
* Public key as hex-encoded string.
|
|
1530
1608
|
*/
|
|
1531
|
-
publicKey:
|
|
1609
|
+
publicKey: v50.string()
|
|
1532
1610
|
});
|
|
1533
|
-
var stxSignStructuredMessageRequestMessageSchema =
|
|
1611
|
+
var stxSignStructuredMessageRequestMessageSchema = v50.object({
|
|
1534
1612
|
...rpcRequestMessageSchema.entries,
|
|
1535
|
-
...
|
|
1536
|
-
method:
|
|
1613
|
+
...v50.object({
|
|
1614
|
+
method: v50.literal(stxSignStructuredMessageMethodName),
|
|
1537
1615
|
params: stxSignStructuredMessageParamsSchema,
|
|
1538
|
-
id:
|
|
1616
|
+
id: v50.string()
|
|
1539
1617
|
}).entries
|
|
1540
1618
|
});
|
|
1541
1619
|
|
|
1542
1620
|
// src/request/types/stxMethods/signTransaction.ts
|
|
1543
|
-
import * as
|
|
1621
|
+
import * as v51 from "valibot";
|
|
1544
1622
|
var stxSignTransactionMethodName = "stx_signTransaction";
|
|
1545
|
-
var stxSignTransactionParamsSchema =
|
|
1623
|
+
var stxSignTransactionParamsSchema = v51.object({
|
|
1546
1624
|
/**
|
|
1547
1625
|
* The transaction to sign as a hex-encoded string.
|
|
1548
1626
|
*/
|
|
1549
|
-
transaction:
|
|
1627
|
+
transaction: v51.string(),
|
|
1550
1628
|
/**
|
|
1551
1629
|
* The public key to sign the transaction with. The wallet may use any key
|
|
1552
1630
|
* when not provided.
|
|
1553
1631
|
*/
|
|
1554
|
-
pubkey:
|
|
1632
|
+
pubkey: v51.optional(v51.string()),
|
|
1555
1633
|
/**
|
|
1556
1634
|
* Whether to broadcast the transaction after signing. Defaults to `true`.
|
|
1557
1635
|
*/
|
|
1558
|
-
broadcast:
|
|
1636
|
+
broadcast: v51.optional(v51.boolean())
|
|
1559
1637
|
});
|
|
1560
|
-
var stxSignTransactionResultSchema =
|
|
1638
|
+
var stxSignTransactionResultSchema = v51.object({
|
|
1561
1639
|
/**
|
|
1562
1640
|
* The signed transaction as a hex-encoded string.
|
|
1563
1641
|
*/
|
|
1564
|
-
transaction:
|
|
1642
|
+
transaction: v51.string()
|
|
1565
1643
|
});
|
|
1566
|
-
var stxSignTransactionRequestMessageSchema =
|
|
1644
|
+
var stxSignTransactionRequestMessageSchema = v51.object({
|
|
1567
1645
|
...rpcRequestMessageSchema.entries,
|
|
1568
|
-
...
|
|
1569
|
-
method:
|
|
1646
|
+
...v51.object({
|
|
1647
|
+
method: v51.literal(stxSignTransactionMethodName),
|
|
1570
1648
|
params: stxSignTransactionParamsSchema,
|
|
1571
|
-
id:
|
|
1649
|
+
id: v51.string()
|
|
1572
1650
|
}).entries
|
|
1573
1651
|
});
|
|
1574
1652
|
|
|
1575
1653
|
// src/request/types/stxMethods/signTransactions.ts
|
|
1576
|
-
import * as
|
|
1654
|
+
import * as v52 from "valibot";
|
|
1577
1655
|
var stxSignTransactionsMethodName = "stx_signTransactions";
|
|
1578
|
-
var stxSignTransactionsParamsSchema =
|
|
1656
|
+
var stxSignTransactionsParamsSchema = v52.object({
|
|
1579
1657
|
/**
|
|
1580
1658
|
* The transactions to sign as hex-encoded strings.
|
|
1581
1659
|
*/
|
|
1582
|
-
transactions:
|
|
1583
|
-
|
|
1584
|
-
|
|
1585
|
-
|
|
1586
|
-
|
|
1660
|
+
transactions: v52.pipe(
|
|
1661
|
+
v52.array(
|
|
1662
|
+
v52.pipe(
|
|
1663
|
+
v52.string(),
|
|
1664
|
+
v52.check((hex) => {
|
|
1587
1665
|
return true;
|
|
1588
1666
|
}, "Invalid hex-encoded Stacks transaction.")
|
|
1589
1667
|
)
|
|
1590
1668
|
),
|
|
1591
|
-
|
|
1669
|
+
v52.minLength(1)
|
|
1592
1670
|
),
|
|
1593
1671
|
/**
|
|
1594
1672
|
* Whether the signed transactions should be broadcast after signing. Defaults
|
|
1595
1673
|
* to `true`.
|
|
1596
1674
|
*/
|
|
1597
|
-
broadcast:
|
|
1675
|
+
broadcast: v52.optional(v52.boolean())
|
|
1598
1676
|
});
|
|
1599
|
-
var stxSignTransactionsResultSchema =
|
|
1677
|
+
var stxSignTransactionsResultSchema = v52.object({
|
|
1600
1678
|
/**
|
|
1601
1679
|
* The signed transactions as hex-encoded strings, in the same order as in the
|
|
1602
1680
|
* sign request.
|
|
1603
1681
|
*/
|
|
1604
|
-
transactions:
|
|
1682
|
+
transactions: v52.array(v52.string())
|
|
1605
1683
|
});
|
|
1606
|
-
var stxSignTransactionsRequestMessageSchema =
|
|
1684
|
+
var stxSignTransactionsRequestMessageSchema = v52.object({
|
|
1607
1685
|
...rpcRequestMessageSchema.entries,
|
|
1608
|
-
...
|
|
1609
|
-
method:
|
|
1686
|
+
...v52.object({
|
|
1687
|
+
method: v52.literal(stxSignTransactionsMethodName),
|
|
1610
1688
|
params: stxSignTransactionsParamsSchema,
|
|
1611
|
-
id:
|
|
1689
|
+
id: v52.string()
|
|
1612
1690
|
}).entries
|
|
1613
1691
|
});
|
|
1614
1692
|
|
|
1615
1693
|
// src/request/types/stxMethods/transferStx.ts
|
|
1616
|
-
import * as
|
|
1694
|
+
import * as v53 from "valibot";
|
|
1617
1695
|
var stxTransferStxMethodName = "stx_transferStx";
|
|
1618
|
-
var stxTransferStxParamsSchema =
|
|
1696
|
+
var stxTransferStxParamsSchema = v53.object({
|
|
1619
1697
|
/**
|
|
1620
1698
|
* Amount of STX tokens to transfer in microstacks as a string. Anything
|
|
1621
1699
|
* parseable by `BigInt` is acceptable.
|
|
@@ -1628,23 +1706,23 @@ var stxTransferStxParamsSchema = v40.object({
|
|
|
1628
1706
|
* const amount3 = '1234';
|
|
1629
1707
|
* ```
|
|
1630
1708
|
*/
|
|
1631
|
-
amount:
|
|
1709
|
+
amount: v53.union([v53.number(), v53.string()]),
|
|
1632
1710
|
/**
|
|
1633
1711
|
* The recipient's principal.
|
|
1634
1712
|
*/
|
|
1635
|
-
recipient:
|
|
1713
|
+
recipient: v53.string(),
|
|
1636
1714
|
/**
|
|
1637
1715
|
* A string representing the memo.
|
|
1638
1716
|
*/
|
|
1639
|
-
memo:
|
|
1717
|
+
memo: v53.optional(v53.string()),
|
|
1640
1718
|
/**
|
|
1641
1719
|
* Version of parameter format.
|
|
1642
1720
|
*/
|
|
1643
|
-
version:
|
|
1721
|
+
version: v53.optional(v53.string()),
|
|
1644
1722
|
/**
|
|
1645
1723
|
* The mode of the post conditions.
|
|
1646
1724
|
*/
|
|
1647
|
-
postConditionMode:
|
|
1725
|
+
postConditionMode: v53.optional(v53.number()),
|
|
1648
1726
|
/**
|
|
1649
1727
|
* A hex-encoded string representing the post conditions.
|
|
1650
1728
|
*
|
|
@@ -1657,29 +1735,29 @@ var stxTransferStxParamsSchema = v40.object({
|
|
|
1657
1735
|
* const hexPostCondition = serializePostCondition(postCondition).toString('hex');
|
|
1658
1736
|
* ```
|
|
1659
1737
|
*/
|
|
1660
|
-
postConditions:
|
|
1738
|
+
postConditions: v53.optional(v53.array(v53.string())),
|
|
1661
1739
|
/**
|
|
1662
1740
|
* The public key to sign the transaction with. The wallet may use any key
|
|
1663
1741
|
* when not provided.
|
|
1664
1742
|
*/
|
|
1665
|
-
pubkey:
|
|
1743
|
+
pubkey: v53.optional(v53.string())
|
|
1666
1744
|
});
|
|
1667
|
-
var stxTransferStxResultSchema =
|
|
1745
|
+
var stxTransferStxResultSchema = v53.object({
|
|
1668
1746
|
/**
|
|
1669
1747
|
* The ID of the transaction.
|
|
1670
1748
|
*/
|
|
1671
|
-
txid:
|
|
1749
|
+
txid: v53.string(),
|
|
1672
1750
|
/**
|
|
1673
1751
|
* A Stacks transaction as a hex-encoded string.
|
|
1674
1752
|
*/
|
|
1675
|
-
transaction:
|
|
1753
|
+
transaction: v53.string()
|
|
1676
1754
|
});
|
|
1677
|
-
var stxTransferStxRequestMessageSchema =
|
|
1755
|
+
var stxTransferStxRequestMessageSchema = v53.object({
|
|
1678
1756
|
...rpcRequestMessageSchema.entries,
|
|
1679
|
-
...
|
|
1680
|
-
method:
|
|
1757
|
+
...v53.object({
|
|
1758
|
+
method: v53.literal(stxTransferStxMethodName),
|
|
1681
1759
|
params: stxTransferStxParamsSchema,
|
|
1682
|
-
id:
|
|
1760
|
+
id: v53.string()
|
|
1683
1761
|
}).entries
|
|
1684
1762
|
});
|
|
1685
1763
|
|
|
@@ -1687,13 +1765,13 @@ var stxTransferStxRequestMessageSchema = v40.object({
|
|
|
1687
1765
|
var cache = {};
|
|
1688
1766
|
var requestInternal = async (provider, method, params) => {
|
|
1689
1767
|
const response = await provider.request(method, params);
|
|
1690
|
-
if (
|
|
1768
|
+
if (v54.is(rpcErrorResponseMessageSchema, response)) {
|
|
1691
1769
|
return {
|
|
1692
1770
|
status: "error",
|
|
1693
1771
|
error: response.error
|
|
1694
1772
|
};
|
|
1695
1773
|
}
|
|
1696
|
-
if (
|
|
1774
|
+
if (v54.is(rpcSuccessResponseMessageSchema, response)) {
|
|
1697
1775
|
return {
|
|
1698
1776
|
status: "success",
|
|
1699
1777
|
result: response.result
|
|
@@ -2829,6 +2907,14 @@ export {
|
|
|
2829
2907
|
isProviderInstalled,
|
|
2830
2908
|
networkChangeEventName,
|
|
2831
2909
|
networkChangeSchema,
|
|
2910
|
+
openBridgeMethodName,
|
|
2911
|
+
openBridgeParamsSchema,
|
|
2912
|
+
openBridgeRequestMessageSchema,
|
|
2913
|
+
openBridgeResultSchema,
|
|
2914
|
+
openReceiveMethodName,
|
|
2915
|
+
openReceiveParamsSchema,
|
|
2916
|
+
openReceiveRequestMessageSchema,
|
|
2917
|
+
openReceiveResultSchema,
|
|
2832
2918
|
permission,
|
|
2833
2919
|
removeDefaultProvider,
|
|
2834
2920
|
renouncePermissionsMethodName,
|