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