@sats-connect/core 0.8.1-db15ee7 → 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.js CHANGED
@@ -180,10 +180,6 @@ __export(index_exports, {
180
180
  sparkGetBalanceParamsSchema: () => sparkGetBalanceParamsSchema,
181
181
  sparkGetBalanceRequestMessageSchema: () => sparkGetBalanceRequestMessageSchema,
182
182
  sparkGetBalanceResultSchema: () => sparkGetBalanceResultSchema,
183
- sparkSignMessageMethodName: () => sparkSignMessageMethodName,
184
- sparkSignMessageParamsSchema: () => sparkSignMessageParamsSchema,
185
- sparkSignMessageRequestMessageSchema: () => sparkSignMessageRequestMessageSchema,
186
- sparkSignMessageResultSchema: () => sparkSignMessageResultSchema,
187
183
  sparkTransferMethodName: () => sparkTransferMethodName,
188
184
  sparkTransferParamsSchema: () => sparkTransferParamsSchema,
189
185
  sparkTransferRequestMessageSchema: () => sparkTransferRequestMessageSchema,
@@ -236,6 +232,9 @@ __export(index_exports, {
236
232
  });
237
233
  module.exports = __toCommonJS(index_exports);
238
234
 
235
+ // src/request/index.ts
236
+ var v25 = __toESM(require("valibot"));
237
+
239
238
  // src/provider/types.ts
240
239
  var v4 = __toESM(require("valibot"));
241
240
 
@@ -429,8 +428,22 @@ function getSupportedWallets() {
429
428
  return wallets;
430
429
  }
431
430
 
432
- // src/request/index.ts
433
- var v26 = __toESM(require("valibot"));
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
+ };
434
447
 
435
448
  // src/request/types/btcMethods.ts
436
449
  var v6 = __toESM(require("valibot"));
@@ -1102,108 +1115,87 @@ var sparkGetBalanceRequestMessageSchema = v13.object({
1102
1115
  }).entries
1103
1116
  });
1104
1117
 
1105
- // src/request/types/sparkMethods/signMessage.ts
1106
- var v14 = __toESM(require("valibot"));
1107
- var sparkSignMessageMethodName = "spark_signMessage";
1108
- var sparkSignMessageParamsSchema = v14.object({
1109
- message: v14.string()
1110
- });
1111
- var sparkSignMessageResultSchema = v14.object({
1112
- /**
1113
- * The signature for the message in hex format
1114
- */
1115
- signature: v14.string()
1116
- });
1117
- var sparkSignMessageRequestMessageSchema = v14.object({
1118
- ...rpcRequestMessageSchema.entries,
1119
- ...v14.object({
1120
- method: v14.literal(sparkSignMessageMethodName),
1121
- params: sparkSignMessageParamsSchema,
1122
- id: v14.string()
1123
- }).entries
1124
- });
1125
-
1126
1118
  // src/request/types/sparkMethods/transfer.ts
1127
- var v15 = __toESM(require("valibot"));
1119
+ var v14 = __toESM(require("valibot"));
1128
1120
  var sparkTransferMethodName = "spark_transfer";
