@sats-connect/core 0.8.1-c2412c4 → 0.8.1-d85ba2a

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
@@ -37,7 +37,6 @@ __export(index_exports, {
37
37
  DefaultAdaptersInfo: () => DefaultAdaptersInfo,
38
38
  MessageSigningProtocols: () => MessageSigningProtocols,
39
39
  PermissionRequestParams: () => PermissionRequestParams,
40
- ProviderPlatform: () => ProviderPlatform,
41
40
  RpcErrorCode: () => RpcErrorCode,
42
41
  RpcIdSchema: () => RpcIdSchema,
43
42
  SatsConnectAdapter: () => SatsConnectAdapter,
@@ -173,6 +172,22 @@ __export(index_exports, {
173
172
  signPsbtRequestMessageSchema: () => signPsbtRequestMessageSchema,
174
173
  signPsbtResultSchema: () => signPsbtResultSchema,
175
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,
176
191
  sparkGetAddressesMethodName: () => sparkGetAddressesMethodName,
177
192
  sparkGetAddressesParamsSchema: () => sparkGetAddressesParamsSchema,
178
193
  sparkGetAddressesRequestMessageSchema: () => sparkGetAddressesRequestMessageSchema,
@@ -233,9 +248,6 @@ __export(index_exports, {
233
248
  });
234
249
  module.exports = __toCommonJS(index_exports);
235
250
 
236
- // src/request/index.ts
237
- var v25 = __toESM(require("valibot"));
238
-
239
251
  // src/provider/types.ts
240
252
  var v4 = __toESM(require("valibot"));
241
253
 
@@ -429,53 +441,8 @@ function getSupportedWallets() {
429
441
  return wallets;
430
442
  }
431
443
 
432
- // src/request/sanitizeRequest.ts
433
- var sanitizeRequest = (method, params, providerInfo) => {
434
- try {
435
- const [major, minor, patch] = providerInfo.version.split(".").map((part) => parseInt(part, 10));
436
- const platform = providerInfo.platform;
437
- if (
438
- // platform is missing for versions < 1.5.0 on web and < 1.55.0 on mobile
439
- !platform || platform === "web" /* Web */ && major <= 1 && minor <= 4 || platform === "mobile" /* Mobile */ && major <= 1 && minor <= 54
440
- ) {
441
- const v1Sanitized = sanitizeAddressPurposeRequest(method, params);
442
- method = v1Sanitized.method;
443
- params = v1Sanitized.params;
444
- }
445
- } catch {
446
- }
447
- return { method, params };
448
- };
449
- var sanitizeAddressPurposeRequest = (method, params) => {
450
- const filterPurposes = (purposes) => purposes?.filter(
451
- (purpose) => purpose !== "spark" /* Spark */ && purpose !== "starknet" /* Starknet */
452
- );
453
- if (method === "wallet_connect") {
454
- const typedParams = params;
455
- if (!typedParams) {
456
- return { method, params };
457
- }
458
- const { addresses, ...rest } = typedParams;
459
- const overrideParams = {
460
- ...rest,
461
- addresses: filterPurposes(addresses)
462
- };
463
- return { method, params: overrideParams };
464
- }
465
- if (method === "getAccounts") {
466
- const typedParams = params;
467
- const { purposes, ...rest } = typedParams;
468
- const overrideParams = { ...rest, purposes: filterPurposes(purposes) };
469
- return { method, params: overrideParams };
470
- }
471
- if (method === "getAddresses") {
472
- const typedParams = params;
473
- const { purposes, ...rest } = typedParams;
474
- const overrideParams = { ...rest, purposes: filterPurposes(purposes) };
475
- return { method, params: overrideParams };
476
- }
477
- return { method, params };
478
- };
444
+ // src/request/index.ts
445
+ var v35 = __toESM(require("valibot"));
479
446
 
480
447
  // src/request/types/btcMethods.ts
481
448
  var v6 = __toESM(require("valibot"));
@@ -694,11 +661,6 @@ var addNetworkResultSchema = v5.object({
694
661
  });
695
662
 
696
663
  // src/request/types/btcMethods.ts
697
- var ProviderPlatform = /* @__PURE__ */ ((ProviderPlatform2) => {
698
- ProviderPlatform2["Web"] = "web";
699
- ProviderPlatform2["Mobile"] = "mobile";
700
- return ProviderPlatform2;
701
- })(ProviderPlatform || {});
702
664
  var getInfoMethodName = "getInfo";
703
665
  var getInfoParamsSchema = v6.nullish(v6.null());
704
666
  var getInfoResultSchema = v6.object({
@@ -706,10 +668,6 @@ var getInfoResultSchema = v6.object({
706
668
  * Version of the wallet.
707
669
  */
708
670
  version: v6.string(),
709
- /**
710
- * The platform the wallet is running on (web or mobile).
711
- */
712
- platform: v6.optional(v6.enum(ProviderPlatform)),
713
671
  /**
714
672
  * [WBIP](https://wbips.netlify.app/wbips/WBIP002) methods supported by the wallet.
715
673
  */
@@ -1097,10 +1055,10 @@ var runesTransferRequestMessageSchema = v11.object({
1097
1055
  }).entries
1098
1056
  });
1099
1057
 
1100
- // src/request/types/sparkMethods/getAddresses.ts
1058
+ // src/request/types/sparkMethods/flashnetMethods/getJwt.ts
1101
1059
  var v12 = __toESM(require("valibot"));
1102
- var sparkGetAddressesMethodName = "spark_getAddresses";
1103
- var sparkGetAddressesParamsSchema = v12.nullish(
1060
+ var sparkFlashnetGetJwtMethodName = "spark_flashnet_getJwt";
1061
+ var sparkFlashnetGetJwtParamsSchema = v12.nullish(
1104
1062
  v12.object({
1105
1063
  /**
1106
1064
  * A message to be displayed to the user in the request prompt.
@@ -1108,135 +1066,315 @@ var sparkGetAddressesParamsSchema = v12.nullish(
1108
1066
  message: v12.optional(v12.string())
1109
1067
  })
1110
1068
  );
1111
- var sparkGetAddressesResultSchema = v12.object({
1069
+ var sparkFlashnetGetJwtResultSchema = v12.object({
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({
1112
1250
  /**
1113
1251
  * The addresses generated for the given purposes.
1114
1252
  */
1115
- addresses: v12.array(addressSchema),
1253
+ addresses: v22.array(addressSchema),
1116
1254
  network: getNetworkResultSchema
1117
1255
  });
1118
- var sparkGetAddressesRequestMessageSchema = v12.object({
1256
+ var sparkGetAddressesRequestMessageSchema = v22.object({
1119
1257
  ...rpcRequestMessageSchema.entries,
1120
- ...v12.object({
1121
- method: v12.literal(sparkGetAddressesMethodName),
1258
+ ...v22.object({
1259
+ method: v22.literal(sparkGetAddressesMethodName),
1122
1260
  params: sparkGetAddressesParamsSchema,
1123
- id: v12.string()
1261
+ id: v22.string()
1124
1262
  }).entries
1125
1263
  });
1126
1264
 
1127
1265
  // src/request/types/sparkMethods/getBalance.ts
1128
- var v13 = __toESM(require("valibot"));
1266
+ var v23 = __toESM(require("valibot"));
1129
1267
  var sparkGetBalanceMethodName = "spark_getBalance";
1130
- var sparkGetBalanceParamsSchema = v13.nullish(v13.null());
1131
- var sparkGetBalanceResultSchema = v13.object({
1268
+ var sparkGetBalanceParamsSchema = v23.nullish(v23.null());
1269
+ var sparkGetBalanceResultSchema = v23.object({
1132
1270
  /**
1133
1271
  * The Spark Bitcoin address balance in sats in string form.
1134
1272
  */
1135
- balance: v13.string(),
1136
- tokenBalances: v13.array(
1137
- v13.object({
1273
+ balance: v23.string(),
1274
+ tokenBalances: v23.array(
1275
+ v23.object({
1138
1276
  /* The address balance of the token in string form as it can overflow a js number */
1139
- balance: v13.string(),
1140
- tokenMetadata: v13.object({
1141
- tokenIdentifier: v13.string(),
1142
- tokenName: v13.string(),
1143
- tokenTicker: v13.string(),
1144
- decimals: v13.number(),
1145
- maxSupply: v13.string()
1277
+ balance: v23.string(),
1278
+ tokenMetadata: v23.object({
1279
+ tokenIdentifier: v23.string(),
1280
+ tokenName: v23.string(),
1281
+ tokenTicker: v23.string(),
1282
+ decimals: v23.number(),
1283
+ maxSupply: v23.string()
1146
1284
  })
1147
1285
  })
1148
1286
  )
1149
1287
  });
1150
- var sparkGetBalanceRequestMessageSchema = v13.object({
1288
+ var sparkGetBalanceRequestMessageSchema = v23.object({
1151
1289
  ...rpcRequestMessageSchema.entries,
1152
- ...v13.object({
1153
- method: v13.literal(sparkGetBalanceMethodName),
1290
+ ...v23.object({
1291
+ method: v23.literal(sparkGetBalanceMethodName),
1154
1292
  params: sparkGetBalanceParamsSchema,
1155
- id: v13.string()
1293
+ id: v23.string()
1156
1294
  }).entries
1157
1295
  });
1158
1296
 
1159
1297
  // src/request/types/sparkMethods/transfer.ts
1160
- var v14 = __toESM(require("valibot"));
1298
+ var v24 = __toESM(require("valibot"));
1161
1299
  var sparkTransferMethodName = "spark_transfer";
1162
- var sparkTransferParamsSchema = v14.object({
1300
+ var sparkTransferParamsSchema = v24.object({
1163
1301
  /**
1164
1302
  * Amount of SATS to transfer as a string or number.
1165
1303
  */
1166
- amountSats: v14.union([v14.number(), v14.string()]),
1304
+ amountSats: v24.union([v24.number(), v24.string()]),
1167
1305
  /**
1168
1306
  * The recipient's spark address.
1169
1307
  */
1170
- receiverSparkAddress: v14.string()
1308
+ receiverSparkAddress: v24.string()
1171
1309
  });
1172
- var sparkTransferResultSchema = v14.object({
1310
+ var sparkTransferResultSchema = v24.object({
1173
1311
  /**
1174
1312
  * The ID of the transaction.
1175
1313
  */
1176
- id: v14.string()
1314
+ id: v24.string()
1177
1315
  });
1178
- var sparkTransferRequestMessageSchema = v14.object({
1316
+ var sparkTransferRequestMessageSchema = v24.object({
1179
1317
  ...rpcRequestMessageSchema.entries,
1180
- ...v14.object({
1181
- method: v14.literal(sparkTransferMethodName),
1318
+ ...v24.object({
1319
+ method: v24.literal(sparkTransferMethodName),
1182
1320
  params: sparkTransferParamsSchema,
1183
- id: v14.string()
1321
+ id: v24.string()
1184
1322
  }).entries
1185
1323
  });
1186
1324
 
1187
1325
  // src/request/types/sparkMethods/transferToken.ts
1188
- var v15 = __toESM(require("valibot"));
1326
+ var v25 = __toESM(require("valibot"));
1189
1327
  var sparkTransferTokenMethodName = "spark_transferToken";
1190
- var sparkTransferTokenParamsSchema = v15.object({
1328
+ var sparkTransferTokenParamsSchema = v25.object({
1191
1329
  /**
1192
1330
  * Amount of units of the token to transfer as a string or number.
1193
1331
  */
1194
- tokenAmount: v15.union([v15.number(), v15.string()]),
1332
+ tokenAmount: v25.union([v25.number(), v25.string()]),
1195
1333
  /**
1196
1334
  * The Bech32m token identifier.
1197
1335
  */
1198
- tokenIdentifier: v15.string(),
1336
+ tokenIdentifier: v25.string(),
1199
1337
  /**
1200
1338
  * The recipient's spark address.
1201
1339
  */
1202
- receiverSparkAddress: v15.string()
1340
+ receiverSparkAddress: v25.string()
1203
1341
  });
1204
- var sparkTransferTokenResultSchema = v15.object({
1342
+ var sparkTransferTokenResultSchema = v25.object({
1205
1343
  /**
1206
1344
  * The ID of the transaction.
1207
1345
  */
1208
- id: v15.string()
1346
+ id: v25.string()
1209
1347
  });
1210
- var sparkTransferTokenRequestMessageSchema = v15.object({
1348
+ var sparkTransferTokenRequestMessageSchema = v25.object({
1211
1349
  ...rpcRequestMessageSchema.entries,
1212
- ...v15.object({
1213
- method: v15.literal(sparkTransferTokenMethodName),
1350
+ ...v25.object({
1351
+ method: v25.literal(sparkTransferTokenMethodName),
1214
1352
  params: sparkTransferTokenParamsSchema,
1215
- id: v15.string()
1353
+ id: v25.string()
1216
1354
  }).entries
1217
1355
  });
1218
1356
 
1219
1357
  // src/request/types/stxMethods/callContract.ts
1220
- var v16 = __toESM(require("valibot"));
1358
+ var v26 = __toESM(require("valibot"));
1221
1359
  var stxCallContractMethodName = "stx_callContract";
1222
- var stxCallContractParamsSchema = v16.object({
1360
+ var stxCallContractParamsSchema = v26.object({
1223
1361
  /**
1224
1362
  * The contract principal.
1225
1363
  *
1226
1364
  * E.g. `"SPKE...GD5C.my-contract"`
1227
1365
  */
1228
- contract: v16.string(),
1366
+ contract: v26.string(),
1229
1367
  /**
1230
1368
  * The name of the function to call.
1231
1369
  *
1232
1370
  * Note: spec changes ongoing,
1233
1371
  * https://github.com/stacksgov/sips/pull/166#pullrequestreview-1914236999
1234
1372
  */
1235
- functionName: v16.string(),
1373
+ functionName: v26.string(),
1236
1374
  /**
1237
1375
  * @deprecated in favor of `functionArgs` for @stacks/connect compatibility
1238
1376
  */
1239
- arguments: v16.optional(v16.array(v16.string())),
1377
+ arguments: v26.optional(v26.array(v26.string())),
1240
1378
  /**
1241
1379
  * The function's arguments. The arguments are expected to be hex-encoded
1242
1380
  * strings of Clarity values.
@@ -1251,274 +1389,274 @@ var stxCallContractParamsSchema = v16.object({
1251
1389
  * const hexArgs = functionArgs.map(cvToHex);
1252
1390
  * ```
1253
1391
  */
1254
- functionArgs: v16.optional(v16.array(v16.string())),
1392
+ functionArgs: v26.optional(v26.array(v26.string())),
1255
1393
  /**
1256
1394
  * The post conditions to apply to the contract call.
1257
1395
  */
1258
- postConditions: v16.optional(v16.array(v16.string())),
1396
+ postConditions: v26.optional(v26.array(v26.string())),
1259
1397
  /**
1260
1398
  * The mode to apply to the post conditions.
1261
1399
  */
1262
- postConditionMode: v16.optional(v16.union([v16.literal("allow"), v16.literal("deny")]))
1400
+ postConditionMode: v26.optional(v26.union([v26.literal("allow"), v26.literal("deny")]))
1263
1401
  });
1264
- var stxCallContractResultSchema = v16.object({
1402
+ var stxCallContractResultSchema = v26.object({
1265
1403
  /**
1266
1404
  * The ID of the transaction.
1267
1405
  */
1268
- txid: v16.string(),
1406
+ txid: v26.string(),
1269
1407
  /**
1270
1408
  * A Stacks transaction as a hex-encoded string.
1271
1409
  */
1272
- transaction: v16.string()
1410
+ transaction: v26.string()
1273
1411
  });
1274
- var stxCallContractRequestMessageSchema = v16.object({
1412
+ var stxCallContractRequestMessageSchema = v26.object({
1275
1413
  ...rpcRequestMessageSchema.entries,
1276
- ...v16.object({
1277
- method: v16.literal(stxCallContractMethodName),
1414
+ ...v26.object({
1415
+ method: v26.literal(stxCallContractMethodName),
1278
1416
  params: stxCallContractParamsSchema,
1279
- id: v16.string()
1417
+ id: v26.string()
1280
1418
  }).entries
1281
1419
  });
1282
1420
 
1283
1421
  // src/request/types/stxMethods/deployContract.ts
1284
- var v17 = __toESM(require("valibot"));
1422
+ var v27 = __toESM(require("valibot"));
1285
1423
  var stxDeployContractMethodName = "stx_deployContract";
1286
- var stxDeployContractParamsSchema = v17.object({
1424
+ var stxDeployContractParamsSchema = v27.object({
1287
1425
  /**
1288
1426
  * Name of the contract.
1289
1427
  */
1290
- name: v17.string(),
1428
+ name: v27.string(),
1291
1429
  /**
1292
1430
  * The source code of the Clarity contract.
1293
1431
  */
1294
- clarityCode: v17.string(),
1432
+ clarityCode: v27.string(),
1295
1433
  /**
1296
1434
  * The version of the Clarity contract.
1297
1435
  */
1298
- clarityVersion: v17.optional(v17.number()),
1436
+ clarityVersion: v27.optional(v27.number()),
1299
1437
  /**
1300
1438
  * The post conditions to apply to the contract call.
1301
1439
  */
1302
- postConditions: v17.optional(v17.array(v17.string())),
1440
+ postConditions: v27.optional(v27.array(v27.string())),
1303
1441
  /**
1304
1442
  * The mode to apply to the post conditions.
1305
1443
  */
1306
- postConditionMode: v17.optional(v17.union([v17.literal("allow"), v17.literal("deny")]))
1444
+ postConditionMode: v27.optional(v27.union([v27.literal("allow"), v27.literal("deny")]))
1307
1445
  });
1308
- var stxDeployContractResultSchema = v17.object({
1446
+ var stxDeployContractResultSchema = v27.object({
1309
1447
  /**
1310
1448
  * The ID of the transaction.
1311
1449
  */
1312
- txid: v17.string(),
1450
+ txid: v27.string(),
1313
1451
  /**
1314
1452
  * A Stacks transaction as a hex-encoded string.
1315
1453
  */
1316
- transaction: v17.string()
1454
+ transaction: v27.string()
1317
1455
  });
1318
- var stxDeployContractRequestMessageSchema = v17.object({
1456
+ var stxDeployContractRequestMessageSchema = v27.object({
1319
1457
  ...rpcRequestMessageSchema.entries,
1320
- ...v17.object({
1321
- method: v17.literal(stxDeployContractMethodName),
1458
+ ...v27.object({
1459
+ method: v27.literal(stxDeployContractMethodName),
1322
1460
  params: stxDeployContractParamsSchema,
1323
- id: v17.string()
1461
+ id: v27.string()
1324
1462
  }).entries
1325
1463
  });
1326
1464
 
1327
1465
  // src/request/types/stxMethods/getAccounts.ts
1328
- var v18 = __toESM(require("valibot"));
1466
+ var v28 = __toESM(require("valibot"));
1329
1467
  var stxGetAccountsMethodName = "stx_getAccounts";
1330
- var stxGetAccountsParamsSchema = v18.nullish(v18.null());
1331
- var stxGetAccountsResultSchema = v18.object({
1468
+ var stxGetAccountsParamsSchema = v28.nullish(v28.null());
1469
+ var stxGetAccountsResultSchema = v28.object({
1332
1470
  /**
1333
1471
  * The addresses generated for the given purposes.
1334
1472
  */
1335
- addresses: v18.array(
1336
- v18.object({
1337
- address: v18.string(),
1338
- publicKey: v18.string(),
1339
- gaiaHubUrl: v18.string(),
1340
- gaiaAppKey: v18.string()
1473
+ addresses: v28.array(
1474
+ v28.object({
1475
+ address: v28.string(),
1476
+ publicKey: v28.string(),
1477
+ gaiaHubUrl: v28.string(),
1478
+ gaiaAppKey: v28.string()
1341
1479
  })
1342
1480
  ),
1343
1481
  network: getNetworkResultSchema
1344
1482
  });
1345
- var stxGetAccountsRequestMessageSchema = v18.object({
1483
+ var stxGetAccountsRequestMessageSchema = v28.object({
1346
1484
  ...rpcRequestMessageSchema.entries,
1347
- ...v18.object({
1348
- method: v18.literal(stxGetAccountsMethodName),
1485
+ ...v28.object({
1486
+ method: v28.literal(stxGetAccountsMethodName),
1349
1487
  params: stxGetAccountsParamsSchema,
1350
- id: v18.string()
1488
+ id: v28.string()
1351
1489
  }).entries
1352
1490
  });
1353
1491
 
1354
1492
  // src/request/types/stxMethods/getAddresses.ts
1355
- var v19 = __toESM(require("valibot"));
1493
+ var v29 = __toESM(require("valibot"));
1356
1494
  var stxGetAddressesMethodName = "stx_getAddresses";
1357
- var stxGetAddressesParamsSchema = v19.nullish(
1358
- v19.object({
1495
+ var stxGetAddressesParamsSchema = v29.nullish(
1496
+ v29.object({
1359
1497
  /**
1360
1498
  * A message to be displayed to the user in the request prompt.
1361
1499
  */
1362
- message: v19.optional(v19.string())
1500
+ message: v29.optional(v29.string())
1363
1501
  })
1364
1502
  );
1365
- var stxGetAddressesResultSchema = v19.object({
1503
+ var stxGetAddressesResultSchema = v29.object({
1366
1504
  /**
1367
1505
  * The addresses generated for the given purposes.
1368
1506
  */
1369
- addresses: v19.array(addressSchema),
1507
+ addresses: v29.array(addressSchema),
1370
1508
  network: getNetworkResultSchema
1371
1509
  });
1372
- var stxGetAddressesRequestMessageSchema = v19.object({
1510
+ var stxGetAddressesRequestMessageSchema = v29.object({
1373
1511
  ...rpcRequestMessageSchema.entries,
1374
- ...v19.object({
1375
- method: v19.literal(stxGetAddressesMethodName),
1512
+ ...v29.object({
1513
+ method: v29.literal(stxGetAddressesMethodName),
1376
1514
  params: stxGetAddressesParamsSchema,
1377
- id: v19.string()
1515
+ id: v29.string()
1378
1516
  }).entries
1379
1517
  });
1380
1518
 
1381
1519
  // src/request/types/stxMethods/signMessage.ts
1382
- var v20 = __toESM(require("valibot"));
1520
+ var v30 = __toESM(require("valibot"));
1383
1521
  var stxSignMessageMethodName = "stx_signMessage";
1384
- var stxSignMessageParamsSchema = v20.object({
1522
+ var stxSignMessageParamsSchema = v30.object({
1385
1523
  /**
1386
1524
  * The message to sign.
1387
1525
  */
1388
- message: v20.string()
1526
+ message: v30.string()
1389
1527
  });
1390
- var stxSignMessageResultSchema = v20.object({
1528
+ var stxSignMessageResultSchema = v30.object({
1391
1529
  /**
1392
1530
  * The signature of the message.
1393
1531
  */
1394
- signature: v20.string(),
1532
+ signature: v30.string(),
1395
1533
  /**
1396
1534
  * The public key used to sign the message.
1397
1535
  */
1398
- publicKey: v20.string()
1536
+ publicKey: v30.string()
1399
1537
  });
1400
- var stxSignMessageRequestMessageSchema = v20.object({
1538
+ var stxSignMessageRequestMessageSchema = v30.object({
1401
1539
  ...rpcRequestMessageSchema.entries,
1402
- ...v20.object({
1403
- method: v20.literal(stxSignMessageMethodName),
1540
+ ...v30.object({
1541
+ method: v30.literal(stxSignMessageMethodName),
1404
1542
  params: stxSignMessageParamsSchema,
1405
- id: v20.string()
1543
+ id: v30.string()
1406
1544
  }).entries
1407
1545
  });
1408
1546
 
1409
1547
  // src/request/types/stxMethods/signStructuredMessage.ts
1410
- var v21 = __toESM(require("valibot"));
1548
+ var v31 = __toESM(require("valibot"));
1411
1549
  var stxSignStructuredMessageMethodName = "stx_signStructuredMessage";
1412
- var stxSignStructuredMessageParamsSchema = v21.object({
1550
+ var stxSignStructuredMessageParamsSchema = v31.object({
1413
1551
  /**
1414
1552
  * The domain to be signed.
1415
1553
  */
1416
- domain: v21.string(),
1554
+ domain: v31.string(),
1417
1555
  /**
1418
1556
  * Message payload to be signed.
1419
1557
  */
1420
- message: v21.string(),
1558
+ message: v31.string(),
1421
1559
  /**
1422
1560
  * The public key to sign the message with.
1423
1561
  */
1424
- publicKey: v21.optional(v21.string())
1562
+ publicKey: v31.optional(v31.string())
1425
1563
  });
1426
- var stxSignStructuredMessageResultSchema = v21.object({
1564
+ var stxSignStructuredMessageResultSchema = v31.object({
1427
1565
  /**
1428
1566
  * Signature of the message.
1429
1567
  */
1430
- signature: v21.string(),
1568
+ signature: v31.string(),
1431
1569
  /**
1432
1570
  * Public key as hex-encoded string.
1433
1571
  */
1434
- publicKey: v21.string()
1572
+ publicKey: v31.string()
1435
1573
  });
1436
- var stxSignStructuredMessageRequestMessageSchema = v21.object({
1574
+ var stxSignStructuredMessageRequestMessageSchema = v31.object({
1437
1575
  ...rpcRequestMessageSchema.entries,
1438
- ...v21.object({
1439
- method: v21.literal(stxSignStructuredMessageMethodName),
1576
+ ...v31.object({
1577
+ method: v31.literal(stxSignStructuredMessageMethodName),
1440
1578
  params: stxSignStructuredMessageParamsSchema,
1441
- id: v21.string()
1579
+ id: v31.string()
1442
1580
  }).entries
1443
1581
  });
1444
1582
 
1445
1583
  // src/request/types/stxMethods/signTransaction.ts
1446
- var v22 = __toESM(require("valibot"));
1584
+ var v32 = __toESM(require("valibot"));
1447
1585
  var stxSignTransactionMethodName = "stx_signTransaction";
1448
- var stxSignTransactionParamsSchema = v22.object({
1586
+ var stxSignTransactionParamsSchema = v32.object({
1449
1587
  /**
1450
1588
  * The transaction to sign as a hex-encoded string.
1451
1589
  */
1452
- transaction: v22.string(),
1590
+ transaction: v32.string(),
1453
1591
  /**
1454
1592
  * The public key to sign the transaction with. The wallet may use any key
1455
1593
  * when not provided.
1456
1594
  */
1457
- pubkey: v22.optional(v22.string()),
1595
+ pubkey: v32.optional(v32.string()),
1458
1596
  /**
1459
1597
  * Whether to broadcast the transaction after signing. Defaults to `true`.
1460
1598
  */
1461
- broadcast: v22.optional(v22.boolean())
1599
+ broadcast: v32.optional(v32.boolean())
1462
1600
  });
1463
- var stxSignTransactionResultSchema = v22.object({
1601
+ var stxSignTransactionResultSchema = v32.object({
1464
1602
  /**
1465
1603
  * The signed transaction as a hex-encoded string.
1466
1604
  */
1467
- transaction: v22.string()
1605
+ transaction: v32.string()
1468
1606
  });
1469
- var stxSignTransactionRequestMessageSchema = v22.object({
1607
+ var stxSignTransactionRequestMessageSchema = v32.object({
1470
1608
  ...rpcRequestMessageSchema.entries,
1471
- ...v22.object({
1472
- method: v22.literal(stxSignTransactionMethodName),
1609
+ ...v32.object({
1610
+ method: v32.literal(stxSignTransactionMethodName),
1473
1611
  params: stxSignTransactionParamsSchema,
1474
- id: v22.string()
1612
+ id: v32.string()
1475
1613
  }).entries
1476
1614
  });
1477
1615
 
1478
1616
  // src/request/types/stxMethods/signTransactions.ts
1479
- var v23 = __toESM(require("valibot"));
1617
+ var v33 = __toESM(require("valibot"));
1480
1618
  var stxSignTransactionsMethodName = "stx_signTransactions";
1481
- var stxSignTransactionsParamsSchema = v23.object({
1619
+ var stxSignTransactionsParamsSchema = v33.object({
1482
1620
  /**
1483
1621
  * The transactions to sign as hex-encoded strings.
1484
1622
  */
1485
- transactions: v23.pipe(
1486
- v23.array(
1487
- v23.pipe(
1488
- v23.string(),
1489
- v23.check((hex) => {
1623
+ transactions: v33.pipe(
1624
+ v33.array(
1625
+ v33.pipe(
1626
+ v33.string(),
1627
+ v33.check((hex) => {
1490
1628
  return true;
1491
1629
  }, "Invalid hex-encoded Stacks transaction.")
1492
1630
  )
1493
1631
  ),
1494
- v23.minLength(1)
1632
+ v33.minLength(1)
1495
1633
  ),
1496
1634
  /**
1497
1635
  * Whether the signed transactions should be broadcast after signing. Defaults
1498
1636
  * to `true`.
1499
1637
  */
1500
- broadcast: v23.optional(v23.boolean())
1638
+ broadcast: v33.optional(v33.boolean())
1501
1639
  });
1502
- var stxSignTransactionsResultSchema = v23.object({
1640
+ var stxSignTransactionsResultSchema = v33.object({
1503
1641
  /**
1504
1642
  * The signed transactions as hex-encoded strings, in the same order as in the
1505
1643
  * sign request.
1506
1644
  */
1507
- transactions: v23.array(v23.string())
1645
+ transactions: v33.array(v33.string())
1508
1646
  });
1509
- var stxSignTransactionsRequestMessageSchema = v23.object({
1647
+ var stxSignTransactionsRequestMessageSchema = v33.object({
1510
1648
  ...rpcRequestMessageSchema.entries,
1511
- ...v23.object({
1512
- method: v23.literal(stxSignTransactionsMethodName),
1649
+ ...v33.object({
1650
+ method: v33.literal(stxSignTransactionsMethodName),
1513
1651
  params: stxSignTransactionsParamsSchema,
1514
- id: v23.string()
1652
+ id: v33.string()
1515
1653
  }).entries
1516
1654
  });
1517
1655
 
1518
1656
  // src/request/types/stxMethods/transferStx.ts
1519
- var v24 = __toESM(require("valibot"));
1657
+ var v34 = __toESM(require("valibot"));
1520
1658
  var stxTransferStxMethodName = "stx_transferStx";
1521
- var stxTransferStxParamsSchema = v24.object({
1659
+ var stxTransferStxParamsSchema = v34.object({
1522
1660
  /**
1523
1661
  * Amount of STX tokens to transfer in microstacks as a string. Anything
1524
1662
  * parseable by `BigInt` is acceptable.
@@ -1531,23 +1669,23 @@ var stxTransferStxParamsSchema = v24.object({
1531
1669
  * const amount3 = '1234';
1532
1670
  * ```
1533
1671
  */
1534
- amount: v24.union([v24.number(), v24.string()]),
1672
+ amount: v34.union([v34.number(), v34.string()]),
1535
1673
  /**
1536
1674
  * The recipient's principal.
1537
1675
  */
1538
- recipient: v24.string(),
1676
+ recipient: v34.string(),
1539
1677
  /**
1540
1678
  * A string representing the memo.
1541
1679
  */
1542
- memo: v24.optional(v24.string()),
1680
+ memo: v34.optional(v34.string()),
1543
1681
  /**
1544
1682
  * Version of parameter format.
1545
1683
  */
1546
- version: v24.optional(v24.string()),
1684
+ version: v34.optional(v34.string()),
1547
1685
  /**
1548
1686
  * The mode of the post conditions.
1549
1687
  */
1550
- postConditionMode: v24.optional(v24.number()),
1688
+ postConditionMode: v34.optional(v34.number()),
1551
1689
  /**
1552
1690
  * A hex-encoded string representing the post conditions.
1553
1691
  *
@@ -1560,43 +1698,52 @@ var stxTransferStxParamsSchema = v24.object({
1560
1698
  * const hexPostCondition = serializePostCondition(postCondition).toString('hex');
1561
1699
  * ```
1562
1700
  */
1563
- postConditions: v24.optional(v24.array(v24.string())),
1701
+ postConditions: v34.optional(v34.array(v34.string())),
1564
1702
  /**
1565
1703
  * The public key to sign the transaction with. The wallet may use any key
1566
1704
  * when not provided.
1567
1705
  */
1568
- pubkey: v24.optional(v24.string())
1706
+ pubkey: v34.optional(v34.string())
1569
1707
  });
1570
- var stxTransferStxResultSchema = v24.object({
1708
+ var stxTransferStxResultSchema = v34.object({
1571
1709
  /**
1572
1710
  * The ID of the transaction.
1573
1711
  */
1574
- txid: v24.string(),
1712
+ txid: v34.string(),
1575
1713
  /**
1576
1714
  * A Stacks transaction as a hex-encoded string.
1577
1715
  */
1578
- transaction: v24.string()
1716
+ transaction: v34.string()
1579
1717
  });
1580
- var stxTransferStxRequestMessageSchema = v24.object({
1718
+ var stxTransferStxRequestMessageSchema = v34.object({
1581
1719
  ...rpcRequestMessageSchema.entries,
1582
- ...v24.object({
1583
- method: v24.literal(stxTransferStxMethodName),
1720
+ ...v34.object({
1721
+ method: v34.literal(stxTransferStxMethodName),
1584
1722
  params: stxTransferStxParamsSchema,
1585
- id: v24.string()
1723
+ id: v34.string()
1586
1724
  }).entries
1587
1725
  });
1588
1726
 
1589
1727
  // src/request/index.ts
1590
- var cache = {};
1591
- var requestInternal = async (provider, method, params) => {
1728
+ var request = async (method, params, providerId) => {
1729
+ let provider = window.XverseProviders?.BitcoinProvider || window.BitcoinProvider;
1730
+ if (providerId) {
1731
+ provider = await getProviderById(providerId);
1732
+ }
1733
+ if (!provider) {
1734
+ throw new Error("no wallet provider was found");
1735
+ }
1736
+ if (!method) {
1737
+ throw new Error("A wallet method is required");
1738
+ }
1592
1739
  const response = await provider.request(method, params);
1593
- if (v25.is(rpcErrorResponseMessageSchema, response)) {
1740
+ if (v35.is(rpcErrorResponseMessageSchema, response)) {
1594
1741
  return {
1595
1742
  status: "error",
1596
1743
  error: response.error
1597
1744
  };
1598
1745
  }
1599
- if (v25.is(rpcSuccessResponseMessageSchema, response)) {
1746
+ if (v35.is(rpcSuccessResponseMessageSchema, response)) {
1600
1747
  return {
1601
1748
  status: "success",
1602
1749
  result: response.result
@@ -1611,39 +1758,6 @@ var requestInternal = async (provider, method, params) => {
1611
1758
  }
1612
1759
  };
1613
1760
  };
1614
- var request = async (method, params, providerId) => {
1615
- let provider = window.XverseProviders?.BitcoinProvider || window.BitcoinProvider;
1616
- if (providerId) {
1617
- provider = await getProviderById(providerId);
1618
- }
1619
- if (!provider) {
1620
- throw new Error("no wallet provider was found");
1621
- }
1622
- if (!method) {
1623
- throw new Error("A wallet method is required");
1624
- }
1625
- if (!cache.providerInfo) {
1626
- const infoResult = await requestInternal(provider, "getInfo", null);
1627
- if (infoResult.status === "success") {
1628
- cache.providerInfo = infoResult.result;
1629
- }
1630
- }
1631
- if (cache.providerInfo) {
1632
- if (method === "getInfo") {
1633
- return {
1634
- status: "success",
1635
- result: cache.providerInfo
1636
- };
1637
- }
1638
- const sanitized = sanitizeRequest(method, params, cache.providerInfo);
1639
- if (sanitized.overrideResponse) {
1640
- return sanitized.overrideResponse;
1641
- }
1642
- method = sanitized.method;
1643
- params = sanitized.params;
1644
- }
1645
- return requestInternal(provider, method, params);
1646
- };
1647
1761
  var addListener = (...rawArgs) => {
1648
1762
  const [listenerInfo, providerId] = (() => {
1649
1763
  if (rawArgs.length === 1) {
@@ -2649,7 +2763,6 @@ var signMultipleTransactions = async (options) => {
2649
2763
  DefaultAdaptersInfo,
2650
2764
  MessageSigningProtocols,
2651
2765
  PermissionRequestParams,
2652
- ProviderPlatform,
2653
2766
  RpcErrorCode,
2654
2767
  RpcIdSchema,
2655
2768
  SatsConnectAdapter,
@@ -2785,6 +2898,22 @@ var signMultipleTransactions = async (options) => {
2785
2898
  signPsbtRequestMessageSchema,
2786
2899
  signPsbtResultSchema,
2787
2900
  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,
2788
2917
  sparkGetAddressesMethodName,
2789
2918
  sparkGetAddressesParamsSchema,
2790
2919
  sparkGetAddressesRequestMessageSchema,