@sats-connect/core 0.8.2-6e91f8a → 0.8.2-aa3016f
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 +23 -1
- package/dist/index.d.ts +23 -1
- package/dist/index.js +194 -167
- package/dist/index.mjs +190 -167
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -188,6 +188,10 @@ __export(index_exports, {
|
|
|
188
188
|
sparkFlashnetSignIntentParamsSchema: () => sparkFlashnetSignIntentParamsSchema,
|
|
189
189
|
sparkFlashnetSignIntentRequestMessageSchema: () => sparkFlashnetSignIntentRequestMessageSchema,
|
|
190
190
|
sparkFlashnetSignIntentResultSchema: () => sparkFlashnetSignIntentResultSchema,
|
|
191
|
+
sparkFlashnetSignStructuredMessageMethodName: () => sparkFlashnetSignStructuredMessageMethodName,
|
|
192
|
+
sparkFlashnetSignStructuredMessageParamsSchema: () => sparkFlashnetSignStructuredMessageParamsSchema,
|
|
193
|
+
sparkFlashnetSignStructuredMessageRequestMessageSchema: () => sparkFlashnetSignStructuredMessageRequestMessageSchema,
|
|
194
|
+
sparkFlashnetSignStructuredMessageResultSchema: () => sparkFlashnetSignStructuredMessageResultSchema,
|
|
191
195
|
sparkFlashnetSwapIntentSchema: () => sparkFlashnetSwapIntentSchema,
|
|
192
196
|
sparkGetAddressesMethodName: () => sparkGetAddressesMethodName,
|
|
193
197
|
sparkGetAddressesParamsSchema: () => sparkGetAddressesParamsSchema,
|
|
@@ -250,7 +254,7 @@ __export(index_exports, {
|
|
|
250
254
|
module.exports = __toCommonJS(index_exports);
|
|
251
255
|
|
|
252
256
|
// src/request/index.ts
|
|
253
|
-
var
|
|
257
|
+
var v36 = __toESM(require("valibot"));
|
|
254
258
|
|
|
255
259
|
// src/provider/types.ts
|
|
256
260
|
var v4 = __toESM(require("valibot"));
|
|
@@ -1286,146 +1290,165 @@ var sparkFlashnetSignIntentRequestMessageSchema = v21.object({
|
|
|
1286
1290
|
}).entries
|
|
1287
1291
|
});
|
|
1288
1292
|
|
|
1289
|
-
// src/request/types/sparkMethods/
|
|
1293
|
+
// src/request/types/sparkMethods/flashnetMethods/signStructuredMessage.ts
|
|
1290
1294
|
var v22 = __toESM(require("valibot"));
|
|
1295
|
+
var sparkFlashnetSignStructuredMessageMethodName = "spark_flashnet_signStructuredMessage";
|
|
1296
|
+
var sparkFlashnetSignStructuredMessageParamsSchema = v22.object({
|
|
1297
|
+
message: v22.string()
|
|
1298
|
+
});
|
|
1299
|
+
var sparkFlashnetSignStructuredMessageResultSchema = v22.object({
|
|
1300
|
+
message: v22.string(),
|
|
1301
|
+
signature: v22.string()
|
|
1302
|
+
});
|
|
1303
|
+
var sparkFlashnetSignStructuredMessageRequestMessageSchema = v22.object({
|
|
1304
|
+
...rpcRequestMessageSchema.entries,
|
|
1305
|
+
...v22.object({
|
|
1306
|
+
method: v22.literal(sparkFlashnetSignStructuredMessageMethodName),
|
|
1307
|
+
params: sparkFlashnetSignStructuredMessageParamsSchema,
|
|
1308
|
+
id: v22.string()
|
|
1309
|
+
}).entries
|
|
1310
|
+
});
|
|
1311
|
+
|
|
1312
|
+
// src/request/types/sparkMethods/getAddresses.ts
|
|
1313
|
+
var v23 = __toESM(require("valibot"));
|
|
1291
1314
|
var sparkGetAddressesMethodName = "spark_getAddresses";
|
|
1292
|
-
var sparkGetAddressesParamsSchema =
|
|
1293
|
-
|
|
1315
|
+
var sparkGetAddressesParamsSchema = v23.nullish(
|
|
1316
|
+
v23.object({
|
|
1294
1317
|
/**
|
|
1295
1318
|
* A message to be displayed to the user in the request prompt.
|
|
1296
1319
|
*/
|
|
1297
|
-
message:
|
|
1320
|
+
message: v23.optional(v23.string())
|
|
1298
1321
|
})
|
|
1299
1322
|
);
|
|
1300
|
-
var sparkGetAddressesResultSchema =
|
|
1323
|
+
var sparkGetAddressesResultSchema = v23.object({
|
|
1301
1324
|
/**
|
|
1302
1325
|
* The addresses generated for the given purposes.
|
|
1303
1326
|
*/
|
|
1304
|
-
addresses:
|
|
1327
|
+
addresses: v23.array(addressSchema),
|
|
1305
1328
|
network: getNetworkResultSchema
|
|
1306
1329
|
});
|
|
1307
|
-
var sparkGetAddressesRequestMessageSchema =
|
|
1330
|
+
var sparkGetAddressesRequestMessageSchema = v23.object({
|
|
1308
1331
|
...rpcRequestMessageSchema.entries,
|
|
1309
|
-
...
|
|
1310
|
-
method:
|
|
1332
|
+
...v23.object({
|
|
1333
|
+
method: v23.literal(sparkGetAddressesMethodName),
|
|
1311
1334
|
params: sparkGetAddressesParamsSchema,
|
|
1312
|
-
id:
|
|
1335
|
+
id: v23.string()
|
|
1313
1336
|
}).entries
|
|
1314
1337
|
});
|
|
1315
1338
|
|
|
1316
1339
|
// src/request/types/sparkMethods/getBalance.ts
|
|
1317
|
-
var
|
|
1340
|
+
var v24 = __toESM(require("valibot"));
|
|
1318
1341
|
var sparkGetBalanceMethodName = "spark_getBalance";
|
|
1319
|
-
var sparkGetBalanceParamsSchema =
|
|
1320
|
-
var sparkGetBalanceResultSchema =
|
|
1342
|
+
var sparkGetBalanceParamsSchema = v24.nullish(v24.null());
|
|
1343
|
+
var sparkGetBalanceResultSchema = v24.object({
|
|
1321
1344
|
/**
|
|
1322
1345
|
* The Spark Bitcoin address balance in sats in string form.
|
|
1323
1346
|
*/
|
|
1324
|
-
balance:
|
|
1325
|
-
tokenBalances:
|
|
1326
|
-
|
|
1347
|
+
balance: v24.string(),
|
|
1348
|
+
tokenBalances: v24.array(
|
|
1349
|
+
v24.object({
|
|
1327
1350
|
/* The address balance of the token in string form as it can overflow a js number */
|
|
1328
|
-
balance:
|
|
1329
|
-
tokenMetadata:
|
|
1330
|
-
tokenIdentifier:
|
|
1331
|
-
tokenName:
|
|
1332
|
-
tokenTicker:
|
|
1333
|
-
decimals:
|
|
1334
|
-
maxSupply:
|
|
1351
|
+
balance: v24.string(),
|
|
1352
|
+
tokenMetadata: v24.object({
|
|
1353
|
+
tokenIdentifier: v24.string(),
|
|
1354
|
+
tokenName: v24.string(),
|
|
1355
|
+
tokenTicker: v24.string(),
|
|
1356
|
+
decimals: v24.number(),
|
|
1357
|
+
maxSupply: v24.string()
|
|
1335
1358
|
})
|
|
1336
1359
|
})
|
|
1337
1360
|
)
|
|
1338
1361
|
});
|
|
1339
|
-
var sparkGetBalanceRequestMessageSchema =
|
|
1362
|
+
var sparkGetBalanceRequestMessageSchema = v24.object({
|
|
1340
1363
|
...rpcRequestMessageSchema.entries,
|
|
1341
|
-
...
|
|
1342
|
-
method:
|
|
1364
|
+
...v24.object({
|
|
1365
|
+
method: v24.literal(sparkGetBalanceMethodName),
|
|
1343
1366
|
params: sparkGetBalanceParamsSchema,
|
|
1344
|
-
id:
|
|
1367
|
+
id: v24.string()
|
|
1345
1368
|
}).entries
|
|
1346
1369
|
});
|
|
1347
1370
|
|
|
1348
1371
|
// src/request/types/sparkMethods/transfer.ts
|
|
1349
|
-
var
|
|
1372
|
+
var v25 = __toESM(require("valibot"));
|
|
1350
1373
|
var sparkTransferMethodName = "spark_transfer";
|
|
1351
|
-
var sparkTransferParamsSchema =
|
|
1374
|
+
var sparkTransferParamsSchema = v25.object({
|
|
1352
1375
|
/**
|
|
1353
1376
|
* Amount of SATS to transfer as a string or number.
|
|
1354
1377
|
*/
|
|
1355
|
-
amountSats:
|
|
1378
|
+
amountSats: v25.union([v25.number(), v25.string()]),
|
|
1356
1379
|
/**
|
|
1357
1380
|
* The recipient's spark address.
|
|
1358
1381
|
*/
|
|
1359
|
-
receiverSparkAddress:
|
|
1382
|
+
receiverSparkAddress: v25.string()
|
|
1360
1383
|
});
|
|
1361
|
-
var sparkTransferResultSchema =
|
|
1384
|
+
var sparkTransferResultSchema = v25.object({
|
|
1362
1385
|
/**
|
|
1363
1386
|
* The ID of the transaction.
|
|
1364
1387
|
*/
|
|
1365
|
-
id:
|
|
1388
|
+
id: v25.string()
|
|
1366
1389
|
});
|
|
1367
|
-
var sparkTransferRequestMessageSchema =
|
|
1390
|
+
var sparkTransferRequestMessageSchema = v25.object({
|
|
1368
1391
|
...rpcRequestMessageSchema.entries,
|
|
1369
|
-
...
|
|
1370
|
-
method:
|
|
1392
|
+
...v25.object({
|
|
1393
|
+
method: v25.literal(sparkTransferMethodName),
|
|
1371
1394
|
params: sparkTransferParamsSchema,
|
|
1372
|
-
id:
|
|
1395
|
+
id: v25.string()
|
|
1373
1396
|
}).entries
|
|
1374
1397
|
});
|
|
1375
1398
|
|
|
1376
1399
|
// src/request/types/sparkMethods/transferToken.ts
|
|
1377
|
-
var
|
|
1400
|
+
var v26 = __toESM(require("valibot"));
|
|
1378
1401
|
var sparkTransferTokenMethodName = "spark_transferToken";
|
|
1379
|
-
var sparkTransferTokenParamsSchema =
|
|
1402
|
+
var sparkTransferTokenParamsSchema = v26.object({
|
|
1380
1403
|
/**
|
|
1381
1404
|
* Amount of units of the token to transfer as a string or number.
|
|
1382
1405
|
*/
|
|
1383
|
-
tokenAmount:
|
|
1406
|
+
tokenAmount: v26.union([v26.number(), v26.string()]),
|
|
1384
1407
|
/**
|
|
1385
1408
|
* The Bech32m token identifier.
|
|
1386
1409
|
*/
|
|
1387
|
-
tokenIdentifier:
|
|
1410
|
+
tokenIdentifier: v26.string(),
|
|
1388
1411
|
/**
|
|
1389
1412
|
* The recipient's spark address.
|
|
1390
1413
|
*/
|
|
1391
|
-
receiverSparkAddress:
|
|
1414
|
+
receiverSparkAddress: v26.string()
|
|
1392
1415
|
});
|
|
1393
|
-
var sparkTransferTokenResultSchema =
|
|
1416
|
+
var sparkTransferTokenResultSchema = v26.object({
|
|
1394
1417
|
/**
|
|
1395
1418
|
* The ID of the transaction.
|
|
1396
1419
|
*/
|
|
1397
|
-
id:
|
|
1420
|
+
id: v26.string()
|
|
1398
1421
|
});
|
|
1399
|
-
var sparkTransferTokenRequestMessageSchema =
|
|
1422
|
+
var sparkTransferTokenRequestMessageSchema = v26.object({
|
|
1400
1423
|
...rpcRequestMessageSchema.entries,
|
|
1401
|
-
...
|
|
1402
|
-
method:
|
|
1424
|
+
...v26.object({
|
|
1425
|
+
method: v26.literal(sparkTransferTokenMethodName),
|
|
1403
1426
|
params: sparkTransferTokenParamsSchema,
|
|
1404
|
-
id:
|
|
1427
|
+
id: v26.string()
|
|
1405
1428
|
}).entries
|
|
1406
1429
|
});
|
|
1407
1430
|
|
|
1408
1431
|
// src/request/types/stxMethods/callContract.ts
|
|
1409
|
-
var
|
|
1432
|
+
var v27 = __toESM(require("valibot"));
|
|
1410
1433
|
var stxCallContractMethodName = "stx_callContract";
|
|
1411
|
-
var stxCallContractParamsSchema =
|
|
1434
|
+
var stxCallContractParamsSchema = v27.object({
|
|
1412
1435
|
/**
|
|
1413
1436
|
* The contract principal.
|
|
1414
1437
|
*
|
|
1415
1438
|
* E.g. `"SPKE...GD5C.my-contract"`
|
|
1416
1439
|
*/
|
|
1417
|
-
contract:
|
|
1440
|
+
contract: v27.string(),
|
|
1418
1441
|
/**
|
|
1419
1442
|
* The name of the function to call.
|
|
1420
1443
|
*
|
|
1421
1444
|
* Note: spec changes ongoing,
|
|
1422
1445
|
* https://github.com/stacksgov/sips/pull/166#pullrequestreview-1914236999
|
|
1423
1446
|
*/
|
|
1424
|
-
functionName:
|
|
1447
|
+
functionName: v27.string(),
|
|
1425
1448
|
/**
|
|
1426
1449
|
* @deprecated in favor of `functionArgs` for @stacks/connect compatibility
|
|
1427
1450
|
*/
|
|
1428
|
-
arguments:
|
|
1451
|
+
arguments: v27.optional(v27.array(v27.string())),
|
|
1429
1452
|
/**
|
|
1430
1453
|
* The function's arguments. The arguments are expected to be hex-encoded
|
|
1431
1454
|
* strings of Clarity values.
|
|
@@ -1440,274 +1463,274 @@ var stxCallContractParamsSchema = v26.object({
|
|
|
1440
1463
|
* const hexArgs = functionArgs.map(cvToHex);
|
|
1441
1464
|
* ```
|
|
1442
1465
|
*/
|
|
1443
|
-
functionArgs:
|
|
1466
|
+
functionArgs: v27.optional(v27.array(v27.string())),
|
|
1444
1467
|
/**
|
|
1445
1468
|
* The post conditions to apply to the contract call.
|
|
1446
1469
|
*/
|
|
1447
|
-
postConditions:
|
|
1470
|
+
postConditions: v27.optional(v27.array(v27.string())),
|
|
1448
1471
|
/**
|
|
1449
1472
|
* The mode to apply to the post conditions.
|
|
1450
1473
|
*/
|
|
1451
|
-
postConditionMode:
|
|
1474
|
+
postConditionMode: v27.optional(v27.union([v27.literal("allow"), v27.literal("deny")]))
|
|
1452
1475
|
});
|
|
1453
|
-
var stxCallContractResultSchema =
|
|
1476
|
+
var stxCallContractResultSchema = v27.object({
|
|
1454
1477
|
/**
|
|
1455
1478
|
* The ID of the transaction.
|
|
1456
1479
|
*/
|
|
1457
|
-
txid:
|
|
1480
|
+
txid: v27.string(),
|
|
1458
1481
|
/**
|
|
1459
1482
|
* A Stacks transaction as a hex-encoded string.
|
|
1460
1483
|
*/
|
|
1461
|
-
transaction:
|
|
1484
|
+
transaction: v27.string()
|
|
1462
1485
|
});
|
|
1463
|
-
var stxCallContractRequestMessageSchema =
|
|
1486
|
+
var stxCallContractRequestMessageSchema = v27.object({
|
|
1464
1487
|
...rpcRequestMessageSchema.entries,
|
|
1465
|
-
...
|
|
1466
|
-
method:
|
|
1488
|
+
...v27.object({
|
|
1489
|
+
method: v27.literal(stxCallContractMethodName),
|
|
1467
1490
|
params: stxCallContractParamsSchema,
|
|
1468
|
-
id:
|
|
1491
|
+
id: v27.string()
|
|
1469
1492
|
}).entries
|
|
1470
1493
|
});
|
|
1471
1494
|
|
|
1472
1495
|
// src/request/types/stxMethods/deployContract.ts
|
|
1473
|
-
var
|
|
1496
|
+
var v28 = __toESM(require("valibot"));
|
|
1474
1497
|
var stxDeployContractMethodName = "stx_deployContract";
|
|
1475
|
-
var stxDeployContractParamsSchema =
|
|
1498
|
+
var stxDeployContractParamsSchema = v28.object({
|
|
1476
1499
|
/**
|
|
1477
1500
|
* Name of the contract.
|
|
1478
1501
|
*/
|
|
1479
|
-
name:
|
|
1502
|
+
name: v28.string(),
|
|
1480
1503
|
/**
|
|
1481
1504
|
* The source code of the Clarity contract.
|
|
1482
1505
|
*/
|
|
1483
|
-
clarityCode:
|
|
1506
|
+
clarityCode: v28.string(),
|
|
1484
1507
|
/**
|
|
1485
1508
|
* The version of the Clarity contract.
|
|
1486
1509
|
*/
|
|
1487
|
-
clarityVersion:
|
|
1510
|
+
clarityVersion: v28.optional(v28.number()),
|
|
1488
1511
|
/**
|
|
1489
1512
|
* The post conditions to apply to the contract call.
|
|
1490
1513
|
*/
|
|
1491
|
-
postConditions:
|
|
1514
|
+
postConditions: v28.optional(v28.array(v28.string())),
|
|
1492
1515
|
/**
|
|
1493
1516
|
* The mode to apply to the post conditions.
|
|
1494
1517
|
*/
|
|
1495
|
-
postConditionMode:
|
|
1518
|
+
postConditionMode: v28.optional(v28.union([v28.literal("allow"), v28.literal("deny")]))
|
|
1496
1519
|
});
|
|
1497
|
-
var stxDeployContractResultSchema =
|
|
1520
|
+
var stxDeployContractResultSchema = v28.object({
|
|
1498
1521
|
/**
|
|
1499
1522
|
* The ID of the transaction.
|
|
1500
1523
|
*/
|
|
1501
|
-
txid:
|
|
1524
|
+
txid: v28.string(),
|
|
1502
1525
|
/**
|
|
1503
1526
|
* A Stacks transaction as a hex-encoded string.
|
|
1504
1527
|
*/
|
|
1505
|
-
transaction:
|
|
1528
|
+
transaction: v28.string()
|
|
1506
1529
|
});
|
|
1507
|
-
var stxDeployContractRequestMessageSchema =
|
|
1530
|
+
var stxDeployContractRequestMessageSchema = v28.object({
|
|
1508
1531
|
...rpcRequestMessageSchema.entries,
|
|
1509
|
-
...
|
|
1510
|
-
method:
|
|
1532
|
+
...v28.object({
|
|
1533
|
+
method: v28.literal(stxDeployContractMethodName),
|
|
1511
1534
|
params: stxDeployContractParamsSchema,
|
|
1512
|
-
id:
|
|
1535
|
+
id: v28.string()
|
|
1513
1536
|
}).entries
|
|
1514
1537
|
});
|
|
1515
1538
|
|
|
1516
1539
|
// src/request/types/stxMethods/getAccounts.ts
|
|
1517
|
-
var
|
|
1540
|
+
var v29 = __toESM(require("valibot"));
|
|
1518
1541
|
var stxGetAccountsMethodName = "stx_getAccounts";
|
|
1519
|
-
var stxGetAccountsParamsSchema =
|
|
1520
|
-
var stxGetAccountsResultSchema =
|
|
1542
|
+
var stxGetAccountsParamsSchema = v29.nullish(v29.null());
|
|
1543
|
+
var stxGetAccountsResultSchema = v29.object({
|
|
1521
1544
|
/**
|
|
1522
1545
|
* The addresses generated for the given purposes.
|
|
1523
1546
|
*/
|
|
1524
|
-
addresses:
|
|
1525
|
-
|
|
1526
|
-
address:
|
|
1527
|
-
publicKey:
|
|
1528
|
-
gaiaHubUrl:
|
|
1529
|
-
gaiaAppKey:
|
|
1547
|
+
addresses: v29.array(
|
|
1548
|
+
v29.object({
|
|
1549
|
+
address: v29.string(),
|
|
1550
|
+
publicKey: v29.string(),
|
|
1551
|
+
gaiaHubUrl: v29.string(),
|
|
1552
|
+
gaiaAppKey: v29.string()
|
|
1530
1553
|
})
|
|
1531
1554
|
),
|
|
1532
1555
|
network: getNetworkResultSchema
|
|
1533
1556
|
});
|
|
1534
|
-
var stxGetAccountsRequestMessageSchema =
|
|
1557
|
+
var stxGetAccountsRequestMessageSchema = v29.object({
|
|
1535
1558
|
...rpcRequestMessageSchema.entries,
|
|
1536
|
-
...
|
|
1537
|
-
method:
|
|
1559
|
+
...v29.object({
|
|
1560
|
+
method: v29.literal(stxGetAccountsMethodName),
|
|
1538
1561
|
params: stxGetAccountsParamsSchema,
|
|
1539
|
-
id:
|
|
1562
|
+
id: v29.string()
|
|
1540
1563
|
}).entries
|
|
1541
1564
|
});
|
|
1542
1565
|
|
|
1543
1566
|
// src/request/types/stxMethods/getAddresses.ts
|
|
1544
|
-
var
|
|
1567
|
+
var v30 = __toESM(require("valibot"));
|
|
1545
1568
|
var stxGetAddressesMethodName = "stx_getAddresses";
|
|
1546
|
-
var stxGetAddressesParamsSchema =
|
|
1547
|
-
|
|
1569
|
+
var stxGetAddressesParamsSchema = v30.nullish(
|
|
1570
|
+
v30.object({
|
|
1548
1571
|
/**
|
|
1549
1572
|
* A message to be displayed to the user in the request prompt.
|
|
1550
1573
|
*/
|
|
1551
|
-
message:
|
|
1574
|
+
message: v30.optional(v30.string())
|
|
1552
1575
|
})
|
|
1553
1576
|
);
|
|
1554
|
-
var stxGetAddressesResultSchema =
|
|
1577
|
+
var stxGetAddressesResultSchema = v30.object({
|
|
1555
1578
|
/**
|
|
1556
1579
|
* The addresses generated for the given purposes.
|
|
1557
1580
|
*/
|
|
1558
|
-
addresses:
|
|
1581
|
+
addresses: v30.array(addressSchema),
|
|
1559
1582
|
network: getNetworkResultSchema
|
|
1560
1583
|
});
|
|
1561
|
-
var stxGetAddressesRequestMessageSchema =
|
|
1584
|
+
var stxGetAddressesRequestMessageSchema = v30.object({
|
|
1562
1585
|
...rpcRequestMessageSchema.entries,
|
|
1563
|
-
...
|
|
1564
|
-
method:
|
|
1586
|
+
...v30.object({
|
|
1587
|
+
method: v30.literal(stxGetAddressesMethodName),
|
|
1565
1588
|
params: stxGetAddressesParamsSchema,
|
|
1566
|
-
id:
|
|
1589
|
+
id: v30.string()
|
|
1567
1590
|
}).entries
|
|
1568
1591
|
});
|
|
1569
1592
|
|
|
1570
1593
|
// src/request/types/stxMethods/signMessage.ts
|
|
1571
|
-
var
|
|
1594
|
+
var v31 = __toESM(require("valibot"));
|
|
1572
1595
|
var stxSignMessageMethodName = "stx_signMessage";
|
|
1573
|
-
var stxSignMessageParamsSchema =
|
|
1596
|
+
var stxSignMessageParamsSchema = v31.object({
|
|
1574
1597
|
/**
|
|
1575
1598
|
* The message to sign.
|
|
1576
1599
|
*/
|
|
1577
|
-
message:
|
|
1600
|
+
message: v31.string()
|
|
1578
1601
|
});
|
|
1579
|
-
var stxSignMessageResultSchema =
|
|
1602
|
+
var stxSignMessageResultSchema = v31.object({
|
|
1580
1603
|
/**
|
|
1581
1604
|
* The signature of the message.
|
|
1582
1605
|
*/
|
|
1583
|
-
signature:
|
|
1606
|
+
signature: v31.string(),
|
|
1584
1607
|
/**
|
|
1585
1608
|
* The public key used to sign the message.
|
|
1586
1609
|
*/
|
|
1587
|
-
publicKey:
|
|
1610
|
+
publicKey: v31.string()
|
|
1588
1611
|
});
|
|
1589
|
-
var stxSignMessageRequestMessageSchema =
|
|
1612
|
+
var stxSignMessageRequestMessageSchema = v31.object({
|
|
1590
1613
|
...rpcRequestMessageSchema.entries,
|
|
1591
|
-
...
|
|
1592
|
-
method:
|
|
1614
|
+
...v31.object({
|
|
1615
|
+
method: v31.literal(stxSignMessageMethodName),
|
|
1593
1616
|
params: stxSignMessageParamsSchema,
|
|
1594
|
-
id:
|
|
1617
|
+
id: v31.string()
|
|
1595
1618
|
}).entries
|
|
1596
1619
|
});
|
|
1597
1620
|
|
|
1598
1621
|
// src/request/types/stxMethods/signStructuredMessage.ts
|
|
1599
|
-
var
|
|
1622
|
+
var v32 = __toESM(require("valibot"));
|
|
1600
1623
|
var stxSignStructuredMessageMethodName = "stx_signStructuredMessage";
|
|
1601
|
-
var stxSignStructuredMessageParamsSchema =
|
|
1624
|
+
var stxSignStructuredMessageParamsSchema = v32.object({
|
|
1602
1625
|
/**
|
|
1603
1626
|
* The domain to be signed.
|
|
1604
1627
|
*/
|
|
1605
|
-
domain:
|
|
1628
|
+
domain: v32.string(),
|
|
1606
1629
|
/**
|
|
1607
1630
|
* Message payload to be signed.
|
|
1608
1631
|
*/
|
|
1609
|
-
message:
|
|
1632
|
+
message: v32.string(),
|
|
1610
1633
|
/**
|
|
1611
1634
|
* The public key to sign the message with.
|
|
1612
1635
|
*/
|
|
1613
|
-
publicKey:
|
|
1636
|
+
publicKey: v32.optional(v32.string())
|
|
1614
1637
|
});
|
|
1615
|
-
var stxSignStructuredMessageResultSchema =
|
|
1638
|
+
var stxSignStructuredMessageResultSchema = v32.object({
|
|
1616
1639
|
/**
|
|
1617
1640
|
* Signature of the message.
|
|
1618
1641
|
*/
|
|
1619
|
-
signature:
|
|
1642
|
+
signature: v32.string(),
|
|
1620
1643
|
/**
|
|
1621
1644
|
* Public key as hex-encoded string.
|
|
1622
1645
|
*/
|
|
1623
|
-
publicKey:
|
|
1646
|
+
publicKey: v32.string()
|
|
1624
1647
|
});
|
|
1625
|
-
var stxSignStructuredMessageRequestMessageSchema =
|
|
1648
|
+
var stxSignStructuredMessageRequestMessageSchema = v32.object({
|
|
1626
1649
|
...rpcRequestMessageSchema.entries,
|
|
1627
|
-
...
|
|
1628
|
-
method:
|
|
1650
|
+
...v32.object({
|
|
1651
|
+
method: v32.literal(stxSignStructuredMessageMethodName),
|
|
1629
1652
|
params: stxSignStructuredMessageParamsSchema,
|
|
1630
|
-
id:
|
|
1653
|
+
id: v32.string()
|
|
1631
1654
|
}).entries
|
|
1632
1655
|
});
|
|
1633
1656
|
|
|
1634
1657
|
// src/request/types/stxMethods/signTransaction.ts
|
|
1635
|
-
var
|
|
1658
|
+
var v33 = __toESM(require("valibot"));
|
|
1636
1659
|
var stxSignTransactionMethodName = "stx_signTransaction";
|
|
1637
|
-
var stxSignTransactionParamsSchema =
|
|
1660
|
+
var stxSignTransactionParamsSchema = v33.object({
|
|
1638
1661
|
/**
|
|
1639
1662
|
* The transaction to sign as a hex-encoded string.
|
|
1640
1663
|
*/
|
|
1641
|
-
transaction:
|
|
1664
|
+
transaction: v33.string(),
|
|
1642
1665
|
/**
|
|
1643
1666
|
* The public key to sign the transaction with. The wallet may use any key
|
|
1644
1667
|
* when not provided.
|
|
1645
1668
|
*/
|
|
1646
|
-
pubkey:
|
|
1669
|
+
pubkey: v33.optional(v33.string()),
|
|
1647
1670
|
/**
|
|
1648
1671
|
* Whether to broadcast the transaction after signing. Defaults to `true`.
|
|
1649
1672
|
*/
|
|
1650
|
-
broadcast:
|
|
1673
|
+
broadcast: v33.optional(v33.boolean())
|
|
1651
1674
|
});
|
|
1652
|
-
var stxSignTransactionResultSchema =
|
|
1675
|
+
var stxSignTransactionResultSchema = v33.object({
|
|
1653
1676
|
/**
|
|
1654
1677
|
* The signed transaction as a hex-encoded string.
|
|
1655
1678
|
*/
|
|
1656
|
-
transaction:
|
|
1679
|
+
transaction: v33.string()
|
|
1657
1680
|
});
|
|
1658
|
-
var stxSignTransactionRequestMessageSchema =
|
|
1681
|
+
var stxSignTransactionRequestMessageSchema = v33.object({
|
|
1659
1682
|
...rpcRequestMessageSchema.entries,
|
|
1660
|
-
...
|
|
1661
|
-
method:
|
|
1683
|
+
...v33.object({
|
|
1684
|
+
method: v33.literal(stxSignTransactionMethodName),
|
|
1662
1685
|
params: stxSignTransactionParamsSchema,
|
|
1663
|
-
id:
|
|
1686
|
+
id: v33.string()
|
|
1664
1687
|
}).entries
|
|
1665
1688
|
});
|
|
1666
1689
|
|
|
1667
1690
|
// src/request/types/stxMethods/signTransactions.ts
|
|
1668
|
-
var
|
|
1691
|
+
var v34 = __toESM(require("valibot"));
|
|
1669
1692
|
var stxSignTransactionsMethodName = "stx_signTransactions";
|
|
1670
|
-
var stxSignTransactionsParamsSchema =
|
|
1693
|
+
var stxSignTransactionsParamsSchema = v34.object({
|
|
1671
1694
|
/**
|
|
1672
1695
|
* The transactions to sign as hex-encoded strings.
|
|
1673
1696
|
*/
|
|
1674
|
-
transactions:
|
|
1675
|
-
|
|
1676
|
-
|
|
1677
|
-
|
|
1678
|
-
|
|
1697
|
+
transactions: v34.pipe(
|
|
1698
|
+
v34.array(
|
|
1699
|
+
v34.pipe(
|
|
1700
|
+
v34.string(),
|
|
1701
|
+
v34.check((hex) => {
|
|
1679
1702
|
return true;
|
|
1680
1703
|
}, "Invalid hex-encoded Stacks transaction.")
|
|
1681
1704
|
)
|
|
1682
1705
|
),
|
|
1683
|
-
|
|
1706
|
+
v34.minLength(1)
|
|
1684
1707
|
),
|
|
1685
1708
|
/**
|
|
1686
1709
|
* Whether the signed transactions should be broadcast after signing. Defaults
|
|
1687
1710
|
* to `true`.
|
|
1688
1711
|
*/
|
|
1689
|
-
broadcast:
|
|
1712
|
+
broadcast: v34.optional(v34.boolean())
|
|
1690
1713
|
});
|
|
1691
|
-
var stxSignTransactionsResultSchema =
|
|
1714
|
+
var stxSignTransactionsResultSchema = v34.object({
|
|
1692
1715
|
/**
|
|
1693
1716
|
* The signed transactions as hex-encoded strings, in the same order as in the
|
|
1694
1717
|
* sign request.
|
|
1695
1718
|
*/
|
|
1696
|
-
transactions:
|
|
1719
|
+
transactions: v34.array(v34.string())
|
|
1697
1720
|
});
|
|
1698
|
-
var stxSignTransactionsRequestMessageSchema =
|
|
1721
|
+
var stxSignTransactionsRequestMessageSchema = v34.object({
|
|
1699
1722
|
...rpcRequestMessageSchema.entries,
|
|
1700
|
-
...
|
|
1701
|
-
method:
|
|
1723
|
+
...v34.object({
|
|
1724
|
+
method: v34.literal(stxSignTransactionsMethodName),
|
|
1702
1725
|
params: stxSignTransactionsParamsSchema,
|
|
1703
|
-
id:
|
|
1726
|
+
id: v34.string()
|
|
1704
1727
|
}).entries
|
|
1705
1728
|
});
|
|
1706
1729
|
|
|
1707
1730
|
// src/request/types/stxMethods/transferStx.ts
|
|
1708
|
-
var
|
|
1731
|
+
var v35 = __toESM(require("valibot"));
|
|
1709
1732
|
var stxTransferStxMethodName = "stx_transferStx";
|
|
1710
|
-
var stxTransferStxParamsSchema =
|
|
1733
|
+
var stxTransferStxParamsSchema = v35.object({
|
|
1711
1734
|
/**
|
|
1712
1735
|
* Amount of STX tokens to transfer in microstacks as a string. Anything
|
|
1713
1736
|
* parseable by `BigInt` is acceptable.
|
|
@@ -1720,23 +1743,23 @@ var stxTransferStxParamsSchema = v34.object({
|
|
|
1720
1743
|
* const amount3 = '1234';
|
|
1721
1744
|
* ```
|
|
1722
1745
|
*/
|
|
1723
|
-
amount:
|
|
1746
|
+
amount: v35.union([v35.number(), v35.string()]),
|
|
1724
1747
|
/**
|
|
1725
1748
|
* The recipient's principal.
|
|
1726
1749
|
*/
|
|
1727
|
-
recipient:
|
|
1750
|
+
recipient: v35.string(),
|
|
1728
1751
|
/**
|
|
1729
1752
|
* A string representing the memo.
|
|
1730
1753
|
*/
|
|
1731
|
-
memo:
|
|
1754
|
+
memo: v35.optional(v35.string()),
|
|
1732
1755
|
/**
|
|
1733
1756
|
* Version of parameter format.
|
|
1734
1757
|
*/
|
|
1735
|
-
version:
|
|
1758
|
+
version: v35.optional(v35.string()),
|
|
1736
1759
|
/**
|
|
1737
1760
|
* The mode of the post conditions.
|
|
1738
1761
|
*/
|
|
1739
|
-
postConditionMode:
|
|
1762
|
+
postConditionMode: v35.optional(v35.number()),
|
|
1740
1763
|
/**
|
|
1741
1764
|
* A hex-encoded string representing the post conditions.
|
|
1742
1765
|
*
|
|
@@ -1749,29 +1772,29 @@ var stxTransferStxParamsSchema = v34.object({
|
|
|
1749
1772
|
* const hexPostCondition = serializePostCondition(postCondition).toString('hex');
|
|
1750
1773
|
* ```
|
|
1751
1774
|
*/
|
|
1752
|
-
postConditions:
|
|
1775
|
+
postConditions: v35.optional(v35.array(v35.string())),
|
|
1753
1776
|
/**
|
|
1754
1777
|
* The public key to sign the transaction with. The wallet may use any key
|
|
1755
1778
|
* when not provided.
|
|
1756
1779
|
*/
|
|
1757
|
-
pubkey:
|
|
1780
|
+
pubkey: v35.optional(v35.string())
|
|
1758
1781
|
});
|
|
1759
|
-
var stxTransferStxResultSchema =
|
|
1782
|
+
var stxTransferStxResultSchema = v35.object({
|
|
1760
1783
|
/**
|
|
1761
1784
|
* The ID of the transaction.
|
|
1762
1785
|
*/
|
|
1763
|
-
txid:
|
|
1786
|
+
txid: v35.string(),
|
|
1764
1787
|
/**
|
|
1765
1788
|
* A Stacks transaction as a hex-encoded string.
|
|
1766
1789
|
*/
|
|
1767
|
-
transaction:
|
|
1790
|
+
transaction: v35.string()
|
|
1768
1791
|
});
|
|
1769
|
-
var stxTransferStxRequestMessageSchema =
|
|
1792
|
+
var stxTransferStxRequestMessageSchema = v35.object({
|
|
1770
1793
|
...rpcRequestMessageSchema.entries,
|
|
1771
|
-
...
|
|
1772
|
-
method:
|
|
1794
|
+
...v35.object({
|
|
1795
|
+
method: v35.literal(stxTransferStxMethodName),
|
|
1773
1796
|
params: stxTransferStxParamsSchema,
|
|
1774
|
-
id:
|
|
1797
|
+
id: v35.string()
|
|
1775
1798
|
}).entries
|
|
1776
1799
|
});
|
|
1777
1800
|
|
|
@@ -1779,13 +1802,13 @@ var stxTransferStxRequestMessageSchema = v34.object({
|
|
|
1779
1802
|
var cache = {};
|
|
1780
1803
|
var requestInternal = async (provider, method, params) => {
|
|
1781
1804
|
const response = await provider.request(method, params);
|
|
1782
|
-
if (
|
|
1805
|
+
if (v36.is(rpcErrorResponseMessageSchema, response)) {
|
|
1783
1806
|
return {
|
|
1784
1807
|
status: "error",
|
|
1785
1808
|
error: response.error
|
|
1786
1809
|
};
|
|
1787
1810
|
}
|
|
1788
|
-
if (
|
|
1811
|
+
if (v36.is(rpcSuccessResponseMessageSchema, response)) {
|
|
1789
1812
|
return {
|
|
1790
1813
|
status: "success",
|
|
1791
1814
|
result: response.result
|
|
@@ -2989,6 +3012,10 @@ var signMultipleTransactions = async (options) => {
|
|
|
2989
3012
|
sparkFlashnetSignIntentParamsSchema,
|
|
2990
3013
|
sparkFlashnetSignIntentRequestMessageSchema,
|
|
2991
3014
|
sparkFlashnetSignIntentResultSchema,
|
|
3015
|
+
sparkFlashnetSignStructuredMessageMethodName,
|
|
3016
|
+
sparkFlashnetSignStructuredMessageParamsSchema,
|
|
3017
|
+
sparkFlashnetSignStructuredMessageRequestMessageSchema,
|
|
3018
|
+
sparkFlashnetSignStructuredMessageResultSchema,
|
|
2992
3019
|
sparkFlashnetSwapIntentSchema,
|
|
2993
3020
|
sparkGetAddressesMethodName,
|
|
2994
3021
|
sparkGetAddressesParamsSchema,
|