@meteora-ag/zap-sdk 1.0.1 → 1.0.2
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 +6 -0
- package/dist/index.d.ts +6 -0
- package/dist/index.js +6 -12
- package/dist/index.mjs +6 -12
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -118,6 +118,8 @@ type ZapOutThroughDammV2Params = {
|
|
|
118
118
|
poolAddress: PublicKey;
|
|
119
119
|
inputMint: PublicKey;
|
|
120
120
|
outputMint: PublicKey;
|
|
121
|
+
inputTokenProgram: PublicKey;
|
|
122
|
+
outputTokenProgram: PublicKey;
|
|
121
123
|
amountIn: BN;
|
|
122
124
|
minimumSwapAmountOut: BN;
|
|
123
125
|
maxSwapAmount: BN;
|
|
@@ -128,6 +130,8 @@ type ZapOutThroughDlmmParams = {
|
|
|
128
130
|
lbPairAddress: PublicKey;
|
|
129
131
|
inputMint: PublicKey;
|
|
130
132
|
outputMint: PublicKey;
|
|
133
|
+
inputTokenProgram: PublicKey;
|
|
134
|
+
outputTokenProgram: PublicKey;
|
|
131
135
|
amountIn: BN;
|
|
132
136
|
minimumSwapAmountOut: BN;
|
|
133
137
|
maxSwapAmount: BN;
|
|
@@ -137,6 +141,8 @@ interface ZapOutThroughJupiterParams {
|
|
|
137
141
|
user: PublicKey;
|
|
138
142
|
inputMint: PublicKey;
|
|
139
143
|
outputMint: PublicKey;
|
|
144
|
+
inputTokenProgram: PublicKey;
|
|
145
|
+
outputTokenProgram: PublicKey;
|
|
140
146
|
jupiterSwapResponse: JupiterSwapInstructionResponse;
|
|
141
147
|
maxSwapAmount: BN;
|
|
142
148
|
percentageToZapOut: number;
|
package/dist/index.d.ts
CHANGED
|
@@ -118,6 +118,8 @@ type ZapOutThroughDammV2Params = {
|
|
|
118
118
|
poolAddress: PublicKey;
|
|
119
119
|
inputMint: PublicKey;
|
|
120
120
|
outputMint: PublicKey;
|
|
121
|
+
inputTokenProgram: PublicKey;
|
|
122
|
+
outputTokenProgram: PublicKey;
|
|
121
123
|
amountIn: BN;
|
|
122
124
|
minimumSwapAmountOut: BN;
|
|
123
125
|
maxSwapAmount: BN;
|
|
@@ -128,6 +130,8 @@ type ZapOutThroughDlmmParams = {
|
|
|
128
130
|
lbPairAddress: PublicKey;
|
|
129
131
|
inputMint: PublicKey;
|
|
130
132
|
outputMint: PublicKey;
|
|
133
|
+
inputTokenProgram: PublicKey;
|
|
134
|
+
outputTokenProgram: PublicKey;
|
|
131
135
|
amountIn: BN;
|
|
132
136
|
minimumSwapAmountOut: BN;
|
|
133
137
|
maxSwapAmount: BN;
|
|
@@ -137,6 +141,8 @@ interface ZapOutThroughJupiterParams {
|
|
|
137
141
|
user: PublicKey;
|
|
138
142
|
inputMint: PublicKey;
|
|
139
143
|
outputMint: PublicKey;
|
|
144
|
+
inputTokenProgram: PublicKey;
|
|
145
|
+
outputTokenProgram: PublicKey;
|
|
140
146
|
jupiterSwapResponse: JupiterSwapInstructionResponse;
|
|
141
147
|
maxSwapAmount: BN;
|
|
142
148
|
percentageToZapOut: number;
|
package/dist/index.js
CHANGED
|
@@ -865,16 +865,14 @@ var Zap = class {
|
|
|
865
865
|
user,
|
|
866
866
|
inputMint,
|
|
867
867
|
outputMint,
|
|
868
|
+
inputTokenProgram,
|
|
869
|
+
outputTokenProgram,
|
|
868
870
|
jupiterSwapResponse,
|
|
869
871
|
maxSwapAmount,
|
|
870
872
|
percentageToZapOut
|
|
871
873
|
} = params;
|
|
872
874
|
const preInstructions = [];
|
|
873
875
|
const postInstructions = [];
|
|
874
|
-
const [inputTokenProgram, outputTokenProgram] = yield Promise.all([
|
|
875
|
-
getTokenProgramFromMint(this.connection, inputMint),
|
|
876
|
-
getTokenProgramFromMint(this.connection, outputMint)
|
|
877
|
-
]);
|
|
878
876
|
const [
|
|
879
877
|
{ ataPubkey: inputTokenAccount, ix: inputTokenAccountIx },
|
|
880
878
|
{ ataPubkey: outputTokenAccount, ix: outputTokenAccountIx }
|
|
@@ -957,6 +955,8 @@ var Zap = class {
|
|
|
957
955
|
poolAddress,
|
|
958
956
|
inputMint,
|
|
959
957
|
outputMint,
|
|
958
|
+
inputTokenProgram,
|
|
959
|
+
outputTokenProgram,
|
|
960
960
|
amountIn,
|
|
961
961
|
minimumSwapAmountOut,
|
|
962
962
|
maxSwapAmount,
|
|
@@ -965,10 +965,6 @@ var Zap = class {
|
|
|
965
965
|
const poolState = yield getDammV2Pool(this.connection, poolAddress);
|
|
966
966
|
const preInstructions = [];
|
|
967
967
|
const postInstructions = [];
|
|
968
|
-
const [inputTokenProgram, outputTokenProgram] = yield Promise.all([
|
|
969
|
-
getTokenProgramFromMint(this.connection, inputMint),
|
|
970
|
-
getTokenProgramFromMint(this.connection, outputMint)
|
|
971
|
-
]);
|
|
972
968
|
const [
|
|
973
969
|
{ ataPubkey: inputTokenAccount, ix: inputTokenAccountIx },
|
|
974
970
|
{ ataPubkey: outputTokenAccount, ix: outputTokenAccountIx }
|
|
@@ -1047,6 +1043,8 @@ var Zap = class {
|
|
|
1047
1043
|
lbPairAddress,
|
|
1048
1044
|
inputMint,
|
|
1049
1045
|
outputMint,
|
|
1046
|
+
inputTokenProgram,
|
|
1047
|
+
outputTokenProgram,
|
|
1050
1048
|
amountIn,
|
|
1051
1049
|
minimumSwapAmountOut,
|
|
1052
1050
|
maxSwapAmount,
|
|
@@ -1055,10 +1053,6 @@ var Zap = class {
|
|
|
1055
1053
|
const lbPairState = yield getLbPairState(this.connection, lbPairAddress);
|
|
1056
1054
|
const preInstructions = [];
|
|
1057
1055
|
const postInstructions = [];
|
|
1058
|
-
const [inputTokenProgram, outputTokenProgram] = yield Promise.all([
|
|
1059
|
-
getTokenProgramFromMint(this.connection, inputMint),
|
|
1060
|
-
getTokenProgramFromMint(this.connection, outputMint)
|
|
1061
|
-
]);
|
|
1062
1056
|
const [
|
|
1063
1057
|
{ ataPubkey: inputTokenAccount, ix: inputTokenAccountIx },
|
|
1064
1058
|
{ ataPubkey: outputTokenAccount, ix: outputTokenAccountIx }
|
package/dist/index.mjs
CHANGED
|
@@ -835,16 +835,14 @@ var Zap = class {
|
|
|
835
835
|
user,
|
|
836
836
|
inputMint,
|
|
837
837
|
outputMint,
|
|
838
|
+
inputTokenProgram,
|
|
839
|
+
outputTokenProgram,
|
|
838
840
|
jupiterSwapResponse,
|
|
839
841
|
maxSwapAmount,
|
|
840
842
|
percentageToZapOut
|
|
841
843
|
} = params;
|
|
842
844
|
const preInstructions = [];
|
|
843
845
|
const postInstructions = [];
|
|
844
|
-
const [inputTokenProgram, outputTokenProgram] = yield Promise.all([
|
|
845
|
-
getTokenProgramFromMint(this.connection, inputMint),
|
|
846
|
-
getTokenProgramFromMint(this.connection, outputMint)
|
|
847
|
-
]);
|
|
848
846
|
const [
|
|
849
847
|
{ ataPubkey: inputTokenAccount, ix: inputTokenAccountIx },
|
|
850
848
|
{ ataPubkey: outputTokenAccount, ix: outputTokenAccountIx }
|
|
@@ -927,6 +925,8 @@ var Zap = class {
|
|
|
927
925
|
poolAddress,
|
|
928
926
|
inputMint,
|
|
929
927
|
outputMint,
|
|
928
|
+
inputTokenProgram,
|
|
929
|
+
outputTokenProgram,
|
|
930
930
|
amountIn,
|
|
931
931
|
minimumSwapAmountOut,
|
|
932
932
|
maxSwapAmount,
|
|
@@ -935,10 +935,6 @@ var Zap = class {
|
|
|
935
935
|
const poolState = yield getDammV2Pool(this.connection, poolAddress);
|
|
936
936
|
const preInstructions = [];
|
|
937
937
|
const postInstructions = [];
|
|
938
|
-
const [inputTokenProgram, outputTokenProgram] = yield Promise.all([
|
|
939
|
-
getTokenProgramFromMint(this.connection, inputMint),
|
|
940
|
-
getTokenProgramFromMint(this.connection, outputMint)
|
|
941
|
-
]);
|
|
942
938
|
const [
|
|
943
939
|
{ ataPubkey: inputTokenAccount, ix: inputTokenAccountIx },
|
|
944
940
|
{ ataPubkey: outputTokenAccount, ix: outputTokenAccountIx }
|
|
@@ -1017,6 +1013,8 @@ var Zap = class {
|
|
|
1017
1013
|
lbPairAddress,
|
|
1018
1014
|
inputMint,
|
|
1019
1015
|
outputMint,
|
|
1016
|
+
inputTokenProgram,
|
|
1017
|
+
outputTokenProgram,
|
|
1020
1018
|
amountIn,
|
|
1021
1019
|
minimumSwapAmountOut,
|
|
1022
1020
|
maxSwapAmount,
|
|
@@ -1025,10 +1023,6 @@ var Zap = class {
|
|
|
1025
1023
|
const lbPairState = yield getLbPairState(this.connection, lbPairAddress);
|
|
1026
1024
|
const preInstructions = [];
|
|
1027
1025
|
const postInstructions = [];
|
|
1028
|
-
const [inputTokenProgram, outputTokenProgram] = yield Promise.all([
|
|
1029
|
-
getTokenProgramFromMint(this.connection, inputMint),
|
|
1030
|
-
getTokenProgramFromMint(this.connection, outputMint)
|
|
1031
|
-
]);
|
|
1032
1026
|
const [
|
|
1033
1027
|
{ ataPubkey: inputTokenAccount, ix: inputTokenAccountIx },
|
|
1034
1028
|
{ ataPubkey: outputTokenAccount, ix: outputTokenAccountIx }
|