pump-trader 1.0.5 → 1.0.6
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 +4 -1
- package/index.js +7 -1
- package/index.ts +7 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -753,6 +753,8 @@ class PumpTrader {
|
|
|
753
753
|
/* ---------- AMM 指令构建 ---------- */
|
|
754
754
|
createAmmBuyInstruction(poolInfo, userBaseAta, userQuoteAta, baseAmountOut, maxQuoteAmountIn, tokenProgramId) {
|
|
755
755
|
const { pool, poolKeys, globalConfig } = poolInfo;
|
|
756
|
+
const bondingCurveV2Mint = poolKeys.baseMint.equals(SOL_MINT) ? poolKeys.quoteMint : poolKeys.baseMint;
|
|
757
|
+
const [bondingCurveV2] = web3_js_1.PublicKey.findProgramAddressSync([Buffer.from("bonding-curve-v2"), bondingCurveV2Mint.toBuffer()], PROGRAM_IDS.PUMP);
|
|
756
758
|
const [eventAuthority] = web3_js_1.PublicKey.findProgramAddressSync([Buffer.from("__event_authority")], PROGRAM_IDS.PUMP_AMM);
|
|
757
759
|
const [coinCreatorVaultAuthority] = web3_js_1.PublicKey.findProgramAddressSync([Buffer.from("creator_vault"), poolKeys.coinCreator.toBuffer()], PROGRAM_IDS.PUMP_AMM);
|
|
758
760
|
const coinCreatorVaultAta = (0, spl_token_1.getAssociatedTokenAddressSync)(SOL_MINT, coinCreatorVaultAuthority, true, spl_token_1.TOKEN_PROGRAM_ID, spl_token_1.ASSOCIATED_TOKEN_PROGRAM_ID);
|
|
@@ -786,7 +788,8 @@ class PumpTrader {
|
|
|
786
788
|
{ pubkey: globalVolumeAccumulator, isSigner: false, isWritable: false },
|
|
787
789
|
{ pubkey: userVolumeAccumulator, isSigner: false, isWritable: true },
|
|
788
790
|
{ pubkey: feeConfig, isSigner: false, isWritable: false },
|
|
789
|
-
{ pubkey: PROGRAM_IDS.FEE, isSigner: false, isWritable: false }
|
|
791
|
+
{ pubkey: PROGRAM_IDS.FEE, isSigner: false, isWritable: false },
|
|
792
|
+
{ pubkey: bondingCurveV2, isSigner: false, isWritable: false }
|
|
790
793
|
],
|
|
791
794
|
data: Buffer.concat([
|
|
792
795
|
DISCRIMINATORS.BUY,
|
package/index.js
CHANGED
|
@@ -1070,6 +1070,11 @@ export class PumpTrader {
|
|
|
1070
1070
|
|
|
1071
1071
|
createAmmBuyInstruction(poolInfo, userBaseAta, userQuoteAta, baseAmountOut, maxQuoteAmountIn, tokenProgramId) {
|
|
1072
1072
|
const { pool, poolKeys, globalConfig } = poolInfo;
|
|
1073
|
+
const bondingCurveV2Mint = poolKeys.baseMint.equals(SOL_MINT) ? poolKeys.quoteMint : poolKeys.baseMint;
|
|
1074
|
+
const [bondingCurveV2] = PublicKey.findProgramAddressSync(
|
|
1075
|
+
[Buffer.from("bonding-curve-v2"), bondingCurveV2Mint.toBuffer()],
|
|
1076
|
+
PROGRAM_IDS.PUMP
|
|
1077
|
+
);
|
|
1073
1078
|
|
|
1074
1079
|
const [eventAuthority] = PublicKey.findProgramAddressSync(
|
|
1075
1080
|
[Buffer.from("__event_authority")],
|
|
@@ -1138,7 +1143,8 @@ export class PumpTrader {
|
|
|
1138
1143
|
{ pubkey: globalVolumeAccumulator, isSigner: false, isWritable: false },
|
|
1139
1144
|
{ pubkey: userVolumeAccumulator, isSigner: false, isWritable: true },
|
|
1140
1145
|
{ pubkey: feeConfig, isSigner: false, isWritable: false },
|
|
1141
|
-
{ pubkey: PROGRAM_IDS.FEE, isSigner: false, isWritable: false }
|
|
1146
|
+
{ pubkey: PROGRAM_IDS.FEE, isSigner: false, isWritable: false },
|
|
1147
|
+
{ pubkey: bondingCurveV2, isSigner: false, isWritable: false }
|
|
1142
1148
|
],
|
|
1143
1149
|
data: Buffer.concat([
|
|
1144
1150
|
DISCRIMINATORS.BUY,
|
package/index.ts
CHANGED
|
@@ -1183,6 +1183,11 @@ export class PumpTrader {
|
|
|
1183
1183
|
tokenProgramId: PublicKey
|
|
1184
1184
|
): TransactionInstruction {
|
|
1185
1185
|
const { pool, poolKeys, globalConfig } = poolInfo;
|
|
1186
|
+
const bondingCurveV2Mint = poolKeys.baseMint.equals(SOL_MINT) ? poolKeys.quoteMint : poolKeys.baseMint;
|
|
1187
|
+
const [bondingCurveV2] = PublicKey.findProgramAddressSync(
|
|
1188
|
+
[Buffer.from("bonding-curve-v2"), bondingCurveV2Mint.toBuffer()],
|
|
1189
|
+
PROGRAM_IDS.PUMP
|
|
1190
|
+
);
|
|
1186
1191
|
|
|
1187
1192
|
const [eventAuthority] = PublicKey.findProgramAddressSync(
|
|
1188
1193
|
[Buffer.from("__event_authority")],
|
|
@@ -1251,7 +1256,8 @@ export class PumpTrader {
|
|
|
1251
1256
|
{ pubkey: globalVolumeAccumulator, isSigner: false, isWritable: false },
|
|
1252
1257
|
{ pubkey: userVolumeAccumulator, isSigner: false, isWritable: true },
|
|
1253
1258
|
{ pubkey: feeConfig, isSigner: false, isWritable: false },
|
|
1254
|
-
{ pubkey: PROGRAM_IDS.FEE, isSigner: false, isWritable: false }
|
|
1259
|
+
{ pubkey: PROGRAM_IDS.FEE, isSigner: false, isWritable: false },
|
|
1260
|
+
{ pubkey: bondingCurveV2, isSigner: false, isWritable: false }
|
|
1255
1261
|
],
|
|
1256
1262
|
data: Buffer.concat([
|
|
1257
1263
|
DISCRIMINATORS.BUY,
|