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