@sats-connect/core 0.11.0-dd369cf → 0.11.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.mts +5 -31
- package/dist/index.d.ts +5 -31
- package/dist/index.js +322 -352
- package/dist/index.mjs +322 -348
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// src/request/index.ts
|
|
2
|
-
import * as
|
|
2
|
+
import * as v39 from "valibot";
|
|
3
3
|
|
|
4
4
|
// src/provider/types.ts
|
|
5
5
|
import * as v4 from "valibot";
|
|
@@ -862,246 +862,224 @@ var runesTransferRequestMessageSchema = v11.object({
|
|
|
862
862
|
}).entries
|
|
863
863
|
});
|
|
864
864
|
|
|
865
|
-
// src/request/types/sparkMethods/flashnetMethods/
|
|
865
|
+
// src/request/types/sparkMethods/flashnetMethods/executeRouteSwap.ts
|
|
866
866
|
import * as v12 from "valibot";
|
|
867
|
-
var
|
|
868
|
-
var
|
|
869
|
-
|
|
870
|
-
|
|
871
|
-
|
|
872
|
-
|
|
867
|
+
var sparkFlashnetExecuteRouteSwapMethodName = "spark_flashnet_executeRouteSwap";
|
|
868
|
+
var sparkFlashnetExecuteRouteSwapParamsSchema = v12.object({
|
|
869
|
+
hops: v12.array(
|
|
870
|
+
v12.object({
|
|
871
|
+
poolId: v12.string(),
|
|
872
|
+
assetInAddress: v12.string(),
|
|
873
|
+
assetOutAddress: v12.string(),
|
|
874
|
+
hopIntegratorFeeRateBps: v12.optional(v12.number())
|
|
875
|
+
})
|
|
876
|
+
),
|
|
877
|
+
initialAssetAddress: v12.string(),
|
|
878
|
+
inputAmount: v12.string(),
|
|
879
|
+
maxRouteSlippageBps: v12.string(),
|
|
880
|
+
minAmountOut: v12.optional(v12.string()),
|
|
881
|
+
integratorFeeRateBps: v12.optional(v12.number()),
|
|
882
|
+
integratorPublicKey: v12.optional(v12.string())
|
|
883
|
+
});
|
|
884
|
+
var sparkFlashnetExecuteRouteSwapResultSchema = v12.object({
|
|
873
885
|
requestId: v12.string(),
|
|
874
886
|
accepted: v12.boolean(),
|
|
875
|
-
|
|
876
|
-
|
|
887
|
+
outputAmount: v12.string(),
|
|
888
|
+
executionPrice: v12.string(),
|
|
889
|
+
finalOutboundTransferId: v12.string(),
|
|
890
|
+
error: v12.optional(v12.string())
|
|
877
891
|
});
|
|
878
|
-
var
|
|
892
|
+
var sparkFlashnetExecuteRouteSwapRequestMessageSchema = v12.object({
|
|
879
893
|
...rpcRequestMessageSchema.entries,
|
|
880
894
|
...v12.object({
|
|
881
|
-
method: v12.literal(
|
|
882
|
-
params:
|
|
895
|
+
method: v12.literal(sparkFlashnetExecuteRouteSwapMethodName),
|
|
896
|
+
params: sparkFlashnetExecuteRouteSwapParamsSchema,
|
|
883
897
|
id: v12.string()
|
|
884
898
|
}).entries
|
|
885
899
|
});
|
|
886
900
|
|
|
887
|
-
// src/request/types/sparkMethods/flashnetMethods/
|
|
901
|
+
// src/request/types/sparkMethods/flashnetMethods/executeSwap.ts
|
|
888
902
|
import * as v13 from "valibot";
|
|
889
|
-
var
|
|
890
|
-
var
|
|
891
|
-
|
|
892
|
-
|
|
893
|
-
|
|
894
|
-
|
|
895
|
-
|
|
896
|
-
|
|
897
|
-
})
|
|
898
|
-
),
|
|
899
|
-
initialAssetAddress: v13.string(),
|
|
900
|
-
inputAmount: v13.string(),
|
|
901
|
-
maxRouteSlippageBps: v13.string(),
|
|
902
|
-
minAmountOut: v13.string(),
|
|
903
|
+
var sparkFlashnetExecuteSwapMethodName = "spark_flashnet_executeSwap";
|
|
904
|
+
var sparkFlashnetExecuteSwapParamsSchema = v13.object({
|
|
905
|
+
poolId: v13.string(),
|
|
906
|
+
assetInAddress: v13.string(),
|
|
907
|
+
assetOutAddress: v13.string(),
|
|
908
|
+
amountIn: v13.string(),
|
|
909
|
+
maxSlippageBps: v13.number(),
|
|
910
|
+
minAmountOut: v13.optional(v13.string()),
|
|
903
911
|
integratorFeeRateBps: v13.optional(v13.number()),
|
|
904
912
|
integratorPublicKey: v13.optional(v13.string())
|
|
905
913
|
});
|
|
906
|
-
var
|
|
914
|
+
var sparkFlashnetExecuteSwapResultSchema = v13.object({
|
|
907
915
|
requestId: v13.string(),
|
|
908
916
|
accepted: v13.boolean(),
|
|
909
|
-
|
|
910
|
-
|
|
911
|
-
|
|
917
|
+
amountOut: v13.optional(v13.string()),
|
|
918
|
+
feeAmount: v13.optional(v13.string()),
|
|
919
|
+
executionPrice: v13.optional(v13.string()),
|
|
920
|
+
assetOutAddress: v13.optional(v13.string()),
|
|
921
|
+
assetInAddress: v13.optional(v13.string()),
|
|
922
|
+
outboundTransferId: v13.optional(v13.string()),
|
|
912
923
|
error: v13.optional(v13.string())
|
|
913
924
|
});
|
|
914
|
-
var
|
|
925
|
+
var sparkFlashnetExecuteSwapRequestMessageSchema = v13.object({
|
|
915
926
|
...rpcRequestMessageSchema.entries,
|
|
916
927
|
...v13.object({
|
|
917
|
-
method: v13.literal(
|
|
918
|
-
params: sparkFlashnetExecuteRouteSwapParamsSchema,
|
|
919
|
-
id: v13.string()
|
|
920
|
-
}).entries
|
|
921
|
-
});
|
|
922
|
-
|
|
923
|
-
// src/request/types/sparkMethods/flashnetMethods/executeSwap.ts
|
|
924
|
-
import * as v14 from "valibot";
|
|
925
|
-
var sparkFlashnetExecuteSwapMethodName = "spark_flashnet_executeSwap";
|
|
926
|
-
var sparkFlashnetExecuteSwapParamsSchema = v14.object({
|
|
927
|
-
poolId: v14.string(),
|
|
928
|
-
assetInAddress: v14.string(),
|
|
929
|
-
assetOutAddress: v14.string(),
|
|
930
|
-
amountIn: v14.string(),
|
|
931
|
-
maxSlippageBps: v14.number(),
|
|
932
|
-
minAmountOut: v14.string(),
|
|
933
|
-
integratorFeeRateBps: v14.optional(v14.number()),
|
|
934
|
-
integratorPublicKey: v14.optional(v14.string())
|
|
935
|
-
});
|
|
936
|
-
var sparkFlashnetExecuteSwapResultSchema = v14.object({
|
|
937
|
-
requestId: v14.string(),
|
|
938
|
-
accepted: v14.boolean(),
|
|
939
|
-
amountOut: v14.optional(v14.string()),
|
|
940
|
-
feeAmount: v14.optional(v14.string()),
|
|
941
|
-
executionPrice: v14.optional(v14.string()),
|
|
942
|
-
assetOutAddress: v14.optional(v14.string()),
|
|
943
|
-
assetInAddress: v14.optional(v14.string()),
|
|
944
|
-
outboundTransferId: v14.optional(v14.string()),
|
|
945
|
-
error: v14.optional(v14.string())
|
|
946
|
-
});
|
|
947
|
-
var sparkFlashnetExecuteSwapRequestMessageSchema = v14.object({
|
|
948
|
-
...rpcRequestMessageSchema.entries,
|
|
949
|
-
...v14.object({
|
|
950
|
-
method: v14.literal(sparkFlashnetExecuteSwapMethodName),
|
|
928
|
+
method: v13.literal(sparkFlashnetExecuteSwapMethodName),
|
|
951
929
|
params: sparkFlashnetExecuteSwapParamsSchema,
|
|
952
|
-
id:
|
|
930
|
+
id: v13.string()
|
|
953
931
|
}).entries
|
|
954
932
|
});
|
|
955
933
|
|
|
956
934
|
// src/request/types/sparkMethods/flashnetMethods/getJwt.ts
|
|
957
|
-
import * as
|
|
935
|
+
import * as v14 from "valibot";
|
|
958
936
|
var sparkFlashnetGetJwtMethodName = "spark_flashnet_getJwt";
|
|
959
|
-
var sparkFlashnetGetJwtParamsSchema =
|
|
960
|
-
var sparkFlashnetGetJwtResultSchema =
|
|
937
|
+
var sparkFlashnetGetJwtParamsSchema = v14.null();
|
|
938
|
+
var sparkFlashnetGetJwtResultSchema = v14.object({
|
|
961
939
|
/**
|
|
962
940
|
* The JWT token for authenticated requests to the Flashnet API.
|
|
963
941
|
*/
|
|
964
|
-
jwt:
|
|
942
|
+
jwt: v14.string()
|
|
965
943
|
});
|
|
966
|
-
var sparkFlashnetGetJwtRequestMessageSchema =
|
|
944
|
+
var sparkFlashnetGetJwtRequestMessageSchema = v14.object({
|
|
967
945
|
...rpcRequestMessageSchema.entries,
|
|
968
|
-
...
|
|
969
|
-
method:
|
|
946
|
+
...v14.object({
|
|
947
|
+
method: v14.literal(sparkFlashnetGetJwtMethodName),
|
|
970
948
|
params: sparkFlashnetGetJwtParamsSchema,
|
|
971
|
-
id:
|
|
949
|
+
id: v14.string()
|
|
972
950
|
}).entries
|
|
973
951
|
});
|
|
974
952
|
|
|
975
953
|
// src/request/types/sparkMethods/flashnetMethods/intents/addLiquidity.ts
|
|
954
|
+
import * as v15 from "valibot";
|
|
955
|
+
var sparkFlashnetAddLiquidityIntentSchema = v15.object({
|
|
956
|
+
type: v15.literal("addLiquidity"),
|
|
957
|
+
data: v15.object({
|
|
958
|
+
userPublicKey: v15.string(),
|
|
959
|
+
poolId: v15.string(),
|
|
960
|
+
assetAAmount: v15.string(),
|
|
961
|
+
assetBAmount: v15.string(),
|
|
962
|
+
assetAMinAmountIn: v15.string(),
|
|
963
|
+
assetBMinAmountIn: v15.string(),
|
|
964
|
+
assetATransferId: v15.string(),
|
|
965
|
+
assetBTransferId: v15.string(),
|
|
966
|
+
nonce: v15.string()
|
|
967
|
+
})
|
|
968
|
+
});
|
|
969
|
+
|
|
970
|
+
// src/request/types/sparkMethods/flashnetMethods/intents/clawback.ts
|
|
976
971
|
import * as v16 from "valibot";
|
|
977
|
-
var
|
|
978
|
-
type: v16.literal("
|
|
972
|
+
var sparkFlashnetClawbackIntentSchema = v16.object({
|
|
973
|
+
type: v16.literal("clawback"),
|
|
979
974
|
data: v16.object({
|
|
980
|
-
|
|
981
|
-
|
|
982
|
-
|
|
983
|
-
assetBAmount: v16.string(),
|
|
984
|
-
assetAMinAmountIn: v16.string(),
|
|
985
|
-
assetBMinAmountIn: v16.string(),
|
|
986
|
-
assetATransferId: v16.string(),
|
|
987
|
-
assetBTransferId: v16.string(),
|
|
975
|
+
senderPublicKey: v16.string(),
|
|
976
|
+
sparkTransferId: v16.string(),
|
|
977
|
+
lpIdentityPublicKey: v16.string(),
|
|
988
978
|
nonce: v16.string()
|
|
989
979
|
})
|
|
990
980
|
});
|
|
991
981
|
|
|
992
|
-
// src/request/types/sparkMethods/flashnetMethods/intents/
|
|
982
|
+
// src/request/types/sparkMethods/flashnetMethods/intents/confirmInitialDeposit.ts
|
|
993
983
|
import * as v17 from "valibot";
|
|
994
|
-
var
|
|
995
|
-
type: v17.literal("
|
|
984
|
+
var sparkFlashnetConfirmInitialDepositIntentSchema = v17.object({
|
|
985
|
+
type: v17.literal("confirmInitialDeposit"),
|
|
996
986
|
data: v17.object({
|
|
997
|
-
|
|
998
|
-
|
|
999
|
-
|
|
987
|
+
poolId: v17.string(),
|
|
988
|
+
assetASparkTransferId: v17.string(),
|
|
989
|
+
poolOwnerPublicKey: v17.string(),
|
|
1000
990
|
nonce: v17.string()
|
|
1001
991
|
})
|
|
1002
992
|
});
|
|
1003
993
|
|
|
1004
|
-
// src/request/types/sparkMethods/flashnetMethods/intents/
|
|
994
|
+
// src/request/types/sparkMethods/flashnetMethods/intents/createConstantProductPool.ts
|
|
1005
995
|
import * as v18 from "valibot";
|
|
1006
|
-
var
|
|
1007
|
-
type: v18.literal("
|
|
996
|
+
var sparkFlashnetCreateConstantProductPoolIntentSchema = v18.object({
|
|
997
|
+
type: v18.literal("createConstantProductPool"),
|
|
1008
998
|
data: v18.object({
|
|
1009
|
-
poolId: v18.string(),
|
|
1010
|
-
assetASparkTransferId: v18.string(),
|
|
1011
999
|
poolOwnerPublicKey: v18.string(),
|
|
1000
|
+
assetAAddress: v18.string(),
|
|
1001
|
+
assetBAddress: v18.string(),
|
|
1002
|
+
lpFeeRateBps: v18.union([v18.number(), v18.string()]),
|
|
1003
|
+
totalHostFeeRateBps: v18.union([v18.number(), v18.string()]),
|
|
1012
1004
|
nonce: v18.string()
|
|
1013
1005
|
})
|
|
1014
1006
|
});
|
|
1015
1007
|
|
|
1016
|
-
// src/request/types/sparkMethods/flashnetMethods/intents/
|
|
1008
|
+
// src/request/types/sparkMethods/flashnetMethods/intents/createSingleSidedPool.ts
|
|
1017
1009
|
import * as v19 from "valibot";
|
|
1018
|
-
var
|
|
1019
|
-
type: v19.literal("
|
|
1010
|
+
var sparkFlashnetCreateSingleSidedPoolIntentSchema = v19.object({
|
|
1011
|
+
type: v19.literal("createSingleSidedPool"),
|
|
1020
1012
|
data: v19.object({
|
|
1021
|
-
poolOwnerPublicKey: v19.string(),
|
|
1022
1013
|
assetAAddress: v19.string(),
|
|
1023
1014
|
assetBAddress: v19.string(),
|
|
1015
|
+
assetAInitialReserve: v19.string(),
|
|
1016
|
+
virtualReserveA: v19.union([v19.number(), v19.string()]),
|
|
1017
|
+
virtualReserveB: v19.union([v19.number(), v19.string()]),
|
|
1018
|
+
threshold: v19.union([v19.number(), v19.string()]),
|
|
1024
1019
|
lpFeeRateBps: v19.union([v19.number(), v19.string()]),
|
|
1025
1020
|
totalHostFeeRateBps: v19.union([v19.number(), v19.string()]),
|
|
1021
|
+
poolOwnerPublicKey: v19.string(),
|
|
1026
1022
|
nonce: v19.string()
|
|
1027
1023
|
})
|
|
1028
1024
|
});
|
|
1029
1025
|
|
|
1030
|
-
// src/request/types/sparkMethods/flashnetMethods/intents/
|
|
1026
|
+
// src/request/types/sparkMethods/flashnetMethods/intents/removeLiquidity.ts
|
|
1031
1027
|
import * as v20 from "valibot";
|
|
1032
|
-
var
|
|
1033
|
-
type: v20.literal("
|
|
1028
|
+
var sparkFlashnetRemoveLiquidityIntentSchema = v20.object({
|
|
1029
|
+
type: v20.literal("removeLiquidity"),
|
|
1034
1030
|
data: v20.object({
|
|
1035
|
-
|
|
1036
|
-
|
|
1037
|
-
|
|
1038
|
-
virtualReserveA: v20.union([v20.number(), v20.string()]),
|
|
1039
|
-
virtualReserveB: v20.union([v20.number(), v20.string()]),
|
|
1040
|
-
threshold: v20.union([v20.number(), v20.string()]),
|
|
1041
|
-
lpFeeRateBps: v20.union([v20.number(), v20.string()]),
|
|
1042
|
-
totalHostFeeRateBps: v20.union([v20.number(), v20.string()]),
|
|
1043
|
-
poolOwnerPublicKey: v20.string(),
|
|
1031
|
+
userPublicKey: v20.string(),
|
|
1032
|
+
poolId: v20.string(),
|
|
1033
|
+
lpTokensToRemove: v20.string(),
|
|
1044
1034
|
nonce: v20.string()
|
|
1045
1035
|
})
|
|
1046
1036
|
});
|
|
1047
1037
|
|
|
1048
|
-
// src/request/types/sparkMethods/flashnetMethods/intents/
|
|
1038
|
+
// src/request/types/sparkMethods/flashnetMethods/intents/routeSwap.ts
|
|
1049
1039
|
import * as v21 from "valibot";
|
|
1050
|
-
var
|
|
1051
|
-
type: v21.literal("
|
|
1040
|
+
var sparkFlashnetRouteSwapIntentSchema = v21.object({
|
|
1041
|
+
type: v21.literal("executeRouteSwap"),
|
|
1052
1042
|
data: v21.object({
|
|
1053
1043
|
userPublicKey: v21.string(),
|
|
1054
|
-
|
|
1055
|
-
|
|
1044
|
+
initialSparkTransferId: v21.string(),
|
|
1045
|
+
hops: v21.array(
|
|
1046
|
+
v21.object({
|
|
1047
|
+
poolId: v21.string(),
|
|
1048
|
+
inputAssetAddress: v21.string(),
|
|
1049
|
+
outputAssetAddress: v21.string(),
|
|
1050
|
+
hopIntegratorFeeRateBps: v21.optional(v21.union([v21.number(), v21.string()]))
|
|
1051
|
+
})
|
|
1052
|
+
),
|
|
1053
|
+
inputAmount: v21.string(),
|
|
1054
|
+
maxRouteSlippageBps: v21.union([v21.number(), v21.string()]),
|
|
1055
|
+
minAmountOut: v21.string(),
|
|
1056
|
+
defaultIntegratorFeeRateBps: v21.optional(v21.union([v21.number(), v21.string()])),
|
|
1056
1057
|
nonce: v21.string()
|
|
1057
1058
|
})
|
|
1058
1059
|
});
|
|
1059
1060
|
|
|
1060
|
-
// src/request/types/sparkMethods/flashnetMethods/intents/
|
|
1061
|
+
// src/request/types/sparkMethods/flashnetMethods/intents/swap.ts
|
|
1061
1062
|
import * as v22 from "valibot";
|
|
1062
|
-
var
|
|
1063
|
-
type: v22.literal("
|
|
1063
|
+
var sparkFlashnetSwapIntentSchema = v22.object({
|
|
1064
|
+
type: v22.literal("executeSwap"),
|
|
1064
1065
|
data: v22.object({
|
|
1065
1066
|
userPublicKey: v22.string(),
|
|
1066
|
-
|
|
1067
|
-
|
|
1068
|
-
|
|
1069
|
-
|
|
1070
|
-
|
|
1071
|
-
|
|
1072
|
-
hopIntegratorFeeRateBps: v22.optional(v22.union([v22.number(), v22.string()]))
|
|
1073
|
-
})
|
|
1074
|
-
),
|
|
1075
|
-
inputAmount: v22.string(),
|
|
1076
|
-
maxRouteSlippageBps: v22.union([v22.number(), v22.string()]),
|
|
1067
|
+
poolId: v22.string(),
|
|
1068
|
+
transferId: v22.string(),
|
|
1069
|
+
assetInAddress: v22.string(),
|
|
1070
|
+
assetOutAddress: v22.string(),
|
|
1071
|
+
amountIn: v22.string(),
|
|
1072
|
+
maxSlippageBps: v22.union([v22.number(), v22.string()]),
|
|
1077
1073
|
minAmountOut: v22.string(),
|
|
1078
|
-
|
|
1074
|
+
totalIntegratorFeeRateBps: v22.optional(v22.union([v22.number(), v22.string()])),
|
|
1079
1075
|
nonce: v22.string()
|
|
1080
1076
|
})
|
|
1081
1077
|
});
|
|
1082
1078
|
|
|
1083
|
-
// src/request/types/sparkMethods/flashnetMethods/intents/swap.ts
|
|
1084
|
-
import * as v23 from "valibot";
|
|
1085
|
-
var sparkFlashnetSwapIntentSchema = v23.object({
|
|
1086
|
-
type: v23.literal("executeSwap"),
|
|
1087
|
-
data: v23.object({
|
|
1088
|
-
userPublicKey: v23.string(),
|
|
1089
|
-
poolId: v23.string(),
|
|
1090
|
-
transferId: v23.string(),
|
|
1091
|
-
assetInAddress: v23.string(),
|
|
1092
|
-
assetOutAddress: v23.string(),
|
|
1093
|
-
amountIn: v23.string(),
|
|
1094
|
-
maxSlippageBps: v23.union([v23.number(), v23.string()]),
|
|
1095
|
-
minAmountOut: v23.string(),
|
|
1096
|
-
totalIntegratorFeeRateBps: v23.optional(v23.union([v23.number(), v23.string()])),
|
|
1097
|
-
nonce: v23.string()
|
|
1098
|
-
})
|
|
1099
|
-
});
|
|
1100
|
-
|
|
1101
1079
|
// src/request/types/sparkMethods/flashnetMethods/signIntent.ts
|
|
1102
|
-
import * as
|
|
1080
|
+
import * as v23 from "valibot";
|
|
1103
1081
|
var sparkFlashnetSignIntentMethodName = "spark_flashnet_signIntent";
|
|
1104
|
-
var sparkFlashnetSignIntentParamsSchema =
|
|
1082
|
+
var sparkFlashnetSignIntentParamsSchema = v23.union([
|
|
1105
1083
|
sparkFlashnetSwapIntentSchema,
|
|
1106
1084
|
sparkFlashnetRouteSwapIntentSchema,
|
|
1107
1085
|
sparkFlashnetAddLiquidityIntentSchema,
|
|
@@ -1111,109 +1089,109 @@ var sparkFlashnetSignIntentParamsSchema = v24.union([
|
|
|
1111
1089
|
sparkFlashnetCreateSingleSidedPoolIntentSchema,
|
|
1112
1090
|
sparkFlashnetRemoveLiquidityIntentSchema
|
|
1113
1091
|
]);
|
|
1114
|
-
var sparkFlashnetSignIntentResultSchema =
|
|
1092
|
+
var sparkFlashnetSignIntentResultSchema = v23.object({
|
|
1115
1093
|
/**
|
|
1116
1094
|
* The signed intent as a hex string.
|
|
1117
1095
|
*/
|
|
1118
|
-
signature:
|
|
1096
|
+
signature: v23.string()
|
|
1119
1097
|
});
|
|
1120
|
-
var sparkFlashnetSignIntentRequestMessageSchema =
|
|
1098
|
+
var sparkFlashnetSignIntentRequestMessageSchema = v23.object({
|
|
1121
1099
|
...rpcRequestMessageSchema.entries,
|
|
1122
|
-
...
|
|
1123
|
-
method:
|
|
1100
|
+
...v23.object({
|
|
1101
|
+
method: v23.literal(sparkFlashnetSignIntentMethodName),
|
|
1124
1102
|
params: sparkFlashnetSignIntentParamsSchema,
|
|
1125
|
-
id:
|
|
1103
|
+
id: v23.string()
|
|
1126
1104
|
}).entries
|
|
1127
1105
|
});
|
|
1128
1106
|
|
|
1129
1107
|
// src/request/types/sparkMethods/flashnetMethods/signStructuredMessage.ts
|
|
1130
|
-
import * as
|
|
1108
|
+
import * as v24 from "valibot";
|
|
1131
1109
|
var sparkFlashnetSignStructuredMessageMethodName = "spark_flashnet_signStructuredMessage";
|
|
1132
|
-
var sparkFlashnetSignStructuredMessageParamsSchema =
|
|
1133
|
-
message:
|
|
1110
|
+
var sparkFlashnetSignStructuredMessageParamsSchema = v24.object({
|
|
1111
|
+
message: v24.string()
|
|
1134
1112
|
});
|
|
1135
|
-
var sparkFlashnetSignStructuredMessageResultSchema =
|
|
1136
|
-
message:
|
|
1137
|
-
signature:
|
|
1113
|
+
var sparkFlashnetSignStructuredMessageResultSchema = v24.object({
|
|
1114
|
+
message: v24.string(),
|
|
1115
|
+
signature: v24.string()
|
|
1138
1116
|
});
|
|
1139
|
-
var sparkFlashnetSignStructuredMessageRequestMessageSchema =
|
|
1117
|
+
var sparkFlashnetSignStructuredMessageRequestMessageSchema = v24.object({
|
|
1140
1118
|
...rpcRequestMessageSchema.entries,
|
|
1141
|
-
...
|
|
1142
|
-
method:
|
|
1119
|
+
...v24.object({
|
|
1120
|
+
method: v24.literal(sparkFlashnetSignStructuredMessageMethodName),
|
|
1143
1121
|
params: sparkFlashnetSignStructuredMessageParamsSchema,
|
|
1144
|
-
id:
|
|
1122
|
+
id: v24.string()
|
|
1145
1123
|
}).entries
|
|
1146
1124
|
});
|
|
1147
1125
|
|
|
1148
1126
|
// src/request/types/sparkMethods/getAddresses.ts
|
|
1149
|
-
import * as
|
|
1127
|
+
import * as v25 from "valibot";
|
|
1150
1128
|
var sparkGetAddressesMethodName = "spark_getAddresses";
|
|
1151
|
-
var sparkGetAddressesParamsSchema =
|
|
1152
|
-
|
|
1129
|
+
var sparkGetAddressesParamsSchema = v25.nullish(
|
|
1130
|
+
v25.object({
|
|
1153
1131
|
/**
|
|
1154
1132
|
* A message to be displayed to the user in the request prompt.
|
|
1155
1133
|
*/
|
|
1156
|
-
message:
|
|
1134
|
+
message: v25.optional(v25.string())
|
|
1157
1135
|
})
|
|
1158
1136
|
);
|
|
1159
|
-
var sparkGetAddressesResultSchema =
|
|
1137
|
+
var sparkGetAddressesResultSchema = v25.object({
|
|
1160
1138
|
/**
|
|
1161
1139
|
* The addresses generated for the given purposes.
|
|
1162
1140
|
*/
|
|
1163
|
-
addresses:
|
|
1141
|
+
addresses: v25.array(addressSchema),
|
|
1164
1142
|
network: getNetworkResultSchema
|
|
1165
1143
|
});
|
|
1166
|
-
var sparkGetAddressesRequestMessageSchema =
|
|
1144
|
+
var sparkGetAddressesRequestMessageSchema = v25.object({
|
|
1167
1145
|
...rpcRequestMessageSchema.entries,
|
|
1168
|
-
...
|
|
1169
|
-
method:
|
|
1146
|
+
...v25.object({
|
|
1147
|
+
method: v25.literal(sparkGetAddressesMethodName),
|
|
1170
1148
|
params: sparkGetAddressesParamsSchema,
|
|
1171
|
-
id:
|
|
1149
|
+
id: v25.string()
|
|
1172
1150
|
}).entries
|
|
1173
1151
|
});
|
|
1174
1152
|
|
|
1175
1153
|
// src/request/types/sparkMethods/getBalance.ts
|
|
1176
|
-
import * as
|
|
1154
|
+
import * as v26 from "valibot";
|
|
1177
1155
|
var sparkGetBalanceMethodName = "spark_getBalance";
|
|
1178
|
-
var sparkGetBalanceParamsSchema =
|
|
1179
|
-
var sparkGetBalanceResultSchema =
|
|
1156
|
+
var sparkGetBalanceParamsSchema = v26.nullish(v26.null());
|
|
1157
|
+
var sparkGetBalanceResultSchema = v26.object({
|
|
1180
1158
|
/**
|
|
1181
1159
|
* The Spark Bitcoin address balance in sats in string form.
|
|
1182
1160
|
*/
|
|
1183
|
-
balance:
|
|
1184
|
-
tokenBalances:
|
|
1185
|
-
|
|
1161
|
+
balance: v26.string(),
|
|
1162
|
+
tokenBalances: v26.array(
|
|
1163
|
+
v26.object({
|
|
1186
1164
|
/* The address balance of the token in string form as it can overflow a js number */
|
|
1187
|
-
balance:
|
|
1188
|
-
tokenMetadata:
|
|
1189
|
-
tokenIdentifier:
|
|
1190
|
-
tokenName:
|
|
1191
|
-
tokenTicker:
|
|
1192
|
-
decimals:
|
|
1193
|
-
maxSupply:
|
|
1165
|
+
balance: v26.string(),
|
|
1166
|
+
tokenMetadata: v26.object({
|
|
1167
|
+
tokenIdentifier: v26.string(),
|
|
1168
|
+
tokenName: v26.string(),
|
|
1169
|
+
tokenTicker: v26.string(),
|
|
1170
|
+
decimals: v26.number(),
|
|
1171
|
+
maxSupply: v26.string()
|
|
1194
1172
|
})
|
|
1195
1173
|
})
|
|
1196
1174
|
)
|
|
1197
1175
|
});
|
|
1198
|
-
var sparkGetBalanceRequestMessageSchema =
|
|
1176
|
+
var sparkGetBalanceRequestMessageSchema = v26.object({
|
|
1199
1177
|
...rpcRequestMessageSchema.entries,
|
|
1200
|
-
...
|
|
1201
|
-
method:
|
|
1178
|
+
...v26.object({
|
|
1179
|
+
method: v26.literal(sparkGetBalanceMethodName),
|
|
1202
1180
|
params: sparkGetBalanceParamsSchema,
|
|
1203
|
-
id:
|
|
1181
|
+
id: v26.string()
|
|
1204
1182
|
}).entries
|
|
1205
1183
|
});
|
|
1206
1184
|
|
|
1207
1185
|
// src/request/types/sparkMethods/signMessage.ts
|
|
1208
|
-
import * as
|
|
1186
|
+
import * as v27 from "valibot";
|
|
1209
1187
|
var sparkSignMessageMethodName = "spark_signMessage";
|
|
1210
|
-
var sparkSignMessageParamsSchema =
|
|
1188
|
+
var sparkSignMessageParamsSchema = v27.object({
|
|
1211
1189
|
/**
|
|
1212
1190
|
* The message to sign. The message should only consist of valid UTF-8 characters.
|
|
1213
1191
|
*/
|
|
1214
|
-
message:
|
|
1192
|
+
message: v27.string()
|
|
1215
1193
|
});
|
|
1216
|
-
var sparkSignMessageResultSchema =
|
|
1194
|
+
var sparkSignMessageResultSchema = v27.object({
|
|
1217
1195
|
/**
|
|
1218
1196
|
* The signature, encoded in base64, of the message hash.
|
|
1219
1197
|
*
|
|
@@ -1221,98 +1199,98 @@ var sparkSignMessageResultSchema = v28.object({
|
|
|
1221
1199
|
* and the resulting byte array is hashed with SHA256 before signing
|
|
1222
1200
|
* with the private key.
|
|
1223
1201
|
*/
|
|
1224
|
-
signature:
|
|
1202
|
+
signature: v27.string()
|
|
1225
1203
|
});
|
|
1226
|
-
var sparkSignMessageRequestMessageSchema =
|
|
1204
|
+
var sparkSignMessageRequestMessageSchema = v27.object({
|
|
1227
1205
|
...rpcRequestMessageSchema.entries,
|
|
1228
|
-
...
|
|
1229
|
-
method:
|
|
1206
|
+
...v27.object({
|
|
1207
|
+
method: v27.literal(sparkSignMessageMethodName),
|
|
1230
1208
|
params: sparkSignMessageParamsSchema,
|
|
1231
|
-
id:
|
|
1209
|
+
id: v27.string()
|
|
1232
1210
|
}).entries
|
|
1233
1211
|
});
|
|
1234
1212
|
|
|
1235
1213
|
// src/request/types/sparkMethods/transfer.ts
|
|
1236
|
-
import * as
|
|
1214
|
+
import * as v28 from "valibot";
|
|
1237
1215
|
var sparkTransferMethodName = "spark_transfer";
|
|
1238
|
-
var sparkTransferParamsSchema =
|
|
1216
|
+
var sparkTransferParamsSchema = v28.object({
|
|
1239
1217
|
/**
|
|
1240
1218
|
* Amount of SATS to transfer as a string or number.
|
|
1241
1219
|
*/
|
|
1242
|
-
amountSats:
|
|
1220
|
+
amountSats: v28.union([v28.number(), v28.string()]),
|
|
1243
1221
|
/**
|
|
1244
1222
|
* The recipient's spark address.
|
|
1245
1223
|
*/
|
|
1246
|
-
receiverSparkAddress:
|
|
1224
|
+
receiverSparkAddress: v28.string()
|
|
1247
1225
|
});
|
|
1248
|
-
var sparkTransferResultSchema =
|
|
1226
|
+
var sparkTransferResultSchema = v28.object({
|
|
1249
1227
|
/**
|
|
1250
1228
|
* The ID of the transaction.
|
|
1251
1229
|
*/
|
|
1252
|
-
id:
|
|
1230
|
+
id: v28.string()
|
|
1253
1231
|
});
|
|
1254
|
-
var sparkTransferRequestMessageSchema =
|
|
1232
|
+
var sparkTransferRequestMessageSchema = v28.object({
|
|
1255
1233
|
...rpcRequestMessageSchema.entries,
|
|
1256
|
-
...
|
|
1257
|
-
method:
|
|
1234
|
+
...v28.object({
|
|
1235
|
+
method: v28.literal(sparkTransferMethodName),
|
|
1258
1236
|
params: sparkTransferParamsSchema,
|
|
1259
|
-
id:
|
|
1237
|
+
id: v28.string()
|
|
1260
1238
|
}).entries
|
|
1261
1239
|
});
|
|
1262
1240
|
|
|
1263
1241
|
// src/request/types/sparkMethods/transferToken.ts
|
|
1264
|
-
import * as
|
|
1242
|
+
import * as v29 from "valibot";
|
|
1265
1243
|
var sparkTransferTokenMethodName = "spark_transferToken";
|
|
1266
|
-
var sparkTransferTokenParamsSchema =
|
|
1244
|
+
var sparkTransferTokenParamsSchema = v29.object({
|
|
1267
1245
|
/**
|
|
1268
1246
|
* Amount of units of the token to transfer as a string or number.
|
|
1269
1247
|
*/
|
|
1270
|
-
tokenAmount:
|
|
1248
|
+
tokenAmount: v29.union([v29.number(), v29.string()]),
|
|
1271
1249
|
/**
|
|
1272
1250
|
* The Bech32m token identifier.
|
|
1273
1251
|
*/
|
|
1274
|
-
tokenIdentifier:
|
|
1252
|
+
tokenIdentifier: v29.string(),
|
|
1275
1253
|
/**
|
|
1276
1254
|
* The recipient's spark address.
|
|
1277
1255
|
*/
|
|
1278
|
-
receiverSparkAddress:
|
|
1256
|
+
receiverSparkAddress: v29.string()
|
|
1279
1257
|
});
|
|
1280
|
-
var sparkTransferTokenResultSchema =
|
|
1258
|
+
var sparkTransferTokenResultSchema = v29.object({
|
|
1281
1259
|
/**
|
|
1282
1260
|
* The ID of the transaction.
|
|
1283
1261
|
*/
|
|
1284
|
-
id:
|
|
1262
|
+
id: v29.string()
|
|
1285
1263
|
});
|
|
1286
|
-
var sparkTransferTokenRequestMessageSchema =
|
|
1264
|
+
var sparkTransferTokenRequestMessageSchema = v29.object({
|
|
1287
1265
|
...rpcRequestMessageSchema.entries,
|
|
1288
|
-
...
|
|
1289
|
-
method:
|
|
1266
|
+
...v29.object({
|
|
1267
|
+
method: v29.literal(sparkTransferTokenMethodName),
|
|
1290
1268
|
params: sparkTransferTokenParamsSchema,
|
|
1291
|
-
id:
|
|
1269
|
+
id: v29.string()
|
|
1292
1270
|
}).entries
|
|
1293
1271
|
});
|
|
1294
1272
|
|
|
1295
1273
|
// src/request/types/stxMethods/callContract.ts
|
|
1296
|
-
import * as
|
|
1274
|
+
import * as v30 from "valibot";
|
|
1297
1275
|
var stxCallContractMethodName = "stx_callContract";
|
|
1298
|
-
var stxCallContractParamsSchema =
|
|
1276
|
+
var stxCallContractParamsSchema = v30.object({
|
|
1299
1277
|
/**
|
|
1300
1278
|
* The contract principal.
|
|
1301
1279
|
*
|
|
1302
1280
|
* E.g. `"SPKE...GD5C.my-contract"`
|
|
1303
1281
|
*/
|
|
1304
|
-
contract:
|
|
1282
|
+
contract: v30.string(),
|
|
1305
1283
|
/**
|
|
1306
1284
|
* The name of the function to call.
|
|
1307
1285
|
*
|
|
1308
1286
|
* Note: spec changes ongoing,
|
|
1309
1287
|
* https://github.com/stacksgov/sips/pull/166#pullrequestreview-1914236999
|
|
1310
1288
|
*/
|
|
1311
|
-
functionName:
|
|
1289
|
+
functionName: v30.string(),
|
|
1312
1290
|
/**
|
|
1313
1291
|
* @deprecated in favor of `functionArgs` for @stacks/connect compatibility
|
|
1314
1292
|
*/
|
|
1315
|
-
arguments:
|
|
1293
|
+
arguments: v30.optional(v30.array(v30.string())),
|
|
1316
1294
|
/**
|
|
1317
1295
|
* The function's arguments. The arguments are expected to be hex-encoded
|
|
1318
1296
|
* strings of Clarity values.
|
|
@@ -1327,274 +1305,274 @@ var stxCallContractParamsSchema = v31.object({
|
|
|
1327
1305
|
* const hexArgs = functionArgs.map(cvToHex);
|
|
1328
1306
|
* ```
|
|
1329
1307
|
*/
|
|
1330
|
-
functionArgs:
|
|
1308
|
+
functionArgs: v30.optional(v30.array(v30.string())),
|
|
1331
1309
|
/**
|
|
1332
1310
|
* The post conditions to apply to the contract call.
|
|
1333
1311
|
*/
|
|
1334
|
-
postConditions:
|
|
1312
|
+
postConditions: v30.optional(v30.array(v30.string())),
|
|
1335
1313
|
/**
|
|
1336
1314
|
* The mode to apply to the post conditions.
|
|
1337
1315
|
*/
|
|
1338
|
-
postConditionMode:
|
|
1316
|
+
postConditionMode: v30.optional(v30.union([v30.literal("allow"), v30.literal("deny")]))
|
|
1339
1317
|
});
|
|
1340
|
-
var stxCallContractResultSchema =
|
|
1318
|
+
var stxCallContractResultSchema = v30.object({
|
|
1341
1319
|
/**
|
|
1342
1320
|
* The ID of the transaction.
|
|
1343
1321
|
*/
|
|
1344
|
-
txid:
|
|
1322
|
+
txid: v30.string(),
|
|
1345
1323
|
/**
|
|
1346
1324
|
* A Stacks transaction as a hex-encoded string.
|
|
1347
1325
|
*/
|
|
1348
|
-
transaction:
|
|
1326
|
+
transaction: v30.string()
|
|
1349
1327
|
});
|
|
1350
|
-
var stxCallContractRequestMessageSchema =
|
|
1328
|
+
var stxCallContractRequestMessageSchema = v30.object({
|
|
1351
1329
|
...rpcRequestMessageSchema.entries,
|
|
1352
|
-
...
|
|
1353
|
-
method:
|
|
1330
|
+
...v30.object({
|
|
1331
|
+
method: v30.literal(stxCallContractMethodName),
|
|
1354
1332
|
params: stxCallContractParamsSchema,
|
|
1355
|
-
id:
|
|
1333
|
+
id: v30.string()
|
|
1356
1334
|
}).entries
|
|
1357
1335
|
});
|
|
1358
1336
|
|
|
1359
1337
|
// src/request/types/stxMethods/deployContract.ts
|
|
1360
|
-
import * as
|
|
1338
|
+
import * as v31 from "valibot";
|
|
1361
1339
|
var stxDeployContractMethodName = "stx_deployContract";
|
|
1362
|
-
var stxDeployContractParamsSchema =
|
|
1340
|
+
var stxDeployContractParamsSchema = v31.object({
|
|
1363
1341
|
/**
|
|
1364
1342
|
* Name of the contract.
|
|
1365
1343
|
*/
|
|
1366
|
-
name:
|
|
1344
|
+
name: v31.string(),
|
|
1367
1345
|
/**
|
|
1368
1346
|
* The source code of the Clarity contract.
|
|
1369
1347
|
*/
|
|
1370
|
-
clarityCode:
|
|
1348
|
+
clarityCode: v31.string(),
|
|
1371
1349
|
/**
|
|
1372
1350
|
* The version of the Clarity contract.
|
|
1373
1351
|
*/
|
|
1374
|
-
clarityVersion:
|
|
1352
|
+
clarityVersion: v31.optional(v31.number()),
|
|
1375
1353
|
/**
|
|
1376
1354
|
* The post conditions to apply to the contract call.
|
|
1377
1355
|
*/
|
|
1378
|
-
postConditions:
|
|
1356
|
+
postConditions: v31.optional(v31.array(v31.string())),
|
|
1379
1357
|
/**
|
|
1380
1358
|
* The mode to apply to the post conditions.
|
|
1381
1359
|
*/
|
|
1382
|
-
postConditionMode:
|
|
1360
|
+
postConditionMode: v31.optional(v31.union([v31.literal("allow"), v31.literal("deny")]))
|
|
1383
1361
|
});
|
|
1384
|
-
var stxDeployContractResultSchema =
|
|
1362
|
+
var stxDeployContractResultSchema = v31.object({
|
|
1385
1363
|
/**
|
|
1386
1364
|
* The ID of the transaction.
|
|
1387
1365
|
*/
|
|
1388
|
-
txid:
|
|
1366
|
+
txid: v31.string(),
|
|
1389
1367
|
/**
|
|
1390
1368
|
* A Stacks transaction as a hex-encoded string.
|
|
1391
1369
|
*/
|
|
1392
|
-
transaction:
|
|
1370
|
+
transaction: v31.string()
|
|
1393
1371
|
});
|
|
1394
|
-
var stxDeployContractRequestMessageSchema =
|
|
1372
|
+
var stxDeployContractRequestMessageSchema = v31.object({
|
|
1395
1373
|
...rpcRequestMessageSchema.entries,
|
|
1396
|
-
...
|
|
1397
|
-
method:
|
|
1374
|
+
...v31.object({
|
|
1375
|
+
method: v31.literal(stxDeployContractMethodName),
|
|
1398
1376
|
params: stxDeployContractParamsSchema,
|
|
1399
|
-
id:
|
|
1377
|
+
id: v31.string()
|
|
1400
1378
|
}).entries
|
|
1401
1379
|
});
|
|
1402
1380
|
|
|
1403
1381
|
// src/request/types/stxMethods/getAccounts.ts
|
|
1404
|
-
import * as
|
|
1382
|
+
import * as v32 from "valibot";
|
|
1405
1383
|
var stxGetAccountsMethodName = "stx_getAccounts";
|
|
1406
|
-
var stxGetAccountsParamsSchema =
|
|
1407
|
-
var stxGetAccountsResultSchema =
|
|
1384
|
+
var stxGetAccountsParamsSchema = v32.nullish(v32.null());
|
|
1385
|
+
var stxGetAccountsResultSchema = v32.object({
|
|
1408
1386
|
/**
|
|
1409
1387
|
* The addresses generated for the given purposes.
|
|
1410
1388
|
*/
|
|
1411
|
-
addresses:
|
|
1412
|
-
|
|
1413
|
-
address:
|
|
1414
|
-
publicKey:
|
|
1415
|
-
gaiaHubUrl:
|
|
1416
|
-
gaiaAppKey:
|
|
1389
|
+
addresses: v32.array(
|
|
1390
|
+
v32.object({
|
|
1391
|
+
address: v32.string(),
|
|
1392
|
+
publicKey: v32.string(),
|
|
1393
|
+
gaiaHubUrl: v32.string(),
|
|
1394
|
+
gaiaAppKey: v32.string()
|
|
1417
1395
|
})
|
|
1418
1396
|
),
|
|
1419
1397
|
network: getNetworkResultSchema
|
|
1420
1398
|
});
|
|
1421
|
-
var stxGetAccountsRequestMessageSchema =
|
|
1399
|
+
var stxGetAccountsRequestMessageSchema = v32.object({
|
|
1422
1400
|
...rpcRequestMessageSchema.entries,
|
|
1423
|
-
...
|
|
1424
|
-
method:
|
|
1401
|
+
...v32.object({
|
|
1402
|
+
method: v32.literal(stxGetAccountsMethodName),
|
|
1425
1403
|
params: stxGetAccountsParamsSchema,
|
|
1426
|
-
id:
|
|
1404
|
+
id: v32.string()
|
|
1427
1405
|
}).entries
|
|
1428
1406
|
});
|
|
1429
1407
|
|
|
1430
1408
|
// src/request/types/stxMethods/getAddresses.ts
|
|
1431
|
-
import * as
|
|
1409
|
+
import * as v33 from "valibot";
|
|
1432
1410
|
var stxGetAddressesMethodName = "stx_getAddresses";
|
|
1433
|
-
var stxGetAddressesParamsSchema =
|
|
1434
|
-
|
|
1411
|
+
var stxGetAddressesParamsSchema = v33.nullish(
|
|
1412
|
+
v33.object({
|
|
1435
1413
|
/**
|
|
1436
1414
|
* A message to be displayed to the user in the request prompt.
|
|
1437
1415
|
*/
|
|
1438
|
-
message:
|
|
1416
|
+
message: v33.optional(v33.string())
|
|
1439
1417
|
})
|
|
1440
1418
|
);
|
|
1441
|
-
var stxGetAddressesResultSchema =
|
|
1419
|
+
var stxGetAddressesResultSchema = v33.object({
|
|
1442
1420
|
/**
|
|
1443
1421
|
* The addresses generated for the given purposes.
|
|
1444
1422
|
*/
|
|
1445
|
-
addresses:
|
|
1423
|
+
addresses: v33.array(addressSchema),
|
|
1446
1424
|
network: getNetworkResultSchema
|
|
1447
1425
|
});
|
|
1448
|
-
var stxGetAddressesRequestMessageSchema =
|
|
1426
|
+
var stxGetAddressesRequestMessageSchema = v33.object({
|
|
1449
1427
|
...rpcRequestMessageSchema.entries,
|
|
1450
|
-
...
|
|
1451
|
-
method:
|
|
1428
|
+
...v33.object({
|
|
1429
|
+
method: v33.literal(stxGetAddressesMethodName),
|
|
1452
1430
|
params: stxGetAddressesParamsSchema,
|
|
1453
|
-
id:
|
|
1431
|
+
id: v33.string()
|
|
1454
1432
|
}).entries
|
|
1455
1433
|
});
|
|
1456
1434
|
|
|
1457
1435
|
// src/request/types/stxMethods/signMessage.ts
|
|
1458
|
-
import * as
|
|
1436
|
+
import * as v34 from "valibot";
|
|
1459
1437
|
var stxSignMessageMethodName = "stx_signMessage";
|
|
1460
|
-
var stxSignMessageParamsSchema =
|
|
1438
|
+
var stxSignMessageParamsSchema = v34.object({
|
|
1461
1439
|
/**
|
|
1462
1440
|
* The message to sign.
|
|
1463
1441
|
*/
|
|
1464
|
-
message:
|
|
1442
|
+
message: v34.string()
|
|
1465
1443
|
});
|
|
1466
|
-
var stxSignMessageResultSchema =
|
|
1444
|
+
var stxSignMessageResultSchema = v34.object({
|
|
1467
1445
|
/**
|
|
1468
1446
|
* The signature of the message.
|
|
1469
1447
|
*/
|
|
1470
|
-
signature:
|
|
1448
|
+
signature: v34.string(),
|
|
1471
1449
|
/**
|
|
1472
1450
|
* The public key used to sign the message.
|
|
1473
1451
|
*/
|
|
1474
|
-
publicKey:
|
|
1452
|
+
publicKey: v34.string()
|
|
1475
1453
|
});
|
|
1476
|
-
var stxSignMessageRequestMessageSchema =
|
|
1454
|
+
var stxSignMessageRequestMessageSchema = v34.object({
|
|
1477
1455
|
...rpcRequestMessageSchema.entries,
|
|
1478
|
-
...
|
|
1479
|
-
method:
|
|
1456
|
+
...v34.object({
|
|
1457
|
+
method: v34.literal(stxSignMessageMethodName),
|
|
1480
1458
|
params: stxSignMessageParamsSchema,
|
|
1481
|
-
id:
|
|
1459
|
+
id: v34.string()
|
|
1482
1460
|
}).entries
|
|
1483
1461
|
});
|
|
1484
1462
|
|
|
1485
1463
|
// src/request/types/stxMethods/signStructuredMessage.ts
|
|
1486
|
-
import * as
|
|
1464
|
+
import * as v35 from "valibot";
|
|
1487
1465
|
var stxSignStructuredMessageMethodName = "stx_signStructuredMessage";
|
|
1488
|
-
var stxSignStructuredMessageParamsSchema =
|
|
1466
|
+
var stxSignStructuredMessageParamsSchema = v35.object({
|
|
1489
1467
|
/**
|
|
1490
1468
|
* The domain to be signed.
|
|
1491
1469
|
*/
|
|
1492
|
-
domain:
|
|
1470
|
+
domain: v35.string(),
|
|
1493
1471
|
/**
|
|
1494
1472
|
* Message payload to be signed.
|
|
1495
1473
|
*/
|
|
1496
|
-
message:
|
|
1474
|
+
message: v35.string(),
|
|
1497
1475
|
/**
|
|
1498
1476
|
* The public key to sign the message with.
|
|
1499
1477
|
*/
|
|
1500
|
-
publicKey:
|
|
1478
|
+
publicKey: v35.optional(v35.string())
|
|
1501
1479
|
});
|
|
1502
|
-
var stxSignStructuredMessageResultSchema =
|
|
1480
|
+
var stxSignStructuredMessageResultSchema = v35.object({
|
|
1503
1481
|
/**
|
|
1504
1482
|
* Signature of the message.
|
|
1505
1483
|
*/
|
|
1506
|
-
signature:
|
|
1484
|
+
signature: v35.string(),
|
|
1507
1485
|
/**
|
|
1508
1486
|
* Public key as hex-encoded string.
|
|
1509
1487
|
*/
|
|
1510
|
-
publicKey:
|
|
1488
|
+
publicKey: v35.string()
|
|
1511
1489
|
});
|
|
1512
|
-
var stxSignStructuredMessageRequestMessageSchema =
|
|
1490
|
+
var stxSignStructuredMessageRequestMessageSchema = v35.object({
|
|
1513
1491
|
...rpcRequestMessageSchema.entries,
|
|
1514
|
-
...
|
|
1515
|
-
method:
|
|
1492
|
+
...v35.object({
|
|
1493
|
+
method: v35.literal(stxSignStructuredMessageMethodName),
|
|
1516
1494
|
params: stxSignStructuredMessageParamsSchema,
|
|
1517
|
-
id:
|
|
1495
|
+
id: v35.string()
|
|
1518
1496
|
}).entries
|
|
1519
1497
|
});
|
|
1520
1498
|
|
|
1521
1499
|
// src/request/types/stxMethods/signTransaction.ts
|
|
1522
|
-
import * as
|
|
1500
|
+
import * as v36 from "valibot";
|
|
1523
1501
|
var stxSignTransactionMethodName = "stx_signTransaction";
|
|
1524
|
-
var stxSignTransactionParamsSchema =
|
|
1502
|
+
var stxSignTransactionParamsSchema = v36.object({
|
|
1525
1503
|
/**
|
|
1526
1504
|
* The transaction to sign as a hex-encoded string.
|
|
1527
1505
|
*/
|
|
1528
|
-
transaction:
|
|
1506
|
+
transaction: v36.string(),
|
|
1529
1507
|
/**
|
|
1530
1508
|
* The public key to sign the transaction with. The wallet may use any key
|
|
1531
1509
|
* when not provided.
|
|
1532
1510
|
*/
|
|
1533
|
-
pubkey:
|
|
1511
|
+
pubkey: v36.optional(v36.string()),
|
|
1534
1512
|
/**
|
|
1535
1513
|
* Whether to broadcast the transaction after signing. Defaults to `true`.
|
|
1536
1514
|
*/
|
|
1537
|
-
broadcast:
|
|
1515
|
+
broadcast: v36.optional(v36.boolean())
|
|
1538
1516
|
});
|
|
1539
|
-
var stxSignTransactionResultSchema =
|
|
1517
|
+
var stxSignTransactionResultSchema = v36.object({
|
|
1540
1518
|
/**
|
|
1541
1519
|
* The signed transaction as a hex-encoded string.
|
|
1542
1520
|
*/
|
|
1543
|
-
transaction:
|
|
1521
|
+
transaction: v36.string()
|
|
1544
1522
|
});
|
|
1545
|
-
var stxSignTransactionRequestMessageSchema =
|
|
1523
|
+
var stxSignTransactionRequestMessageSchema = v36.object({
|
|
1546
1524
|
...rpcRequestMessageSchema.entries,
|
|
1547
|
-
...
|
|
1548
|
-
method:
|
|
1525
|
+
...v36.object({
|
|
1526
|
+
method: v36.literal(stxSignTransactionMethodName),
|
|
1549
1527
|
params: stxSignTransactionParamsSchema,
|
|
1550
|
-
id:
|
|
1528
|
+
id: v36.string()
|
|
1551
1529
|
}).entries
|
|
1552
1530
|
});
|
|
1553
1531
|
|
|
1554
1532
|
// src/request/types/stxMethods/signTransactions.ts
|
|
1555
|
-
import * as
|
|
1533
|
+
import * as v37 from "valibot";
|
|
1556
1534
|
var stxSignTransactionsMethodName = "stx_signTransactions";
|
|
1557
|
-
var stxSignTransactionsParamsSchema =
|
|
1535
|
+
var stxSignTransactionsParamsSchema = v37.object({
|
|
1558
1536
|
/**
|
|
1559
1537
|
* The transactions to sign as hex-encoded strings.
|
|
1560
1538
|
*/
|
|
1561
|
-
transactions:
|
|
1562
|
-
|
|
1563
|
-
|
|
1564
|
-
|
|
1565
|
-
|
|
1539
|
+
transactions: v37.pipe(
|
|
1540
|
+
v37.array(
|
|
1541
|
+
v37.pipe(
|
|
1542
|
+
v37.string(),
|
|
1543
|
+
v37.check((hex) => {
|
|
1566
1544
|
return true;
|
|
1567
1545
|
}, "Invalid hex-encoded Stacks transaction.")
|
|
1568
1546
|
)
|
|
1569
1547
|
),
|
|
1570
|
-
|
|
1548
|
+
v37.minLength(1)
|
|
1571
1549
|
),
|
|
1572
1550
|
/**
|
|
1573
1551
|
* Whether the signed transactions should be broadcast after signing. Defaults
|
|
1574
1552
|
* to `true`.
|
|
1575
1553
|
*/
|
|
1576
|
-
broadcast:
|
|
1554
|
+
broadcast: v37.optional(v37.boolean())
|
|
1577
1555
|
});
|
|
1578
|
-
var stxSignTransactionsResultSchema =
|
|
1556
|
+
var stxSignTransactionsResultSchema = v37.object({
|
|
1579
1557
|
/**
|
|
1580
1558
|
* The signed transactions as hex-encoded strings, in the same order as in the
|
|
1581
1559
|
* sign request.
|
|
1582
1560
|
*/
|
|
1583
|
-
transactions:
|
|
1561
|
+
transactions: v37.array(v37.string())
|
|
1584
1562
|
});
|
|
1585
|
-
var stxSignTransactionsRequestMessageSchema =
|
|
1563
|
+
var stxSignTransactionsRequestMessageSchema = v37.object({
|
|
1586
1564
|
...rpcRequestMessageSchema.entries,
|
|
1587
|
-
...
|
|
1588
|
-
method:
|
|
1565
|
+
...v37.object({
|
|
1566
|
+
method: v37.literal(stxSignTransactionsMethodName),
|
|
1589
1567
|
params: stxSignTransactionsParamsSchema,
|
|
1590
|
-
id:
|
|
1568
|
+
id: v37.string()
|
|
1591
1569
|
}).entries
|
|
1592
1570
|
});
|
|
1593
1571
|
|
|
1594
1572
|
// src/request/types/stxMethods/transferStx.ts
|
|
1595
|
-
import * as
|
|
1573
|
+
import * as v38 from "valibot";
|
|
1596
1574
|
var stxTransferStxMethodName = "stx_transferStx";
|
|
1597
|
-
var stxTransferStxParamsSchema =
|
|
1575
|
+
var stxTransferStxParamsSchema = v38.object({
|
|
1598
1576
|
/**
|
|
1599
1577
|
* Amount of STX tokens to transfer in microstacks as a string. Anything
|
|
1600
1578
|
* parseable by `BigInt` is acceptable.
|
|
@@ -1607,23 +1585,23 @@ var stxTransferStxParamsSchema = v39.object({
|
|
|
1607
1585
|
* const amount3 = '1234';
|
|
1608
1586
|
* ```
|
|
1609
1587
|
*/
|
|
1610
|
-
amount:
|
|
1588
|
+
amount: v38.union([v38.number(), v38.string()]),
|
|
1611
1589
|
/**
|
|
1612
1590
|
* The recipient's principal.
|
|
1613
1591
|
*/
|
|
1614
|
-
recipient:
|
|
1592
|
+
recipient: v38.string(),
|
|
1615
1593
|
/**
|
|
1616
1594
|
* A string representing the memo.
|
|
1617
1595
|
*/
|
|
1618
|
-
memo:
|
|
1596
|
+
memo: v38.optional(v38.string()),
|
|
1619
1597
|
/**
|
|
1620
1598
|
* Version of parameter format.
|
|
1621
1599
|
*/
|
|
1622
|
-
version:
|
|
1600
|
+
version: v38.optional(v38.string()),
|
|
1623
1601
|
/**
|
|
1624
1602
|
* The mode of the post conditions.
|
|
1625
1603
|
*/
|
|
1626
|
-
postConditionMode:
|
|
1604
|
+
postConditionMode: v38.optional(v38.number()),
|
|
1627
1605
|
/**
|
|
1628
1606
|
* A hex-encoded string representing the post conditions.
|
|
1629
1607
|
*
|
|
@@ -1636,29 +1614,29 @@ var stxTransferStxParamsSchema = v39.object({
|
|
|
1636
1614
|
* const hexPostCondition = serializePostCondition(postCondition).toString('hex');
|
|
1637
1615
|
* ```
|
|
1638
1616
|
*/
|
|
1639
|
-
postConditions:
|
|
1617
|
+
postConditions: v38.optional(v38.array(v38.string())),
|
|
1640
1618
|
/**
|
|
1641
1619
|
* The public key to sign the transaction with. The wallet may use any key
|
|
1642
1620
|
* when not provided.
|
|
1643
1621
|
*/
|
|
1644
|
-
pubkey:
|
|
1622
|
+
pubkey: v38.optional(v38.string())
|
|
1645
1623
|
});
|
|
1646
|
-
var stxTransferStxResultSchema =
|
|
1624
|
+
var stxTransferStxResultSchema = v38.object({
|
|
1647
1625
|
/**
|
|
1648
1626
|
* The ID of the transaction.
|
|
1649
1627
|
*/
|
|
1650
|
-
txid:
|
|
1628
|
+
txid: v38.string(),
|
|
1651
1629
|
/**
|
|
1652
1630
|
* A Stacks transaction as a hex-encoded string.
|
|
1653
1631
|
*/
|
|
1654
|
-
transaction:
|
|
1632
|
+
transaction: v38.string()
|
|
1655
1633
|
});
|
|
1656
|
-
var stxTransferStxRequestMessageSchema =
|
|
1634
|
+
var stxTransferStxRequestMessageSchema = v38.object({
|
|
1657
1635
|
...rpcRequestMessageSchema.entries,
|
|
1658
|
-
...
|
|
1659
|
-
method:
|
|
1636
|
+
...v38.object({
|
|
1637
|
+
method: v38.literal(stxTransferStxMethodName),
|
|
1660
1638
|
params: stxTransferStxParamsSchema,
|
|
1661
|
-
id:
|
|
1639
|
+
id: v38.string()
|
|
1662
1640
|
}).entries
|
|
1663
1641
|
});
|
|
1664
1642
|
|
|
@@ -1666,13 +1644,13 @@ var stxTransferStxRequestMessageSchema = v39.object({
|
|
|
1666
1644
|
var cache = {};
|
|
1667
1645
|
var requestInternal = async (provider, method, params) => {
|
|
1668
1646
|
const response = await provider.request(method, params);
|
|
1669
|
-
if (
|
|
1647
|
+
if (v39.is(rpcErrorResponseMessageSchema, response)) {
|
|
1670
1648
|
return {
|
|
1671
1649
|
status: "error",
|
|
1672
1650
|
error: response.error
|
|
1673
1651
|
};
|
|
1674
1652
|
}
|
|
1675
|
-
if (
|
|
1653
|
+
if (v39.is(rpcSuccessResponseMessageSchema, response)) {
|
|
1676
1654
|
return {
|
|
1677
1655
|
status: "success",
|
|
1678
1656
|
result: response.result
|
|
@@ -2865,10 +2843,6 @@ export {
|
|
|
2865
2843
|
sparkFlashnetConfirmInitialDepositIntentSchema,
|
|
2866
2844
|
sparkFlashnetCreateConstantProductPoolIntentSchema,
|
|
2867
2845
|
sparkFlashnetCreateSingleSidedPoolIntentSchema,
|
|
2868
|
-
sparkFlashnetExecuteClawbackMethodName,
|
|
2869
|
-
sparkFlashnetExecuteClawbackParamsSchema,
|
|
2870
|
-
sparkFlashnetExecuteClawbackRequestMessageSchema,
|
|
2871
|
-
sparkFlashnetExecuteClawbackResultSchema,
|
|
2872
2846
|
sparkFlashnetExecuteRouteSwapMethodName,
|
|
2873
2847
|
sparkFlashnetExecuteRouteSwapParamsSchema,
|
|
2874
2848
|
sparkFlashnetExecuteRouteSwapRequestMessageSchema,
|