@meteora-ag/zap-sdk 1.0.7 → 1.0.8-rc.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +3 -33
- package/dist/index.mjs +3 -33
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -893,16 +893,6 @@ var Zap = class {
|
|
|
893
893
|
]);
|
|
894
894
|
inputTokenAccountIx && preInstructions.push(inputTokenAccountIx);
|
|
895
895
|
outputTokenAccountIx && preInstructions.push(outputTokenAccountIx);
|
|
896
|
-
if (inputMint.equals(import_spl_token5.NATIVE_MINT)) {
|
|
897
|
-
const wrapIxs = wrapSOLInstruction(
|
|
898
|
-
user,
|
|
899
|
-
inputTokenAccount,
|
|
900
|
-
BigInt(maxSwapAmount.toString())
|
|
901
|
-
);
|
|
902
|
-
if (wrapIxs) {
|
|
903
|
-
preInstructions.push(...wrapIxs);
|
|
904
|
-
}
|
|
905
|
-
}
|
|
906
896
|
let preUserTokenBalance;
|
|
907
897
|
try {
|
|
908
898
|
preUserTokenBalance = yield getTokenAccountBalance(
|
|
@@ -927,7 +917,7 @@ var Zap = class {
|
|
|
927
917
|
"base64"
|
|
928
918
|
);
|
|
929
919
|
const offsetAmountIn = payloadData.length - AMOUNT_IN_JUP_V6_REVERSE_OFFSET;
|
|
930
|
-
if (outputMint.
|
|
920
|
+
if ([inputMint, outputMint].includes(import_spl_token5.NATIVE_MINT)) {
|
|
931
921
|
const unwrapInstructions = unwrapSOLInstruction(user, user);
|
|
932
922
|
if (unwrapInstructions) {
|
|
933
923
|
postInstructions.push(unwrapInstructions);
|
|
@@ -1003,16 +993,6 @@ var Zap = class {
|
|
|
1003
993
|
]);
|
|
1004
994
|
inputTokenAccountIx && preInstructions.push(inputTokenAccountIx);
|
|
1005
995
|
outputTokenAccountIx && preInstructions.push(outputTokenAccountIx);
|
|
1006
|
-
if (inputMint.equals(import_spl_token5.NATIVE_MINT)) {
|
|
1007
|
-
const wrapIxs = wrapSOLInstruction(
|
|
1008
|
-
user,
|
|
1009
|
-
inputTokenAccount,
|
|
1010
|
-
BigInt(maxSwapAmount.toString())
|
|
1011
|
-
);
|
|
1012
|
-
if (wrapIxs) {
|
|
1013
|
-
preInstructions.push(...wrapIxs);
|
|
1014
|
-
}
|
|
1015
|
-
}
|
|
1016
996
|
let preUserTokenBalance;
|
|
1017
997
|
try {
|
|
1018
998
|
preUserTokenBalance = yield getTokenAccountBalance(
|
|
@@ -1033,7 +1013,7 @@ var Zap = class {
|
|
|
1033
1013
|
);
|
|
1034
1014
|
const payloadData = createDammV2SwapPayload(amountIn, minimumSwapAmountOut);
|
|
1035
1015
|
const offsetAmountIn = AMOUNT_IN_DAMM_V2_OFFSET;
|
|
1036
|
-
if (outputMint.
|
|
1016
|
+
if ([inputMint, outputMint].includes(import_spl_token5.NATIVE_MINT)) {
|
|
1037
1017
|
const unwrapInstructions = unwrapSOLInstruction(user, user);
|
|
1038
1018
|
if (unwrapInstructions) {
|
|
1039
1019
|
postInstructions.push(unwrapInstructions);
|
|
@@ -1109,16 +1089,6 @@ var Zap = class {
|
|
|
1109
1089
|
]);
|
|
1110
1090
|
inputTokenAccountIx && preInstructions.push(inputTokenAccountIx);
|
|
1111
1091
|
outputTokenAccountIx && preInstructions.push(outputTokenAccountIx);
|
|
1112
|
-
if (inputMint.equals(import_spl_token5.NATIVE_MINT)) {
|
|
1113
|
-
const wrapIxs = wrapSOLInstruction(
|
|
1114
|
-
user,
|
|
1115
|
-
inputTokenAccount,
|
|
1116
|
-
BigInt(maxSwapAmount.toString())
|
|
1117
|
-
);
|
|
1118
|
-
if (wrapIxs) {
|
|
1119
|
-
preInstructions.push(...wrapIxs);
|
|
1120
|
-
}
|
|
1121
|
-
}
|
|
1122
1092
|
let preUserTokenBalance;
|
|
1123
1093
|
try {
|
|
1124
1094
|
preUserTokenBalance = yield getTokenAccountBalance(
|
|
@@ -1143,7 +1113,7 @@ var Zap = class {
|
|
|
1143
1113
|
minimumSwapAmountOut,
|
|
1144
1114
|
remainingAccountsInfo
|
|
1145
1115
|
);
|
|
1146
|
-
if (outputMint.
|
|
1116
|
+
if ([inputMint, outputMint].includes(import_spl_token5.NATIVE_MINT)) {
|
|
1147
1117
|
const unwrapInstructions = unwrapSOLInstruction(user, user);
|
|
1148
1118
|
if (unwrapInstructions) {
|
|
1149
1119
|
postInstructions.push(unwrapInstructions);
|
package/dist/index.mjs
CHANGED
|
@@ -859,16 +859,6 @@ var Zap = class {
|
|
|
859
859
|
]);
|
|
860
860
|
inputTokenAccountIx && preInstructions.push(inputTokenAccountIx);
|
|
861
861
|
outputTokenAccountIx && preInstructions.push(outputTokenAccountIx);
|
|
862
|
-
if (inputMint.equals(NATIVE_MINT3)) {
|
|
863
|
-
const wrapIxs = wrapSOLInstruction(
|
|
864
|
-
user,
|
|
865
|
-
inputTokenAccount,
|
|
866
|
-
BigInt(maxSwapAmount.toString())
|
|
867
|
-
);
|
|
868
|
-
if (wrapIxs) {
|
|
869
|
-
preInstructions.push(...wrapIxs);
|
|
870
|
-
}
|
|
871
|
-
}
|
|
872
862
|
let preUserTokenBalance;
|
|
873
863
|
try {
|
|
874
864
|
preUserTokenBalance = yield getTokenAccountBalance(
|
|
@@ -893,7 +883,7 @@ var Zap = class {
|
|
|
893
883
|
"base64"
|
|
894
884
|
);
|
|
895
885
|
const offsetAmountIn = payloadData.length - AMOUNT_IN_JUP_V6_REVERSE_OFFSET;
|
|
896
|
-
if (outputMint.
|
|
886
|
+
if ([inputMint, outputMint].includes(NATIVE_MINT3)) {
|
|
897
887
|
const unwrapInstructions = unwrapSOLInstruction(user, user);
|
|
898
888
|
if (unwrapInstructions) {
|
|
899
889
|
postInstructions.push(unwrapInstructions);
|
|
@@ -969,16 +959,6 @@ var Zap = class {
|
|
|
969
959
|
]);
|
|
970
960
|
inputTokenAccountIx && preInstructions.push(inputTokenAccountIx);
|
|
971
961
|
outputTokenAccountIx && preInstructions.push(outputTokenAccountIx);
|
|
972
|
-
if (inputMint.equals(NATIVE_MINT3)) {
|
|
973
|
-
const wrapIxs = wrapSOLInstruction(
|
|
974
|
-
user,
|
|
975
|
-
inputTokenAccount,
|
|
976
|
-
BigInt(maxSwapAmount.toString())
|
|
977
|
-
);
|
|
978
|
-
if (wrapIxs) {
|
|
979
|
-
preInstructions.push(...wrapIxs);
|
|
980
|
-
}
|
|
981
|
-
}
|
|
982
962
|
let preUserTokenBalance;
|
|
983
963
|
try {
|
|
984
964
|
preUserTokenBalance = yield getTokenAccountBalance(
|
|
@@ -999,7 +979,7 @@ var Zap = class {
|
|
|
999
979
|
);
|
|
1000
980
|
const payloadData = createDammV2SwapPayload(amountIn, minimumSwapAmountOut);
|
|
1001
981
|
const offsetAmountIn = AMOUNT_IN_DAMM_V2_OFFSET;
|
|
1002
|
-
if (outputMint.
|
|
982
|
+
if ([inputMint, outputMint].includes(NATIVE_MINT3)) {
|
|
1003
983
|
const unwrapInstructions = unwrapSOLInstruction(user, user);
|
|
1004
984
|
if (unwrapInstructions) {
|
|
1005
985
|
postInstructions.push(unwrapInstructions);
|
|
@@ -1075,16 +1055,6 @@ var Zap = class {
|
|
|
1075
1055
|
]);
|
|
1076
1056
|
inputTokenAccountIx && preInstructions.push(inputTokenAccountIx);
|
|
1077
1057
|
outputTokenAccountIx && preInstructions.push(outputTokenAccountIx);
|
|
1078
|
-
if (inputMint.equals(NATIVE_MINT3)) {
|
|
1079
|
-
const wrapIxs = wrapSOLInstruction(
|
|
1080
|
-
user,
|
|
1081
|
-
inputTokenAccount,
|
|
1082
|
-
BigInt(maxSwapAmount.toString())
|
|
1083
|
-
);
|
|
1084
|
-
if (wrapIxs) {
|
|
1085
|
-
preInstructions.push(...wrapIxs);
|
|
1086
|
-
}
|
|
1087
|
-
}
|
|
1088
1058
|
let preUserTokenBalance;
|
|
1089
1059
|
try {
|
|
1090
1060
|
preUserTokenBalance = yield getTokenAccountBalance(
|
|
@@ -1109,7 +1079,7 @@ var Zap = class {
|
|
|
1109
1079
|
minimumSwapAmountOut,
|
|
1110
1080
|
remainingAccountsInfo
|
|
1111
1081
|
);
|
|
1112
|
-
if (outputMint.
|
|
1082
|
+
if ([inputMint, outputMint].includes(NATIVE_MINT3)) {
|
|
1113
1083
|
const unwrapInstructions = unwrapSOLInstruction(user, user);
|
|
1114
1084
|
if (unwrapInstructions) {
|
|
1115
1085
|
postInstructions.push(unwrapInstructions);
|