@sats-connect/core 0.8.0 → 0.8.1-17b18cb

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.mjs CHANGED
@@ -192,7 +192,7 @@ function getSupportedWallets() {
192
192
  }
193
193
 
194
194
  // src/request/index.ts
195
- import * as v25 from "valibot";
195
+ import * as v35 from "valibot";
196
196
 
197
197
  // src/request/types/btcMethods.ts
198
198
  import * as v6 from "valibot";
@@ -805,146 +805,319 @@ var runesTransferRequestMessageSchema = v11.object({
805
805
  }).entries
806
806
  });
807
807
 
808
- // src/request/types/sparkMethods/getAddresses.ts
808
+ // src/request/types/sparkMethods/flashnetMethods/getJwt.ts
809
809
  import * as v12 from "valibot";
810
+ var sparkFlashnetGetJwtMethodName = "spark_flashnet_getJwt";
811
+ var sparkFlashnetGetJwtParamsSchema = v12.null();
812
+ var sparkFlashnetGetJwtResultSchema = v12.object({
813
+ /**
814
+ * The JWT token for authenticated requests to the Flashnet API.
815
+ */
816
+ jwt: v12.string()
817
+ });
818
+ var sparkFlashnetGetJwtRequestMessageSchema = v12.object({
819
+ ...rpcRequestMessageSchema.entries,
820
+ ...v12.object({
821
+ method: v12.literal(sparkFlashnetGetJwtMethodName),
822
+ params: sparkFlashnetGetJwtParamsSchema,
823
+ id: v12.string()
824
+ }).entries
825
+ });
826
+
827
+ // src/request/types/sparkMethods/flashnetMethods/intents/addLiquidity.ts
828
+ import * as v13 from "valibot";
829
+ var sparkFlashnetAddLiquidityIntentSchema = v13.object({
830
+ type: v13.literal("addLiquidity"),
831
+ data: v13.object({
832
+ userPublicKey: v13.string(),
833
+ poolId: v13.string(),
834
+ assetAAmount: v13.string(),
835
+ assetBAmount: v13.string(),
836
+ assetAMinAmountIn: v13.string(),
837
+ assetBMinAmountIn: v13.string(),
838
+ assetATransferId: v13.string(),
839
+ assetBTransferId: v13.string(),
840
+ nonce: v13.string()
841
+ })
842
+ });
843
+
844
+ // src/request/types/sparkMethods/flashnetMethods/intents/clawback.ts
845
+ import * as v14 from "valibot";
846
+ var sparkFlashnetClawbackIntentSchema = v14.object({
847
+ type: v14.literal("clawback"),
848
+ data: v14.object({
849
+ senderPublicKey: v14.string(),
850
+ sparkTransferId: v14.string(),
851
+ lpIdentityPublicKey: v14.string(),
852
+ nonce: v14.string()
853
+ })
854
+ });
855
+
856
+ // src/request/types/sparkMethods/flashnetMethods/intents/confirmInitialDeposit.ts
857
+ import * as v15 from "valibot";
858
+ var sparkFlashnetConfirmInitialDepositIntentSchema = v15.object({
859
+ type: v15.literal("confirmInitialDeposit"),
860
+ data: v15.object({
861
+ poolId: v15.string(),
862
+ assetASparkTransferId: v15.string(),
863
+ poolOwnerPublicKey: v15.string(),
864
+ nonce: v15.string()
865
+ })
866
+ });
867
+
868
+ // src/request/types/sparkMethods/flashnetMethods/intents/createConstantProductPool.ts
869
+ import * as v16 from "valibot";
870
+ var sparkFlashnetCreateConstantProductPoolIntentSchema = v16.object({
871
+ type: v16.literal("createConstantProductPool"),
872
+ data: v16.object({
873
+ poolOwnerPublicKey: v16.string(),
874
+ assetAAddress: v16.string(),
875
+ assetBAddress: v16.string(),
876
+ lpFeeRateBps: v16.number(),
877
+ totalHostFeeRateBps: v16.number(),
878
+ nonce: v16.string()
879
+ })
880
+ });
881
+
882
+ // src/request/types/sparkMethods/flashnetMethods/intents/createSingleSidedPool.ts
883
+ import * as v17 from "valibot";
884
+ var sparkFlashnetCreateSingleSidedPoolIntentSchema = v17.object({
885
+ type: v17.literal("createSingleSidedPool"),
886
+ data: v17.object({
887
+ assetAAddress: v17.string(),
888
+ assetBAddress: v17.string(),
889
+ assetAInitialReserve: v17.string(),
890
+ virtualReserveA: v17.union([v17.number(), v17.string()]),
891
+ virtualReserveB: v17.union([v17.number(), v17.string()]),
892
+ threshold: v17.union([v17.number(), v17.string()]),
893
+ lpFeeRateBps: v17.number(),
894
+ totalHostFeeRateBps: v17.number(),
895
+ poolOwnerPublicKey: v17.string(),
896
+ nonce: v17.string()
897
+ })
898
+ });
899
+
900
+ // src/request/types/sparkMethods/flashnetMethods/intents/removeLiquidity.ts
901
+ import * as v18 from "valibot";
902
+ var sparkFlashnetRemoveLiquidityIntentSchema = v18.object({
903
+ type: v18.literal("removeLiquidity"),
904
+ data: v18.object({
905
+ userPublicKey: v18.string(),
906
+ poolId: v18.string(),
907
+ lpTokensToRemove: v18.string(),
908
+ nonce: v18.string()
909
+ })
910
+ });
911
+
912
+ // src/request/types/sparkMethods/flashnetMethods/intents/routeSwap.ts
913
+ import * as v19 from "valibot";
914
+ var sparkFlashnetRouteSwapIntentSchema = v19.object({
915
+ type: v19.literal("executeRouteSwap"),
916
+ data: v19.object({
917
+ userPublicKey: v19.string(),
918
+ initialSparkTransferId: v19.string(),
919
+ hops: v19.array(
920
+ v19.object({
921
+ poolId: v19.string(),
922
+ inputAssetAddress: v19.string(),
923
+ outputAssetAddress: v19.string(),
924
+ hopIntegratorFeeRateBps: v19.optional(v19.number())
925
+ })
926
+ ),
927
+ inputAmount: v19.string(),
928
+ maxRouteSlippageBps: v19.number(),
929
+ minAmountOut: v19.string(),
930
+ defaultIntegratorFeeRateBps: v19.optional(v19.number()),
931
+ nonce: v19.string()
932
+ })
933
+ });
934
+
935
+ // src/request/types/sparkMethods/flashnetMethods/intents/swap.ts
936
+ import * as v20 from "valibot";
937
+ var sparkFlashnetSwapIntentSchema = v20.object({
938
+ type: v20.literal("executeSwap"),
939
+ data: v20.object({
940
+ userPublicKey: v20.string(),
941
+ poolId: v20.string(),
942
+ transferId: v20.string(),
943
+ assetInAddress: v20.string(),
944
+ assetOutAddress: v20.string(),
945
+ amountIn: v20.string(),
946
+ maxSlippageBps: v20.number(),
947
+ minAmountOut: v20.string(),
948
+ totalIntegratorFeeRateBps: v20.optional(v20.number()),
949
+ nonce: v20.string()
950
+ })
951
+ });
952
+
953
+ // src/request/types/sparkMethods/flashnetMethods/signIntent.ts
954
+ import * as v21 from "valibot";
955
+ var sparkFlashnetSignIntentMethodName = "spark_flashnet_signIntent";
956
+ var sparkFlashnetSignIntentParamsSchema = v21.union([
957
+ sparkFlashnetSwapIntentSchema,
958
+ sparkFlashnetRouteSwapIntentSchema,
959
+ sparkFlashnetAddLiquidityIntentSchema,
960
+ sparkFlashnetClawbackIntentSchema,
961
+ sparkFlashnetConfirmInitialDepositIntentSchema,
962
+ sparkFlashnetCreateConstantProductPoolIntentSchema,
963
+ sparkFlashnetCreateSingleSidedPoolIntentSchema,
964
+ sparkFlashnetRemoveLiquidityIntentSchema
965
+ ]);
966
+ var sparkFlashnetSignIntentResultSchema = v21.object({
967
+ /**
968
+ * The signed intent as a hex string.
969
+ */
970
+ signature: v21.string()
971
+ });
972
+ var sparkFlashnetSignIntentRequestMessageSchema = v21.object({
973
+ ...rpcRequestMessageSchema.entries,
974
+ ...v21.object({
975
+ method: v21.literal(sparkFlashnetSignIntentMethodName),
976
+ params: sparkFlashnetSignIntentParamsSchema,
977
+ id: v21.string()
978
+ }).entries
979
+ });
980
+
981
+ // src/request/types/sparkMethods/getAddresses.ts
982
+ import * as v22 from "valibot";
810
983
  var sparkGetAddressesMethodName = "spark_getAddresses";
