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