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