811
- var sparkGetAddressesParamsSchema = v12.nullish(
812
- v12.object({
984
+ var sparkGetAddressesParamsSchema = v22.nullish(
985
+ v22.object({
813
986
  /**
814
987
  * A message to be displayed to the user in the request prompt.
815
988
  */
816
- message: v12.optional(v12.string())
989
+ message: v22.optional(v22.string())
817
990
  })
818
991
  );
819
- var sparkGetAddressesResultSchema = v12.object({
992
+ var sparkGetAddressesResultSchema = v22.object({
820
993
  /**
821
994
  * The addresses generated for the given purposes.
822
995
  */
823
- addresses: v12.array(addressSchema),
996
+ addresses: v22.array(addressSchema),
824
997
  network: getNetworkResultSchema
825
998
  });
826
- var sparkGetAddressesRequestMessageSchema = v12.object({
999
+ var sparkGetAddressesRequestMessageSchema = v22.object({
827
1000
  ...rpcRequestMessageSchema.entries,
828
- ...v12.object({
829
- method: v12.literal(sparkGetAddressesMethodName),
1001
+ ...v22.object({
1002
+ method: v22.literal(sparkGetAddressesMethodName),
830
1003
  params: sparkGetAddressesParamsSchema,
831
- id: v12.string()
1004
+ id: v22.string()
832
1005
  }).entries
833
1006
  });
834
1007
 
835
1008
  // src/request/types/sparkMethods/getBalance.ts
836
- import * as v13 from "valibot";
1009
+ import * as v23 from "valibot";
837
1010
  var sparkGetBalanceMethodName = "spark_getBalance";
838
- var sparkGetBalanceParamsSchema = v13.nullish(v13.null());
839
- var sparkGetBalanceResultSchema = v13.object({
1011
+ var sparkGetBalanceParamsSchema = v23.nullish(v23.null());
1012
+ var sparkGetBalanceResultSchema = v23.object({
840
1013
  /**
841
1014
  * The Spark Bitcoin address balance in sats in string form.
842
1015
  */
843
- balance: v13.string(),
844
- tokenBalances: v13.array(
845
- v13.object({
1016
+ balance: v23.string(),
1017
+ tokenBalances: v23.array(
1018
+ v23.object({
846
1019
  /* The address balance of the token in string form as it can overflow a js number */
847
- balance: v13.string(),
848
- tokenMetadata: v13.object({
849
- tokenIdentifier: v13.string(),
850
- tokenName: v13.string(),
851
- tokenTicker: v13.string(),
852
- decimals: v13.number(),
853
- maxSupply: v13.string()
1020
+ balance: v23.string(),
1021
+ tokenMetadata: v23.object({
1022
+ tokenIdentifier: v23.string(),
1023
+ tokenName: v23.string(),
1024
+ tokenTicker: v23.string(),
1025
+ decimals: v23.number(),
1026
+ maxSupply: v23.string()
854
1027
  })
855
1028
  })
856
1029
  )
857
1030
  });
858
- var sparkGetBalanceRequestMessageSchema = v13.object({
1031
+ var sparkGetBalanceRequestMessageSchema = v23.object({
859
1032
  ...rpcRequestMessageSchema.entries,
860
- ...v13.object({
861
- method: v13.literal(sparkGetBalanceMethodName),
1033
+ ...v23.object({
1034
+ method: v23.literal(sparkGetBalanceMethodName),
862
1035
  params: sparkGetBalanceParamsSchema,
863
- id: v13.string()
1036
+ id: v23.string()
864
1037
  }).entries
865
1038
  });
866
1039
 
867
1040
  // src/request/types/sparkMethods/transfer.ts
868
- import * as v14 from "valibot";
1041
+ import * as v24 from "valibot";
869
1042
  var sparkTransferMethodName = "spark_transfer";
870
- var sparkTransferParamsSchema = v14.object({
1043
+ var sparkTransferParamsSchema = v24.object({
871
1044
  /**
872
1045
  * Amount of SATS to transfer as a string or number.
873
1046
  */
874
- amountSats: v14.union([v14.number(), v14.string()]),
1047
+ amountSats: v24.union([v24.number(), v24.string()]),
875
1048
  /**
876
1049
  * The recipient's spark address.
877
1050
  */
878
- receiverSparkAddress: v14.string()
1051
+ receiverSparkAddress: v24.string()
879
1052
  });
880
- var sparkTransferResultSchema = v14.object({
1053
+ var sparkTransferResultSchema = v24.object({
881
1054
  /**
882
1055
  * The ID of the transaction.
883
1056
  */
884
- id: v14.string()
1057
+ id: v24.string()
885
1058
  });
886
- var sparkTransferRequestMessageSchema = v14.object({
1059
+ var sparkTransferRequestMessageSchema = v24.object({
887
1060
  ...rpcRequestMessageSchema.entries,
888
- ...v14.object({
889
- method: v14.literal(sparkTransferMethodName),
1061
+ ...v24.object({
1062
+ method: v24.literal(sparkTransferMethodName),
890
1063
  params: sparkTransferParamsSchema,
891
- id: v14.string()
1064
+ id: v24.string()
892
1065
  }).entries
893
1066
  });
894
1067
 
895
1068
  // src/request/types/sparkMethods/transferToken.ts
896
- import * as v15 from "valibot";
1069
+ import * as v25 from "valibot";
897
1070
  var sparkTransferTokenMethodName = "spark_transferToken";
898
- var sparkTransferTokenParamsSchema = v15.object({
1071
+ var sparkTransferTokenParamsSchema = v25.object({
899
1072
  /**
900
1073
  * Amount of units of the token to transfer as a string or number.
901
1074
  */
902
- tokenAmount: v15.union([v15.number(), v15.string()]),
1075
+ tokenAmount: v25.union([v25.number(), v25.string()]),
903
1076
  /**
904
1077
  * The Bech32m token identifier.
905
1078
  */
906
- tokenIdentifier: v15.string(),
1079
+ tokenIdentifier: v25.string(),
907
1080
  /**
908
1081
  * The recipient's spark address.
909
1082
  */
910
- receiverSparkAddress: v15.string()
1083
+ receiverSparkAddress: v25.string()
911
1084
  });
912
- var sparkTransferTokenResultSchema = v15.object({
1085
+ var sparkTransferTokenResultSchema = v25.object({
913
1086
  /**
914
1087
  * The ID of the transaction.
915
1088
  */
916
- id: v15.string()
1089
+ id: v25.string()
917
1090
  });
918
- var sparkTransferTokenRequestMessageSchema = v15.object({
1091
+ var sparkTransferTokenRequestMessageSchema = v25.object({
919
1092
  ...rpcRequestMessageSchema.entries,
920
- ...v15.object({
921
- method: v15.literal(sparkTransferTokenMethodName),
1093
+ ...v25.object({
1094
+ method: v25.literal(sparkTransferTokenMethodName),
922
1095
  params: sparkTransferTokenParamsSchema,
923
- id: v15.string()
1096
+ id: v25.string()
924
1097
  }).entries
925
1098
  });
926
1099
 
927
1100
  // src/request/types/stxMethods/callContract.ts
928
- import * as v16 from "valibot";
1101
+ import * as v26 from "valibot";
929
1102
  var stxCallContractMethodName = "stx_callContract";
930
- var stxCallContractParamsSchema = v16.object({
1103
+ var stxCallContractParamsSchema = v26.object({
931
1104
  /**
932
1105
  * The contract principal.
933
1106
  *
934
1107
  * E.g. `"SPKE...GD5C.my-contract"`
935
1108
  */
936
- contract: v16.string(),
1109
+ contract: v26.string(),
937
1110
  /**
938
1111
  * The name of the function to call.
939
1112
  *
940
1113
  * Note: spec changes ongoing,
941
1114
  * https://github.com/stacksgov/sips/pull/166#pullrequestreview-1914236999
942
1115
  */
943
- functionName: v16.string(),
1116
+ functionName: v26.string(),
944
1117
  /**
945
1118
  * @deprecated in favor of `functionArgs` for @stacks/connect compatibility
946
1119
  */
947
- arguments: v16.optional(v16.array(v16.string())),
1120
+ arguments: v26.optional(v26.array(v26.string())),
948
1121
  /**
949
1122
  * The function's arguments. The arguments are expected to be hex-encoded
950
1123
  * strings of Clarity values.
@@ -959,274 +1132,274 @@ var stxCallContractParamsSchema = v16.object({
959
1132
  * const hexArgs = functionArgs.map(cvToHex);
960
1133
  * ```
961
1134
  */
962
- functionArgs: v16.optional(v16.array(v16.string())),
1135
+ functionArgs: v26.optional(v26.array(v26.string())),
963
1136
  /**
964
1137
  * The post conditions to apply to the contract call.
965
1138
  */
966
- postConditions: v16.optional(v16.array(v16.string())),
1139
+ postConditions: v26.optional(v26.array(v26.string())),
967
1140
  /**
968
1141
  * The mode to apply to the post conditions.
969
1142
  */
970
- postConditionMode: v16.optional(v16.union([v16.literal("allow"), v16.literal("deny")]))
1143
+ postConditionMode: v26.optional(v26.union([v26.literal("allow"), v26.literal("deny")]))
971
1144
  });
972
- var stxCallContractResultSchema = v16.object({
1145
+ var stxCallContractResultSchema = v26.object({
973
1146
  /**
974
1147
  * The ID of the transaction.
975
1148
  */
976
- txid: v16.string(),
1149
+ txid: v26.string(),
977
1150
  /**
978
1151
  * A Stacks transaction as a hex-encoded string.
979
1152
  */
980
- transaction: v16.string()
1153
+ transaction: v26.string()
981
1154
  });
982
- var stxCallContractRequestMessageSchema = v16.object({
1155
+ var stxCallContractRequestMessageSchema = v26.object({
983
1156
  ...rpcRequestMessageSchema.entries,
984
- ...v16.object({
985
- method: v16.literal(stxCallContractMethodName),
1157
+ ...v26.object({
1158
+ method: v26.literal(stxCallContractMethodName),
986
1159
  params: stxCallContractParamsSchema,
987
- id: v16.string()
1160
+ id: v26.string()
988
1161
  }).entries
989
1162
  });
990
1163
 
991
1164
  // src/request/types/stxMethods/deployContract.ts
992
- import * as v17 from "valibot";
1165
+ import * as v27 from "valibot";
993
1166
  var stxDeployContractMethodName = "stx_deployContract";
994
- var stxDeployContractParamsSchema = v17.object({
1167
+ var stxDeployContractParamsSchema = v27.object({
995
1168
  /**
996
1169
  * Name of the contract.
997
1170
  */
998
- name: v17.string(),
1171
+ name: v27.string(),
999
1172
  /**
1000
1173
  * The source code of the Clarity contract.
1001
1174
  */
1002
- clarityCode: v17.string(),
1175
+ clarityCode: v27.string(),
1003
1176
  /**
1004
1177
  * The version of the Clarity contract.
1005
1178
  */
1006
- clarityVersion: v17.optional(v17.number()),
1179
+ clarityVersion: v27.optional(v27.number()),
1007
1180
  /**
1008
1181
  * The post conditions to apply to the contract call.
1009
1182
  */
1010
- postConditions: v17.optional(v17.array(v17.string())),
1183
+ postConditions: v27.optional(v27.array(v27.string())),
1011
1184
  /**
1012
1185
  * The mode to apply to the post conditions.
1013
1186
  */
1014
- postConditionMode: v17.optional(v17.union([v17.literal("allow"), v17.literal("deny")]))
1187
+ postConditionMode: v27.optional(v27.union([v27.literal("allow"), v27.literal("deny")]))
1015
1188
  });
1016
- var stxDeployContractResultSchema = v17.object({
1189
+ var stxDeployContractResultSchema = v27.object({
1017
1190
  /**
1018
1191
  * The ID of the transaction.
1019
1192
  */
1020
- txid: v17.string(),
1193
+ txid: v27.string(),
1021
1194
  /**
1022
1195
  * A Stacks transaction as a hex-encoded string.
1023
1196
  */
1024
- transaction: v17.string()
1197
+ transaction: v27.string()
1025
1198
  });
1026
- var stxDeployContractRequestMessageSchema = v17.object({
1199
+ var stxDeployContractRequestMessageSchema = v27.object({
1027
1200
  ...rpcRequestMessageSchema.entries,
1028
- ...v17.object({
1029
- method: v17.literal(stxDeployContractMethodName),
1201
+ ...v27.object({
1202
+ method: v27.literal(stxDeployContractMethodName),
1030
1203
  params: stxDeployContractParamsSchema,
1031
- id: v17.string()
1204
+ id: v27.string()
1032
1205
  }).entries
1033
1206
  });
1034
1207
 
1035
1208
  // src/request/types/stxMethods/getAccounts.ts
1036
- import * as v18 from "valibot";
1209
+ import * as v28 from "valibot";
1037
1210
  var stxGetAccountsMethodName = "stx_getAccounts";
1038
- var stxGetAccountsParamsSchema = v18.nullish(v18.null());
1039
- var stxGetAccountsResultSchema = v18.object({
1211
+ var stxGetAccountsParamsSchema = v28.nullish(v28.null());
1212
+ var stxGetAccountsResultSchema = v28.object({
1040
1213
  /**
1041
1214
  * The addresses generated for the given purposes.
1042
1215
  */
1043
- addresses: v18.array(
1044
- v18.object({
1045
- address: v18.string(),
1046
- publicKey: v18.string(),
1047
- gaiaHubUrl: v18.string(),
1048
- gaiaAppKey: v18.string()
1216
+ addresses: v28.array(
1217
+ v28.object({
1218
+ address: v28.string(),
1219
+ publicKey: v28.string(),
1220
+ gaiaHubUrl: v28.string(),
1221
+ gaiaAppKey: v28.string()
1049
1222
  })
1050
1223
  ),
1051
1224
  network: getNetworkResultSchema
1052
1225
  });
1053
- var stxGetAccountsRequestMessageSchema = v18.object({
1226
+ var stxGetAccountsRequestMessageSchema = v28.object({
1054
1227
  ...rpcRequestMessageSchema.entries,
1055
- ...v18.object({
1056
- method: v18.literal(stxGetAccountsMethodName),
1228
+ ...v28.object({
1229
+ method: v28.literal(stxGetAccountsMethodName),
1057
1230
  params: stxGetAccountsParamsSchema,
1058
- id: v18.string()
1231
+ id: v28.string()
1059
1232
  }).entries
1060
1233
  });
1061
1234
 
1062
1235
  // src/request/types/stxMethods/getAddresses.ts
1063
- import * as v19 from "valibot";
1236
+ import * as v29 from "valibot";
1064
1237
  var stxGetAddressesMethodName = "stx_getAddresses";
1065
- var stxGetAddressesParamsSchema = v19.nullish(
1066
- v19.object({
1238
+ var stxGetAddressesParamsSchema = v29.nullish(
1239
+ v29.object({
1067
1240
  /**
1068
1241
  * A message to be displayed to the user in the request prompt.
1069
1242
  */
1070
- message: v19.optional(v19.string())
1243
+ message: v29.optional(v29.string())
1071
1244
  })
1072
1245
  );
1073
- var stxGetAddressesResultSchema = v19.object({
1246
+ var stxGetAddressesResultSchema = v29.object({
1074
1247
  /**
1075
1248
  * The addresses generated for the given purposes.
1076
1249
  */
1077
- addresses: v19.array(addressSchema),
1250
+ addresses: v29.array(addressSchema),
1078
1251
  network: getNetworkResultSchema
1079
1252
  });
1080
- var stxGetAddressesRequestMessageSchema = v19.object({
1253
+ var stxGetAddressesRequestMessageSchema = v29.object({
1081
1254
  ...rpcRequestMessageSchema.entries,
1082
- ...v19.object({
1083
- method: v19.literal(stxGetAddressesMethodName),
1255
+ ...v29.object({
1256
+ method: v29.literal(stxGetAddressesMethodName),
1084
1257
  params: stxGetAddressesParamsSchema,
1085
- id: v19.string()
1258
+ id: v29.string()
1086
1259
  }).entries
1087
1260
  });
1088
1261
 
1089
1262
  // src/request/types/stxMethods/signMessage.ts
1090
- import * as v20 from "valibot";
1263
+ import * as v30 from "valibot";
1091
1264
  var stxSignMessageMethodName = "stx_signMessage";
1092
- var stxSignMessageParamsSchema = v20.object({
1265
+ var stxSignMessageParamsSchema = v30.object({
1093
1266
  /**
1094
1267
  * The message to sign.
1095
1268
  */
1096
- message: v20.string()
1269
+ message: v30.string()
1097
1270
  });
1098
- var stxSignMessageResultSchema = v20.object({
1271
+ var stxSignMessageResultSchema = v30.object({
1099
1272
  /**
1100
1273
  * The signature of the message.
1101
1274
  */
1102
- signature: v20.string(),
1275
+ signature: v30.string(),
1103
1276
  /**
1104
1277
  * The public key used to sign the message.
1105
1278
  */
1106
- publicKey: v20.string()
1279
+ publicKey: v30.string()
1107
1280
  });
1108
- var stxSignMessageRequestMessageSchema = v20.object({
1281
+ var stxSignMessageRequestMessageSchema = v30.object({
1109
1282
  ...rpcRequestMessageSchema.entries,
1110
- ...v20.object({
1111
- method: v20.literal(stxSignMessageMethodName),
1283
+ ...v30.object({
1284
+ method: v30.literal(stxSignMessageMethodName),
1112
1285
  params: stxSignMessageParamsSchema,
1113
- id: v20.string()
1286
+ id: v30.string()
1114
1287
  }).entries
1115
1288
  });
1116
1289
 
1117
1290
  // src/request/types/stxMethods/signStructuredMessage.ts
1118
- import * as v21 from "valibot";
1291
+ import * as v31 from "valibot";
1119
1292
  var stxSignStructuredMessageMethodName = "stx_signStructuredMessage";
1120
- var stxSignStructuredMessageParamsSchema = v21.object({
1293
+ var stxSignStructuredMessageParamsSchema = v31.object({
1121
1294
  /**
1122
1295
  * The domain to be signed.
1123
1296
  */
1124
- domain: v21.string(),
1297
+ domain: v31.string(),
1125
1298
  /**
1126
1299
  * Message payload to be signed.
1127
1300
  */
1128
- message: v21.string(),
1301
+ message: v31.string(),
1129
1302
  /**
1130
1303
  * The public key to sign the message with.
1131
1304
  */
1132
- publicKey: v21.optional(v21.string())
1305
+ publicKey: v31.optional(v31.string())
1133
1306
  });
1134
- var stxSignStructuredMessageResultSchema = v21.object({
1307
+ var stxSignStructuredMessageResultSchema = v31.object({
1135
1308
  /**
1136
1309
  * Signature of the message.
1137
1310
  */
1138
- signature: v21.string(),
1311
+ signature: v31.string(),
1139
1312
  /**
1140
1313
  * Public key as hex-encoded string.
1141
1314
  */
1142
- publicKey: v21.string()
1315
+ publicKey: v31.string()
1143
1316
  });
1144
- var stxSignStructuredMessageRequestMessageSchema = v21.object({
1317
+ var stxSignStructuredMessageRequestMessageSchema = v31.object({
1145
1318
  ...rpcRequestMessageSchema.entries,
1146
- ...v21.object({
1147
- method: v21.literal(stxSignStructuredMessageMethodName),
1319
+ ...v31.object({
1320
+ method: v31.literal(stxSignStructuredMessageMethodName),
1148
1321
  params: stxSignStructuredMessageParamsSchema,
1149
- id: v21.string()
1322
+ id: v31.string()
1150
1323
  }).entries
1151
1324
  });
1152
1325
 
1153
1326
  // src/request/types/stxMethods/signTransaction.ts
1154
- import * as v22 from "valibot";
1327
+ import * as v32 from "valibot";
1155
1328
  var stxSignTransactionMethodName = "stx_signTransaction";
1156
- var stxSignTransactionParamsSchema = v22.object({
1329
+ var stxSignTransactionParamsSchema = v32.object({
1157
1330
  /**
1158
1331
  * The transaction to sign as a hex-encoded string.
1159
1332
  */
1160
- transaction: v22.string(),
1333
+ transaction: v32.string(),
1161
1334
  /**
1162
1335
  * The public key to sign the transaction with. The wallet may use any key
1163
1336
  * when not provided.
1164
1337
  */
1165
- pubkey: v22.optional(v22.string()),
1338
+ pubkey: v32.optional(v32.string()),
1166
1339
  /**
1167
1340
  * Whether to broadcast the transaction after signing. Defaults to `true`.
1168
1341
  */
1169
- broadcast: v22.optional(v22.boolean())
1342
+ broadcast: v32.optional(v32.boolean())
1170
1343
  });
1171
- var stxSignTransactionResultSchema = v22.object({
1344
+ var stxSignTransactionResultSchema = v32.object({
1172
1345
  /**
1173
1346
  * The signed transaction as a hex-encoded string.
1174
1347
  */
1175
- transaction: v22.string()
1348
+ transaction: v32.string()
1176
1349
  });
1177
- var stxSignTransactionRequestMessageSchema = v22.object({
1350
+ var stxSignTransactionRequestMessageSchema = v32.object({
1178
1351
  ...rpcRequestMessageSchema.entries,
1179
- ...v22.object({
1180
- method: v22.literal(stxSignTransactionMethodName),
1352
+ ...v32.object({
1353
+ method: v32.literal(stxSignTransactionMethodName),
1181
1354
  params: stxSignTransactionParamsSchema,
1182
- id: v22.string()
1355
+ id: v32.string()
1183
1356
  }).entries
1184
1357
  });
1185
1358
 
1186
1359
  // src/request/types/stxMethods/signTransactions.ts
1187
- import * as v23 from "valibot";
1360
+ import * as v33 from "valibot";
1188
1361
  var stxSignTransactionsMethodName = "stx_signTransactions";
1189
- var stxSignTransactionsParamsSchema = v23.object({
1362
+ var stxSignTransactionsParamsSchema = v33.object({
1190
1363
  /**
1191
1364
  * The transactions to sign as hex-encoded strings.
1192
1365
  */
1193
- transactions: v23.pipe(
1194
- v23.array(
1195
- v23.pipe(
1196
- v23.string(),
1197
- v23.check((hex) => {
1366
+ transactions: v33.pipe(
1367
+ v33.array(
1368
+ v33.pipe(
1369
+ v33.string(),
1370
+ v33.check((hex) => {
1198
1371
  return true;
1199
1372
  }, "Invalid hex-encoded Stacks transaction.")
1200
1373
  )
1201
1374
  ),
1202
- v23.minLength(1)
1375
+ v33.minLength(1)
1203
1376
  ),
1204
1377
  /**
1205
1378
  * Whether the signed transactions should be broadcast after signing. Defaults
1206
1379
  * to `true`.
1207
1380
  */
1208
- broadcast: v23.optional(v23.boolean())
1381
+ broadcast: v33.optional(v33.boolean())
1209
1382
  });
1210
- var stxSignTransactionsResultSchema = v23.object({
1383
+ var stxSignTransactionsResultSchema = v33.object({
1211
1384
  /**
1212
1385
  * The signed transactions as hex-encoded strings, in the same order as in the
1213
1386
  * sign request.
1214
1387
  */
1215
- transactions: v23.array(v23.string())
1388
+ transactions: v33.array(v33.string())
1216
1389
  });
1217
- var stxSignTransactionsRequestMessageSchema = v23.object({
1390
+ var stxSignTransactionsRequestMessageSchema = v33.object({
1218
1391
  ...rpcRequestMessageSchema.entries,
1219
- ...v23.object({
1220
- method: v23.literal(stxSignTransactionsMethodName),
1392
+ ...v33.object({
1393
+ method: v33.literal(stxSignTransactionsMethodName),
1221
1394
  params: stxSignTransactionsParamsSchema,
1222
- id: v23.string()
1395
+ id: v33.string()
1223
1396
  }).entries
1224
1397
  });
1225
1398
 
1226
1399
  // src/request/types/stxMethods/transferStx.ts
1227
- import * as v24 from "valibot";
1400
+ import * as v34 from "valibot";
1228
1401
  var stxTransferStxMethodName = "stx_transferStx";
1229
- var stxTransferStxParamsSchema = v24.object({
1402
+ var stxTransferStxParamsSchema = v34.object({
1230
1403
  /**
1231
1404
  * Amount of STX tokens to transfer in microstacks as a string. Anything
1232
1405
  * parseable by `BigInt` is acceptable.
@@ -1239,23 +1412,23 @@ var stxTransferStxParamsSchema = v24.object({
1239
1412
  * const amount3 = '1234';
1240
1413
  * ```
1241
1414
  */
1242
- amount: v24.union([v24.number(), v24.string()]),
1415
+ amount: v34.union([v34.number(), v34.string()]),
1243
1416
  /**
1244
1417
  * The recipient's principal.
1245
1418
  */
1246
- recipient: v24.string(),
1419
+ recipient: v34.string(),
1247
1420
  /**
1248
1421
  * A string representing the memo.
1249
1422
  */
1250
- memo: v24.optional(v24.string()),
1423
+ memo: v34.optional(v34.string()),
1251
1424
  /**
1252
1425
  * Version of parameter format.
1253
1426
  */
1254
- version: v24.optional(v24.string()),
1427
+ version: v34.optional(v34.string()),
1255
1428
  /**
1256
1429
  * The mode of the post conditions.
1257
1430
  */
1258
- postConditionMode: v24.optional(v24.number()),
1431
+ postConditionMode: v34.optional(v34.number()),
1259
1432
  /**
1260
1433
  * A hex-encoded string representing the post conditions.
1261
1434
  *
@@ -1268,29 +1441,29 @@ var stxTransferStxParamsSchema = v24.object({
1268
1441
  * const hexPostCondition = serializePostCondition(postCondition).toString('hex');
1269
1442
  * ```
1270
1443
  */
1271
- postConditions: v24.optional(v24.array(v24.string())),
1444
+ postConditions: v34.optional(v34.array(v34.string())),
1272
1445
  /**
1273
1446
  * The public key to sign the transaction with. The wallet may use any key
1274
1447
  * when not provided.
1275
1448
  */
1276
- pubkey: v24.optional(v24.string())
1449
+ pubkey: v34.optional(v34.string())
1277
1450
  });
1278
- var stxTransferStxResultSchema = v24.object({
1451
+ var stxTransferStxResultSchema = v34.object({
1279
1452
  /**
1280
1453
  * The ID of the transaction.
1281
1454
  */
1282
- txid: v24.string(),
1455
+ txid: v34.string(),
1283
1456
  /**
1284
1457
  * A Stacks transaction as a hex-encoded string.
1285
1458
  */
1286
- transaction: v24.string()
1459
+ transaction: v34.string()
1287
1460
  });
1288
- var stxTransferStxRequestMessageSchema = v24.object({
1461
+ var stxTransferStxRequestMessageSchema = v34.object({
1289
1462
  ...rpcRequestMessageSchema.entries,
1290
- ...v24.object({
1291
- method: v24.literal(stxTransferStxMethodName),
1463
+ ...v34.object({
1464
+ method: v34.literal(stxTransferStxMethodName),
1292
1465
  params: stxTransferStxParamsSchema,
1293
- id: v24.string()
1466
+ id: v34.string()
1294
1467
  }).entries
1295
1468
  });
1296
1469
 
@@ -1307,13 +1480,13 @@ var request = async (method, params, providerId) => {
1307
1480
  throw new Error("A wallet method is required");
1308
1481
  }
1309
1482
  const response = await provider.request(method, params);
1310
- if (v25.is(rpcErrorResponseMessageSchema, response)) {
1483
+ if (v35.is(rpcErrorResponseMessageSchema, response)) {
1311
1484
  return {
1312
1485
  status: "error",
1313
1486
  error: response.error
1314
1487
  };
1315
1488
  }
1316
- if (v25.is(rpcSuccessResponseMessageSchema, response)) {
1489
+ if (v35.is(rpcSuccessResponseMessageSchema, response)) {
1317
1490
  return {
1318
1491
  status: "success",
1319
1492
  result: response.result
@@ -2467,6 +2640,22 @@ export {
2467
2640
  signPsbtRequestMessageSchema,
2468
2641
  signPsbtResultSchema,
2469
2642
  signTransaction,
2643
+ sparkFlashnetAddLiquidityIntentSchema,
2644
+ sparkFlashnetClawbackIntentSchema,
2645
+ sparkFlashnetConfirmInitialDepositIntentSchema,
2646
+ sparkFlashnetCreateConstantProductPoolIntentSchema,
2647
+ sparkFlashnetCreateSingleSidedPoolIntentSchema,
2648
+ sparkFlashnetGetJwtMethodName,
2649
+ sparkFlashnetGetJwtParamsSchema,
2650
+ sparkFlashnetGetJwtRequestMessageSchema,
2651
+ sparkFlashnetGetJwtResultSchema,
2652
+ sparkFlashnetRemoveLiquidityIntentSchema,
2653
+ sparkFlashnetRouteSwapIntentSchema,
2654
+ sparkFlashnetSignIntentMethodName,
2655
+ sparkFlashnetSignIntentParamsSchema,
2656
+ sparkFlashnetSignIntentRequestMessageSchema,
2657
+ sparkFlashnetSignIntentResultSchema,
2658
+ sparkFlashnetSwapIntentSchema,
2470
2659
  sparkGetAddressesMethodName,
2471
2660
  sparkGetAddressesParamsSchema,
2472
2661
  sparkGetAddressesRequestMessageSchema,