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