@sats-connect/core 0.12.0 → 0.13.0
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 +20 -1
- package/dist/index.d.ts +20 -1
- package/dist/index.js +305 -277
- package/dist/index.mjs +301 -277
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -213,6 +213,10 @@ __export(index_exports, {
|
|
|
213
213
|
sparkGetBalanceParamsSchema: () => sparkGetBalanceParamsSchema,
|
|
214
214
|
sparkGetBalanceRequestMessageSchema: () => sparkGetBalanceRequestMessageSchema,
|
|
215
215
|
sparkGetBalanceResultSchema: () => sparkGetBalanceResultSchema,
|
|
216
|
+
sparkGetEligibleClawbackTransactionsMethodName: () => sparkGetEligibleClawbackTransactionsMethodName,
|
|
217
|
+
sparkGetEligibleClawbackTransactionsParamsSchema: () => sparkGetEligibleClawbackTransactionsParamsSchema,
|
|
218
|
+
sparkGetEligibleClawbackTransactionsRequestMessageSchema: () => sparkGetEligibleClawbackTransactionsRequestMessageSchema,
|
|
219
|
+
sparkGetEligibleClawbackTransactionsResultSchema: () => sparkGetEligibleClawbackTransactionsResultSchema,
|
|
216
220
|
sparkSignMessageMethodName: () => sparkSignMessageMethodName,
|
|
217
221
|
sparkSignMessageParamsSchema: () => sparkSignMessageParamsSchema,
|
|
218
222
|
sparkSignMessageRequestMessageSchema: () => sparkSignMessageRequestMessageSchema,
|
|
@@ -270,7 +274,7 @@ __export(index_exports, {
|
|
|
270
274
|
module.exports = __toCommonJS(index_exports);
|
|
271
275
|
|
|
272
276
|
// src/request/index.ts
|
|
273
|
-
var
|
|
277
|
+
var v41 = __toESM(require("valibot"));
|
|
274
278
|
|
|
275
279
|
// src/provider/types.ts
|
|
276
280
|
var v4 = __toESM(require("valibot"));
|
|
@@ -1225,155 +1229,175 @@ var sparkFlashnetExecuteSwapRequestMessageSchema = v14.object({
|
|
|
1225
1229
|
}).entries
|
|
1226
1230
|
});
|
|
1227
1231
|
|
|
1228
|
-
// src/request/types/sparkMethods/flashnetMethods/
|
|
1232
|
+
// src/request/types/sparkMethods/flashnetMethods/getEligibleClawbackTransactions.ts
|
|
1229
1233
|
var v15 = __toESM(require("valibot"));
|
|
1234
|
+
var sparkGetEligibleClawbackTransactionsMethodName = "spark_flashnet_getEligibleClawbackTransactions";
|
|
1235
|
+
var sparkGetEligibleClawbackTransactionsParamsSchema = v15.nullish(v15.null());
|
|
1236
|
+
var sparkGetEligibleClawbackTransactionsResultSchema = v15.array(
|
|
1237
|
+
v15.object({
|
|
1238
|
+
txId: v15.string(),
|
|
1239
|
+
createdAt: v15.string(),
|
|
1240
|
+
lpIdentityPublicKey: v15.string()
|
|
1241
|
+
})
|
|
1242
|
+
);
|
|
1243
|
+
var sparkGetEligibleClawbackTransactionsRequestMessageSchema = v15.object({
|
|
1244
|
+
...rpcRequestMessageSchema.entries,
|
|
1245
|
+
...v15.object({
|
|
1246
|
+
method: v15.literal(sparkGetEligibleClawbackTransactionsMethodName),
|
|
1247
|
+
params: sparkGetEligibleClawbackTransactionsParamsSchema,
|
|
1248
|
+
id: v15.string()
|
|
1249
|
+
}).entries
|
|
1250
|
+
});
|
|
1251
|
+
|
|
1252
|
+
// src/request/types/sparkMethods/flashnetMethods/getJwt.ts
|
|
1253
|
+
var v16 = __toESM(require("valibot"));
|
|
1230
1254
|
var sparkFlashnetGetJwtMethodName = "spark_flashnet_getJwt";
|
|
1231
|
-
var sparkFlashnetGetJwtParamsSchema =
|
|
1232
|
-
var sparkFlashnetGetJwtResultSchema =
|
|
1255
|
+
var sparkFlashnetGetJwtParamsSchema = v16.null();
|
|
1256
|
+
var sparkFlashnetGetJwtResultSchema = v16.object({
|
|
1233
1257
|
/**
|
|
1234
1258
|
* The JWT token for authenticated requests to the Flashnet API.
|
|
1235
1259
|
*/
|
|
1236
|
-
jwt:
|
|
1260
|
+
jwt: v16.string()
|
|
1237
1261
|
});
|
|
1238
|
-
var sparkFlashnetGetJwtRequestMessageSchema =
|
|
1262
|
+
var sparkFlashnetGetJwtRequestMessageSchema = v16.object({
|
|
1239
1263
|
...rpcRequestMessageSchema.entries,
|
|
1240
|
-
...
|
|
1241
|
-
method:
|
|
1264
|
+
...v16.object({
|
|
1265
|
+
method: v16.literal(sparkFlashnetGetJwtMethodName),
|
|
1242
1266
|
params: sparkFlashnetGetJwtParamsSchema,
|
|
1243
|
-
id:
|
|
1267
|
+
id: v16.string()
|
|
1244
1268
|
}).entries
|
|
1245
1269
|
});
|
|
1246
1270
|
|
|
1247
1271
|
// src/request/types/sparkMethods/flashnetMethods/intents/addLiquidity.ts
|
|
1248
|
-
var v16 = __toESM(require("valibot"));
|
|
1249
|
-
var sparkFlashnetAddLiquidityIntentSchema = v16.object({
|
|
1250
|
-
type: v16.literal("addLiquidity"),
|
|
1251
|
-
data: v16.object({
|
|
1252
|
-
userPublicKey: v16.string(),
|
|
1253
|
-
poolId: v16.string(),
|
|
1254
|
-
assetAAmount: v16.string(),
|
|
1255
|
-
assetBAmount: v16.string(),
|
|
1256
|
-
assetAMinAmountIn: v16.string(),
|
|
1257
|
-
assetBMinAmountIn: v16.string(),
|
|
1258
|
-
assetATransferId: v16.string(),
|
|
1259
|
-
assetBTransferId: v16.string(),
|
|
1260
|
-
nonce: v16.string()
|
|
1261
|
-
})
|
|
1262
|
-
});
|
|
1263
|
-
|
|
1264
|
-
// src/request/types/sparkMethods/flashnetMethods/intents/clawback.ts
|
|
1265
1272
|
var v17 = __toESM(require("valibot"));
|
|
1266
|
-
var
|
|
1267
|
-
type: v17.literal("
|
|
1273
|
+
var sparkFlashnetAddLiquidityIntentSchema = v17.object({
|
|
1274
|
+
type: v17.literal("addLiquidity"),
|
|
1268
1275
|
data: v17.object({
|
|
1269
|
-
|
|
1270
|
-
|
|
1271
|
-
|
|
1276
|
+
userPublicKey: v17.string(),
|
|
1277
|
+
poolId: v17.string(),
|
|
1278
|
+
assetAAmount: v17.string(),
|
|
1279
|
+
assetBAmount: v17.string(),
|
|
1280
|
+
assetAMinAmountIn: v17.string(),
|
|
1281
|
+
assetBMinAmountIn: v17.string(),
|
|
1282
|
+
assetATransferId: v17.string(),
|
|
1283
|
+
assetBTransferId: v17.string(),
|
|
1272
1284
|
nonce: v17.string()
|
|
1273
1285
|
})
|
|
1274
1286
|
});
|
|
1275
1287
|
|
|
1276
|
-
// src/request/types/sparkMethods/flashnetMethods/intents/
|
|
1288
|
+
// src/request/types/sparkMethods/flashnetMethods/intents/clawback.ts
|
|
1277
1289
|
var v18 = __toESM(require("valibot"));
|
|
1278
|
-
var
|
|
1279
|
-
type: v18.literal("
|
|
1290
|
+
var sparkFlashnetClawbackIntentSchema = v18.object({
|
|
1291
|
+
type: v18.literal("clawback"),
|
|
1280
1292
|
data: v18.object({
|
|
1281
|
-
|
|
1282
|
-
|
|
1283
|
-
|
|
1293
|
+
senderPublicKey: v18.string(),
|
|
1294
|
+
sparkTransferId: v18.string(),
|
|
1295
|
+
lpIdentityPublicKey: v18.string(),
|
|
1284
1296
|
nonce: v18.string()
|
|
1285
1297
|
})
|
|
1286
1298
|
});
|
|
1287
1299
|
|
|
1288
|
-
// src/request/types/sparkMethods/flashnetMethods/intents/
|
|
1300
|
+
// src/request/types/sparkMethods/flashnetMethods/intents/confirmInitialDeposit.ts
|
|
1289
1301
|
var v19 = __toESM(require("valibot"));
|
|
1290
|
-
var
|
|
1291
|
-
type: v19.literal("
|
|
1302
|
+
var sparkFlashnetConfirmInitialDepositIntentSchema = v19.object({
|
|
1303
|
+
type: v19.literal("confirmInitialDeposit"),
|
|
1292
1304
|
data: v19.object({
|
|
1305
|
+
poolId: v19.string(),
|
|
1306
|
+
assetASparkTransferId: v19.string(),
|
|
1293
1307
|
poolOwnerPublicKey: v19.string(),
|
|
1294
|
-
assetAAddress: v19.string(),
|
|
1295
|
-
assetBAddress: v19.string(),
|
|
1296
|
-
lpFeeRateBps: v19.union([v19.number(), v19.string()]),
|
|
1297
|
-
totalHostFeeRateBps: v19.union([v19.number(), v19.string()]),
|
|
1298
1308
|
nonce: v19.string()
|
|
1299
1309
|
})
|
|
1300
1310
|
});
|
|
1301
1311
|
|
|
1302
|
-
// src/request/types/sparkMethods/flashnetMethods/intents/
|
|
1312
|
+
// src/request/types/sparkMethods/flashnetMethods/intents/createConstantProductPool.ts
|
|
1303
1313
|
var v20 = __toESM(require("valibot"));
|
|
1304
|
-
var
|
|
1305
|
-
type: v20.literal("
|
|
1314
|
+
var sparkFlashnetCreateConstantProductPoolIntentSchema = v20.object({
|
|
1315
|
+
type: v20.literal("createConstantProductPool"),
|
|
1306
1316
|
data: v20.object({
|
|
1317
|
+
poolOwnerPublicKey: v20.string(),
|
|
1307
1318
|
assetAAddress: v20.string(),
|
|
1308
1319
|
assetBAddress: v20.string(),
|
|
1309
|
-
assetAInitialReserve: v20.string(),
|
|
1310
|
-
virtualReserveA: v20.union([v20.number(), v20.string()]),
|
|
1311
|
-
virtualReserveB: v20.union([v20.number(), v20.string()]),
|
|
1312
|
-
threshold: v20.union([v20.number(), v20.string()]),
|
|
1313
1320
|
lpFeeRateBps: v20.union([v20.number(), v20.string()]),
|
|
1314
1321
|
totalHostFeeRateBps: v20.union([v20.number(), v20.string()]),
|
|
1315
|
-
poolOwnerPublicKey: v20.string(),
|
|
1316
1322
|
nonce: v20.string()
|
|
1317
1323
|
})
|
|
1318
1324
|
});
|
|
1319
1325
|
|
|
1320
|
-
// src/request/types/sparkMethods/flashnetMethods/intents/
|
|
1326
|
+
// src/request/types/sparkMethods/flashnetMethods/intents/createSingleSidedPool.ts
|
|
1321
1327
|
var v21 = __toESM(require("valibot"));
|
|
1322
|
-
var
|
|
1323
|
-
type: v21.literal("
|
|
1328
|
+
var sparkFlashnetCreateSingleSidedPoolIntentSchema = v21.object({
|
|
1329
|
+
type: v21.literal("createSingleSidedPool"),
|
|
1324
1330
|
data: v21.object({
|
|
1325
|
-
|
|
1326
|
-
|
|
1327
|
-
|
|
1331
|
+
assetAAddress: v21.string(),
|
|
1332
|
+
assetBAddress: v21.string(),
|
|
1333
|
+
assetAInitialReserve: v21.string(),
|
|
1334
|
+
virtualReserveA: v21.union([v21.number(), v21.string()]),
|
|
1335
|
+
virtualReserveB: v21.union([v21.number(), v21.string()]),
|
|
1336
|
+
threshold: v21.union([v21.number(), v21.string()]),
|
|
1337
|
+
lpFeeRateBps: v21.union([v21.number(), v21.string()]),
|
|
1338
|
+
totalHostFeeRateBps: v21.union([v21.number(), v21.string()]),
|
|
1339
|
+
poolOwnerPublicKey: v21.string(),
|
|
1328
1340
|
nonce: v21.string()
|
|
1329
1341
|
})
|
|
1330
1342
|
});
|
|
1331
1343
|
|
|
1332
|
-
// src/request/types/sparkMethods/flashnetMethods/intents/
|
|
1344
|
+
// src/request/types/sparkMethods/flashnetMethods/intents/removeLiquidity.ts
|
|
1333
1345
|
var v22 = __toESM(require("valibot"));
|
|
1334
|
-
var
|
|
1335
|
-
type: v22.literal("
|
|
1346
|
+
var sparkFlashnetRemoveLiquidityIntentSchema = v22.object({
|
|
1347
|
+
type: v22.literal("removeLiquidity"),
|
|
1336
1348
|
data: v22.object({
|
|
1337
1349
|
userPublicKey: v22.string(),
|
|
1338
|
-
|
|
1339
|
-
|
|
1340
|
-
v22.object({
|
|
1341
|
-
poolId: v22.string(),
|
|
1342
|
-
inputAssetAddress: v22.string(),
|
|
1343
|
-
outputAssetAddress: v22.string(),
|
|
1344
|
-
hopIntegratorFeeRateBps: v22.optional(v22.union([v22.number(), v22.string()]))
|
|
1345
|
-
})
|
|
1346
|
-
),
|
|
1347
|
-
inputAmount: v22.string(),
|
|
1348
|
-
maxRouteSlippageBps: v22.union([v22.number(), v22.string()]),
|
|
1349
|
-
minAmountOut: v22.string(),
|
|
1350
|
-
defaultIntegratorFeeRateBps: v22.optional(v22.union([v22.number(), v22.string()])),
|
|
1350
|
+
poolId: v22.string(),
|
|
1351
|
+
lpTokensToRemove: v22.string(),
|
|
1351
1352
|
nonce: v22.string()
|
|
1352
1353
|
})
|
|
1353
1354
|
});
|
|
1354
1355
|
|
|
1355
|
-
// src/request/types/sparkMethods/flashnetMethods/intents/
|
|
1356
|
+
// src/request/types/sparkMethods/flashnetMethods/intents/routeSwap.ts
|
|
1356
1357
|
var v23 = __toESM(require("valibot"));
|
|
1357
|
-
var
|
|
1358
|
-
type: v23.literal("
|
|
1358
|
+
var sparkFlashnetRouteSwapIntentSchema = v23.object({
|
|
1359
|
+
type: v23.literal("executeRouteSwap"),
|
|
1359
1360
|
data: v23.object({
|
|
1360
1361
|
userPublicKey: v23.string(),
|
|
1361
|
-
|
|
1362
|
-
|
|
1363
|
-
|
|
1364
|
-
|
|
1365
|
-
|
|
1366
|
-
|
|
1362
|
+
initialSparkTransferId: v23.string(),
|
|
1363
|
+
hops: v23.array(
|
|
1364
|
+
v23.object({
|
|
1365
|
+
poolId: v23.string(),
|
|
1366
|
+
inputAssetAddress: v23.string(),
|
|
1367
|
+
outputAssetAddress: v23.string(),
|
|
1368
|
+
hopIntegratorFeeRateBps: v23.optional(v23.union([v23.number(), v23.string()]))
|
|
1369
|
+
})
|
|
1370
|
+
),
|
|
1371
|
+
inputAmount: v23.string(),
|
|
1372
|
+
maxRouteSlippageBps: v23.union([v23.number(), v23.string()]),
|
|
1367
1373
|
minAmountOut: v23.string(),
|
|
1368
|
-
|
|
1374
|
+
defaultIntegratorFeeRateBps: v23.optional(v23.union([v23.number(), v23.string()])),
|
|
1369
1375
|
nonce: v23.string()
|
|
1370
1376
|
})
|
|
1371
1377
|
});
|
|
1372
1378
|
|
|
1373
|
-
// src/request/types/sparkMethods/flashnetMethods/
|
|
1379
|
+
// src/request/types/sparkMethods/flashnetMethods/intents/swap.ts
|
|
1374
1380
|
var v24 = __toESM(require("valibot"));
|
|
1381
|
+
var sparkFlashnetSwapIntentSchema = v24.object({
|
|
1382
|
+
type: v24.literal("executeSwap"),
|
|
1383
|
+
data: v24.object({
|
|
1384
|
+
userPublicKey: v24.string(),
|
|
1385
|
+
poolId: v24.string(),
|
|
1386
|
+
transferId: v24.string(),
|
|
1387
|
+
assetInAddress: v24.string(),
|
|
1388
|
+
assetOutAddress: v24.string(),
|
|
1389
|
+
amountIn: v24.string(),
|
|
1390
|
+
maxSlippageBps: v24.union([v24.number(), v24.string()]),
|
|
1391
|
+
minAmountOut: v24.string(),
|
|
1392
|
+
totalIntegratorFeeRateBps: v24.optional(v24.union([v24.number(), v24.string()])),
|
|
1393
|
+
nonce: v24.string()
|
|
1394
|
+
})
|
|
1395
|
+
});
|
|
1396
|
+
|
|
1397
|
+
// src/request/types/sparkMethods/flashnetMethods/signIntent.ts
|
|
1398
|
+
var v25 = __toESM(require("valibot"));
|
|
1375
1399
|
var sparkFlashnetSignIntentMethodName = "spark_flashnet_signIntent";
|
|
1376
|
-
var sparkFlashnetSignIntentParamsSchema =
|
|
1400
|
+
var sparkFlashnetSignIntentParamsSchema = v25.union([
|
|
1377
1401
|
sparkFlashnetSwapIntentSchema,
|
|
1378
1402
|
sparkFlashnetRouteSwapIntentSchema,
|
|
1379
1403
|
sparkFlashnetAddLiquidityIntentSchema,
|
|
@@ -1383,109 +1407,109 @@ var sparkFlashnetSignIntentParamsSchema = v24.union([
|
|
|
1383
1407
|
sparkFlashnetCreateSingleSidedPoolIntentSchema,
|
|
1384
1408
|
sparkFlashnetRemoveLiquidityIntentSchema
|
|
1385
1409
|
]);
|
|
1386
|
-
var sparkFlashnetSignIntentResultSchema =
|
|
1410
|
+
var sparkFlashnetSignIntentResultSchema = v25.object({
|
|
1387
1411
|
/**
|
|
1388
1412
|
* The signed intent as a hex string.
|
|
1389
1413
|
*/
|
|
1390
|
-
signature:
|
|
1414
|
+
signature: v25.string()
|
|
1391
1415
|
});
|
|
1392
|
-
var sparkFlashnetSignIntentRequestMessageSchema =
|
|
1416
|
+
var sparkFlashnetSignIntentRequestMessageSchema = v25.object({
|
|
1393
1417
|
...rpcRequestMessageSchema.entries,
|
|
1394
|
-
...
|
|
1395
|
-
method:
|
|
1418
|
+
...v25.object({
|
|
1419
|
+
method: v25.literal(sparkFlashnetSignIntentMethodName),
|
|
1396
1420
|
params: sparkFlashnetSignIntentParamsSchema,
|
|
1397
|
-
id:
|
|
1421
|
+
id: v25.string()
|
|
1398
1422
|
}).entries
|
|
1399
1423
|
});
|
|
1400
1424
|
|
|
1401
1425
|
// src/request/types/sparkMethods/flashnetMethods/signStructuredMessage.ts
|
|
1402
|
-
var
|
|
1426
|
+
var v26 = __toESM(require("valibot"));
|
|
1403
1427
|
var sparkFlashnetSignStructuredMessageMethodName = "spark_flashnet_signStructuredMessage";
|
|
1404
|
-
var sparkFlashnetSignStructuredMessageParamsSchema =
|
|
1405
|
-
message:
|
|
1428
|
+
var sparkFlashnetSignStructuredMessageParamsSchema = v26.object({
|
|
1429
|
+
message: v26.string()
|
|
1406
1430
|
});
|
|
1407
|
-
var sparkFlashnetSignStructuredMessageResultSchema =
|
|
1408
|
-
message:
|
|
1409
|
-
signature:
|
|
1431
|
+
var sparkFlashnetSignStructuredMessageResultSchema = v26.object({
|
|
1432
|
+
message: v26.string(),
|
|
1433
|
+
signature: v26.string()
|
|
1410
1434
|
});
|
|
1411
|
-
var sparkFlashnetSignStructuredMessageRequestMessageSchema =
|
|
1435
|
+
var sparkFlashnetSignStructuredMessageRequestMessageSchema = v26.object({
|
|
1412
1436
|
...rpcRequestMessageSchema.entries,
|
|
1413
|
-
...
|
|
1414
|
-
method:
|
|
1437
|
+
...v26.object({
|
|
1438
|
+
method: v26.literal(sparkFlashnetSignStructuredMessageMethodName),
|
|
1415
1439
|
params: sparkFlashnetSignStructuredMessageParamsSchema,
|
|
1416
|
-
id:
|
|
1440
|
+
id: v26.string()
|
|
1417
1441
|
}).entries
|
|
1418
1442
|
});
|
|
1419
1443
|
|
|
1420
1444
|
// src/request/types/sparkMethods/getAddresses.ts
|
|
1421
|
-
var
|
|
1445
|
+
var v27 = __toESM(require("valibot"));
|
|
1422
1446
|
var sparkGetAddressesMethodName = "spark_getAddresses";
|
|
1423
|
-
var sparkGetAddressesParamsSchema =
|
|
1424
|
-
|
|
1447
|
+
var sparkGetAddressesParamsSchema = v27.nullish(
|
|
1448
|
+
v27.object({
|
|
1425
1449
|
/**
|
|
1426
1450
|
* A message to be displayed to the user in the request prompt.
|
|
1427
1451
|
*/
|
|
1428
|
-
message:
|
|
1452
|
+
message: v27.optional(v27.string())
|
|
1429
1453
|
})
|
|
1430
1454
|
);
|
|
1431
|
-
var sparkGetAddressesResultSchema =
|
|
1455
|
+
var sparkGetAddressesResultSchema = v27.object({
|
|
1432
1456
|
/**
|
|
1433
1457
|
* The addresses generated for the given purposes.
|
|
1434
1458
|
*/
|
|
1435
|
-
addresses:
|
|
1459
|
+
addresses: v27.array(addressSchema),
|
|
1436
1460
|
network: getNetworkResultSchema
|
|
1437
1461
|
});
|
|
1438
|
-
var sparkGetAddressesRequestMessageSchema =
|
|
1462
|
+
var sparkGetAddressesRequestMessageSchema = v27.object({
|
|
1439
1463
|
...rpcRequestMessageSchema.entries,
|
|
1440
|
-
...
|
|
1441
|
-
method:
|
|
1464
|
+
...v27.object({
|
|
1465
|
+
method: v27.literal(sparkGetAddressesMethodName),
|
|
1442
1466
|
params: sparkGetAddressesParamsSchema,
|
|
1443
|
-
id:
|
|
1467
|
+
id: v27.string()
|
|
1444
1468
|
}).entries
|
|
1445
1469
|
});
|
|
1446
1470
|
|
|
1447
1471
|
// src/request/types/sparkMethods/getBalance.ts
|
|
1448
|
-
var
|
|
1472
|
+
var v28 = __toESM(require("valibot"));
|
|
1449
1473
|
var sparkGetBalanceMethodName = "spark_getBalance";
|
|
1450
|
-
var sparkGetBalanceParamsSchema =
|
|
1451
|
-
var sparkGetBalanceResultSchema =
|
|
1474
|
+
var sparkGetBalanceParamsSchema = v28.nullish(v28.null());
|
|
1475
|
+
var sparkGetBalanceResultSchema = v28.object({
|
|
1452
1476
|
/**
|
|
1453
1477
|
* The Spark Bitcoin address balance in sats in string form.
|
|
1454
1478
|
*/
|
|
1455
|
-
balance:
|
|
1456
|
-
tokenBalances:
|
|
1457
|
-
|
|
1479
|
+
balance: v28.string(),
|
|
1480
|
+
tokenBalances: v28.array(
|
|
1481
|
+
v28.object({
|
|
1458
1482
|
/* The address balance of the token in string form as it can overflow a js number */
|
|
1459
|
-
balance:
|
|
1460
|
-
tokenMetadata:
|
|
1461
|
-
tokenIdentifier:
|
|
1462
|
-
tokenName:
|
|
1463
|
-
tokenTicker:
|
|
1464
|
-
decimals:
|
|
1465
|
-
maxSupply:
|
|
1483
|
+
balance: v28.string(),
|
|
1484
|
+
tokenMetadata: v28.object({
|
|
1485
|
+
tokenIdentifier: v28.string(),
|
|
1486
|
+
tokenName: v28.string(),
|
|
1487
|
+
tokenTicker: v28.string(),
|
|
1488
|
+
decimals: v28.number(),
|
|
1489
|
+
maxSupply: v28.string()
|
|
1466
1490
|
})
|
|
1467
1491
|
})
|
|
1468
1492
|
)
|
|
1469
1493
|
});
|
|
1470
|
-
var sparkGetBalanceRequestMessageSchema =
|
|
1494
|
+
var sparkGetBalanceRequestMessageSchema = v28.object({
|
|
1471
1495
|
...rpcRequestMessageSchema.entries,
|
|
1472
|
-
...
|
|
1473
|
-
method:
|
|
1496
|
+
...v28.object({
|
|
1497
|
+
method: v28.literal(sparkGetBalanceMethodName),
|
|
1474
1498
|
params: sparkGetBalanceParamsSchema,
|
|
1475
|
-
id:
|
|
1499
|
+
id: v28.string()
|
|
1476
1500
|
}).entries
|
|
1477
1501
|
});
|
|
1478
1502
|
|
|
1479
1503
|
// src/request/types/sparkMethods/signMessage.ts
|
|
1480
|
-
var
|
|
1504
|
+
var v29 = __toESM(require("valibot"));
|
|
1481
1505
|
var sparkSignMessageMethodName = "spark_signMessage";
|
|
1482
|
-
var sparkSignMessageParamsSchema =
|
|
1506
|
+
var sparkSignMessageParamsSchema = v29.object({
|
|
1483
1507
|
/**
|
|
1484
1508
|
* The message to sign. The message should only consist of valid UTF-8 characters.
|
|
1485
1509
|
*/
|
|
1486
|
-
message:
|
|
1510
|
+
message: v29.string()
|
|
1487
1511
|
});
|
|
1488
|
-
var sparkSignMessageResultSchema =
|
|
1512
|
+
var sparkSignMessageResultSchema = v29.object({
|
|
1489
1513
|
/**
|
|
1490
1514
|
* The signature, encoded in base64, of the message hash.
|
|
1491
1515
|
*
|
|
@@ -1493,98 +1517,98 @@ var sparkSignMessageResultSchema = v28.object({
|
|
|
1493
1517
|
* and the resulting byte array is hashed with SHA256 before signing
|
|
1494
1518
|
* with the private key.
|
|
1495
1519
|
*/
|
|
1496
|
-
signature:
|
|
1520
|
+
signature: v29.string()
|
|
1497
1521
|
});
|
|
1498
|
-
var sparkSignMessageRequestMessageSchema =
|
|
1522
|
+
var sparkSignMessageRequestMessageSchema = v29.object({
|
|
1499
1523
|
...rpcRequestMessageSchema.entries,
|
|
1500
|
-
...
|
|
1501
|
-
method:
|
|
1524
|
+
...v29.object({
|
|
1525
|
+
method: v29.literal(sparkSignMessageMethodName),
|
|
1502
1526
|
params: sparkSignMessageParamsSchema,
|
|
1503
|
-
id:
|
|
1527
|
+
id: v29.string()
|
|
1504
1528
|
}).entries
|
|
1505
1529
|
});
|
|
1506
1530
|
|
|
1507
1531
|
// src/request/types/sparkMethods/transfer.ts
|
|
1508
|
-
var
|
|
1532
|
+
var v30 = __toESM(require("valibot"));
|
|
1509
1533
|
var sparkTransferMethodName = "spark_transfer";
|
|
1510
|
-
var sparkTransferParamsSchema =
|
|
1534
|
+
var sparkTransferParamsSchema = v30.object({
|
|
1511
1535
|
/**
|
|
1512
1536
|
* Amount of SATS to transfer as a string or number.
|
|
1513
1537
|
*/
|
|
1514
|
-
amountSats:
|
|
1538
|
+
amountSats: v30.union([v30.number(), v30.string()]),
|
|
1515
1539
|
/**
|
|
1516
1540
|
* The recipient's spark address.
|
|
1517
1541
|
*/
|
|
1518
|
-
receiverSparkAddress:
|
|
1542
|
+
receiverSparkAddress: v30.string()
|
|
1519
1543
|
});
|
|
1520
|
-
var sparkTransferResultSchema =
|
|
1544
|
+
var sparkTransferResultSchema = v30.object({
|
|
1521
1545
|
/**
|
|
1522
1546
|
* The ID of the transaction.
|
|
1523
1547
|
*/
|
|
1524
|
-
id:
|
|
1548
|
+
id: v30.string()
|
|
1525
1549
|
});
|
|
1526
|
-
var sparkTransferRequestMessageSchema =
|
|
1550
|
+
var sparkTransferRequestMessageSchema = v30.object({
|
|
1527
1551
|
...rpcRequestMessageSchema.entries,
|
|
1528
|
-
...
|
|
1529
|
-
method:
|
|
1552
|
+
...v30.object({
|
|
1553
|
+
method: v30.literal(sparkTransferMethodName),
|
|
1530
1554
|
params: sparkTransferParamsSchema,
|
|
1531
|
-
id:
|
|
1555
|
+
id: v30.string()
|
|
1532
1556
|
}).entries
|
|
1533
1557
|
});
|
|
1534
1558
|
|
|
1535
1559
|
// src/request/types/sparkMethods/transferToken.ts
|
|
1536
|
-
var
|
|
1560
|
+
var v31 = __toESM(require("valibot"));
|
|
1537
1561
|
var sparkTransferTokenMethodName = "spark_transferToken";
|
|
1538
|
-
var sparkTransferTokenParamsSchema =
|
|
1562
|
+
var sparkTransferTokenParamsSchema = v31.object({
|
|
1539
1563
|
/**
|
|
1540
1564
|
* Amount of units of the token to transfer as a string or number.
|
|
1541
1565
|
*/
|
|
1542
|
-
tokenAmount:
|
|
1566
|
+
tokenAmount: v31.union([v31.number(), v31.string()]),
|
|
1543
1567
|
/**
|
|
1544
1568
|
* The Bech32m token identifier.
|
|
1545
1569
|
*/
|
|
1546
|
-
tokenIdentifier:
|
|
1570
|
+
tokenIdentifier: v31.string(),
|
|
1547
1571
|
/**
|
|
1548
1572
|
* The recipient's spark address.
|
|
1549
1573
|
*/
|
|
1550
|
-
receiverSparkAddress:
|
|
1574
|
+
receiverSparkAddress: v31.string()
|
|
1551
1575
|
});
|
|
1552
|
-
var sparkTransferTokenResultSchema =
|
|
1576
|
+
var sparkTransferTokenResultSchema = v31.object({
|
|
1553
1577
|
/**
|
|
1554
1578
|
* The ID of the transaction.
|
|
1555
1579
|
*/
|
|
1556
|
-
id:
|
|
1580
|
+
id: v31.string()
|
|
1557
1581
|
});
|
|
1558
|
-
var sparkTransferTokenRequestMessageSchema =
|
|
1582
|
+
var sparkTransferTokenRequestMessageSchema = v31.object({
|
|
1559
1583
|
...rpcRequestMessageSchema.entries,
|
|
1560
|
-
...
|
|
1561
|
-
method:
|
|
1584
|
+
...v31.object({
|
|
1585
|
+
method: v31.literal(sparkTransferTokenMethodName),
|
|
1562
1586
|
params: sparkTransferTokenParamsSchema,
|
|
1563
|
-
id:
|
|
1587
|
+
id: v31.string()
|
|
1564
1588
|
}).entries
|
|
1565
1589
|
});
|
|
1566
1590
|
|
|
1567
1591
|
// src/request/types/stxMethods/callContract.ts
|
|
1568
|
-
var
|
|
1592
|
+
var v32 = __toESM(require("valibot"));
|
|
1569
1593
|
var stxCallContractMethodName = "stx_callContract";
|
|
1570
|
-
var stxCallContractParamsSchema =
|
|
1594
|
+
var stxCallContractParamsSchema = v32.object({
|
|
1571
1595
|
/**
|
|
1572
1596
|
* The contract principal.
|
|
1573
1597
|
*
|
|
1574
1598
|
* E.g. `"SPKE...GD5C.my-contract"`
|
|
1575
1599
|
*/
|
|
1576
|
-
contract:
|
|
1600
|
+
contract: v32.string(),
|
|
1577
1601
|
/**
|
|
1578
1602
|
* The name of the function to call.
|
|
1579
1603
|
*
|
|
1580
1604
|
* Note: spec changes ongoing,
|
|
1581
1605
|
* https://github.com/stacksgov/sips/pull/166#pullrequestreview-1914236999
|
|
1582
1606
|
*/
|
|
1583
|
-
functionName:
|
|
1607
|
+
functionName: v32.string(),
|
|
1584
1608
|
/**
|
|
1585
1609
|
* @deprecated in favor of `functionArgs` for @stacks/connect compatibility
|
|
1586
1610
|
*/
|
|
1587
|
-
arguments:
|
|
1611
|
+
arguments: v32.optional(v32.array(v32.string())),
|
|
1588
1612
|
/**
|
|
1589
1613
|
* The function's arguments. The arguments are expected to be hex-encoded
|
|
1590
1614
|
* strings of Clarity values.
|
|
@@ -1599,274 +1623,274 @@ var stxCallContractParamsSchema = v31.object({
|
|
|
1599
1623
|
* const hexArgs = functionArgs.map(cvToHex);
|
|
1600
1624
|
* ```
|
|
1601
1625
|
*/
|
|
1602
|
-
functionArgs:
|
|
1626
|
+
functionArgs: v32.optional(v32.array(v32.string())),
|
|
1603
1627
|
/**
|
|
1604
1628
|
* The post conditions to apply to the contract call.
|
|
1605
1629
|
*/
|
|
1606
|
-
postConditions:
|
|
1630
|
+
postConditions: v32.optional(v32.array(v32.string())),
|
|
1607
1631
|
/**
|
|
1608
1632
|
* The mode to apply to the post conditions.
|
|
1609
1633
|
*/
|
|
1610
|
-
postConditionMode:
|
|
1634
|
+
postConditionMode: v32.optional(v32.union([v32.literal("allow"), v32.literal("deny")]))
|
|
1611
1635
|
});
|
|
1612
|
-
var stxCallContractResultSchema =
|
|
1636
|
+
var stxCallContractResultSchema = v32.object({
|
|
1613
1637
|
/**
|
|
1614
1638
|
* The ID of the transaction.
|
|
1615
1639
|
*/
|
|
1616
|
-
txid:
|
|
1640
|
+
txid: v32.string(),
|
|
1617
1641
|
/**
|
|
1618
1642
|
* A Stacks transaction as a hex-encoded string.
|
|
1619
1643
|
*/
|
|
1620
|
-
transaction:
|
|
1644
|
+
transaction: v32.string()
|
|
1621
1645
|
});
|
|
1622
|
-
var stxCallContractRequestMessageSchema =
|
|
1646
|
+
var stxCallContractRequestMessageSchema = v32.object({
|
|
1623
1647
|
...rpcRequestMessageSchema.entries,
|
|
1624
|
-
...
|
|
1625
|
-
method:
|
|
1648
|
+
...v32.object({
|
|
1649
|
+
method: v32.literal(stxCallContractMethodName),
|
|
1626
1650
|
params: stxCallContractParamsSchema,
|
|
1627
|
-
id:
|
|
1651
|
+
id: v32.string()
|
|
1628
1652
|
}).entries
|
|
1629
1653
|
});
|
|
1630
1654
|
|
|
1631
1655
|
// src/request/types/stxMethods/deployContract.ts
|
|
1632
|
-
var
|
|
1656
|
+
var v33 = __toESM(require("valibot"));
|
|
1633
1657
|
var stxDeployContractMethodName = "stx_deployContract";
|
|
1634
|
-
var stxDeployContractParamsSchema =
|
|
1658
|
+
var stxDeployContractParamsSchema = v33.object({
|
|
1635
1659
|
/**
|
|
1636
1660
|
* Name of the contract.
|
|
1637
1661
|
*/
|
|
1638
|
-
name:
|
|
1662
|
+
name: v33.string(),
|
|
1639
1663
|
/**
|
|
1640
1664
|
* The source code of the Clarity contract.
|
|
1641
1665
|
*/
|
|
1642
|
-
clarityCode:
|
|
1666
|
+
clarityCode: v33.string(),
|
|
1643
1667
|
/**
|
|
1644
1668
|
* The version of the Clarity contract.
|
|
1645
1669
|
*/
|
|
1646
|
-
clarityVersion:
|
|
1670
|
+
clarityVersion: v33.optional(v33.number()),
|
|
1647
1671
|
/**
|
|
1648
1672
|
* The post conditions to apply to the contract call.
|
|
1649
1673
|
*/
|
|
1650
|
-
postConditions:
|
|
1674
|
+
postConditions: v33.optional(v33.array(v33.string())),
|
|
1651
1675
|
/**
|
|
1652
1676
|
* The mode to apply to the post conditions.
|
|
1653
1677
|
*/
|
|
1654
|
-
postConditionMode:
|
|
1678
|
+
postConditionMode: v33.optional(v33.union([v33.literal("allow"), v33.literal("deny")]))
|
|
1655
1679
|
});
|
|
1656
|
-
var stxDeployContractResultSchema =
|
|
1680
|
+
var stxDeployContractResultSchema = v33.object({
|
|
1657
1681
|
/**
|
|
1658
1682
|
* The ID of the transaction.
|
|
1659
1683
|
*/
|
|
1660
|
-
txid:
|
|
1684
|
+
txid: v33.string(),
|
|
1661
1685
|
/**
|
|
1662
1686
|
* A Stacks transaction as a hex-encoded string.
|
|
1663
1687
|
*/
|
|
1664
|
-
transaction:
|
|
1688
|
+
transaction: v33.string()
|
|
1665
1689
|
});
|
|
1666
|
-
var stxDeployContractRequestMessageSchema =
|
|
1690
|
+
var stxDeployContractRequestMessageSchema = v33.object({
|
|
1667
1691
|
...rpcRequestMessageSchema.entries,
|
|
1668
|
-
...
|
|
1669
|
-
method:
|
|
1692
|
+
...v33.object({
|
|
1693
|
+
method: v33.literal(stxDeployContractMethodName),
|
|
1670
1694
|
params: stxDeployContractParamsSchema,
|
|
1671
|
-
id:
|
|
1695
|
+
id: v33.string()
|
|
1672
1696
|
}).entries
|
|
1673
1697
|
});
|
|
1674
1698
|
|
|
1675
1699
|
// src/request/types/stxMethods/getAccounts.ts
|
|
1676
|
-
var
|
|
1700
|
+
var v34 = __toESM(require("valibot"));
|
|
1677
1701
|
var stxGetAccountsMethodName = "stx_getAccounts";
|
|
1678
|
-
var stxGetAccountsParamsSchema =
|
|
1679
|
-
var stxGetAccountsResultSchema =
|
|
1702
|
+
var stxGetAccountsParamsSchema = v34.nullish(v34.null());
|
|
1703
|
+
var stxGetAccountsResultSchema = v34.object({
|
|
1680
1704
|
/**
|
|
1681
1705
|
* The addresses generated for the given purposes.
|
|
1682
1706
|
*/
|
|
1683
|
-
addresses:
|
|
1684
|
-
|
|
1685
|
-
address:
|
|
1686
|
-
publicKey:
|
|
1687
|
-
gaiaHubUrl:
|
|
1688
|
-
gaiaAppKey:
|
|
1707
|
+
addresses: v34.array(
|
|
1708
|
+
v34.object({
|
|
1709
|
+
address: v34.string(),
|
|
1710
|
+
publicKey: v34.string(),
|
|
1711
|
+
gaiaHubUrl: v34.string(),
|
|
1712
|
+
gaiaAppKey: v34.string()
|
|
1689
1713
|
})
|
|
1690
1714
|
),
|
|
1691
1715
|
network: getNetworkResultSchema
|
|
1692
1716
|
});
|
|
1693
|
-
var stxGetAccountsRequestMessageSchema =
|
|
1717
|
+
var stxGetAccountsRequestMessageSchema = v34.object({
|
|
1694
1718
|
...rpcRequestMessageSchema.entries,
|
|
1695
|
-
...
|
|
1696
|
-
method:
|
|
1719
|
+
...v34.object({
|
|
1720
|
+
method: v34.literal(stxGetAccountsMethodName),
|
|
1697
1721
|
params: stxGetAccountsParamsSchema,
|
|
1698
|
-
id:
|
|
1722
|
+
id: v34.string()
|
|
1699
1723
|
}).entries
|
|
1700
1724
|
});
|
|
1701
1725
|
|
|
1702
1726
|
// src/request/types/stxMethods/getAddresses.ts
|
|
1703
|
-
var
|
|
1727
|
+
var v35 = __toESM(require("valibot"));
|
|
1704
1728
|
var stxGetAddressesMethodName = "stx_getAddresses";
|
|
1705
|
-
var stxGetAddressesParamsSchema =
|
|
1706
|
-
|
|
1729
|
+
var stxGetAddressesParamsSchema = v35.nullish(
|
|
1730
|
+
v35.object({
|
|
1707
1731
|
/**
|
|
1708
1732
|
* A message to be displayed to the user in the request prompt.
|
|
1709
1733
|
*/
|
|
1710
|
-
message:
|
|
1734
|
+
message: v35.optional(v35.string())
|
|
1711
1735
|
})
|
|
1712
1736
|
);
|
|
1713
|
-
var stxGetAddressesResultSchema =
|
|
1737
|
+
var stxGetAddressesResultSchema = v35.object({
|
|
1714
1738
|
/**
|
|
1715
1739
|
* The addresses generated for the given purposes.
|
|
1716
1740
|
*/
|
|
1717
|
-
addresses:
|
|
1741
|
+
addresses: v35.array(addressSchema),
|
|
1718
1742
|
network: getNetworkResultSchema
|
|
1719
1743
|
});
|
|
1720
|
-
var stxGetAddressesRequestMessageSchema =
|
|
1744
|
+
var stxGetAddressesRequestMessageSchema = v35.object({
|
|
1721
1745
|
...rpcRequestMessageSchema.entries,
|
|
1722
|
-
...
|
|
1723
|
-
method:
|
|
1746
|
+
...v35.object({
|
|
1747
|
+
method: v35.literal(stxGetAddressesMethodName),
|
|
1724
1748
|
params: stxGetAddressesParamsSchema,
|
|
1725
|
-
id:
|
|
1749
|
+
id: v35.string()
|
|
1726
1750
|
}).entries
|
|
1727
1751
|
});
|
|
1728
1752
|
|
|
1729
1753
|
// src/request/types/stxMethods/signMessage.ts
|
|
1730
|
-
var
|
|
1754
|
+
var v36 = __toESM(require("valibot"));
|
|
1731
1755
|
var stxSignMessageMethodName = "stx_signMessage";
|
|
1732
|
-
var stxSignMessageParamsSchema =
|
|
1756
|
+
var stxSignMessageParamsSchema = v36.object({
|
|
1733
1757
|
/**
|
|
1734
1758
|
* The message to sign.
|
|
1735
1759
|
*/
|
|
1736
|
-
message:
|
|
1760
|
+
message: v36.string()
|
|
1737
1761
|
});
|
|
1738
|
-
var stxSignMessageResultSchema =
|
|
1762
|
+
var stxSignMessageResultSchema = v36.object({
|
|
1739
1763
|
/**
|
|
1740
1764
|
* The signature of the message.
|
|
1741
1765
|
*/
|
|
1742
|
-
signature:
|
|
1766
|
+
signature: v36.string(),
|
|
1743
1767
|
/**
|
|
1744
1768
|
* The public key used to sign the message.
|
|
1745
1769
|
*/
|
|
1746
|
-
publicKey:
|
|
1770
|
+
publicKey: v36.string()
|
|
1747
1771
|
});
|
|
1748
|
-
var stxSignMessageRequestMessageSchema =
|
|
1772
|
+
var stxSignMessageRequestMessageSchema = v36.object({
|
|
1749
1773
|
...rpcRequestMessageSchema.entries,
|
|
1750
|
-
...
|
|
1751
|
-
method:
|
|
1774
|
+
...v36.object({
|
|
1775
|
+
method: v36.literal(stxSignMessageMethodName),
|
|
1752
1776
|
params: stxSignMessageParamsSchema,
|
|
1753
|
-
id:
|
|
1777
|
+
id: v36.string()
|
|
1754
1778
|
}).entries
|
|
1755
1779
|
});
|
|
1756
1780
|
|
|
1757
1781
|
// src/request/types/stxMethods/signStructuredMessage.ts
|
|
1758
|
-
var
|
|
1782
|
+
var v37 = __toESM(require("valibot"));
|
|
1759
1783
|
var stxSignStructuredMessageMethodName = "stx_signStructuredMessage";
|
|
1760
|
-
var stxSignStructuredMessageParamsSchema =
|
|
1784
|
+
var stxSignStructuredMessageParamsSchema = v37.object({
|
|
1761
1785
|
/**
|
|
1762
1786
|
* The domain to be signed.
|
|
1763
1787
|
*/
|
|
1764
|
-
domain:
|
|
1788
|
+
domain: v37.string(),
|
|
1765
1789
|
/**
|
|
1766
1790
|
* Message payload to be signed.
|
|
1767
1791
|
*/
|
|
1768
|
-
message:
|
|
1792
|
+
message: v37.string(),
|
|
1769
1793
|
/**
|
|
1770
1794
|
* The public key to sign the message with.
|
|
1771
1795
|
*/
|
|
1772
|
-
publicKey:
|
|
1796
|
+
publicKey: v37.optional(v37.string())
|
|
1773
1797
|
});
|
|
1774
|
-
var stxSignStructuredMessageResultSchema =
|
|
1798
|
+
var stxSignStructuredMessageResultSchema = v37.object({
|
|
1775
1799
|
/**
|
|
1776
1800
|
* Signature of the message.
|
|
1777
1801
|
*/
|
|
1778
|
-
signature:
|
|
1802
|
+
signature: v37.string(),
|
|
1779
1803
|
/**
|
|
1780
1804
|
* Public key as hex-encoded string.
|
|
1781
1805
|
*/
|
|
1782
|
-
publicKey:
|
|
1806
|
+
publicKey: v37.string()
|
|
1783
1807
|
});
|
|
1784
|
-
var stxSignStructuredMessageRequestMessageSchema =
|
|
1808
|
+
var stxSignStructuredMessageRequestMessageSchema = v37.object({
|
|
1785
1809
|
...rpcRequestMessageSchema.entries,
|
|
1786
|
-
...
|
|
1787
|
-
method:
|
|
1810
|
+
...v37.object({
|
|
1811
|
+
method: v37.literal(stxSignStructuredMessageMethodName),
|
|
1788
1812
|
params: stxSignStructuredMessageParamsSchema,
|
|
1789
|
-
id:
|
|
1813
|
+
id: v37.string()
|
|
1790
1814
|
}).entries
|
|
1791
1815
|
});
|
|
1792
1816
|
|
|
1793
1817
|
// src/request/types/stxMethods/signTransaction.ts
|
|
1794
|
-
var
|
|
1818
|
+
var v38 = __toESM(require("valibot"));
|
|
1795
1819
|
var stxSignTransactionMethodName = "stx_signTransaction";
|
|
1796
|
-
var stxSignTransactionParamsSchema =
|
|
1820
|
+
var stxSignTransactionParamsSchema = v38.object({
|
|
1797
1821
|
/**
|
|
1798
1822
|
* The transaction to sign as a hex-encoded string.
|
|
1799
1823
|
*/
|
|
1800
|
-
transaction:
|
|
1824
|
+
transaction: v38.string(),
|
|
1801
1825
|
/**
|
|
1802
1826
|
* The public key to sign the transaction with. The wallet may use any key
|
|
1803
1827
|
* when not provided.
|
|
1804
1828
|
*/
|
|
1805
|
-
pubkey:
|
|
1829
|
+
pubkey: v38.optional(v38.string()),
|
|
1806
1830
|
/**
|
|
1807
1831
|
* Whether to broadcast the transaction after signing. Defaults to `true`.
|
|
1808
1832
|
*/
|
|
1809
|
-
broadcast:
|
|
1833
|
+
broadcast: v38.optional(v38.boolean())
|
|
1810
1834
|
});
|
|
1811
|
-
var stxSignTransactionResultSchema =
|
|
1835
|
+
var stxSignTransactionResultSchema = v38.object({
|
|
1812
1836
|
/**
|
|
1813
1837
|
* The signed transaction as a hex-encoded string.
|
|
1814
1838
|
*/
|
|
1815
|
-
transaction:
|
|
1839
|
+
transaction: v38.string()
|
|
1816
1840
|
});
|
|
1817
|
-
var stxSignTransactionRequestMessageSchema =
|
|
1841
|
+
var stxSignTransactionRequestMessageSchema = v38.object({
|
|
1818
1842
|
...rpcRequestMessageSchema.entries,
|
|
1819
|
-
...
|
|
1820
|
-
method:
|
|
1843
|
+
...v38.object({
|
|
1844
|
+
method: v38.literal(stxSignTransactionMethodName),
|
|
1821
1845
|
params: stxSignTransactionParamsSchema,
|
|
1822
|
-
id:
|
|
1846
|
+
id: v38.string()
|
|
1823
1847
|
}).entries
|
|
1824
1848
|
});
|
|
1825
1849
|
|
|
1826
1850
|
// src/request/types/stxMethods/signTransactions.ts
|
|
1827
|
-
var
|
|
1851
|
+
var v39 = __toESM(require("valibot"));
|
|
1828
1852
|
var stxSignTransactionsMethodName = "stx_signTransactions";
|
|
1829
|
-
var stxSignTransactionsParamsSchema =
|
|
1853
|
+
var stxSignTransactionsParamsSchema = v39.object({
|
|
1830
1854
|
/**
|
|
1831
1855
|
* The transactions to sign as hex-encoded strings.
|
|
1832
1856
|
*/
|
|
1833
|
-
transactions:
|
|
1834
|
-
|
|
1835
|
-
|
|
1836
|
-
|
|
1837
|
-
|
|
1857
|
+
transactions: v39.pipe(
|
|
1858
|
+
v39.array(
|
|
1859
|
+
v39.pipe(
|
|
1860
|
+
v39.string(),
|
|
1861
|
+
v39.check((hex) => {
|
|
1838
1862
|
return true;
|
|
1839
1863
|
}, "Invalid hex-encoded Stacks transaction.")
|
|
1840
1864
|
)
|
|
1841
1865
|
),
|
|
1842
|
-
|
|
1866
|
+
v39.minLength(1)
|
|
1843
1867
|
),
|
|
1844
1868
|
/**
|
|
1845
1869
|
* Whether the signed transactions should be broadcast after signing. Defaults
|
|
1846
1870
|
* to `true`.
|
|
1847
1871
|
*/
|
|
1848
|
-
broadcast:
|
|
1872
|
+
broadcast: v39.optional(v39.boolean())
|
|
1849
1873
|
});
|
|
1850
|
-
var stxSignTransactionsResultSchema =
|
|
1874
|
+
var stxSignTransactionsResultSchema = v39.object({
|
|
1851
1875
|
/**
|
|
1852
1876
|
* The signed transactions as hex-encoded strings, in the same order as in the
|
|
1853
1877
|
* sign request.
|
|
1854
1878
|
*/
|
|
1855
|
-
transactions:
|
|
1879
|
+
transactions: v39.array(v39.string())
|
|
1856
1880
|
});
|
|
1857
|
-
var stxSignTransactionsRequestMessageSchema =
|
|
1881
|
+
var stxSignTransactionsRequestMessageSchema = v39.object({
|
|
1858
1882
|
...rpcRequestMessageSchema.entries,
|
|
1859
|
-
...
|
|
1860
|
-
method:
|
|
1883
|
+
...v39.object({
|
|
1884
|
+
method: v39.literal(stxSignTransactionsMethodName),
|
|
1861
1885
|
params: stxSignTransactionsParamsSchema,
|
|
1862
|
-
id:
|
|
1886
|
+
id: v39.string()
|
|
1863
1887
|
}).entries
|
|
1864
1888
|
});
|
|
1865
1889
|
|
|
1866
1890
|
// src/request/types/stxMethods/transferStx.ts
|
|
1867
|
-
var
|
|
1891
|
+
var v40 = __toESM(require("valibot"));
|
|
1868
1892
|
var stxTransferStxMethodName = "stx_transferStx";
|
|
1869
|
-
var stxTransferStxParamsSchema =
|
|
1893
|
+
var stxTransferStxParamsSchema = v40.object({
|
|
1870
1894
|
/**
|
|
1871
1895
|
* Amount of STX tokens to transfer in microstacks as a string. Anything
|
|
1872
1896
|
* parseable by `BigInt` is acceptable.
|
|
@@ -1879,23 +1903,23 @@ var stxTransferStxParamsSchema = v39.object({
|
|
|
1879
1903
|
* const amount3 = '1234';
|
|
1880
1904
|
* ```
|
|
1881
1905
|
*/
|
|
1882
|
-
amount:
|
|
1906
|
+
amount: v40.union([v40.number(), v40.string()]),
|
|
1883
1907
|
/**
|
|
1884
1908
|
* The recipient's principal.
|
|
1885
1909
|
*/
|
|
1886
|
-
recipient:
|
|
1910
|
+
recipient: v40.string(),
|
|
1887
1911
|
/**
|
|
1888
1912
|
* A string representing the memo.
|
|
1889
1913
|
*/
|
|
1890
|
-
memo:
|
|
1914
|
+
memo: v40.optional(v40.string()),
|
|
1891
1915
|
/**
|
|
1892
1916
|
* Version of parameter format.
|
|
1893
1917
|
*/
|
|
1894
|
-
version:
|
|
1918
|
+
version: v40.optional(v40.string()),
|
|
1895
1919
|
/**
|
|
1896
1920
|
* The mode of the post conditions.
|
|
1897
1921
|
*/
|
|
1898
|
-
postConditionMode:
|
|
1922
|
+
postConditionMode: v40.optional(v40.number()),
|
|
1899
1923
|
/**
|
|
1900
1924
|
* A hex-encoded string representing the post conditions.
|
|
1901
1925
|
*
|
|
@@ -1908,29 +1932,29 @@ var stxTransferStxParamsSchema = v39.object({
|
|
|
1908
1932
|
* const hexPostCondition = serializePostCondition(postCondition).toString('hex');
|
|
1909
1933
|
* ```
|
|
1910
1934
|
*/
|
|
1911
|
-
postConditions:
|
|
1935
|
+
postConditions: v40.optional(v40.array(v40.string())),
|
|
1912
1936
|
/**
|
|
1913
1937
|
* The public key to sign the transaction with. The wallet may use any key
|
|
1914
1938
|
* when not provided.
|
|
1915
1939
|
*/
|
|
1916
|
-
pubkey:
|
|
1940
|
+
pubkey: v40.optional(v40.string())
|
|
1917
1941
|
});
|
|
1918
|
-
var stxTransferStxResultSchema =
|
|
1942
|
+
var stxTransferStxResultSchema = v40.object({
|
|
1919
1943
|
/**
|
|
1920
1944
|
* The ID of the transaction.
|
|
1921
1945
|
*/
|
|
1922
|
-
txid:
|
|
1946
|
+
txid: v40.string(),
|
|
1923
1947
|
/**
|
|
1924
1948
|
* A Stacks transaction as a hex-encoded string.
|
|
1925
1949
|
*/
|
|
1926
|
-
transaction:
|
|
1950
|
+
transaction: v40.string()
|
|
1927
1951
|
});
|
|
1928
|
-
var stxTransferStxRequestMessageSchema =
|
|
1952
|
+
var stxTransferStxRequestMessageSchema = v40.object({
|
|
1929
1953
|
...rpcRequestMessageSchema.entries,
|
|
1930
|
-
...
|
|
1931
|
-
method:
|
|
1954
|
+
...v40.object({
|
|
1955
|
+
method: v40.literal(stxTransferStxMethodName),
|
|
1932
1956
|
params: stxTransferStxParamsSchema,
|
|
1933
|
-
id:
|
|
1957
|
+
id: v40.string()
|
|
1934
1958
|
}).entries
|
|
1935
1959
|
});
|
|
1936
1960
|
|
|
@@ -1938,13 +1962,13 @@ var stxTransferStxRequestMessageSchema = v39.object({
|
|
|
1938
1962
|
var cache = {};
|
|
1939
1963
|
var requestInternal = async (provider, method, params) => {
|
|
1940
1964
|
const response = await provider.request(method, params);
|
|
1941
|
-
if (
|
|
1965
|
+
if (v41.is(rpcErrorResponseMessageSchema, response)) {
|
|
1942
1966
|
return {
|
|
1943
1967
|
status: "error",
|
|
1944
1968
|
error: response.error
|
|
1945
1969
|
};
|
|
1946
1970
|
}
|
|
1947
|
-
if (
|
|
1971
|
+
if (v41.is(rpcSuccessResponseMessageSchema, response)) {
|
|
1948
1972
|
return {
|
|
1949
1973
|
status: "success",
|
|
1950
1974
|
result: response.result
|
|
@@ -3173,6 +3197,10 @@ var signMultipleTransactions = async (options) => {
|
|
|
3173
3197
|
sparkGetBalanceParamsSchema,
|
|
3174
3198
|
sparkGetBalanceRequestMessageSchema,
|
|
3175
3199
|
sparkGetBalanceResultSchema,
|
|
3200
|
+
sparkGetEligibleClawbackTransactionsMethodName,
|
|
3201
|
+
sparkGetEligibleClawbackTransactionsParamsSchema,
|
|
3202
|
+
sparkGetEligibleClawbackTransactionsRequestMessageSchema,
|
|
3203
|
+
sparkGetEligibleClawbackTransactionsResultSchema,
|
|
3176
3204
|
sparkSignMessageMethodName,
|
|
3177
3205
|
sparkSignMessageParamsSchema,
|
|
3178
3206
|
sparkSignMessageRequestMessageSchema,
|