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