@sats-connect/core 0.8.1-d85ba2a → 0.8.1-e76eede
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 +2 -343
- package/dist/index.d.ts +2 -343
- package/dist/index.js +194 -380
- package/dist/index.mjs +194 -364
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -172,22 +172,6 @@ __export(index_exports, {
|
|
|
172
172
|
signPsbtRequestMessageSchema: () => signPsbtRequestMessageSchema,
|
|
173
173
|
signPsbtResultSchema: () => signPsbtResultSchema,
|
|
174
174
|
signTransaction: () => signTransaction,
|
|
175
|
-
sparkFlashnetAddLiquidityIntentSchema: () => sparkFlashnetAddLiquidityIntentSchema,
|
|
176
|
-
sparkFlashnetClawbackIntentSchema: () => sparkFlashnetClawbackIntentSchema,
|
|
177
|
-
sparkFlashnetConfirmInitialDepositIntentSchema: () => sparkFlashnetConfirmInitialDepositIntentSchema,
|
|
178
|
-
sparkFlashnetCreateConstantProductPoolIntentSchema: () => sparkFlashnetCreateConstantProductPoolIntentSchema,
|
|
179
|
-
sparkFlashnetCreateSingleSidedPoolIntentSchema: () => sparkFlashnetCreateSingleSidedPoolIntentSchema,
|
|
180
|
-
sparkFlashnetGetJwtMethodName: () => sparkFlashnetGetJwtMethodName,
|
|
181
|
-
sparkFlashnetGetJwtParamsSchema: () => sparkFlashnetGetJwtParamsSchema,
|
|
182
|
-
sparkFlashnetGetJwtRequestMessageSchema: () => sparkFlashnetGetJwtRequestMessageSchema,
|
|
183
|
-
sparkFlashnetGetJwtResultSchema: () => sparkFlashnetGetJwtResultSchema,
|
|
184
|
-
sparkFlashnetRemoveLiquidityIntentSchema: () => sparkFlashnetRemoveLiquidityIntentSchema,
|
|
185
|
-
sparkFlashnetRouteSwapIntentSchema: () => sparkFlashnetRouteSwapIntentSchema,
|
|
186
|
-
sparkFlashnetSignIntentMethodName: () => sparkFlashnetSignIntentMethodName,
|
|
187
|
-
sparkFlashnetSignIntentParamsSchema: () => sparkFlashnetSignIntentParamsSchema,
|
|
188
|
-
sparkFlashnetSignIntentRequestMessageSchema: () => sparkFlashnetSignIntentRequestMessageSchema,
|
|
189
|
-
sparkFlashnetSignIntentResultSchema: () => sparkFlashnetSignIntentResultSchema,
|
|
190
|
-
sparkFlashnetSwapIntentSchema: () => sparkFlashnetSwapIntentSchema,
|
|
191
175
|
sparkGetAddressesMethodName: () => sparkGetAddressesMethodName,
|
|
192
176
|
sparkGetAddressesParamsSchema: () => sparkGetAddressesParamsSchema,
|
|
193
177
|
sparkGetAddressesRequestMessageSchema: () => sparkGetAddressesRequestMessageSchema,
|
|
@@ -248,6 +232,9 @@ __export(index_exports, {
|
|
|
248
232
|
});
|
|
249
233
|
module.exports = __toCommonJS(index_exports);
|
|
250
234
|
|
|
235
|
+
// src/request/index.ts
|
|
236
|
+
var v25 = __toESM(require("valibot"));
|
|
237
|
+
|
|
251
238
|
// src/provider/types.ts
|
|
252
239
|
var v4 = __toESM(require("valibot"));
|
|
253
240
|
|
|
@@ -441,8 +428,22 @@ function getSupportedWallets() {
|
|
|
441
428
|
return wallets;
|
|
442
429
|
}
|
|
443
430
|
|
|
444
|
-
// src/request/
|
|
445
|
-
var
|
|
431
|
+
// src/request/sanitizeRequest.ts
|
|
432
|
+
var sanitizeRequest = (method, params, providerVersion) => {
|
|
433
|
+
if (method === "wallet_connect" && providerVersion < 1) {
|
|
434
|
+
const typedParams = params;
|
|
435
|
+
if (!typedParams) {
|
|
436
|
+
return { method, params };
|
|
437
|
+
}
|
|
438
|
+
const { addresses, ...rest } = typedParams;
|
|
439
|
+
const sanitizedAddresses = addresses?.filter(
|
|
440
|
+
(addr) => addr !== "spark" /* Spark */ && addr !== "starknet" /* Starknet */
|
|
441
|
+
);
|
|
442
|
+
const overrideParams = { ...rest, addresses: sanitizedAddresses };
|
|
443
|
+
return { method, params: overrideParams };
|
|
444
|
+
}
|
|
445
|
+
return { method, params };
|
|
446
|
+
};
|
|
446
447
|
|
|
447
448
|
// src/request/types/btcMethods.ts
|
|
448
449
|
var v6 = __toESM(require("valibot"));
|
|
@@ -1055,10 +1056,10 @@ var runesTransferRequestMessageSchema = v11.object({
|
|
|
1055
1056
|
}).entries
|
|
1056
1057
|
});
|
|
1057
1058
|
|
|
1058
|
-
// src/request/types/sparkMethods/
|
|
1059
|
+
// src/request/types/sparkMethods/getAddresses.ts
|
|
1059
1060
|
var v12 = __toESM(require("valibot"));
|
|
1060
|
-
var
|
|
1061
|
-
var
|
|
1061
|
+
var sparkGetAddressesMethodName = "spark_getAddresses";
|
|
1062
|
+
var sparkGetAddressesParamsSchema = v12.nullish(
|
|
1062
1063
|
v12.object({
|
|
1063
1064
|
/**
|
|
1064
1065
|
* A message to be displayed to the user in the request prompt.
|
|
@@ -1066,315 +1067,135 @@ var sparkFlashnetGetJwtParamsSchema = v12.nullish(
|
|
|
1066
1067
|
message: v12.optional(v12.string())
|
|
1067
1068
|
})
|
|
1068
1069
|
);
|
|
1069
|
-
var
|
|
1070
|
-
/**
|
|
1071
|
-
* The JWT token for authenticated requests to the Flashnet API.
|
|
1072
|
-
*/
|
|
1073
|
-
jwt: v12.string()
|
|
1074
|
-
});
|
|
1075
|
-
var sparkFlashnetGetJwtRequestMessageSchema = v12.object({
|
|
1076
|
-
...rpcRequestMessageSchema.entries,
|
|
1077
|
-
...v12.object({
|
|
1078
|
-
method: v12.literal(sparkFlashnetGetJwtMethodName),
|
|
1079
|
-
params: sparkFlashnetGetJwtParamsSchema,
|
|
1080
|
-
id: v12.string()
|
|
1081
|
-
}).entries
|
|
1082
|
-
});
|
|
1083
|
-
|
|
1084
|
-
// src/request/types/sparkMethods/flashnetMethods/intents/addLiquidity.ts
|
|
1085
|
-
var v13 = __toESM(require("valibot"));
|
|
1086
|
-
var sparkFlashnetAddLiquidityIntentSchema = v13.object({
|
|
1087
|
-
type: v13.literal("addLiquidity"),
|
|
1088
|
-
data: v13.object({
|
|
1089
|
-
userPublicKey: v13.string(),
|
|
1090
|
-
poolId: v13.string(),
|
|
1091
|
-
assetAAmount: v13.string(),
|
|
1092
|
-
assetBAmount: v13.string(),
|
|
1093
|
-
assetAMinAmountIn: v13.string(),
|
|
1094
|
-
assetBMinAmountIn: v13.string(),
|
|
1095
|
-
assetATransferId: v13.string(),
|
|
1096
|
-
assetBTransferId: v13.string(),
|
|
1097
|
-
nonce: v13.string()
|
|
1098
|
-
})
|
|
1099
|
-
});
|
|
1100
|
-
|
|
1101
|
-
// src/request/types/sparkMethods/flashnetMethods/intents/clawback.ts
|
|
1102
|
-
var v14 = __toESM(require("valibot"));
|
|
1103
|
-
var sparkFlashnetClawbackIntentSchema = v14.object({
|
|
1104
|
-
type: v14.literal("clawback"),
|
|
1105
|
-
data: v14.object({
|
|
1106
|
-
senderPublicKey: v14.string(),
|
|
1107
|
-
sparkTransferId: v14.string(),
|
|
1108
|
-
lpIdentityPublicKey: v14.string(),
|
|
1109
|
-
nonce: v14.string()
|
|
1110
|
-
})
|
|
1111
|
-
});
|
|
1112
|
-
|
|
1113
|
-
// src/request/types/sparkMethods/flashnetMethods/intents/confirmInitialDeposit.ts
|
|
1114
|
-
var v15 = __toESM(require("valibot"));
|
|
1115
|
-
var sparkFlashnetConfirmInitialDepositIntentSchema = v15.object({
|
|
1116
|
-
type: v15.literal("confirmInitialDeposit"),
|
|
1117
|
-
data: v15.object({
|
|
1118
|
-
poolId: v15.string(),
|
|
1119
|
-
assetASparkTransferId: v15.string(),
|
|
1120
|
-
poolOwnerPublicKey: v15.string(),
|
|
1121
|
-
nonce: v15.string()
|
|
1122
|
-
})
|
|
1123
|
-
});
|
|
1124
|
-
|
|
1125
|
-
// src/request/types/sparkMethods/flashnetMethods/intents/createConstantProductPool.ts
|
|
1126
|
-
var v16 = __toESM(require("valibot"));
|
|
1127
|
-
var sparkFlashnetCreateConstantProductPoolIntentSchema = v16.object({
|
|
1128
|
-
type: v16.literal("createConstantProductPool"),
|
|
1129
|
-
data: v16.object({
|
|
1130
|
-
poolOwnerPublicKey: v16.string(),
|
|
1131
|
-
assetAAddress: v16.string(),
|
|
1132
|
-
assetBAddress: v16.string(),
|
|
1133
|
-
lpFeeRateBps: v16.number(),
|
|
1134
|
-
totalHostFeeRateBps: v16.number(),
|
|
1135
|
-
nonce: v16.string()
|
|
1136
|
-
})
|
|
1137
|
-
});
|
|
1138
|
-
|
|
1139
|
-
// src/request/types/sparkMethods/flashnetMethods/intents/createSingleSidedPool.ts
|
|
1140
|
-
var v17 = __toESM(require("valibot"));
|
|
1141
|
-
var sparkFlashnetCreateSingleSidedPoolIntentSchema = v17.object({
|
|
1142
|
-
type: v17.literal("createSingleSidedPool"),
|
|
1143
|
-
data: v17.object({
|
|
1144
|
-
assetAAddress: v17.string(),
|
|
1145
|
-
assetBAddress: v17.string(),
|
|
1146
|
-
assetAInitialReserve: v17.string(),
|
|
1147
|
-
virtualReserveA: v17.union([v17.number(), v17.string()]),
|
|
1148
|
-
virtualReserveB: v17.union([v17.number(), v17.string()]),
|
|
1149
|
-
threshold: v17.union([v17.number(), v17.string()]),
|
|
1150
|
-
lpFeeRateBps: v17.number(),
|
|
1151
|
-
totalHostFeeRateBps: v17.number(),
|
|
1152
|
-
poolOwnerPublicKey: v17.string(),
|
|
1153
|
-
nonce: v17.string()
|
|
1154
|
-
})
|
|
1155
|
-
});
|
|
1156
|
-
|
|
1157
|
-
// src/request/types/sparkMethods/flashnetMethods/intents/removeLiquidity.ts
|
|
1158
|
-
var v18 = __toESM(require("valibot"));
|
|
1159
|
-
var sparkFlashnetRemoveLiquidityIntentSchema = v18.object({
|
|
1160
|
-
type: v18.literal("removeLiquidity"),
|
|
1161
|
-
data: v18.object({
|
|
1162
|
-
userPublicKey: v18.string(),
|
|
1163
|
-
poolId: v18.string(),
|
|
1164
|
-
lpTokensToRemove: v18.string(),
|
|
1165
|
-
nonce: v18.string()
|
|
1166
|
-
})
|
|
1167
|
-
});
|
|
1168
|
-
|
|
1169
|
-
// src/request/types/sparkMethods/flashnetMethods/intents/routeSwap.ts
|
|
1170
|
-
var v19 = __toESM(require("valibot"));
|
|
1171
|
-
var sparkFlashnetRouteSwapIntentSchema = v19.object({
|
|
1172
|
-
type: v19.literal("executeRouteSwap"),
|
|
1173
|
-
data: v19.object({
|
|
1174
|
-
userPublicKey: v19.string(),
|
|
1175
|
-
initialSparkTransferId: v19.string(),
|
|
1176
|
-
hops: v19.array(
|
|
1177
|
-
v19.object({
|
|
1178
|
-
poolId: v19.string(),
|
|
1179
|
-
assetInAddress: v19.string(),
|
|
1180
|
-
assetOutAddress: v19.string(),
|
|
1181
|
-
hopIntegratorFeeRateBps: v19.optional(v19.number())
|
|
1182
|
-
})
|
|
1183
|
-
),
|
|
1184
|
-
inputAmount: v19.string(),
|
|
1185
|
-
maxRouteSlippageBps: v19.number(),
|
|
1186
|
-
minAmountOut: v19.string(),
|
|
1187
|
-
defaultIntegratorFeeRateBps: v19.optional(v19.number()),
|
|
1188
|
-
nonce: v19.string()
|
|
1189
|
-
})
|
|
1190
|
-
});
|
|
1191
|
-
|
|
1192
|
-
// src/request/types/sparkMethods/flashnetMethods/intents/swap.ts
|
|
1193
|
-
var v20 = __toESM(require("valibot"));
|
|
1194
|
-
var sparkFlashnetSwapIntentSchema = v20.object({
|
|
1195
|
-
type: v20.literal("executeSwap"),
|
|
1196
|
-
data: v20.object({
|
|
1197
|
-
userPublicKey: v20.string(),
|
|
1198
|
-
poolId: v20.string(),
|
|
1199
|
-
transferId: v20.string(),
|
|
1200
|
-
assetInAddress: v20.string(),
|
|
1201
|
-
assetOutAddress: v20.string(),
|
|
1202
|
-
amountIn: v20.string(),
|
|
1203
|
-
maxSlippageBps: v20.number(),
|
|
1204
|
-
minAmountOut: v20.string(),
|
|
1205
|
-
totalIntegratorFeeRateBps: v20.optional(v20.number()),
|
|
1206
|
-
nonce: v20.string()
|
|
1207
|
-
})
|
|
1208
|
-
});
|
|
1209
|
-
|
|
1210
|
-
// src/request/types/sparkMethods/flashnetMethods/signIntent.ts
|
|
1211
|
-
var v21 = __toESM(require("valibot"));
|
|
1212
|
-
var sparkFlashnetSignIntentMethodName = "spark_flashnet_signIntent";
|
|
1213
|
-
var sparkFlashnetSignIntentParamsSchema = v21.union([
|
|
1214
|
-
sparkFlashnetSwapIntentSchema,
|
|
1215
|
-
sparkFlashnetRouteSwapIntentSchema,
|
|
1216
|
-
sparkFlashnetAddLiquidityIntentSchema,
|
|
1217
|
-
sparkFlashnetClawbackIntentSchema,
|
|
1218
|
-
sparkFlashnetConfirmInitialDepositIntentSchema,
|
|
1219
|
-
sparkFlashnetCreateConstantProductPoolIntentSchema,
|
|
1220
|
-
sparkFlashnetCreateSingleSidedPoolIntentSchema,
|
|
1221
|
-
sparkFlashnetRemoveLiquidityIntentSchema
|
|
1222
|
-
]);
|
|
1223
|
-
var sparkFlashnetSignIntentResultSchema = v21.object({
|
|
1224
|
-
/**
|
|
1225
|
-
* The signed intent as a hex string.
|
|
1226
|
-
*/
|
|
1227
|
-
signature: v21.string()
|
|
1228
|
-
});
|
|
1229
|
-
var sparkFlashnetSignIntentRequestMessageSchema = v21.object({
|
|
1230
|
-
...rpcRequestMessageSchema.entries,
|
|
1231
|
-
...v21.object({
|
|
1232
|
-
method: v21.literal(sparkFlashnetSignIntentMethodName),
|
|
1233
|
-
params: sparkFlashnetSignIntentParamsSchema,
|
|
1234
|
-
id: v21.string()
|
|
1235
|
-
}).entries
|
|
1236
|
-
});
|
|
1237
|
-
|
|
1238
|
-
// src/request/types/sparkMethods/getAddresses.ts
|
|
1239
|
-
var v22 = __toESM(require("valibot"));
|
|
1240
|
-
var sparkGetAddressesMethodName = "spark_getAddresses";
|
|
1241
|
-
var sparkGetAddressesParamsSchema = v22.nullish(
|
|
1242
|
-
v22.object({
|
|
1243
|
-
/**
|
|
1244
|
-
* A message to be displayed to the user in the request prompt.
|
|
1245
|
-
*/
|
|
1246
|
-
message: v22.optional(v22.string())
|
|
1247
|
-
})
|
|
1248
|
-
);
|
|
1249
|
-
var sparkGetAddressesResultSchema = v22.object({
|
|
1070
|
+
var sparkGetAddressesResultSchema = v12.object({
|
|
1250
1071
|
/**
|
|
1251
1072
|
* The addresses generated for the given purposes.
|
|
1252
1073
|
*/
|
|
1253
|
-
addresses:
|
|
1074
|
+
addresses: v12.array(addressSchema),
|
|
1254
1075
|
network: getNetworkResultSchema
|
|
1255
1076
|
});
|
|
1256
|
-
var sparkGetAddressesRequestMessageSchema =
|
|
1077
|
+
var sparkGetAddressesRequestMessageSchema = v12.object({
|
|
1257
1078
|
...rpcRequestMessageSchema.entries,
|
|
1258
|
-
...
|
|
1259
|
-
method:
|
|
1079
|
+
...v12.object({
|
|
1080
|
+
method: v12.literal(sparkGetAddressesMethodName),
|
|
1260
1081
|
params: sparkGetAddressesParamsSchema,
|
|
1261
|
-
id:
|
|
1082
|
+
id: v12.string()
|
|
1262
1083
|
}).entries
|
|
1263
1084
|
});
|
|
1264
1085
|
|
|
1265
1086
|
// src/request/types/sparkMethods/getBalance.ts
|
|
1266
|
-
var
|
|
1087
|
+
var v13 = __toESM(require("valibot"));
|
|
1267
1088
|
var sparkGetBalanceMethodName = "spark_getBalance";
|
|
1268
|
-
var sparkGetBalanceParamsSchema =
|
|
1269
|
-
var sparkGetBalanceResultSchema =
|
|
1089
|
+
var sparkGetBalanceParamsSchema = v13.nullish(v13.null());
|
|
1090
|
+
var sparkGetBalanceResultSchema = v13.object({
|
|
1270
1091
|
/**
|
|
1271
1092
|
* The Spark Bitcoin address balance in sats in string form.
|
|
1272
1093
|
*/
|
|
1273
|
-
balance:
|
|
1274
|
-
tokenBalances:
|
|
1275
|
-
|
|
1094
|
+
balance: v13.string(),
|
|
1095
|
+
tokenBalances: v13.array(
|
|
1096
|
+
v13.object({
|
|
1276
1097
|
/* The address balance of the token in string form as it can overflow a js number */
|
|
1277
|
-
balance:
|
|
1278
|
-
tokenMetadata:
|
|
1279
|
-
tokenIdentifier:
|
|
1280
|
-
tokenName:
|
|
1281
|
-
tokenTicker:
|
|
1282
|
-
decimals:
|
|
1283
|
-
maxSupply:
|
|
1098
|
+
balance: v13.string(),
|
|
1099
|
+
tokenMetadata: v13.object({
|
|
1100
|
+
tokenIdentifier: v13.string(),
|
|
1101
|
+
tokenName: v13.string(),
|
|
1102
|
+
tokenTicker: v13.string(),
|
|
1103
|
+
decimals: v13.number(),
|
|
1104
|
+
maxSupply: v13.string()
|
|
1284
1105
|
})
|
|
1285
1106
|
})
|
|
1286
1107
|
)
|
|
1287
1108
|
});
|
|
1288
|
-
var sparkGetBalanceRequestMessageSchema =
|
|
1109
|
+
var sparkGetBalanceRequestMessageSchema = v13.object({
|
|
1289
1110
|
...rpcRequestMessageSchema.entries,
|
|
1290
|
-
...
|
|
1291
|
-
method:
|
|
1111
|
+
...v13.object({
|
|
1112
|
+
method: v13.literal(sparkGetBalanceMethodName),
|
|
1292
1113
|
params: sparkGetBalanceParamsSchema,
|
|
1293
|
-
id:
|
|
1114
|
+
id: v13.string()
|
|
1294
1115
|
}).entries
|
|
1295
1116
|
});
|
|
1296
1117
|
|
|
1297
1118
|
// src/request/types/sparkMethods/transfer.ts
|
|
1298
|
-
var
|
|
1119
|
+
var v14 = __toESM(require("valibot"));
|
|
1299
1120
|
var sparkTransferMethodName = "spark_transfer";
|
|
1300
|
-
var sparkTransferParamsSchema =
|
|
1121
|
+
var sparkTransferParamsSchema = v14.object({
|
|
1301
1122
|
/**
|
|
1302
1123
|
* Amount of SATS to transfer as a string or number.
|
|
1303
1124
|
*/
|
|
1304
|
-
amountSats:
|
|
1125
|
+
amountSats: v14.union([v14.number(), v14.string()]),
|
|
1305
1126
|
/**
|
|
1306
1127
|
* The recipient's spark address.
|
|
1307
1128
|
*/
|
|
1308
|
-
receiverSparkAddress:
|
|
1129
|
+
receiverSparkAddress: v14.string()
|
|
1309
1130
|
});
|
|
1310
|
-
var sparkTransferResultSchema =
|
|
1131
|
+
var sparkTransferResultSchema = v14.object({
|
|
1311
1132
|
/**
|
|
1312
1133
|
* The ID of the transaction.
|
|
1313
1134
|
*/
|
|
1314
|
-
id:
|
|
1135
|
+
id: v14.string()
|
|
1315
1136
|
});
|
|
1316
|
-
var sparkTransferRequestMessageSchema =
|
|
1137
|
+
var sparkTransferRequestMessageSchema = v14.object({
|
|
1317
1138
|
...rpcRequestMessageSchema.entries,
|
|
1318
|
-
...
|
|
1319
|
-
method:
|
|
1139
|
+
...v14.object({
|
|
1140
|
+
method: v14.literal(sparkTransferMethodName),
|
|
1320
1141
|
params: sparkTransferParamsSchema,
|
|
1321
|
-
id:
|
|
1142
|
+
id: v14.string()
|
|
1322
1143
|
}).entries
|
|
1323
1144
|
});
|
|
1324
1145
|
|
|
1325
1146
|
// src/request/types/sparkMethods/transferToken.ts
|
|
1326
|
-
var
|
|
1147
|
+
var v15 = __toESM(require("valibot"));
|
|
1327
1148
|
var sparkTransferTokenMethodName = "spark_transferToken";
|
|
1328
|
-
var sparkTransferTokenParamsSchema =
|
|
1149
|
+
var sparkTransferTokenParamsSchema = v15.object({
|
|
1329
1150
|
/**
|
|
1330
1151
|
* Amount of units of the token to transfer as a string or number.
|
|
1331
1152
|
*/
|
|
1332
|
-
tokenAmount:
|
|
1153
|
+
tokenAmount: v15.union([v15.number(), v15.string()]),
|
|
1333
1154
|
/**
|
|
1334
1155
|
* The Bech32m token identifier.
|
|
1335
1156
|
*/
|
|
1336
|
-
tokenIdentifier:
|
|
1157
|
+
tokenIdentifier: v15.string(),
|
|
1337
1158
|
/**
|
|
1338
1159
|
* The recipient's spark address.
|
|
1339
1160
|
*/
|
|
1340
|
-
receiverSparkAddress:
|
|
1161
|
+
receiverSparkAddress: v15.string()
|
|
1341
1162
|
});
|
|
1342
|
-
var sparkTransferTokenResultSchema =
|
|
1163
|
+
var sparkTransferTokenResultSchema = v15.object({
|
|
1343
1164
|
/**
|
|
1344
1165
|
* The ID of the transaction.
|
|
1345
1166
|
*/
|
|
1346
|
-
id:
|
|
1167
|
+
id: v15.string()
|
|
1347
1168
|
});
|
|
1348
|
-
var sparkTransferTokenRequestMessageSchema =
|
|
1169
|
+
var sparkTransferTokenRequestMessageSchema = v15.object({
|
|
1349
1170
|
...rpcRequestMessageSchema.entries,
|
|
1350
|
-
...
|
|
1351
|
-
method:
|
|
1171
|
+
...v15.object({
|
|
1172
|
+
method: v15.literal(sparkTransferTokenMethodName),
|
|
1352
1173
|
params: sparkTransferTokenParamsSchema,
|
|
1353
|
-
id:
|
|
1174
|
+
id: v15.string()
|
|
1354
1175
|
}).entries
|
|
1355
1176
|
});
|
|
1356
1177
|
|
|
1357
1178
|
// src/request/types/stxMethods/callContract.ts
|
|
1358
|
-
var
|
|
1179
|
+
var v16 = __toESM(require("valibot"));
|
|
1359
1180
|
var stxCallContractMethodName = "stx_callContract";
|
|
1360
|
-
var stxCallContractParamsSchema =
|
|
1181
|
+
var stxCallContractParamsSchema = v16.object({
|
|
1361
1182
|
/**
|
|
1362
1183
|
* The contract principal.
|
|
1363
1184
|
*
|
|
1364
1185
|
* E.g. `"SPKE...GD5C.my-contract"`
|
|
1365
1186
|
*/
|
|
1366
|
-
contract:
|
|
1187
|
+
contract: v16.string(),
|
|
1367
1188
|
/**
|
|
1368
1189
|
* The name of the function to call.
|
|
1369
1190
|
*
|
|
1370
1191
|
* Note: spec changes ongoing,
|
|
1371
1192
|
* https://github.com/stacksgov/sips/pull/166#pullrequestreview-1914236999
|
|
1372
1193
|
*/
|
|
1373
|
-
functionName:
|
|
1194
|
+
functionName: v16.string(),
|
|
1374
1195
|
/**
|
|
1375
1196
|
* @deprecated in favor of `functionArgs` for @stacks/connect compatibility
|
|
1376
1197
|
*/
|
|
1377
|
-
arguments:
|
|
1198
|
+
arguments: v16.optional(v16.array(v16.string())),
|
|
1378
1199
|
/**
|
|
1379
1200
|
* The function's arguments. The arguments are expected to be hex-encoded
|
|
1380
1201
|
* strings of Clarity values.
|
|
@@ -1389,274 +1210,274 @@ var stxCallContractParamsSchema = v26.object({
|
|
|
1389
1210
|
* const hexArgs = functionArgs.map(cvToHex);
|
|
1390
1211
|
* ```
|
|
1391
1212
|
*/
|
|
1392
|
-
functionArgs:
|
|
1213
|
+
functionArgs: v16.optional(v16.array(v16.string())),
|
|
1393
1214
|
/**
|
|
1394
1215
|
* The post conditions to apply to the contract call.
|
|
1395
1216
|
*/
|
|
1396
|
-
postConditions:
|
|
1217
|
+
postConditions: v16.optional(v16.array(v16.string())),
|
|
1397
1218
|
/**
|
|
1398
1219
|
* The mode to apply to the post conditions.
|
|
1399
1220
|
*/
|
|
1400
|
-
postConditionMode:
|
|
1221
|
+
postConditionMode: v16.optional(v16.union([v16.literal("allow"), v16.literal("deny")]))
|
|
1401
1222
|
});
|
|
1402
|
-
var stxCallContractResultSchema =
|
|
1223
|
+
var stxCallContractResultSchema = v16.object({
|
|
1403
1224
|
/**
|
|
1404
1225
|
* The ID of the transaction.
|
|
1405
1226
|
*/
|
|
1406
|
-
txid:
|
|
1227
|
+
txid: v16.string(),
|
|
1407
1228
|
/**
|
|
1408
1229
|
* A Stacks transaction as a hex-encoded string.
|
|
1409
1230
|
*/
|
|
1410
|
-
transaction:
|
|
1231
|
+
transaction: v16.string()
|
|
1411
1232
|
});
|
|
1412
|
-
var stxCallContractRequestMessageSchema =
|
|
1233
|
+
var stxCallContractRequestMessageSchema = v16.object({
|
|
1413
1234
|
...rpcRequestMessageSchema.entries,
|
|
1414
|
-
...
|
|
1415
|
-
method:
|
|
1235
|
+
...v16.object({
|
|
1236
|
+
method: v16.literal(stxCallContractMethodName),
|
|
1416
1237
|
params: stxCallContractParamsSchema,
|
|
1417
|
-
id:
|
|
1238
|
+
id: v16.string()
|
|
1418
1239
|
}).entries
|
|
1419
1240
|
});
|
|
1420
1241
|
|
|
1421
1242
|
// src/request/types/stxMethods/deployContract.ts
|
|
1422
|
-
var
|
|
1243
|
+
var v17 = __toESM(require("valibot"));
|
|
1423
1244
|
var stxDeployContractMethodName = "stx_deployContract";
|
|
1424
|
-
var stxDeployContractParamsSchema =
|
|
1245
|
+
var stxDeployContractParamsSchema = v17.object({
|
|
1425
1246
|
/**
|
|
1426
1247
|
* Name of the contract.
|
|
1427
1248
|
*/
|
|
1428
|
-
name:
|
|
1249
|
+
name: v17.string(),
|
|
1429
1250
|
/**
|
|
1430
1251
|
* The source code of the Clarity contract.
|
|
1431
1252
|
*/
|
|
1432
|
-
clarityCode:
|
|
1253
|
+
clarityCode: v17.string(),
|
|
1433
1254
|
/**
|
|
1434
1255
|
* The version of the Clarity contract.
|
|
1435
1256
|
*/
|
|
1436
|
-
clarityVersion:
|
|
1257
|
+
clarityVersion: v17.optional(v17.number()),
|
|
1437
1258
|
/**
|
|
1438
1259
|
* The post conditions to apply to the contract call.
|
|
1439
1260
|
*/
|
|
1440
|
-
postConditions:
|
|
1261
|
+
postConditions: v17.optional(v17.array(v17.string())),
|
|
1441
1262
|
/**
|
|
1442
1263
|
* The mode to apply to the post conditions.
|
|
1443
1264
|
*/
|
|
1444
|
-
postConditionMode:
|
|
1265
|
+
postConditionMode: v17.optional(v17.union([v17.literal("allow"), v17.literal("deny")]))
|
|
1445
1266
|
});
|
|
1446
|
-
var stxDeployContractResultSchema =
|
|
1267
|
+
var stxDeployContractResultSchema = v17.object({
|
|
1447
1268
|
/**
|
|
1448
1269
|
* The ID of the transaction.
|
|
1449
1270
|
*/
|
|
1450
|
-
txid:
|
|
1271
|
+
txid: v17.string(),
|
|
1451
1272
|
/**
|
|
1452
1273
|
* A Stacks transaction as a hex-encoded string.
|
|
1453
1274
|
*/
|
|
1454
|
-
transaction:
|
|
1275
|
+
transaction: v17.string()
|
|
1455
1276
|
});
|
|
1456
|
-
var stxDeployContractRequestMessageSchema =
|
|
1277
|
+
var stxDeployContractRequestMessageSchema = v17.object({
|
|
1457
1278
|
...rpcRequestMessageSchema.entries,
|
|
1458
|
-
...
|
|
1459
|
-
method:
|
|
1279
|
+
...v17.object({
|
|
1280
|
+
method: v17.literal(stxDeployContractMethodName),
|
|
1460
1281
|
params: stxDeployContractParamsSchema,
|
|
1461
|
-
id:
|
|
1282
|
+
id: v17.string()
|
|
1462
1283
|
}).entries
|
|
1463
1284
|
});
|
|
1464
1285
|
|
|
1465
1286
|
// src/request/types/stxMethods/getAccounts.ts
|
|
1466
|
-
var
|
|
1287
|
+
var v18 = __toESM(require("valibot"));
|
|
1467
1288
|
var stxGetAccountsMethodName = "stx_getAccounts";
|
|
1468
|
-
var stxGetAccountsParamsSchema =
|
|
1469
|
-
var stxGetAccountsResultSchema =
|
|
1289
|
+
var stxGetAccountsParamsSchema = v18.nullish(v18.null());
|
|
1290
|
+
var stxGetAccountsResultSchema = v18.object({
|
|
1470
1291
|
/**
|
|
1471
1292
|
* The addresses generated for the given purposes.
|
|
1472
1293
|
*/
|
|
1473
|
-
addresses:
|
|
1474
|
-
|
|
1475
|
-
address:
|
|
1476
|
-
publicKey:
|
|
1477
|
-
gaiaHubUrl:
|
|
1478
|
-
gaiaAppKey:
|
|
1294
|
+
addresses: v18.array(
|
|
1295
|
+
v18.object({
|
|
1296
|
+
address: v18.string(),
|
|
1297
|
+
publicKey: v18.string(),
|
|
1298
|
+
gaiaHubUrl: v18.string(),
|
|
1299
|
+
gaiaAppKey: v18.string()
|
|
1479
1300
|
})
|
|
1480
1301
|
),
|
|
1481
1302
|
network: getNetworkResultSchema
|
|
1482
1303
|
});
|
|
1483
|
-
var stxGetAccountsRequestMessageSchema =
|
|
1304
|
+
var stxGetAccountsRequestMessageSchema = v18.object({
|
|
1484
1305
|
...rpcRequestMessageSchema.entries,
|
|
1485
|
-
...
|
|
1486
|
-
method:
|
|
1306
|
+
...v18.object({
|
|
1307
|
+
method: v18.literal(stxGetAccountsMethodName),
|
|
1487
1308
|
params: stxGetAccountsParamsSchema,
|
|
1488
|
-
id:
|
|
1309
|
+
id: v18.string()
|
|
1489
1310
|
}).entries
|
|
1490
1311
|
});
|
|
1491
1312
|
|
|
1492
1313
|
// src/request/types/stxMethods/getAddresses.ts
|
|
1493
|
-
var
|
|
1314
|
+
var v19 = __toESM(require("valibot"));
|
|
1494
1315
|
var stxGetAddressesMethodName = "stx_getAddresses";
|
|
1495
|
-
var stxGetAddressesParamsSchema =
|
|
1496
|
-
|
|
1316
|
+
var stxGetAddressesParamsSchema = v19.nullish(
|
|
1317
|
+
v19.object({
|
|
1497
1318
|
/**
|
|
1498
1319
|
* A message to be displayed to the user in the request prompt.
|
|
1499
1320
|
*/
|
|
1500
|
-
message:
|
|
1321
|
+
message: v19.optional(v19.string())
|
|
1501
1322
|
})
|
|
1502
1323
|
);
|
|
1503
|
-
var stxGetAddressesResultSchema =
|
|
1324
|
+
var stxGetAddressesResultSchema = v19.object({
|
|
1504
1325
|
/**
|
|
1505
1326
|
* The addresses generated for the given purposes.
|
|
1506
1327
|
*/
|
|
1507
|
-
addresses:
|
|
1328
|
+
addresses: v19.array(addressSchema),
|
|
1508
1329
|
network: getNetworkResultSchema
|
|
1509
1330
|
});
|
|
1510
|
-
var stxGetAddressesRequestMessageSchema =
|
|
1331
|
+
var stxGetAddressesRequestMessageSchema = v19.object({
|
|
1511
1332
|
...rpcRequestMessageSchema.entries,
|
|
1512
|
-
...
|
|
1513
|
-
method:
|
|
1333
|
+
...v19.object({
|
|
1334
|
+
method: v19.literal(stxGetAddressesMethodName),
|
|
1514
1335
|
params: stxGetAddressesParamsSchema,
|
|
1515
|
-
id:
|
|
1336
|
+
id: v19.string()
|
|
1516
1337
|
}).entries
|
|
1517
1338
|
});
|
|
1518
1339
|
|
|
1519
1340
|
// src/request/types/stxMethods/signMessage.ts
|
|
1520
|
-
var
|
|
1341
|
+
var v20 = __toESM(require("valibot"));
|
|
1521
1342
|
var stxSignMessageMethodName = "stx_signMessage";
|
|
1522
|
-
var stxSignMessageParamsSchema =
|
|
1343
|
+
var stxSignMessageParamsSchema = v20.object({
|
|
1523
1344
|
/**
|
|
1524
1345
|
* The message to sign.
|
|
1525
1346
|
*/
|
|
1526
|
-
message:
|
|
1347
|
+
message: v20.string()
|
|
1527
1348
|
});
|
|
1528
|
-
var stxSignMessageResultSchema =
|
|
1349
|
+
var stxSignMessageResultSchema = v20.object({
|
|
1529
1350
|
/**
|
|
1530
1351
|
* The signature of the message.
|
|
1531
1352
|
*/
|
|
1532
|
-
signature:
|
|
1353
|
+
signature: v20.string(),
|
|
1533
1354
|
/**
|
|
1534
1355
|
* The public key used to sign the message.
|
|
1535
1356
|
*/
|
|
1536
|
-
publicKey:
|
|
1357
|
+
publicKey: v20.string()
|
|
1537
1358
|
});
|
|
1538
|
-
var stxSignMessageRequestMessageSchema =
|
|
1359
|
+
var stxSignMessageRequestMessageSchema = v20.object({
|
|
1539
1360
|
...rpcRequestMessageSchema.entries,
|
|
1540
|
-
...
|
|
1541
|
-
method:
|
|
1361
|
+
...v20.object({
|
|
1362
|
+
method: v20.literal(stxSignMessageMethodName),
|
|
1542
1363
|
params: stxSignMessageParamsSchema,
|
|
1543
|
-
id:
|
|
1364
|
+
id: v20.string()
|
|
1544
1365
|
}).entries
|
|
1545
1366
|
});
|
|
1546
1367
|
|
|
1547
1368
|
// src/request/types/stxMethods/signStructuredMessage.ts
|
|
1548
|
-
var
|
|
1369
|
+
var v21 = __toESM(require("valibot"));
|
|
1549
1370
|
var stxSignStructuredMessageMethodName = "stx_signStructuredMessage";
|
|
1550
|
-
var stxSignStructuredMessageParamsSchema =
|
|
1371
|
+
var stxSignStructuredMessageParamsSchema = v21.object({
|
|
1551
1372
|
/**
|
|
1552
1373
|
* The domain to be signed.
|
|
1553
1374
|
*/
|
|
1554
|
-
domain:
|
|
1375
|
+
domain: v21.string(),
|
|
1555
1376
|
/**
|
|
1556
1377
|
* Message payload to be signed.
|
|
1557
1378
|
*/
|
|
1558
|
-
message:
|
|
1379
|
+
message: v21.string(),
|
|
1559
1380
|
/**
|
|
1560
1381
|
* The public key to sign the message with.
|
|
1561
1382
|
*/
|
|
1562
|
-
publicKey:
|
|
1383
|
+
publicKey: v21.optional(v21.string())
|
|
1563
1384
|
});
|
|
1564
|
-
var stxSignStructuredMessageResultSchema =
|
|
1385
|
+
var stxSignStructuredMessageResultSchema = v21.object({
|
|
1565
1386
|
/**
|
|
1566
1387
|
* Signature of the message.
|
|
1567
1388
|
*/
|
|
1568
|
-
signature:
|
|
1389
|
+
signature: v21.string(),
|
|
1569
1390
|
/**
|
|
1570
1391
|
* Public key as hex-encoded string.
|
|
1571
1392
|
*/
|
|
1572
|
-
publicKey:
|
|
1393
|
+
publicKey: v21.string()
|
|
1573
1394
|
});
|
|
1574
|
-
var stxSignStructuredMessageRequestMessageSchema =
|
|
1395
|
+
var stxSignStructuredMessageRequestMessageSchema = v21.object({
|
|
1575
1396
|
...rpcRequestMessageSchema.entries,
|
|
1576
|
-
...
|
|
1577
|
-
method:
|
|
1397
|
+
...v21.object({
|
|
1398
|
+
method: v21.literal(stxSignStructuredMessageMethodName),
|
|
1578
1399
|
params: stxSignStructuredMessageParamsSchema,
|
|
1579
|
-
id:
|
|
1400
|
+
id: v21.string()
|
|
1580
1401
|
}).entries
|
|
1581
1402
|
});
|
|
1582
1403
|
|
|
1583
1404
|
// src/request/types/stxMethods/signTransaction.ts
|
|
1584
|
-
var
|
|
1405
|
+
var v22 = __toESM(require("valibot"));
|
|
1585
1406
|
var stxSignTransactionMethodName = "stx_signTransaction";
|
|
1586
|
-
var stxSignTransactionParamsSchema =
|
|
1407
|
+
var stxSignTransactionParamsSchema = v22.object({
|
|
1587
1408
|
/**
|
|
1588
1409
|
* The transaction to sign as a hex-encoded string.
|
|
1589
1410
|
*/
|
|
1590
|
-
transaction:
|
|
1411
|
+
transaction: v22.string(),
|
|
1591
1412
|
/**
|
|
1592
1413
|
* The public key to sign the transaction with. The wallet may use any key
|
|
1593
1414
|
* when not provided.
|
|
1594
1415
|
*/
|
|
1595
|
-
pubkey:
|
|
1416
|
+
pubkey: v22.optional(v22.string()),
|
|
1596
1417
|
/**
|
|
1597
1418
|
* Whether to broadcast the transaction after signing. Defaults to `true`.
|
|
1598
1419
|
*/
|
|
1599
|
-
broadcast:
|
|
1420
|
+
broadcast: v22.optional(v22.boolean())
|
|
1600
1421
|
});
|
|
1601
|
-
var stxSignTransactionResultSchema =
|
|
1422
|
+
var stxSignTransactionResultSchema = v22.object({
|
|
1602
1423
|
/**
|
|
1603
1424
|
* The signed transaction as a hex-encoded string.
|
|
1604
1425
|
*/
|
|
1605
|
-
transaction:
|
|
1426
|
+
transaction: v22.string()
|
|
1606
1427
|
});
|
|
1607
|
-
var stxSignTransactionRequestMessageSchema =
|
|
1428
|
+
var stxSignTransactionRequestMessageSchema = v22.object({
|
|
1608
1429
|
...rpcRequestMessageSchema.entries,
|
|
1609
|
-
...
|
|
1610
|
-
method:
|
|
1430
|
+
...v22.object({
|
|
1431
|
+
method: v22.literal(stxSignTransactionMethodName),
|
|
1611
1432
|
params: stxSignTransactionParamsSchema,
|
|
1612
|
-
id:
|
|
1433
|
+
id: v22.string()
|
|
1613
1434
|
}).entries
|
|
1614
1435
|
});
|
|
1615
1436
|
|
|
1616
1437
|
// src/request/types/stxMethods/signTransactions.ts
|
|
1617
|
-
var
|
|
1438
|
+
var v23 = __toESM(require("valibot"));
|
|
1618
1439
|
var stxSignTransactionsMethodName = "stx_signTransactions";
|
|
1619
|
-
var stxSignTransactionsParamsSchema =
|
|
1440
|
+
var stxSignTransactionsParamsSchema = v23.object({
|
|
1620
1441
|
/**
|
|
1621
1442
|
* The transactions to sign as hex-encoded strings.
|
|
1622
1443
|
*/
|
|
1623
|
-
transactions:
|
|
1624
|
-
|
|
1625
|
-
|
|
1626
|
-
|
|
1627
|
-
|
|
1444
|
+
transactions: v23.pipe(
|
|
1445
|
+
v23.array(
|
|
1446
|
+
v23.pipe(
|
|
1447
|
+
v23.string(),
|
|
1448
|
+
v23.check((hex) => {
|
|
1628
1449
|
return true;
|
|
1629
1450
|
}, "Invalid hex-encoded Stacks transaction.")
|
|
1630
1451
|
)
|
|
1631
1452
|
),
|
|
1632
|
-
|
|
1453
|
+
v23.minLength(1)
|
|
1633
1454
|
),
|
|
1634
1455
|
/**
|
|
1635
1456
|
* Whether the signed transactions should be broadcast after signing. Defaults
|
|
1636
1457
|
* to `true`.
|
|
1637
1458
|
*/
|
|
1638
|
-
broadcast:
|
|
1459
|
+
broadcast: v23.optional(v23.boolean())
|
|
1639
1460
|
});
|
|
1640
|
-
var stxSignTransactionsResultSchema =
|
|
1461
|
+
var stxSignTransactionsResultSchema = v23.object({
|
|
1641
1462
|
/**
|
|
1642
1463
|
* The signed transactions as hex-encoded strings, in the same order as in the
|
|
1643
1464
|
* sign request.
|
|
1644
1465
|
*/
|
|
1645
|
-
transactions:
|
|
1466
|
+
transactions: v23.array(v23.string())
|
|
1646
1467
|
});
|
|
1647
|
-
var stxSignTransactionsRequestMessageSchema =
|
|
1468
|
+
var stxSignTransactionsRequestMessageSchema = v23.object({
|
|
1648
1469
|
...rpcRequestMessageSchema.entries,
|
|
1649
|
-
...
|
|
1650
|
-
method:
|
|
1470
|
+
...v23.object({
|
|
1471
|
+
method: v23.literal(stxSignTransactionsMethodName),
|
|
1651
1472
|
params: stxSignTransactionsParamsSchema,
|
|
1652
|
-
id:
|
|
1473
|
+
id: v23.string()
|
|
1653
1474
|
}).entries
|
|
1654
1475
|
});
|
|
1655
1476
|
|
|
1656
1477
|
// src/request/types/stxMethods/transferStx.ts
|
|
1657
|
-
var
|
|
1478
|
+
var v24 = __toESM(require("valibot"));
|
|
1658
1479
|
var stxTransferStxMethodName = "stx_transferStx";
|
|
1659
|
-
var stxTransferStxParamsSchema =
|
|
1480
|
+
var stxTransferStxParamsSchema = v24.object({
|
|
1660
1481
|
/**
|
|
1661
1482
|
* Amount of STX tokens to transfer in microstacks as a string. Anything
|
|
1662
1483
|
* parseable by `BigInt` is acceptable.
|
|
@@ -1669,23 +1490,23 @@ var stxTransferStxParamsSchema = v34.object({
|
|
|
1669
1490
|
* const amount3 = '1234';
|
|
1670
1491
|
* ```
|
|
1671
1492
|
*/
|
|
1672
|
-
amount:
|
|
1493
|
+
amount: v24.union([v24.number(), v24.string()]),
|
|
1673
1494
|
/**
|
|
1674
1495
|
* The recipient's principal.
|
|
1675
1496
|
*/
|
|
1676
|
-
recipient:
|
|
1497
|
+
recipient: v24.string(),
|
|
1677
1498
|
/**
|
|
1678
1499
|
* A string representing the memo.
|
|
1679
1500
|
*/
|
|
1680
|
-
memo:
|
|
1501
|
+
memo: v24.optional(v24.string()),
|
|
1681
1502
|
/**
|
|
1682
1503
|
* Version of parameter format.
|
|
1683
1504
|
*/
|
|
1684
|
-
version:
|
|
1505
|
+
version: v24.optional(v24.string()),
|
|
1685
1506
|
/**
|
|
1686
1507
|
* The mode of the post conditions.
|
|
1687
1508
|
*/
|
|
1688
|
-
postConditionMode:
|
|
1509
|
+
postConditionMode: v24.optional(v24.number()),
|
|
1689
1510
|
/**
|
|
1690
1511
|
* A hex-encoded string representing the post conditions.
|
|
1691
1512
|
*
|
|
@@ -1698,29 +1519,29 @@ var stxTransferStxParamsSchema = v34.object({
|
|
|
1698
1519
|
* const hexPostCondition = serializePostCondition(postCondition).toString('hex');
|
|
1699
1520
|
* ```
|
|
1700
1521
|
*/
|
|
1701
|
-
postConditions:
|
|
1522
|
+
postConditions: v24.optional(v24.array(v24.string())),
|
|
1702
1523
|
/**
|
|
1703
1524
|
* The public key to sign the transaction with. The wallet may use any key
|
|
1704
1525
|
* when not provided.
|
|
1705
1526
|
*/
|
|
1706
|
-
pubkey:
|
|
1527
|
+
pubkey: v24.optional(v24.string())
|
|
1707
1528
|
});
|
|
1708
|
-
var stxTransferStxResultSchema =
|
|
1529
|
+
var stxTransferStxResultSchema = v24.object({
|
|
1709
1530
|
/**
|
|
1710
1531
|
* The ID of the transaction.
|
|
1711
1532
|
*/
|
|
1712
|
-
txid:
|
|
1533
|
+
txid: v24.string(),
|
|
1713
1534
|
/**
|
|
1714
1535
|
* A Stacks transaction as a hex-encoded string.
|
|
1715
1536
|
*/
|
|
1716
|
-
transaction:
|
|
1537
|
+
transaction: v24.string()
|
|
1717
1538
|
});
|
|
1718
|
-
var stxTransferStxRequestMessageSchema =
|
|
1539
|
+
var stxTransferStxRequestMessageSchema = v24.object({
|
|
1719
1540
|
...rpcRequestMessageSchema.entries,
|
|
1720
|
-
...
|
|
1721
|
-
method:
|
|
1541
|
+
...v24.object({
|
|
1542
|
+
method: v24.literal(stxTransferStxMethodName),
|
|
1722
1543
|
params: stxTransferStxParamsSchema,
|
|
1723
|
-
id:
|
|
1544
|
+
id: v24.string()
|
|
1724
1545
|
}).entries
|
|
1725
1546
|
});
|
|
1726
1547
|
|
|
@@ -1736,14 +1557,23 @@ var request = async (method, params, providerId) => {
|
|
|
1736
1557
|
if (!method) {
|
|
1737
1558
|
throw new Error("A wallet method is required");
|
|
1738
1559
|
}
|
|
1739
|
-
const
|
|
1740
|
-
|
|
1560
|
+
const providerVersion = provider.version ?? 0;
|
|
1561
|
+
const {
|
|
1562
|
+
method: sanitizedMethod,
|
|
1563
|
+
params: sanitizedParams,
|
|
1564
|
+
overrideResponse
|
|
1565
|
+
} = sanitizeRequest(method, params, providerVersion);
|
|
1566
|
+
if (overrideResponse) {
|
|
1567
|
+
return overrideResponse;
|
|
1568
|
+
}
|
|
1569
|
+
const response = await provider.request(sanitizedMethod, sanitizedParams);
|
|
1570
|
+
if (v25.is(rpcErrorResponseMessageSchema, response)) {
|
|
1741
1571
|
return {
|
|
1742
1572
|
status: "error",
|
|
1743
1573
|
error: response.error
|
|
1744
1574
|
};
|
|
1745
1575
|
}
|
|
1746
|
-
if (
|
|
1576
|
+
if (v25.is(rpcSuccessResponseMessageSchema, response)) {
|
|
1747
1577
|
return {
|
|
1748
1578
|
status: "success",
|
|
1749
1579
|
result: response.result
|
|
@@ -2898,22 +2728,6 @@ var signMultipleTransactions = async (options) => {
|
|
|
2898
2728
|
signPsbtRequestMessageSchema,
|
|
2899
2729
|
signPsbtResultSchema,
|
|
2900
2730
|
signTransaction,
|
|
2901
|
-
sparkFlashnetAddLiquidityIntentSchema,
|
|
2902
|
-
sparkFlashnetClawbackIntentSchema,
|
|
2903
|
-
sparkFlashnetConfirmInitialDepositIntentSchema,
|
|
2904
|
-
sparkFlashnetCreateConstantProductPoolIntentSchema,
|
|
2905
|
-
sparkFlashnetCreateSingleSidedPoolIntentSchema,
|
|
2906
|
-
sparkFlashnetGetJwtMethodName,
|
|
2907
|
-
sparkFlashnetGetJwtParamsSchema,
|
|
2908
|
-
sparkFlashnetGetJwtRequestMessageSchema,
|
|
2909
|
-
sparkFlashnetGetJwtResultSchema,
|
|
2910
|
-
sparkFlashnetRemoveLiquidityIntentSchema,
|
|
2911
|
-
sparkFlashnetRouteSwapIntentSchema,
|
|
2912
|
-
sparkFlashnetSignIntentMethodName,
|
|
2913
|
-
sparkFlashnetSignIntentParamsSchema,
|
|
2914
|
-
sparkFlashnetSignIntentRequestMessageSchema,
|
|
2915
|
-
sparkFlashnetSignIntentResultSchema,
|
|
2916
|
-
sparkFlashnetSwapIntentSchema,
|
|
2917
2731
|
sparkGetAddressesMethodName,
|
|
2918
2732
|
sparkGetAddressesParamsSchema,
|
|
2919
2733
|
sparkGetAddressesRequestMessageSchema,
|