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