@sats-connect/core 0.8.2 → 0.9.0-6f299e4
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 +389 -1
- package/dist/index.d.ts +389 -1
- package/dist/index.js +435 -167
- package/dist/index.mjs +411 -167
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -173,6 +173,26 @@ __export(index_exports, {
|
|
|
173
173
|
signPsbtRequestMessageSchema: () => signPsbtRequestMessageSchema,
|
|
174
174
|
signPsbtResultSchema: () => signPsbtResultSchema,
|
|
175
175
|
signTransaction: () => signTransaction,
|
|
176
|
+
sparkFlashnetAddLiquidityIntentSchema: () => sparkFlashnetAddLiquidityIntentSchema,
|
|
177
|
+
sparkFlashnetClawbackIntentSchema: () => sparkFlashnetClawbackIntentSchema,
|
|
178
|
+
sparkFlashnetConfirmInitialDepositIntentSchema: () => sparkFlashnetConfirmInitialDepositIntentSchema,
|
|
179
|
+
sparkFlashnetCreateConstantProductPoolIntentSchema: () => sparkFlashnetCreateConstantProductPoolIntentSchema,
|
|
180
|
+
sparkFlashnetCreateSingleSidedPoolIntentSchema: () => sparkFlashnetCreateSingleSidedPoolIntentSchema,
|
|
181
|
+
sparkFlashnetGetJwtMethodName: () => sparkFlashnetGetJwtMethodName,
|
|
182
|
+
sparkFlashnetGetJwtParamsSchema: () => sparkFlashnetGetJwtParamsSchema,
|
|
183
|
+
sparkFlashnetGetJwtRequestMessageSchema: () => sparkFlashnetGetJwtRequestMessageSchema,
|
|
184
|
+
sparkFlashnetGetJwtResultSchema: () => sparkFlashnetGetJwtResultSchema,
|
|
185
|
+
sparkFlashnetRemoveLiquidityIntentSchema: () => sparkFlashnetRemoveLiquidityIntentSchema,
|
|
186
|
+
sparkFlashnetRouteSwapIntentSchema: () => sparkFlashnetRouteSwapIntentSchema,
|
|
187
|
+
sparkFlashnetSignIntentMethodName: () => sparkFlashnetSignIntentMethodName,
|
|
188
|
+
sparkFlashnetSignIntentParamsSchema: () => sparkFlashnetSignIntentParamsSchema,
|
|
189
|
+
sparkFlashnetSignIntentRequestMessageSchema: () => sparkFlashnetSignIntentRequestMessageSchema,
|
|
190
|
+
sparkFlashnetSignIntentResultSchema: () => sparkFlashnetSignIntentResultSchema,
|
|
191
|
+
sparkFlashnetSignStructuredMessageMethodName: () => sparkFlashnetSignStructuredMessageMethodName,
|
|
192
|
+
sparkFlashnetSignStructuredMessageParamsSchema: () => sparkFlashnetSignStructuredMessageParamsSchema,
|
|
193
|
+
sparkFlashnetSignStructuredMessageRequestMessageSchema: () => sparkFlashnetSignStructuredMessageRequestMessageSchema,
|
|
194
|
+
sparkFlashnetSignStructuredMessageResultSchema: () => sparkFlashnetSignStructuredMessageResultSchema,
|
|
195
|
+
sparkFlashnetSwapIntentSchema: () => sparkFlashnetSwapIntentSchema,
|
|
176
196
|
sparkGetAddressesMethodName: () => sparkGetAddressesMethodName,
|
|
177
197
|
sparkGetAddressesParamsSchema: () => sparkGetAddressesParamsSchema,
|
|
178
198
|
sparkGetAddressesRequestMessageSchema: () => sparkGetAddressesRequestMessageSchema,
|
|
@@ -181,6 +201,10 @@ __export(index_exports, {
|
|
|
181
201
|
sparkGetBalanceParamsSchema: () => sparkGetBalanceParamsSchema,
|
|
182
202
|
sparkGetBalanceRequestMessageSchema: () => sparkGetBalanceRequestMessageSchema,
|
|
183
203
|
sparkGetBalanceResultSchema: () => sparkGetBalanceResultSchema,
|
|
204
|
+
sparkSignMessageMethodName: () => sparkSignMessageMethodName,
|
|
205
|
+
sparkSignMessageParamsSchema: () => sparkSignMessageParamsSchema,
|
|
206
|
+
sparkSignMessageRequestMessageSchema: () => sparkSignMessageRequestMessageSchema,
|
|
207
|
+
sparkSignMessageResultSchema: () => sparkSignMessageResultSchema,
|
|
184
208
|
sparkTransferMethodName: () => sparkTransferMethodName,
|
|
185
209
|
sparkTransferParamsSchema: () => sparkTransferParamsSchema,
|
|
186
210
|
sparkTransferRequestMessageSchema: () => sparkTransferRequestMessageSchema,
|
|
@@ -234,7 +258,7 @@ __export(index_exports, {
|
|
|
234
258
|
module.exports = __toCommonJS(index_exports);
|
|
235
259
|
|
|
236
260
|
// src/request/index.ts
|
|
237
|
-
var
|
|
261
|
+
var v37 = __toESM(require("valibot"));
|
|
238
262
|
|
|
239
263
|
// src/provider/types.ts
|
|
240
264
|
var v4 = __toESM(require("valibot"));
|
|
@@ -1097,146 +1121,366 @@ var runesTransferRequestMessageSchema = v11.object({
|
|
|
1097
1121
|
}).entries
|
|
1098
1122
|
});
|
|
1099
1123
|
|
|
1100
|
-
// src/request/types/sparkMethods/
|
|
1124
|
+
// src/request/types/sparkMethods/flashnetMethods/getJwt.ts
|
|
1101
1125
|
var v12 = __toESM(require("valibot"));
|
|
1126
|
+
var sparkFlashnetGetJwtMethodName = "spark_flashnet_getJwt";
|
|
1127
|
+
var sparkFlashnetGetJwtParamsSchema = v12.null();
|
|
1128
|
+
var sparkFlashnetGetJwtResultSchema = v12.object({
|
|
1129
|
+
/**
|
|
1130
|
+
* The JWT token for authenticated requests to the Flashnet API.
|
|
1131
|
+
*/
|
|
1132
|
+
jwt: v12.string()
|
|
1133
|
+
});
|
|
1134
|
+
var sparkFlashnetGetJwtRequestMessageSchema = v12.object({
|
|
1135
|
+
...rpcRequestMessageSchema.entries,
|
|
1136
|
+
...v12.object({
|
|
1137
|
+
method: v12.literal(sparkFlashnetGetJwtMethodName),
|
|
1138
|
+
params: sparkFlashnetGetJwtParamsSchema,
|
|
1139
|
+
id: v12.string()
|
|
1140
|
+
}).entries
|
|
1141
|
+
});
|
|
1142
|
+
|
|
1143
|
+
// src/request/types/sparkMethods/flashnetMethods/intents/addLiquidity.ts
|
|
1144
|
+
var v13 = __toESM(require("valibot"));
|
|
1145
|
+
var sparkFlashnetAddLiquidityIntentSchema = v13.object({
|
|
1146
|
+
type: v13.literal("addLiquidity"),
|
|
1147
|
+
data: v13.object({
|
|
1148
|
+
userPublicKey: v13.string(),
|
|
1149
|
+
poolId: v13.string(),
|
|
1150
|
+
assetAAmount: v13.string(),
|
|
1151
|
+
assetBAmount: v13.string(),
|
|
1152
|
+
assetAMinAmountIn: v13.string(),
|
|
1153
|
+
assetBMinAmountIn: v13.string(),
|
|
1154
|
+
assetATransferId: v13.string(),
|
|
1155
|
+
assetBTransferId: v13.string(),
|
|
1156
|
+
nonce: v13.string()
|
|
1157
|
+
})
|
|
1158
|
+
});
|
|
1159
|
+
|
|
1160
|
+
// src/request/types/sparkMethods/flashnetMethods/intents/clawback.ts
|
|
1161
|
+
var v14 = __toESM(require("valibot"));
|
|
1162
|
+
var sparkFlashnetClawbackIntentSchema = v14.object({
|
|
1163
|
+
type: v14.literal("clawback"),
|
|
1164
|
+
data: v14.object({
|
|
1165
|
+
senderPublicKey: v14.string(),
|
|
1166
|
+
sparkTransferId: v14.string(),
|
|
1167
|
+
lpIdentityPublicKey: v14.string(),
|
|
1168
|
+
nonce: v14.string()
|
|
1169
|
+
})
|
|
1170
|
+
});
|
|
1171
|
+
|
|
1172
|
+
// src/request/types/sparkMethods/flashnetMethods/intents/confirmInitialDeposit.ts
|
|
1173
|
+
var v15 = __toESM(require("valibot"));
|
|
1174
|
+
var sparkFlashnetConfirmInitialDepositIntentSchema = v15.object({
|
|
1175
|
+
type: v15.literal("confirmInitialDeposit"),
|
|
1176
|
+
data: v15.object({
|
|
1177
|
+
poolId: v15.string(),
|
|
1178
|
+
assetASparkTransferId: v15.string(),
|
|
1179
|
+
poolOwnerPublicKey: v15.string(),
|
|
1180
|
+
nonce: v15.string()
|
|
1181
|
+
})
|
|
1182
|
+
});
|
|
1183
|
+
|
|
1184
|
+
// src/request/types/sparkMethods/flashnetMethods/intents/createConstantProductPool.ts
|
|
1185
|
+
var v16 = __toESM(require("valibot"));
|
|
1186
|
+
var sparkFlashnetCreateConstantProductPoolIntentSchema = v16.object({
|
|
1187
|
+
type: v16.literal("createConstantProductPool"),
|
|
1188
|
+
data: v16.object({
|
|
1189
|
+
poolOwnerPublicKey: v16.string(),
|
|
1190
|
+
assetAAddress: v16.string(),
|
|
1191
|
+
assetBAddress: v16.string(),
|
|
1192
|
+
lpFeeRateBps: v16.union([v16.number(), v16.string()]),
|
|
1193
|
+
totalHostFeeRateBps: v16.union([v16.number(), v16.string()]),
|
|
1194
|
+
nonce: v16.string()
|
|
1195
|
+
})
|
|
1196
|
+
});
|
|
1197
|
+
|
|
1198
|
+
// src/request/types/sparkMethods/flashnetMethods/intents/createSingleSidedPool.ts
|
|
1199
|
+
var v17 = __toESM(require("valibot"));
|
|
1200
|
+
var sparkFlashnetCreateSingleSidedPoolIntentSchema = v17.object({
|
|
1201
|
+
type: v17.literal("createSingleSidedPool"),
|
|
1202
|
+
data: v17.object({
|
|
1203
|
+
assetAAddress: v17.string(),
|
|
1204
|
+
assetBAddress: v17.string(),
|
|
1205
|
+
assetAInitialReserve: v17.string(),
|
|
1206
|
+
virtualReserveA: v17.union([v17.number(), v17.string()]),
|
|
1207
|
+
virtualReserveB: v17.union([v17.number(), v17.string()]),
|
|
1208
|
+
threshold: v17.union([v17.number(), v17.string()]),
|
|
1209
|
+
lpFeeRateBps: v17.union([v17.number(), v17.string()]),
|
|
1210
|
+
totalHostFeeRateBps: v17.union([v17.number(), v17.string()]),
|
|
1211
|
+
poolOwnerPublicKey: v17.string(),
|
|
1212
|
+
nonce: v17.string()
|
|
1213
|
+
})
|
|
1214
|
+
});
|
|
1215
|
+
|
|
1216
|
+
// src/request/types/sparkMethods/flashnetMethods/intents/removeLiquidity.ts
|
|
1217
|
+
var v18 = __toESM(require("valibot"));
|
|
1218
|
+
var sparkFlashnetRemoveLiquidityIntentSchema = v18.object({
|
|
1219
|
+
type: v18.literal("removeLiquidity"),
|
|
1220
|
+
data: v18.object({
|
|
1221
|
+
userPublicKey: v18.string(),
|
|
1222
|
+
poolId: v18.string(),
|
|
1223
|
+
lpTokensToRemove: v18.string(),
|
|
1224
|
+
nonce: v18.string()
|
|
1225
|
+
})
|
|
1226
|
+
});
|
|
1227
|
+
|
|
1228
|
+
// src/request/types/sparkMethods/flashnetMethods/intents/routeSwap.ts
|
|
1229
|
+
var v19 = __toESM(require("valibot"));
|
|
1230
|
+
var sparkFlashnetRouteSwapIntentSchema = v19.object({
|
|
1231
|
+
type: v19.literal("executeRouteSwap"),
|
|
1232
|
+
data: v19.object({
|
|
1233
|
+
userPublicKey: v19.string(),
|
|
1234
|
+
initialSparkTransferId: v19.string(),
|
|
1235
|
+
hops: v19.array(
|
|
1236
|
+
v19.object({
|
|
1237
|
+
poolId: v19.string(),
|
|
1238
|
+
inputAssetAddress: v19.string(),
|
|
1239
|
+
outputAssetAddress: v19.string(),
|
|
1240
|
+
hopIntegratorFeeRateBps: v19.optional(v19.union([v19.number(), v19.string()]))
|
|
1241
|
+
})
|
|
1242
|
+
),
|
|
1243
|
+
inputAmount: v19.string(),
|
|
1244
|
+
maxRouteSlippageBps: v19.union([v19.number(), v19.string()]),
|
|
1245
|
+
minAmountOut: v19.string(),
|
|
1246
|
+
defaultIntegratorFeeRateBps: v19.optional(v19.union([v19.number(), v19.string()])),
|
|
1247
|
+
nonce: v19.string()
|
|
1248
|
+
})
|
|
1249
|
+
});
|
|
1250
|
+
|
|
1251
|
+
// src/request/types/sparkMethods/flashnetMethods/intents/swap.ts
|
|
1252
|
+
var v20 = __toESM(require("valibot"));
|
|
1253
|
+
var sparkFlashnetSwapIntentSchema = v20.object({
|
|
1254
|
+
type: v20.literal("executeSwap"),
|
|
1255
|
+
data: v20.object({
|
|
1256
|
+
userPublicKey: v20.string(),
|
|
1257
|
+
poolId: v20.string(),
|
|
1258
|
+
transferId: v20.string(),
|
|
1259
|
+
assetInAddress: v20.string(),
|
|
1260
|
+
assetOutAddress: v20.string(),
|
|
1261
|
+
amountIn: v20.string(),
|
|
1262
|
+
maxSlippageBps: v20.union([v20.number(), v20.string()]),
|
|
1263
|
+
minAmountOut: v20.string(),
|
|
1264
|
+
totalIntegratorFeeRateBps: v20.optional(v20.union([v20.number(), v20.string()])),
|
|
1265
|
+
nonce: v20.string()
|
|
1266
|
+
})
|
|
1267
|
+
});
|
|
1268
|
+
|
|
1269
|
+
// src/request/types/sparkMethods/flashnetMethods/signIntent.ts
|
|
1270
|
+
var v21 = __toESM(require("valibot"));
|
|
1271
|
+
var sparkFlashnetSignIntentMethodName = "spark_flashnet_signIntent";
|
|
1272
|
+
var sparkFlashnetSignIntentParamsSchema = v21.union([
|
|
1273
|
+
sparkFlashnetSwapIntentSchema,
|
|
1274
|
+
sparkFlashnetRouteSwapIntentSchema,
|
|
1275
|
+
sparkFlashnetAddLiquidityIntentSchema,
|
|
1276
|
+
sparkFlashnetClawbackIntentSchema,
|
|
1277
|
+
sparkFlashnetConfirmInitialDepositIntentSchema,
|
|
1278
|
+
sparkFlashnetCreateConstantProductPoolIntentSchema,
|
|
1279
|
+
sparkFlashnetCreateSingleSidedPoolIntentSchema,
|
|
1280
|
+
sparkFlashnetRemoveLiquidityIntentSchema
|
|
1281
|
+
]);
|
|
1282
|
+
var sparkFlashnetSignIntentResultSchema = v21.object({
|
|
1283
|
+
/**
|
|
1284
|
+
* The signed intent as a hex string.
|
|
1285
|
+
*/
|
|
1286
|
+
signature: v21.string()
|
|
1287
|
+
});
|
|
1288
|
+
var sparkFlashnetSignIntentRequestMessageSchema = v21.object({
|
|
1289
|
+
...rpcRequestMessageSchema.entries,
|
|
1290
|
+
...v21.object({
|
|
1291
|
+
method: v21.literal(sparkFlashnetSignIntentMethodName),
|
|
1292
|
+
params: sparkFlashnetSignIntentParamsSchema,
|
|
1293
|
+
id: v21.string()
|
|
1294
|
+
}).entries
|
|
1295
|
+
});
|
|
1296
|
+
|
|
1297
|
+
// src/request/types/sparkMethods/flashnetMethods/signStructuredMessage.ts
|
|
1298
|
+
var v22 = __toESM(require("valibot"));
|
|
1299
|
+
var sparkFlashnetSignStructuredMessageMethodName = "spark_flashnet_signStructuredMessage";
|
|
1300
|
+
var sparkFlashnetSignStructuredMessageParamsSchema = v22.object({
|
|
1301
|
+
message: v22.string()
|
|
1302
|
+
});
|
|
1303
|
+
var sparkFlashnetSignStructuredMessageResultSchema = v22.object({
|
|
1304
|
+
message: v22.string(),
|
|
1305
|
+
signature: v22.string()
|
|
1306
|
+
});
|
|
1307
|
+
var sparkFlashnetSignStructuredMessageRequestMessageSchema = v22.object({
|
|
1308
|
+
...rpcRequestMessageSchema.entries,
|
|
1309
|
+
...v22.object({
|
|
1310
|
+
method: v22.literal(sparkFlashnetSignStructuredMessageMethodName),
|
|
1311
|
+
params: sparkFlashnetSignStructuredMessageParamsSchema,
|
|
1312
|
+
id: v22.string()
|
|
1313
|
+
}).entries
|
|
1314
|
+
});
|
|
1315
|
+
|
|
1316
|
+
// src/request/types/sparkMethods/getAddresses.ts
|
|
1317
|
+
var v23 = __toESM(require("valibot"));
|
|
1102
1318
|
var sparkGetAddressesMethodName = "spark_getAddresses";
|
|
1103
|
-
var sparkGetAddressesParamsSchema =
|
|
1104
|
-
|
|
1319
|
+
var sparkGetAddressesParamsSchema = v23.nullish(
|
|
1320
|
+
v23.object({
|
|
1105
1321
|
/**
|
|
1106
1322
|
* A message to be displayed to the user in the request prompt.
|
|
1107
1323
|
*/
|
|
1108
|
-
message:
|
|
1324
|
+
message: v23.optional(v23.string())
|
|
1109
1325
|
})
|
|
1110
1326
|
);
|
|
1111
|
-
var sparkGetAddressesResultSchema =
|
|
1327
|
+
var sparkGetAddressesResultSchema = v23.object({
|
|
1112
1328
|
/**
|
|
1113
1329
|
* The addresses generated for the given purposes.
|
|
1114
1330
|
*/
|
|
1115
|
-
addresses:
|
|
1331
|
+
addresses: v23.array(addressSchema),
|
|
1116
1332
|
network: getNetworkResultSchema
|
|
1117
1333
|
});
|
|
1118
|
-
var sparkGetAddressesRequestMessageSchema =
|
|
1334
|
+
var sparkGetAddressesRequestMessageSchema = v23.object({
|
|
1119
1335
|
...rpcRequestMessageSchema.entries,
|
|
1120
|
-
...
|
|
1121
|
-
method:
|
|
1336
|
+
...v23.object({
|
|
1337
|
+
method: v23.literal(sparkGetAddressesMethodName),
|
|
1122
1338
|
params: sparkGetAddressesParamsSchema,
|
|
1123
|
-
id:
|
|
1339
|
+
id: v23.string()
|
|
1124
1340
|
}).entries
|
|
1125
1341
|
});
|
|
1126
1342
|
|
|
1127
1343
|
// src/request/types/sparkMethods/getBalance.ts
|
|
1128
|
-
var
|
|
1344
|
+
var v24 = __toESM(require("valibot"));
|
|
1129
1345
|
var sparkGetBalanceMethodName = "spark_getBalance";
|
|
1130
|
-
var sparkGetBalanceParamsSchema =
|
|
1131
|
-
var sparkGetBalanceResultSchema =
|
|
1346
|
+
var sparkGetBalanceParamsSchema = v24.nullish(v24.null());
|
|
1347
|
+
var sparkGetBalanceResultSchema = v24.object({
|
|
1132
1348
|
/**
|
|
1133
1349
|
* The Spark Bitcoin address balance in sats in string form.
|
|
1134
1350
|
*/
|
|
1135
|
-
balance:
|
|
1136
|
-
tokenBalances:
|
|
1137
|
-
|
|
1351
|
+
balance: v24.string(),
|
|
1352
|
+
tokenBalances: v24.array(
|
|
1353
|
+
v24.object({
|
|
1138
1354
|
/* The address balance of the token in string form as it can overflow a js number */
|
|
1139
|
-
balance:
|
|
1140
|
-
tokenMetadata:
|
|
1141
|
-
tokenIdentifier:
|
|
1142
|
-
tokenName:
|
|
1143
|
-
tokenTicker:
|
|
1144
|
-
decimals:
|
|
1145
|
-
maxSupply:
|
|
1355
|
+
balance: v24.string(),
|
|
1356
|
+
tokenMetadata: v24.object({
|
|
1357
|
+
tokenIdentifier: v24.string(),
|
|
1358
|
+
tokenName: v24.string(),
|
|
1359
|
+
tokenTicker: v24.string(),
|
|
1360
|
+
decimals: v24.number(),
|
|
1361
|
+
maxSupply: v24.string()
|
|
1146
1362
|
})
|
|
1147
1363
|
})
|
|
1148
1364
|
)
|
|
1149
1365
|
});
|
|
1150
|
-
var sparkGetBalanceRequestMessageSchema =
|
|
1366
|
+
var sparkGetBalanceRequestMessageSchema = v24.object({
|
|
1151
1367
|
...rpcRequestMessageSchema.entries,
|
|
1152
|
-
...
|
|
1153
|
-
method:
|
|
1368
|
+
...v24.object({
|
|
1369
|
+
method: v24.literal(sparkGetBalanceMethodName),
|
|
1154
1370
|
params: sparkGetBalanceParamsSchema,
|
|
1155
|
-
id:
|
|
1371
|
+
id: v24.string()
|
|
1372
|
+
}).entries
|
|
1373
|
+
});
|
|
1374
|
+
|
|
1375
|
+
// src/request/types/sparkMethods/signMessage.ts
|
|
1376
|
+
var v25 = __toESM(require("valibot"));
|
|
1377
|
+
var sparkSignMessageMethodName = "spark_signMessage";
|
|
1378
|
+
var sparkSignMessageParamsSchema = v25.object({
|
|
1379
|
+
/**
|
|
1380
|
+
* The message to sign. The message should only consist of valid UTF-8 characters.
|
|
1381
|
+
*/
|
|
1382
|
+
message: v25.string()
|
|
1383
|
+
});
|
|
1384
|
+
var sparkSignMessageResultSchema = v25.object({
|
|
1385
|
+
/**
|
|
1386
|
+
* The signature, encoded in base64, of the message hash.
|
|
1387
|
+
*
|
|
1388
|
+
* Note: When signing, the message is decoded into a byte array,
|
|
1389
|
+
* and the resulting byte array is hashed with SHA256 before signing
|
|
1390
|
+
* with the private key.
|
|
1391
|
+
*/
|
|
1392
|
+
signature: v25.string()
|
|
1393
|
+
});
|
|
1394
|
+
var sparkSignMessageRequestMessageSchema = v25.object({
|
|
1395
|
+
...rpcRequestMessageSchema.entries,
|
|
1396
|
+
...v25.object({
|
|
1397
|
+
method: v25.literal(sparkSignMessageMethodName),
|
|
1398
|
+
params: sparkSignMessageParamsSchema,
|
|
1399
|
+
id: v25.string()
|
|
1156
1400
|
}).entries
|
|
1157
1401
|
});
|
|
1158
1402
|
|
|
1159
1403
|
// src/request/types/sparkMethods/transfer.ts
|
|
1160
|
-
var
|
|
1404
|
+
var v26 = __toESM(require("valibot"));
|
|
1161
1405
|
var sparkTransferMethodName = "spark_transfer";
|
|
1162
|
-
var sparkTransferParamsSchema =
|
|
1406
|
+
var sparkTransferParamsSchema = v26.object({
|
|
1163
1407
|
/**
|
|
1164
1408
|
* Amount of SATS to transfer as a string or number.
|
|
1165
1409
|
*/
|
|
1166
|
-
amountSats:
|
|
1410
|
+
amountSats: v26.union([v26.number(), v26.string()]),
|
|
1167
1411
|
/**
|
|
1168
1412
|
* The recipient's spark address.
|
|
1169
1413
|
*/
|
|
1170
|
-
receiverSparkAddress:
|
|
1414
|
+
receiverSparkAddress: v26.string()
|
|
1171
1415
|
});
|
|
1172
|
-
var sparkTransferResultSchema =
|
|
1416
|
+
var sparkTransferResultSchema = v26.object({
|
|
1173
1417
|
/**
|
|
1174
1418
|
* The ID of the transaction.
|
|
1175
1419
|
*/
|
|
1176
|
-
id:
|
|
1420
|
+
id: v26.string()
|
|
1177
1421
|
});
|
|
1178
|
-
var sparkTransferRequestMessageSchema =
|
|
1422
|
+
var sparkTransferRequestMessageSchema = v26.object({
|
|
1179
1423
|
...rpcRequestMessageSchema.entries,
|
|
1180
|
-
...
|
|
1181
|
-
method:
|
|
1424
|
+
...v26.object({
|
|
1425
|
+
method: v26.literal(sparkTransferMethodName),
|
|
1182
1426
|
params: sparkTransferParamsSchema,
|
|
1183
|
-
id:
|
|
1427
|
+
id: v26.string()
|
|
1184
1428
|
}).entries
|
|
1185
1429
|
});
|
|
1186
1430
|
|
|
1187
1431
|
// src/request/types/sparkMethods/transferToken.ts
|
|
1188
|
-
var
|
|
1432
|
+
var v27 = __toESM(require("valibot"));
|
|
1189
1433
|
var sparkTransferTokenMethodName = "spark_transferToken";
|
|
1190
|
-
var sparkTransferTokenParamsSchema =
|
|
1434
|
+
var sparkTransferTokenParamsSchema = v27.object({
|
|
1191
1435
|
/**
|
|
1192
1436
|
* Amount of units of the token to transfer as a string or number.
|
|
1193
1437
|
*/
|
|
1194
|
-
tokenAmount:
|
|
1438
|
+
tokenAmount: v27.union([v27.number(), v27.string()]),
|
|
1195
1439
|
/**
|
|
1196
1440
|
* The Bech32m token identifier.
|
|
1197
1441
|
*/
|
|
1198
|
-
tokenIdentifier:
|
|
1442
|
+
tokenIdentifier: v27.string(),
|
|
1199
1443
|
/**
|
|
1200
1444
|
* The recipient's spark address.
|
|
1201
1445
|
*/
|
|
1202
|
-
receiverSparkAddress:
|
|
1446
|
+
receiverSparkAddress: v27.string()
|
|
1203
1447
|
});
|
|
1204
|
-
var sparkTransferTokenResultSchema =
|
|
1448
|
+
var sparkTransferTokenResultSchema = v27.object({
|
|
1205
1449
|
/**
|
|
1206
1450
|
* The ID of the transaction.
|
|
1207
1451
|
*/
|
|
1208
|
-
id:
|
|
1452
|
+
id: v27.string()
|
|
1209
1453
|
});
|
|
1210
|
-
var sparkTransferTokenRequestMessageSchema =
|
|
1454
|
+
var sparkTransferTokenRequestMessageSchema = v27.object({
|
|
1211
1455
|
...rpcRequestMessageSchema.entries,
|
|
1212
|
-
...
|
|
1213
|
-
method:
|
|
1456
|
+
...v27.object({
|
|
1457
|
+
method: v27.literal(sparkTransferTokenMethodName),
|
|
1214
1458
|
params: sparkTransferTokenParamsSchema,
|
|
1215
|
-
id:
|
|
1459
|
+
id: v27.string()
|
|
1216
1460
|
}).entries
|
|
1217
1461
|
});
|
|
1218
1462
|
|
|
1219
1463
|
// src/request/types/stxMethods/callContract.ts
|
|
1220
|
-
var
|
|
1464
|
+
var v28 = __toESM(require("valibot"));
|
|
1221
1465
|
var stxCallContractMethodName = "stx_callContract";
|
|
1222
|
-
var stxCallContractParamsSchema =
|
|
1466
|
+
var stxCallContractParamsSchema = v28.object({
|
|
1223
1467
|
/**
|
|
1224
1468
|
* The contract principal.
|
|
1225
1469
|
*
|
|
1226
1470
|
* E.g. `"SPKE...GD5C.my-contract"`
|
|
1227
1471
|
*/
|
|
1228
|
-
contract:
|
|
1472
|
+
contract: v28.string(),
|
|
1229
1473
|
/**
|
|
1230
1474
|
* The name of the function to call.
|
|
1231
1475
|
*
|
|
1232
1476
|
* Note: spec changes ongoing,
|
|
1233
1477
|
* https://github.com/stacksgov/sips/pull/166#pullrequestreview-1914236999
|
|
1234
1478
|
*/
|
|
1235
|
-
functionName:
|
|
1479
|
+
functionName: v28.string(),
|
|
1236
1480
|
/**
|
|
1237
1481
|
* @deprecated in favor of `functionArgs` for @stacks/connect compatibility
|
|
1238
1482
|
*/
|
|
1239
|
-
arguments:
|
|
1483
|
+
arguments: v28.optional(v28.array(v28.string())),
|
|
1240
1484
|
/**
|
|
1241
1485
|
* The function's arguments. The arguments are expected to be hex-encoded
|
|
1242
1486
|
* strings of Clarity values.
|
|
@@ -1251,274 +1495,274 @@ var stxCallContractParamsSchema = v16.object({
|
|
|
1251
1495
|
* const hexArgs = functionArgs.map(cvToHex);
|
|
1252
1496
|
* ```
|
|
1253
1497
|
*/
|
|
1254
|
-
functionArgs:
|
|
1498
|
+
functionArgs: v28.optional(v28.array(v28.string())),
|
|
1255
1499
|
/**
|
|
1256
1500
|
* The post conditions to apply to the contract call.
|
|
1257
1501
|
*/
|
|
1258
|
-
postConditions:
|
|
1502
|
+
postConditions: v28.optional(v28.array(v28.string())),
|
|
1259
1503
|
/**
|
|
1260
1504
|
* The mode to apply to the post conditions.
|
|
1261
1505
|
*/
|
|
1262
|
-
postConditionMode:
|
|
1506
|
+
postConditionMode: v28.optional(v28.union([v28.literal("allow"), v28.literal("deny")]))
|
|
1263
1507
|
});
|
|
1264
|
-
var stxCallContractResultSchema =
|
|
1508
|
+
var stxCallContractResultSchema = v28.object({
|
|
1265
1509
|
/**
|
|
1266
1510
|
* The ID of the transaction.
|
|
1267
1511
|
*/
|
|
1268
|
-
txid:
|
|
1512
|
+
txid: v28.string(),
|
|
1269
1513
|
/**
|
|
1270
1514
|
* A Stacks transaction as a hex-encoded string.
|
|
1271
1515
|
*/
|
|
1272
|
-
transaction:
|
|
1516
|
+
transaction: v28.string()
|
|
1273
1517
|
});
|
|
1274
|
-
var stxCallContractRequestMessageSchema =
|
|
1518
|
+
var stxCallContractRequestMessageSchema = v28.object({
|
|
1275
1519
|
...rpcRequestMessageSchema.entries,
|
|
1276
|
-
...
|
|
1277
|
-
method:
|
|
1520
|
+
...v28.object({
|
|
1521
|
+
method: v28.literal(stxCallContractMethodName),
|
|
1278
1522
|
params: stxCallContractParamsSchema,
|
|
1279
|
-
id:
|
|
1523
|
+
id: v28.string()
|
|
1280
1524
|
}).entries
|
|
1281
1525
|
});
|
|
1282
1526
|
|
|
1283
1527
|
// src/request/types/stxMethods/deployContract.ts
|
|
1284
|
-
var
|
|
1528
|
+
var v29 = __toESM(require("valibot"));
|
|
1285
1529
|
var stxDeployContractMethodName = "stx_deployContract";
|
|
1286
|
-
var stxDeployContractParamsSchema =
|
|
1530
|
+
var stxDeployContractParamsSchema = v29.object({
|
|
1287
1531
|
/**
|
|
1288
1532
|
* Name of the contract.
|
|
1289
1533
|
*/
|
|
1290
|
-
name:
|
|
1534
|
+
name: v29.string(),
|
|
1291
1535
|
/**
|
|
1292
1536
|
* The source code of the Clarity contract.
|
|
1293
1537
|
*/
|
|
1294
|
-
clarityCode:
|
|
1538
|
+
clarityCode: v29.string(),
|
|
1295
1539
|
/**
|
|
1296
1540
|
* The version of the Clarity contract.
|
|
1297
1541
|
*/
|
|
1298
|
-
clarityVersion:
|
|
1542
|
+
clarityVersion: v29.optional(v29.number()),
|
|
1299
1543
|
/**
|
|
1300
1544
|
* The post conditions to apply to the contract call.
|
|
1301
1545
|
*/
|
|
1302
|
-
postConditions:
|
|
1546
|
+
postConditions: v29.optional(v29.array(v29.string())),
|
|
1303
1547
|
/**
|
|
1304
1548
|
* The mode to apply to the post conditions.
|
|
1305
1549
|
*/
|
|
1306
|
-
postConditionMode:
|
|
1550
|
+
postConditionMode: v29.optional(v29.union([v29.literal("allow"), v29.literal("deny")]))
|
|
1307
1551
|
});
|
|
1308
|
-
var stxDeployContractResultSchema =
|
|
1552
|
+
var stxDeployContractResultSchema = v29.object({
|
|
1309
1553
|
/**
|
|
1310
1554
|
* The ID of the transaction.
|
|
1311
1555
|
*/
|
|
1312
|
-
txid:
|
|
1556
|
+
txid: v29.string(),
|
|
1313
1557
|
/**
|
|
1314
1558
|
* A Stacks transaction as a hex-encoded string.
|
|
1315
1559
|
*/
|
|
1316
|
-
transaction:
|
|
1560
|
+
transaction: v29.string()
|
|
1317
1561
|
});
|
|
1318
|
-
var stxDeployContractRequestMessageSchema =
|
|
1562
|
+
var stxDeployContractRequestMessageSchema = v29.object({
|
|
1319
1563
|
...rpcRequestMessageSchema.entries,
|
|
1320
|
-
...
|
|
1321
|
-
method:
|
|
1564
|
+
...v29.object({
|
|
1565
|
+
method: v29.literal(stxDeployContractMethodName),
|
|
1322
1566
|
params: stxDeployContractParamsSchema,
|
|
1323
|
-
id:
|
|
1567
|
+
id: v29.string()
|
|
1324
1568
|
}).entries
|
|
1325
1569
|
});
|
|
1326
1570
|
|
|
1327
1571
|
// src/request/types/stxMethods/getAccounts.ts
|
|
1328
|
-
var
|
|
1572
|
+
var v30 = __toESM(require("valibot"));
|
|
1329
1573
|
var stxGetAccountsMethodName = "stx_getAccounts";
|
|
1330
|
-
var stxGetAccountsParamsSchema =
|
|
1331
|
-
var stxGetAccountsResultSchema =
|
|
1574
|
+
var stxGetAccountsParamsSchema = v30.nullish(v30.null());
|
|
1575
|
+
var stxGetAccountsResultSchema = v30.object({
|
|
1332
1576
|
/**
|
|
1333
1577
|
* The addresses generated for the given purposes.
|
|
1334
1578
|
*/
|
|
1335
|
-
addresses:
|
|
1336
|
-
|
|
1337
|
-
address:
|
|
1338
|
-
publicKey:
|
|
1339
|
-
gaiaHubUrl:
|
|
1340
|
-
gaiaAppKey:
|
|
1579
|
+
addresses: v30.array(
|
|
1580
|
+
v30.object({
|
|
1581
|
+
address: v30.string(),
|
|
1582
|
+
publicKey: v30.string(),
|
|
1583
|
+
gaiaHubUrl: v30.string(),
|
|
1584
|
+
gaiaAppKey: v30.string()
|
|
1341
1585
|
})
|
|
1342
1586
|
),
|
|
1343
1587
|
network: getNetworkResultSchema
|
|
1344
1588
|
});
|
|
1345
|
-
var stxGetAccountsRequestMessageSchema =
|
|
1589
|
+
var stxGetAccountsRequestMessageSchema = v30.object({
|
|
1346
1590
|
...rpcRequestMessageSchema.entries,
|
|
1347
|
-
...
|
|
1348
|
-
method:
|
|
1591
|
+
...v30.object({
|
|
1592
|
+
method: v30.literal(stxGetAccountsMethodName),
|
|
1349
1593
|
params: stxGetAccountsParamsSchema,
|
|
1350
|
-
id:
|
|
1594
|
+
id: v30.string()
|
|
1351
1595
|
}).entries
|
|
1352
1596
|
});
|
|
1353
1597
|
|
|
1354
1598
|
// src/request/types/stxMethods/getAddresses.ts
|
|
1355
|
-
var
|
|
1599
|
+
var v31 = __toESM(require("valibot"));
|
|
1356
1600
|
var stxGetAddressesMethodName = "stx_getAddresses";
|
|
1357
|
-
var stxGetAddressesParamsSchema =
|
|
1358
|
-
|
|
1601
|
+
var stxGetAddressesParamsSchema = v31.nullish(
|
|
1602
|
+
v31.object({
|
|
1359
1603
|
/**
|
|
1360
1604
|
* A message to be displayed to the user in the request prompt.
|
|
1361
1605
|
*/
|
|
1362
|
-
message:
|
|
1606
|
+
message: v31.optional(v31.string())
|
|
1363
1607
|
})
|
|
1364
1608
|
);
|
|
1365
|
-
var stxGetAddressesResultSchema =
|
|
1609
|
+
var stxGetAddressesResultSchema = v31.object({
|
|
1366
1610
|
/**
|
|
1367
1611
|
* The addresses generated for the given purposes.
|
|
1368
1612
|
*/
|
|
1369
|
-
addresses:
|
|
1613
|
+
addresses: v31.array(addressSchema),
|
|
1370
1614
|
network: getNetworkResultSchema
|
|
1371
1615
|
});
|
|
1372
|
-
var stxGetAddressesRequestMessageSchema =
|
|
1616
|
+
var stxGetAddressesRequestMessageSchema = v31.object({
|
|
1373
1617
|
...rpcRequestMessageSchema.entries,
|
|
1374
|
-
...
|
|
1375
|
-
method:
|
|
1618
|
+
...v31.object({
|
|
1619
|
+
method: v31.literal(stxGetAddressesMethodName),
|
|
1376
1620
|
params: stxGetAddressesParamsSchema,
|
|
1377
|
-
id:
|
|
1621
|
+
id: v31.string()
|
|
1378
1622
|
}).entries
|
|
1379
1623
|
});
|
|
1380
1624
|
|
|
1381
1625
|
// src/request/types/stxMethods/signMessage.ts
|
|
1382
|
-
var
|
|
1626
|
+
var v32 = __toESM(require("valibot"));
|
|
1383
1627
|
var stxSignMessageMethodName = "stx_signMessage";
|
|
1384
|
-
var stxSignMessageParamsSchema =
|
|
1628
|
+
var stxSignMessageParamsSchema = v32.object({
|
|
1385
1629
|
/**
|
|
1386
1630
|
* The message to sign.
|
|
1387
1631
|
*/
|
|
1388
|
-
message:
|
|
1632
|
+
message: v32.string()
|
|
1389
1633
|
});
|
|
1390
|
-
var stxSignMessageResultSchema =
|
|
1634
|
+
var stxSignMessageResultSchema = v32.object({
|
|
1391
1635
|
/**
|
|
1392
1636
|
* The signature of the message.
|
|
1393
1637
|
*/
|
|
1394
|
-
signature:
|
|
1638
|
+
signature: v32.string(),
|
|
1395
1639
|
/**
|
|
1396
1640
|
* The public key used to sign the message.
|
|
1397
1641
|
*/
|
|
1398
|
-
publicKey:
|
|
1642
|
+
publicKey: v32.string()
|
|
1399
1643
|
});
|
|
1400
|
-
var stxSignMessageRequestMessageSchema =
|
|
1644
|
+
var stxSignMessageRequestMessageSchema = v32.object({
|
|
1401
1645
|
...rpcRequestMessageSchema.entries,
|
|
1402
|
-
...
|
|
1403
|
-
method:
|
|
1646
|
+
...v32.object({
|
|
1647
|
+
method: v32.literal(stxSignMessageMethodName),
|
|
1404
1648
|
params: stxSignMessageParamsSchema,
|
|
1405
|
-
id:
|
|
1649
|
+
id: v32.string()
|
|
1406
1650
|
}).entries
|
|
1407
1651
|
});
|
|
1408
1652
|
|
|
1409
1653
|
// src/request/types/stxMethods/signStructuredMessage.ts
|
|
1410
|
-
var
|
|
1654
|
+
var v33 = __toESM(require("valibot"));
|
|
1411
1655
|
var stxSignStructuredMessageMethodName = "stx_signStructuredMessage";
|
|
1412
|
-
var stxSignStructuredMessageParamsSchema =
|
|
1656
|
+
var stxSignStructuredMessageParamsSchema = v33.object({
|
|
1413
1657
|
/**
|
|
1414
1658
|
* The domain to be signed.
|
|
1415
1659
|
*/
|
|
1416
|
-
domain:
|
|
1660
|
+
domain: v33.string(),
|
|
1417
1661
|
/**
|
|
1418
1662
|
* Message payload to be signed.
|
|
1419
1663
|
*/
|
|
1420
|
-
message:
|
|
1664
|
+
message: v33.string(),
|
|
1421
1665
|
/**
|
|
1422
1666
|
* The public key to sign the message with.
|
|
1423
1667
|
*/
|
|
1424
|
-
publicKey:
|
|
1668
|
+
publicKey: v33.optional(v33.string())
|
|
1425
1669
|
});
|
|
1426
|
-
var stxSignStructuredMessageResultSchema =
|
|
1670
|
+
var stxSignStructuredMessageResultSchema = v33.object({
|
|
1427
1671
|
/**
|
|
1428
1672
|
* Signature of the message.
|
|
1429
1673
|
*/
|
|
1430
|
-
signature:
|
|
1674
|
+
signature: v33.string(),
|
|
1431
1675
|
/**
|
|
1432
1676
|
* Public key as hex-encoded string.
|
|
1433
1677
|
*/
|
|
1434
|
-
publicKey:
|
|
1678
|
+
publicKey: v33.string()
|
|
1435
1679
|
});
|
|
1436
|
-
var stxSignStructuredMessageRequestMessageSchema =
|
|
1680
|
+
var stxSignStructuredMessageRequestMessageSchema = v33.object({
|
|
1437
1681
|
...rpcRequestMessageSchema.entries,
|
|
1438
|
-
...
|
|
1439
|
-
method:
|
|
1682
|
+
...v33.object({
|
|
1683
|
+
method: v33.literal(stxSignStructuredMessageMethodName),
|
|
1440
1684
|
params: stxSignStructuredMessageParamsSchema,
|
|
1441
|
-
id:
|
|
1685
|
+
id: v33.string()
|
|
1442
1686
|
}).entries
|
|
1443
1687
|
});
|
|
1444
1688
|
|
|
1445
1689
|
// src/request/types/stxMethods/signTransaction.ts
|
|
1446
|
-
var
|
|
1690
|
+
var v34 = __toESM(require("valibot"));
|
|
1447
1691
|
var stxSignTransactionMethodName = "stx_signTransaction";
|
|
1448
|
-
var stxSignTransactionParamsSchema =
|
|
1692
|
+
var stxSignTransactionParamsSchema = v34.object({
|
|
1449
1693
|
/**
|
|
1450
1694
|
* The transaction to sign as a hex-encoded string.
|
|
1451
1695
|
*/
|
|
1452
|
-
transaction:
|
|
1696
|
+
transaction: v34.string(),
|
|
1453
1697
|
/**
|
|
1454
1698
|
* The public key to sign the transaction with. The wallet may use any key
|
|
1455
1699
|
* when not provided.
|
|
1456
1700
|
*/
|
|
1457
|
-
pubkey:
|
|
1701
|
+
pubkey: v34.optional(v34.string()),
|
|
1458
1702
|
/**
|
|
1459
1703
|
* Whether to broadcast the transaction after signing. Defaults to `true`.
|
|
1460
1704
|
*/
|
|
1461
|
-
broadcast:
|
|
1705
|
+
broadcast: v34.optional(v34.boolean())
|
|
1462
1706
|
});
|
|
1463
|
-
var stxSignTransactionResultSchema =
|
|
1707
|
+
var stxSignTransactionResultSchema = v34.object({
|
|
1464
1708
|
/**
|
|
1465
1709
|
* The signed transaction as a hex-encoded string.
|
|
1466
1710
|
*/
|
|
1467
|
-
transaction:
|
|
1711
|
+
transaction: v34.string()
|
|
1468
1712
|
});
|
|
1469
|
-
var stxSignTransactionRequestMessageSchema =
|
|
1713
|
+
var stxSignTransactionRequestMessageSchema = v34.object({
|
|
1470
1714
|
...rpcRequestMessageSchema.entries,
|
|
1471
|
-
...
|
|
1472
|
-
method:
|
|
1715
|
+
...v34.object({
|
|
1716
|
+
method: v34.literal(stxSignTransactionMethodName),
|
|
1473
1717
|
params: stxSignTransactionParamsSchema,
|
|
1474
|
-
id:
|
|
1718
|
+
id: v34.string()
|
|
1475
1719
|
}).entries
|
|
1476
1720
|
});
|
|
1477
1721
|
|
|
1478
1722
|
// src/request/types/stxMethods/signTransactions.ts
|
|
1479
|
-
var
|
|
1723
|
+
var v35 = __toESM(require("valibot"));
|
|
1480
1724
|
var stxSignTransactionsMethodName = "stx_signTransactions";
|
|
1481
|
-
var stxSignTransactionsParamsSchema =
|
|
1725
|
+
var stxSignTransactionsParamsSchema = v35.object({
|
|
1482
1726
|
/**
|
|
1483
1727
|
* The transactions to sign as hex-encoded strings.
|
|
1484
1728
|
*/
|
|
1485
|
-
transactions:
|
|
1486
|
-
|
|
1487
|
-
|
|
1488
|
-
|
|
1489
|
-
|
|
1729
|
+
transactions: v35.pipe(
|
|
1730
|
+
v35.array(
|
|
1731
|
+
v35.pipe(
|
|
1732
|
+
v35.string(),
|
|
1733
|
+
v35.check((hex) => {
|
|
1490
1734
|
return true;
|
|
1491
1735
|
}, "Invalid hex-encoded Stacks transaction.")
|
|
1492
1736
|
)
|
|
1493
1737
|
),
|
|
1494
|
-
|
|
1738
|
+
v35.minLength(1)
|
|
1495
1739
|
),
|
|
1496
1740
|
/**
|
|
1497
1741
|
* Whether the signed transactions should be broadcast after signing. Defaults
|
|
1498
1742
|
* to `true`.
|
|
1499
1743
|
*/
|
|
1500
|
-
broadcast:
|
|
1744
|
+
broadcast: v35.optional(v35.boolean())
|
|
1501
1745
|
});
|
|
1502
|
-
var stxSignTransactionsResultSchema =
|
|
1746
|
+
var stxSignTransactionsResultSchema = v35.object({
|
|
1503
1747
|
/**
|
|
1504
1748
|
* The signed transactions as hex-encoded strings, in the same order as in the
|
|
1505
1749
|
* sign request.
|
|
1506
1750
|
*/
|
|
1507
|
-
transactions:
|
|
1751
|
+
transactions: v35.array(v35.string())
|
|
1508
1752
|
});
|
|
1509
|
-
var stxSignTransactionsRequestMessageSchema =
|
|
1753
|
+
var stxSignTransactionsRequestMessageSchema = v35.object({
|
|
1510
1754
|
...rpcRequestMessageSchema.entries,
|
|
1511
|
-
...
|
|
1512
|
-
method:
|
|
1755
|
+
...v35.object({
|
|
1756
|
+
method: v35.literal(stxSignTransactionsMethodName),
|
|
1513
1757
|
params: stxSignTransactionsParamsSchema,
|
|
1514
|
-
id:
|
|
1758
|
+
id: v35.string()
|
|
1515
1759
|
}).entries
|
|
1516
1760
|
});
|
|
1517
1761
|
|
|
1518
1762
|
// src/request/types/stxMethods/transferStx.ts
|
|
1519
|
-
var
|
|
1763
|
+
var v36 = __toESM(require("valibot"));
|
|
1520
1764
|
var stxTransferStxMethodName = "stx_transferStx";
|
|
1521
|
-
var stxTransferStxParamsSchema =
|
|
1765
|
+
var stxTransferStxParamsSchema = v36.object({
|
|
1522
1766
|
/**
|
|
1523
1767
|
* Amount of STX tokens to transfer in microstacks as a string. Anything
|
|
1524
1768
|
* parseable by `BigInt` is acceptable.
|
|
@@ -1531,23 +1775,23 @@ var stxTransferStxParamsSchema = v24.object({
|
|
|
1531
1775
|
* const amount3 = '1234';
|
|
1532
1776
|
* ```
|
|
1533
1777
|
*/
|
|
1534
|
-
amount:
|
|
1778
|
+
amount: v36.union([v36.number(), v36.string()]),
|
|
1535
1779
|
/**
|
|
1536
1780
|
* The recipient's principal.
|
|
1537
1781
|
*/
|
|
1538
|
-
recipient:
|
|
1782
|
+
recipient: v36.string(),
|
|
1539
1783
|
/**
|
|
1540
1784
|
* A string representing the memo.
|
|
1541
1785
|
*/
|
|
1542
|
-
memo:
|
|
1786
|
+
memo: v36.optional(v36.string()),
|
|
1543
1787
|
/**
|
|
1544
1788
|
* Version of parameter format.
|
|
1545
1789
|
*/
|
|
1546
|
-
version:
|
|
1790
|
+
version: v36.optional(v36.string()),
|
|
1547
1791
|
/**
|
|
1548
1792
|
* The mode of the post conditions.
|
|
1549
1793
|
*/
|
|
1550
|
-
postConditionMode:
|
|
1794
|
+
postConditionMode: v36.optional(v36.number()),
|
|
1551
1795
|
/**
|
|
1552
1796
|
* A hex-encoded string representing the post conditions.
|
|
1553
1797
|
*
|
|
@@ -1560,29 +1804,29 @@ var stxTransferStxParamsSchema = v24.object({
|
|
|
1560
1804
|
* const hexPostCondition = serializePostCondition(postCondition).toString('hex');
|
|
1561
1805
|
* ```
|
|
1562
1806
|
*/
|
|
1563
|
-
postConditions:
|
|
1807
|
+
postConditions: v36.optional(v36.array(v36.string())),
|
|
1564
1808
|
/**
|
|
1565
1809
|
* The public key to sign the transaction with. The wallet may use any key
|
|
1566
1810
|
* when not provided.
|
|
1567
1811
|
*/
|
|
1568
|
-
pubkey:
|
|
1812
|
+
pubkey: v36.optional(v36.string())
|
|
1569
1813
|
});
|
|
1570
|
-
var stxTransferStxResultSchema =
|
|
1814
|
+
var stxTransferStxResultSchema = v36.object({
|
|
1571
1815
|
/**
|
|
1572
1816
|
* The ID of the transaction.
|
|
1573
1817
|
*/
|
|
1574
|
-
txid:
|
|
1818
|
+
txid: v36.string(),
|
|
1575
1819
|
/**
|
|
1576
1820
|
* A Stacks transaction as a hex-encoded string.
|
|
1577
1821
|
*/
|
|
1578
|
-
transaction:
|
|
1822
|
+
transaction: v36.string()
|
|
1579
1823
|
});
|
|
1580
|
-
var stxTransferStxRequestMessageSchema =
|
|
1824
|
+
var stxTransferStxRequestMessageSchema = v36.object({
|
|
1581
1825
|
...rpcRequestMessageSchema.entries,
|
|
1582
|
-
...
|
|
1583
|
-
method:
|
|
1826
|
+
...v36.object({
|
|
1827
|
+
method: v36.literal(stxTransferStxMethodName),
|
|
1584
1828
|
params: stxTransferStxParamsSchema,
|
|
1585
|
-
id:
|
|
1829
|
+
id: v36.string()
|
|
1586
1830
|
}).entries
|
|
1587
1831
|
});
|
|
1588
1832
|
|
|
@@ -1590,13 +1834,13 @@ var stxTransferStxRequestMessageSchema = v24.object({
|
|
|
1590
1834
|
var cache = {};
|
|
1591
1835
|
var requestInternal = async (provider, method, params) => {
|
|
1592
1836
|
const response = await provider.request(method, params);
|
|
1593
|
-
if (
|
|
1837
|
+
if (v37.is(rpcErrorResponseMessageSchema, response)) {
|
|
1594
1838
|
return {
|
|
1595
1839
|
status: "error",
|
|
1596
1840
|
error: response.error
|
|
1597
1841
|
};
|
|
1598
1842
|
}
|
|
1599
|
-
if (
|
|
1843
|
+
if (v37.is(rpcSuccessResponseMessageSchema, response)) {
|
|
1600
1844
|
return {
|
|
1601
1845
|
status: "success",
|
|
1602
1846
|
result: response.result
|
|
@@ -2785,6 +3029,26 @@ var signMultipleTransactions = async (options) => {
|
|
|
2785
3029
|
signPsbtRequestMessageSchema,
|
|
2786
3030
|
signPsbtResultSchema,
|
|
2787
3031
|
signTransaction,
|
|
3032
|
+
sparkFlashnetAddLiquidityIntentSchema,
|
|
3033
|
+
sparkFlashnetClawbackIntentSchema,
|
|
3034
|
+
sparkFlashnetConfirmInitialDepositIntentSchema,
|
|
3035
|
+
sparkFlashnetCreateConstantProductPoolIntentSchema,
|
|
3036
|
+
sparkFlashnetCreateSingleSidedPoolIntentSchema,
|
|
3037
|
+
sparkFlashnetGetJwtMethodName,
|
|
3038
|
+
sparkFlashnetGetJwtParamsSchema,
|
|
3039
|
+
sparkFlashnetGetJwtRequestMessageSchema,
|
|
3040
|
+
sparkFlashnetGetJwtResultSchema,
|
|
3041
|
+
sparkFlashnetRemoveLiquidityIntentSchema,
|
|
3042
|
+
sparkFlashnetRouteSwapIntentSchema,
|
|
3043
|
+
sparkFlashnetSignIntentMethodName,
|
|
3044
|
+
sparkFlashnetSignIntentParamsSchema,
|
|
3045
|
+
sparkFlashnetSignIntentRequestMessageSchema,
|
|
3046
|
+
sparkFlashnetSignIntentResultSchema,
|
|
3047
|
+
sparkFlashnetSignStructuredMessageMethodName,
|
|
3048
|
+
sparkFlashnetSignStructuredMessageParamsSchema,
|
|
3049
|
+
sparkFlashnetSignStructuredMessageRequestMessageSchema,
|
|
3050
|
+
sparkFlashnetSignStructuredMessageResultSchema,
|
|
3051
|
+
sparkFlashnetSwapIntentSchema,
|
|
2788
3052
|
sparkGetAddressesMethodName,
|
|
2789
3053
|
sparkGetAddressesParamsSchema,
|
|
2790
3054
|
sparkGetAddressesRequestMessageSchema,
|
|
@@ -2793,6 +3057,10 @@ var signMultipleTransactions = async (options) => {
|
|
|
2793
3057
|
sparkGetBalanceParamsSchema,
|
|
2794
3058
|
sparkGetBalanceRequestMessageSchema,
|
|
2795
3059
|
sparkGetBalanceResultSchema,
|
|
3060
|
+
sparkSignMessageMethodName,
|
|
3061
|
+
sparkSignMessageParamsSchema,
|
|
3062
|
+
sparkSignMessageRequestMessageSchema,
|
|
3063
|
+
sparkSignMessageResultSchema,
|
|
2796
3064
|
sparkTransferMethodName,
|
|
2797
3065
|
sparkTransferParamsSchema,
|
|
2798
3066
|
sparkTransferRequestMessageSchema,
|