1129
- var sparkTransferParamsSchema = v15.object({
1121
+ var sparkTransferParamsSchema = v14.object({
1130
1122
  /**
1131
1123
  * Amount of SATS to transfer as a string or number.
1132
1124
  */
1133
- amountSats: v15.union([v15.number(), v15.string()]),
1125
+ amountSats: v14.union([v14.number(), v14.string()]),
1134
1126
  /**
1135
1127
  * The recipient's spark address.
1136
1128
  */
1137
- receiverSparkAddress: v15.string()
1129
+ receiverSparkAddress: v14.string()
1138
1130
  });
1139
- var sparkTransferResultSchema = v15.object({
1131
+ var sparkTransferResultSchema = v14.object({
1140
1132
  /**
1141
1133
  * The ID of the transaction.
1142
1134
  */
1143
- id: v15.string()
1135
+ id: v14.string()
1144
1136
  });
1145
- var sparkTransferRequestMessageSchema = v15.object({
1137
+ var sparkTransferRequestMessageSchema = v14.object({
1146
1138
  ...rpcRequestMessageSchema.entries,
1147
- ...v15.object({
1148
- method: v15.literal(sparkTransferMethodName),
1139
+ ...v14.object({
1140
+ method: v14.literal(sparkTransferMethodName),
1149
1141
  params: sparkTransferParamsSchema,
1150
- id: v15.string()
1142
+ id: v14.string()
1151
1143
  }).entries
1152
1144
  });
1153
1145
 
1154
1146
  // src/request/types/sparkMethods/transferToken.ts
1155
- var v16 = __toESM(require("valibot"));
1147
+ var v15 = __toESM(require("valibot"));
1156
1148
  var sparkTransferTokenMethodName = "spark_transferToken";
1157
- var sparkTransferTokenParamsSchema = v16.object({
1149
+ var sparkTransferTokenParamsSchema = v15.object({
1158
1150
  /**
1159
1151
  * Amount of units of the token to transfer as a string or number.
1160
1152
  */
1161
- tokenAmount: v16.union([v16.number(), v16.string()]),
1153
+ tokenAmount: v15.union([v15.number(), v15.string()]),
1162
1154
  /**
1163
1155
  * The Bech32m token identifier.
1164
1156
  */
1165
- tokenIdentifier: v16.string(),
1157
+ tokenIdentifier: v15.string(),
1166
1158
  /**
1167
1159
  * The recipient's spark address.
1168
1160
  */
1169
- receiverSparkAddress: v16.string()
1161
+ receiverSparkAddress: v15.string()
1170
1162
  });
1171
- var sparkTransferTokenResultSchema = v16.object({
1163
+ var sparkTransferTokenResultSchema = v15.object({
1172
1164
  /**
1173
1165
  * The ID of the transaction.
1174
1166
  */
1175
- id: v16.string()
1167
+ id: v15.string()
1176
1168
  });
1177
- var sparkTransferTokenRequestMessageSchema = v16.object({
1169
+ var sparkTransferTokenRequestMessageSchema = v15.object({
1178
1170
  ...rpcRequestMessageSchema.entries,
1179
- ...v16.object({
1180
- method: v16.literal(sparkTransferTokenMethodName),
1171
+ ...v15.object({
1172
+ method: v15.literal(sparkTransferTokenMethodName),
1181
1173
  params: sparkTransferTokenParamsSchema,
1182
- id: v16.string()
1174
+ id: v15.string()
1183
1175
  }).entries
1184
1176
  });
1185
1177
 
1186
1178
  // src/request/types/stxMethods/callContract.ts
1187
- var v17 = __toESM(require("valibot"));
1179
+ var v16 = __toESM(require("valibot"));
1188
1180
  var stxCallContractMethodName = "stx_callContract";
1189
- var stxCallContractParamsSchema = v17.object({
1181
+ var stxCallContractParamsSchema = v16.object({
1190
1182
  /**
1191
1183
  * The contract principal.
1192
1184
  *
1193
1185
  * E.g. `"SPKE...GD5C.my-contract"`
1194
1186
  */
1195
- contract: v17.string(),
1187
+ contract: v16.string(),
1196
1188
  /**
1197
1189
  * The name of the function to call.
1198
1190
  *
1199
1191
  * Note: spec changes ongoing,
1200
1192
  * https://github.com/stacksgov/sips/pull/166#pullrequestreview-1914236999
1201
1193
  */
1202
- functionName: v17.string(),
1194
+ functionName: v16.string(),
1203
1195
  /**
1204
1196
  * @deprecated in favor of `functionArgs` for @stacks/connect compatibility
1205
1197
  */
1206
- arguments: v17.optional(v17.array(v17.string())),
1198
+ arguments: v16.optional(v16.array(v16.string())),
1207
1199
  /**
1208
1200
  * The function's arguments. The arguments are expected to be hex-encoded
1209
1201
  * strings of Clarity values.
@@ -1218,274 +1210,274 @@ var stxCallContractParamsSchema = v17.object({
1218
1210
  * const hexArgs = functionArgs.map(cvToHex);
1219
1211
  * ```
1220
1212
  */
1221
- functionArgs: v17.optional(v17.array(v17.string())),
1213
+ functionArgs: v16.optional(v16.array(v16.string())),
1222
1214
  /**
1223
1215
  * The post conditions to apply to the contract call.
1224
1216
  */
1225
- postConditions: v17.optional(v17.array(v17.string())),
1217
+ postConditions: v16.optional(v16.array(v16.string())),
1226
1218
  /**
1227
1219
  * The mode to apply to the post conditions.
1228
1220
  */
1229
- postConditionMode: v17.optional(v17.union([v17.literal("allow"), v17.literal("deny")]))
1221
+ postConditionMode: v16.optional(v16.union([v16.literal("allow"), v16.literal("deny")]))
1230
1222
  });
1231
- var stxCallContractResultSchema = v17.object({
1223
+ var stxCallContractResultSchema = v16.object({
1232
1224
  /**
1233
1225
  * The ID of the transaction.
1234
1226
  */
1235
- txid: v17.string(),
1227
+ txid: v16.string(),
1236
1228
  /**
1237
1229
  * A Stacks transaction as a hex-encoded string.
1238
1230
  */
1239
- transaction: v17.string()
1231
+ transaction: v16.string()
1240
1232
  });
1241
- var stxCallContractRequestMessageSchema = v17.object({
1233
+ var stxCallContractRequestMessageSchema = v16.object({
1242
1234
  ...rpcRequestMessageSchema.entries,
1243
- ...v17.object({
1244
- method: v17.literal(stxCallContractMethodName),
1235
+ ...v16.object({
1236
+ method: v16.literal(stxCallContractMethodName),
1245
1237
  params: stxCallContractParamsSchema,
1246
- id: v17.string()
1238
+ id: v16.string()
1247
1239
  }).entries
1248
1240
  });
1249
1241
 
1250
1242
  // src/request/types/stxMethods/deployContract.ts
1251
- var v18 = __toESM(require("valibot"));
1243
+ var v17 = __toESM(require("valibot"));
1252
1244
  var stxDeployContractMethodName = "stx_deployContract";
1253
- var stxDeployContractParamsSchema = v18.object({
1245
+ var stxDeployContractParamsSchema = v17.object({
1254
1246
  /**
1255
1247
  * Name of the contract.
1256
1248
  */
1257
- name: v18.string(),
1249
+ name: v17.string(),
1258
1250
  /**
1259
1251
  * The source code of the Clarity contract.
1260
1252
  */
1261
- clarityCode: v18.string(),
1253
+ clarityCode: v17.string(),
1262
1254
  /**
1263
1255
  * The version of the Clarity contract.
1264
1256
  */
1265
- clarityVersion: v18.optional(v18.number()),
1257
+ clarityVersion: v17.optional(v17.number()),
1266
1258
  /**
1267
1259
  * The post conditions to apply to the contract call.
1268
1260
  */
1269
- postConditions: v18.optional(v18.array(v18.string())),
1261
+ postConditions: v17.optional(v17.array(v17.string())),
1270
1262
  /**
1271
1263
  * The mode to apply to the post conditions.
1272
1264
  */
1273
- postConditionMode: v18.optional(v18.union([v18.literal("allow"), v18.literal("deny")]))
1265
+ postConditionMode: v17.optional(v17.union([v17.literal("allow"), v17.literal("deny")]))
1274
1266
  });
1275
- var stxDeployContractResultSchema = v18.object({
1267
+ var stxDeployContractResultSchema = v17.object({
1276
1268
  /**
1277
1269
  * The ID of the transaction.
1278
1270
  */
1279
- txid: v18.string(),
1271
+ txid: v17.string(),
1280
1272
  /**
1281
1273
  * A Stacks transaction as a hex-encoded string.
1282
1274
  */
1283
- transaction: v18.string()
1275
+ transaction: v17.string()
1284
1276
  });
1285
- var stxDeployContractRequestMessageSchema = v18.object({
1277
+ var stxDeployContractRequestMessageSchema = v17.object({
1286
1278
  ...rpcRequestMessageSchema.entries,
1287
- ...v18.object({
1288
- method: v18.literal(stxDeployContractMethodName),
1279
+ ...v17.object({
1280
+ method: v17.literal(stxDeployContractMethodName),
1289
1281
  params: stxDeployContractParamsSchema,
1290
- id: v18.string()
1282
+ id: v17.string()
1291
1283
  }).entries
1292
1284
  });
1293
1285
 
1294
1286
  // src/request/types/stxMethods/getAccounts.ts
1295
- var v19 = __toESM(require("valibot"));
1287
+ var v18 = __toESM(require("valibot"));
1296
1288
  var stxGetAccountsMethodName = "stx_getAccounts";
1297
- var stxGetAccountsParamsSchema = v19.nullish(v19.null());
1298
- var stxGetAccountsResultSchema = v19.object({
1289
+ var stxGetAccountsParamsSchema = v18.nullish(v18.null());
1290
+ var stxGetAccountsResultSchema = v18.object({
1299
1291
  /**
1300
1292
  * The addresses generated for the given purposes.
1301
1293
  */
1302
- addresses: v19.array(
1303
- v19.object({
1304
- address: v19.string(),
1305
- publicKey: v19.string(),
1306
- gaiaHubUrl: v19.string(),
1307
- gaiaAppKey: v19.string()
1294
+ addresses: v18.array(
1295
+ v18.object({
1296
+ address: v18.string(),
1297
+ publicKey: v18.string(),
1298
+ gaiaHubUrl: v18.string(),
1299
+ gaiaAppKey: v18.string()
1308
1300
  })
1309
1301
  ),
1310
1302
  network: getNetworkResultSchema
1311
1303
  });
1312
- var stxGetAccountsRequestMessageSchema = v19.object({
1304
+ var stxGetAccountsRequestMessageSchema = v18.object({
1313
1305
  ...rpcRequestMessageSchema.entries,
1314
- ...v19.object({
1315
- method: v19.literal(stxGetAccountsMethodName),
1306
+ ...v18.object({
1307
+ method: v18.literal(stxGetAccountsMethodName),
1316
1308
  params: stxGetAccountsParamsSchema,
1317
- id: v19.string()
1309
+ id: v18.string()
1318
1310
  }).entries
1319
1311
  });
1320
1312
 
1321
1313
  // src/request/types/stxMethods/getAddresses.ts
1322
- var v20 = __toESM(require("valibot"));
1314
+ var v19 = __toESM(require("valibot"));
1323
1315
  var stxGetAddressesMethodName = "stx_getAddresses";
1324
- var stxGetAddressesParamsSchema = v20.nullish(
1325
- v20.object({
1316
+ var stxGetAddressesParamsSchema = v19.nullish(
1317
+ v19.object({
1326
1318
  /**
1327
1319
  * A message to be displayed to the user in the request prompt.
1328
1320
  */
1329
- message: v20.optional(v20.string())
1321
+ message: v19.optional(v19.string())
1330
1322
  })
1331
1323
  );
1332
- var stxGetAddressesResultSchema = v20.object({
1324
+ var stxGetAddressesResultSchema = v19.object({
1333
1325
  /**
1334
1326
  * The addresses generated for the given purposes.
1335
1327
  */
1336
- addresses: v20.array(addressSchema),
1328
+ addresses: v19.array(addressSchema),
1337
1329
  network: getNetworkResultSchema
1338
1330
  });
1339
- var stxGetAddressesRequestMessageSchema = v20.object({
1331
+ var stxGetAddressesRequestMessageSchema = v19.object({
1340
1332
  ...rpcRequestMessageSchema.entries,
1341
- ...v20.object({
1342
- method: v20.literal(stxGetAddressesMethodName),
1333
+ ...v19.object({
1334
+ method: v19.literal(stxGetAddressesMethodName),
1343
1335
  params: stxGetAddressesParamsSchema,
1344
- id: v20.string()
1336
+ id: v19.string()
1345
1337
  }).entries
1346
1338
  });
1347
1339
 
1348
1340
  // src/request/types/stxMethods/signMessage.ts
1349
- var v21 = __toESM(require("valibot"));
1341
+ var v20 = __toESM(require("valibot"));
1350
1342
  var stxSignMessageMethodName = "stx_signMessage";
1351
- var stxSignMessageParamsSchema = v21.object({
1343
+ var stxSignMessageParamsSchema = v20.object({
1352
1344
  /**
1353
1345
  * The message to sign.
1354
1346
  */
1355
- message: v21.string()
1347
+ message: v20.string()
1356
1348
  });
1357
- var stxSignMessageResultSchema = v21.object({
1349
+ var stxSignMessageResultSchema = v20.object({
1358
1350
  /**
1359
1351
  * The signature of the message.
1360
1352
  */
1361
- signature: v21.string(),
1353
+ signature: v20.string(),
1362
1354
  /**
1363
1355
  * The public key used to sign the message.
1364
1356
  */
1365
- publicKey: v21.string()
1357
+ publicKey: v20.string()
1366
1358
  });
1367
- var stxSignMessageRequestMessageSchema = v21.object({
1359
+ var stxSignMessageRequestMessageSchema = v20.object({
1368
1360
  ...rpcRequestMessageSchema.entries,
1369
- ...v21.object({
1370
- method: v21.literal(stxSignMessageMethodName),
1361
+ ...v20.object({
1362
+ method: v20.literal(stxSignMessageMethodName),
1371
1363
  params: stxSignMessageParamsSchema,
1372
- id: v21.string()
1364
+ id: v20.string()
1373
1365
  }).entries
1374
1366
  });
1375
1367
 
1376
1368
  // src/request/types/stxMethods/signStructuredMessage.ts
1377
- var v22 = __toESM(require("valibot"));
1369
+ var v21 = __toESM(require("valibot"));
1378
1370
  var stxSignStructuredMessageMethodName = "stx_signStructuredMessage";
1379
- var stxSignStructuredMessageParamsSchema = v22.object({
1371
+ var stxSignStructuredMessageParamsSchema = v21.object({
1380
1372
  /**
1381
1373
  * The domain to be signed.
1382
1374
  */
1383
- domain: v22.string(),
1375
+ domain: v21.string(),
1384
1376
  /**
1385
1377
  * Message payload to be signed.
1386
1378
  */
1387
- message: v22.string(),
1379
+ message: v21.string(),
1388
1380
  /**
1389
1381
  * The public key to sign the message with.
1390
1382
  */
1391
- publicKey: v22.optional(v22.string())
1383
+ publicKey: v21.optional(v21.string())
1392
1384
  });
1393
- var stxSignStructuredMessageResultSchema = v22.object({
1385
+ var stxSignStructuredMessageResultSchema = v21.object({
1394
1386
  /**
1395
1387
  * Signature of the message.
1396
1388
  */
1397
- signature: v22.string(),
1389
+ signature: v21.string(),
1398
1390
  /**
1399
1391
  * Public key as hex-encoded string.
1400
1392
  */
1401
- publicKey: v22.string()
1393
+ publicKey: v21.string()
1402
1394
  });
1403
- var stxSignStructuredMessageRequestMessageSchema = v22.object({
1395
+ var stxSignStructuredMessageRequestMessageSchema = v21.object({
1404
1396
  ...rpcRequestMessageSchema.entries,
1405
- ...v22.object({
1406
- method: v22.literal(stxSignStructuredMessageMethodName),
1397
+ ...v21.object({
1398
+ method: v21.literal(stxSignStructuredMessageMethodName),
1407
1399
  params: stxSignStructuredMessageParamsSchema,
1408
- id: v22.string()
1400
+ id: v21.string()
1409
1401
  }).entries
1410
1402
  });
1411
1403
 
1412
1404
  // src/request/types/stxMethods/signTransaction.ts
1413
- var v23 = __toESM(require("valibot"));
1405
+ var v22 = __toESM(require("valibot"));
1414
1406
  var stxSignTransactionMethodName = "stx_signTransaction";
1415
- var stxSignTransactionParamsSchema = v23.object({
1407
+ var stxSignTransactionParamsSchema = v22.object({
1416
1408
  /**
1417
1409
  * The transaction to sign as a hex-encoded string.
1418
1410
  */
1419
- transaction: v23.string(),
1411
+ transaction: v22.string(),
1420
1412
  /**
1421
1413
  * The public key to sign the transaction with. The wallet may use any key
1422
1414
  * when not provided.
1423
1415
  */
1424
- pubkey: v23.optional(v23.string()),
1416
+ pubkey: v22.optional(v22.string()),
1425
1417
  /**
1426
1418
  * Whether to broadcast the transaction after signing. Defaults to `true`.
1427
1419
  */
1428
- broadcast: v23.optional(v23.boolean())
1420
+ broadcast: v22.optional(v22.boolean())
1429
1421
  });
1430
- var stxSignTransactionResultSchema = v23.object({
1422
+ var stxSignTransactionResultSchema = v22.object({
1431
1423
  /**
1432
1424
  * The signed transaction as a hex-encoded string.
1433
1425
  */
1434
- transaction: v23.string()
1426
+ transaction: v22.string()
1435
1427
  });
1436
- var stxSignTransactionRequestMessageSchema = v23.object({
1428
+ var stxSignTransactionRequestMessageSchema = v22.object({
1437
1429
  ...rpcRequestMessageSchema.entries,
1438
- ...v23.object({
1439
- method: v23.literal(stxSignTransactionMethodName),
1430
+ ...v22.object({
1431
+ method: v22.literal(stxSignTransactionMethodName),
1440
1432
  params: stxSignTransactionParamsSchema,
1441
- id: v23.string()
1433
+ id: v22.string()
1442
1434
  }).entries
1443
1435
  });
1444
1436
 
1445
1437
  // src/request/types/stxMethods/signTransactions.ts
1446
- var v24 = __toESM(require("valibot"));
1438
+ var v23 = __toESM(require("valibot"));
1447
1439
  var stxSignTransactionsMethodName = "stx_signTransactions";
1448
- var stxSignTransactionsParamsSchema = v24.object({
1440
+ var stxSignTransactionsParamsSchema = v23.object({
1449
1441
  /**
1450
1442
  * The transactions to sign as hex-encoded strings.
1451
1443
  */
1452
- transactions: v24.pipe(
1453
- v24.array(
1454
- v24.pipe(
1455
- v24.string(),
1456
- v24.check((hex) => {
1444
+ transactions: v23.pipe(
1445
+ v23.array(
1446
+ v23.pipe(
1447
+ v23.string(),
1448
+ v23.check((hex) => {
1457
1449
  return true;
1458
1450
  }, "Invalid hex-encoded Stacks transaction.")
1459
1451
  )
1460
1452
  ),
1461
- v24.minLength(1)
1453
+ v23.minLength(1)
1462
1454
  ),
1463
1455
  /**
1464
1456
  * Whether the signed transactions should be broadcast after signing. Defaults
1465
1457
  * to `true`.
1466
1458
  */
1467
- broadcast: v24.optional(v24.boolean())
1459
+ broadcast: v23.optional(v23.boolean())
1468
1460
  });
1469
- var stxSignTransactionsResultSchema = v24.object({
1461
+ var stxSignTransactionsResultSchema = v23.object({
1470
1462
  /**
1471
1463
  * The signed transactions as hex-encoded strings, in the same order as in the
1472
1464
  * sign request.
1473
1465
  */
1474
- transactions: v24.array(v24.string())
1466
+ transactions: v23.array(v23.string())
1475
1467
  });
1476
- var stxSignTransactionsRequestMessageSchema = v24.object({
1468
+ var stxSignTransactionsRequestMessageSchema = v23.object({
1477
1469
  ...rpcRequestMessageSchema.entries,
1478
- ...v24.object({
1479
- method: v24.literal(stxSignTransactionsMethodName),
1470
+ ...v23.object({
1471
+ method: v23.literal(stxSignTransactionsMethodName),
1480
1472
  params: stxSignTransactionsParamsSchema,
1481
- id: v24.string()
1473
+ id: v23.string()
1482
1474
  }).entries
1483
1475
  });
1484
1476
 
1485
1477
  // src/request/types/stxMethods/transferStx.ts
1486
- var v25 = __toESM(require("valibot"));
1478
+ var v24 = __toESM(require("valibot"));
1487
1479
  var stxTransferStxMethodName = "stx_transferStx";
1488
- var stxTransferStxParamsSchema = v25.object({
1480
+ var stxTransferStxParamsSchema = v24.object({
1489
1481
  /**
1490
1482
  * Amount of STX tokens to transfer in microstacks as a string. Anything
1491
1483
  * parseable by `BigInt` is acceptable.
@@ -1498,23 +1490,23 @@ var stxTransferStxParamsSchema = v25.object({
1498
1490
  * const amount3 = '1234';
1499
1491
  * ```
1500
1492
  */
1501
- amount: v25.union([v25.number(), v25.string()]),
1493
+ amount: v24.union([v24.number(), v24.string()]),
1502
1494
  /**
1503
1495
  * The recipient's principal.
1504
1496
  */
1505
- recipient: v25.string(),
1497
+ recipient: v24.string(),
1506
1498
  /**
1507
1499
  * A string representing the memo.
1508
1500
  */
1509
- memo: v25.optional(v25.string()),
1501
+ memo: v24.optional(v24.string()),
1510
1502
  /**
1511
1503
  * Version of parameter format.
1512
1504
  */
1513
- version: v25.optional(v25.string()),
1505
+ version: v24.optional(v24.string()),
1514
1506
  /**
1515
1507
  * The mode of the post conditions.
1516
1508
  */
1517
- postConditionMode: v25.optional(v25.number()),
1509
+ postConditionMode: v24.optional(v24.number()),
1518
1510
  /**
1519
1511
  * A hex-encoded string representing the post conditions.
1520
1512
  *
@@ -1527,29 +1519,29 @@ var stxTransferStxParamsSchema = v25.object({
1527
1519
  * const hexPostCondition = serializePostCondition(postCondition).toString('hex');
1528
1520
  * ```
1529
1521
  */
1530
- postConditions: v25.optional(v25.array(v25.string())),
1522
+ postConditions: v24.optional(v24.array(v24.string())),
1531
1523
  /**
1532
1524
  * The public key to sign the transaction with. The wallet may use any key
1533
1525
  * when not provided.
1534
1526
  */
1535
- pubkey: v25.optional(v25.string())
1527
+ pubkey: v24.optional(v24.string())
1536
1528
  });
1537
- var stxTransferStxResultSchema = v25.object({
1529
+ var stxTransferStxResultSchema = v24.object({
1538
1530
  /**
1539
1531
  * The ID of the transaction.
1540
1532
  */
1541
- txid: v25.string(),
1533
+ txid: v24.string(),
1542
1534
  /**
1543
1535
  * A Stacks transaction as a hex-encoded string.
1544
1536
  */
1545
- transaction: v25.string()
1537
+ transaction: v24.string()
1546
1538
  });
1547
- var stxTransferStxRequestMessageSchema = v25.object({
1539
+ var stxTransferStxRequestMessageSchema = v24.object({
1548
1540
  ...rpcRequestMessageSchema.entries,
1549
- ...v25.object({
1550
- method: v25.literal(stxTransferStxMethodName),
1541
+ ...v24.object({
1542
+ method: v24.literal(stxTransferStxMethodName),
1551
1543
  params: stxTransferStxParamsSchema,
1552
- id: v25.string()
1544
+ id: v24.string()
1553
1545
  }).entries
1554
1546
  });
1555
1547
 
@@ -1565,14 +1557,23 @@ var request = async (method, params, providerId) => {
1565
1557
  if (!method) {
1566
1558
  throw new Error("A wallet method is required");
1567
1559
  }
1568
- const response = await provider.request(method, params);
1569
- if (v26.is(rpcErrorResponseMessageSchema, response)) {
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)) {
1570
1571
  return {
1571
1572
  status: "error",
1572
1573
  error: response.error
1573
1574
  };
1574
1575
  }
1575
- if (v26.is(rpcSuccessResponseMessageSchema, response)) {
1576
+ if (v25.is(rpcSuccessResponseMessageSchema, response)) {
1576
1577
  return {
1577
1578
  status: "success",
1578
1579
  result: response.result
@@ -2735,10 +2736,6 @@ var signMultipleTransactions = async (options) => {
2735
2736
  sparkGetBalanceParamsSchema,
2736
2737
  sparkGetBalanceRequestMessageSchema,
2737
2738
  sparkGetBalanceResultSchema,
2738
- sparkSignMessageMethodName,
2739
- sparkSignMessageParamsSchema,
2740
- sparkSignMessageRequestMessageSchema,
2741
- sparkSignMessageResultSchema,
2742
2739
  sparkTransferMethodName,
2743
2740
  sparkTransferParamsSchema,
2744
2741
  sparkTransferRequestMessageSchema,