@meteora-ag/zap-sdk 1.0.6 → 1.0.7
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 +27 -3
- package/dist/index.mjs +27 -3
- package/package.json +6 -6
package/dist/index.js
CHANGED
|
@@ -903,7 +903,15 @@ var Zap = class {
|
|
|
903
903
|
preInstructions.push(...wrapIxs);
|
|
904
904
|
}
|
|
905
905
|
}
|
|
906
|
-
|
|
906
|
+
let preUserTokenBalance;
|
|
907
|
+
try {
|
|
908
|
+
preUserTokenBalance = yield getTokenAccountBalance(
|
|
909
|
+
this.connection,
|
|
910
|
+
inputTokenAccount
|
|
911
|
+
);
|
|
912
|
+
} catch (e) {
|
|
913
|
+
preUserTokenBalance = "0";
|
|
914
|
+
}
|
|
907
915
|
const remainingAccounts = jupiterSwapResponse.swapInstruction.accounts.map(
|
|
908
916
|
(account) => {
|
|
909
917
|
let pubkey = typeof account.pubkey === "string" ? new import_web37.PublicKey(account.pubkey) : account.pubkey;
|
|
@@ -1005,7 +1013,15 @@ var Zap = class {
|
|
|
1005
1013
|
preInstructions.push(...wrapIxs);
|
|
1006
1014
|
}
|
|
1007
1015
|
}
|
|
1008
|
-
|
|
1016
|
+
let preUserTokenBalance;
|
|
1017
|
+
try {
|
|
1018
|
+
preUserTokenBalance = yield getTokenAccountBalance(
|
|
1019
|
+
this.connection,
|
|
1020
|
+
inputTokenAccount
|
|
1021
|
+
);
|
|
1022
|
+
} catch (e) {
|
|
1023
|
+
preUserTokenBalance = "0";
|
|
1024
|
+
}
|
|
1009
1025
|
const remainingAccounts = yield getDammV2RemainingAccounts(
|
|
1010
1026
|
poolAddress,
|
|
1011
1027
|
user,
|
|
@@ -1103,7 +1119,15 @@ var Zap = class {
|
|
|
1103
1119
|
preInstructions.push(...wrapIxs);
|
|
1104
1120
|
}
|
|
1105
1121
|
}
|
|
1106
|
-
|
|
1122
|
+
let preUserTokenBalance;
|
|
1123
|
+
try {
|
|
1124
|
+
preUserTokenBalance = yield getTokenAccountBalance(
|
|
1125
|
+
this.connection,
|
|
1126
|
+
inputTokenAccount
|
|
1127
|
+
);
|
|
1128
|
+
} catch (e) {
|
|
1129
|
+
preUserTokenBalance = "0";
|
|
1130
|
+
}
|
|
1107
1131
|
const { remainingAccounts, remainingAccountsInfo } = yield getDlmmRemainingAccounts(
|
|
1108
1132
|
this.connection,
|
|
1109
1133
|
lbPairAddress,
|
package/dist/index.mjs
CHANGED
|
@@ -869,7 +869,15 @@ var Zap = class {
|
|
|
869
869
|
preInstructions.push(...wrapIxs);
|
|
870
870
|
}
|
|
871
871
|
}
|
|
872
|
-
|
|
872
|
+
let preUserTokenBalance;
|
|
873
|
+
try {
|
|
874
|
+
preUserTokenBalance = yield getTokenAccountBalance(
|
|
875
|
+
this.connection,
|
|
876
|
+
inputTokenAccount
|
|
877
|
+
);
|
|
878
|
+
} catch (e) {
|
|
879
|
+
preUserTokenBalance = "0";
|
|
880
|
+
}
|
|
873
881
|
const remainingAccounts = jupiterSwapResponse.swapInstruction.accounts.map(
|
|
874
882
|
(account) => {
|
|
875
883
|
let pubkey = typeof account.pubkey === "string" ? new PublicKey7(account.pubkey) : account.pubkey;
|
|
@@ -971,7 +979,15 @@ var Zap = class {
|
|
|
971
979
|
preInstructions.push(...wrapIxs);
|
|
972
980
|
}
|
|
973
981
|
}
|
|
974
|
-
|
|
982
|
+
let preUserTokenBalance;
|
|
983
|
+
try {
|
|
984
|
+
preUserTokenBalance = yield getTokenAccountBalance(
|
|
985
|
+
this.connection,
|
|
986
|
+
inputTokenAccount
|
|
987
|
+
);
|
|
988
|
+
} catch (e) {
|
|
989
|
+
preUserTokenBalance = "0";
|
|
990
|
+
}
|
|
975
991
|
const remainingAccounts = yield getDammV2RemainingAccounts(
|
|
976
992
|
poolAddress,
|
|
977
993
|
user,
|
|
@@ -1069,7 +1085,15 @@ var Zap = class {
|
|
|
1069
1085
|
preInstructions.push(...wrapIxs);
|
|
1070
1086
|
}
|
|
1071
1087
|
}
|
|
1072
|
-
|
|
1088
|
+
let preUserTokenBalance;
|
|
1089
|
+
try {
|
|
1090
|
+
preUserTokenBalance = yield getTokenAccountBalance(
|
|
1091
|
+
this.connection,
|
|
1092
|
+
inputTokenAccount
|
|
1093
|
+
);
|
|
1094
|
+
} catch (e) {
|
|
1095
|
+
preUserTokenBalance = "0";
|
|
1096
|
+
}
|
|
1073
1097
|
const { remainingAccounts, remainingAccountsInfo } = yield getDlmmRemainingAccounts(
|
|
1074
1098
|
this.connection,
|
|
1075
1099
|
lbPairAddress,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@meteora-ag/zap-sdk",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.7",
|
|
4
4
|
"description": "A Typescript SDK for interacting with the Zap program on Meteora.",
|
|
5
5
|
"main": "dist/index.cjs",
|
|
6
6
|
"module": "dist/index.js",
|
|
@@ -17,6 +17,10 @@
|
|
|
17
17
|
"files": [
|
|
18
18
|
"dist/**"
|
|
19
19
|
],
|
|
20
|
+
"scripts": {
|
|
21
|
+
"build": "rm -rf dist && tsup src/index.ts --format esm,cjs --dts",
|
|
22
|
+
"clean": "rm -rf dist && rm -rf node_modules rm -rf pnpm-lock.yaml"
|
|
23
|
+
},
|
|
20
24
|
"exports": {
|
|
21
25
|
".": {
|
|
22
26
|
"types": "./dist/index.d.ts",
|
|
@@ -42,9 +46,5 @@
|
|
|
42
46
|
"bn.js": "^5.2.2",
|
|
43
47
|
"decimal.js": "^10.4.2",
|
|
44
48
|
"jito-ts": "^4.2.0"
|
|
45
|
-
},
|
|
46
|
-
"scripts": {
|
|
47
|
-
"build": "rm -rf dist && tsup src/index.ts --format esm,cjs --dts",
|
|
48
|
-
"clean": "rm -rf dist && rm -rf node_modules rm -rf pnpm-lock.yaml"
|
|
49
49
|
}
|
|
50
|
-
}
|
|
50
|
+
}
|