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