Skip to content

Conversation

@kiennd
Copy link

@kiennd kiennd commented May 21, 2025

This pull request addresses compatibility and functionality issues introduced by the recent Pump.fun IDL update. The following changes have been made:

  • Updated buy, sell, and createAndBuy functions to align with the updated IDL structure.

  • Synchronized project interfaces with the latest Pump.fun IDL to ensure seamless program interaction.

  • Added the missing bn.js dependency required for BigNumber operations.

@tranchien2002
Copy link

LGTM!

@Aries-Spring
Copy link

Getting this error when attempting to create a token using this MR:

34 |         if ((0, idl_js_1.isCompositeAccounts)(acc)) {
35 |             validateAccounts(acc.accounts, accounts[acc.name]);
36 |         }
37 |         else {
38 |             if (!accounts[acc.name]) {
39 |                 throw new Error(`Account \`${acc.name}\` not provided.`);
                           ^
error: Account `feeRecipient` not provided.

@Storryy
Copy link

Storryy commented May 23, 2025

Getting this error when attempting to create a token using this MR:

34 |         if ((0, idl_js_1.isCompositeAccounts)(acc)) {
35 |             validateAccounts(acc.accounts, accounts[acc.name]);
36 |         }
37 |         else {
38 |             if (!accounts[acc.name]) {
39 |                 throw new Error(`Account \`${acc.name}\` not provided.`);
                           ^
error: Account `feeRecipient` not provided.

same here. Any fix for this?

@Storryy
Copy link

Storryy commented May 23, 2025

I changed the files that were changed in this commit, but I seem to run into this issue

@kiennd
Copy link
Author

kiennd commented May 24, 2025

@LightYagami200 @Storryy
i've updated new code, bellow is working log:

Details % npm run example

Initial test account balance:
2KGqqvJeURrkLuV9W8LXwErmvPuEcjekiMCt9gAzF1w1: 0.053529375 SOL

🔧 GlobalAccount:
{
initialized: true,
authority: FFWtrEQ4B4PKQoVuHYzZq8FabGkVatYzDpEVHsK5rrhF,
feeRecipient: 62qc2CNXwrYqQScmEdiZFFAnJR262PxWEuNQtxfafNgV,
initialVirtualTokenReserves: 1073000000000000n,
initialVirtualSolReserves: 30000000000n,
initialRealTokenReserves: 793100000000000n,
tokenTotalSupply: 1000000000000000n,
feeBasisPoints: 95n
}

📤 Create & Buy TX:
🔗 https://solscan.io/tx/5gNv8LzdSB6kAMYJ19JMKEub48oNkHpVzSNYAEUFePmYUu1iQNwThYaPT9374Dy76kEAatJLkFitsKZyERhrUH5Y
✅ Success: https://pump.fun/EgYErvxQUiuo87BcY3RPZZGj2JnfLmGHorFAZmDC7jsQ

📈 Bonding curve after create & buy:
{
virtualTokenReserves: 1072996423345256n,
virtualSolReserves: 30000100000n,
realTokenReserves: 793096423345256n,
realSolReserves: 100000n,
complete: false
}

💰 SPL Balance after buy: 3576.654744

📤 Buy TX:
🔗 https://solscan.io/tx/9KUVMbaQYnAPYGRoSFuxA5jKJS7Bge1NNSaxfGrdDTWc4zyhakZ28iuQKpcxMbDEwWq7tZLTKgSg13z4pbXifNf

📈 Bonding curve after buy:
{
virtualTokenReserves: 1072727817469418n,
virtualSolReserves: 30007611881n,
realTokenReserves: 792827817469418n,
realSolReserves: 7611881n,
complete: false
}

💸 Sell:

  • amount: 3576654744
  • exactSolOutput: 99100
  • withSlippage: 98109
  • vault PDA: 9FP2NECUSpPdgPZwd3ummxhEFXbkyUC1mRvjYwLcwYtF

📤 Sell TX:
🔗 https://solscan.io/tx/43Tjd6FMoMCdLFiDZpAeBqTZY7kBW11FtYNcnm4mXPRpoRGMu8mLZSz2JyfuUhCV1GcLRnEHh62ZjVapBUG8q19j

Final test account balance: 0.031397181 SOL
After full SPL sell: 0 SOL

📉 Bonding curve after sell:
{
virtualTokenReserves: 1072423395124162n,
virtualSolReserves: 30016129961n,
realTokenReserves: 792523395124162n,
realSolReserves: 16129961n,
complete: false
}

@kiennd kiennd requested a review from BastienGimbert May 24, 2025 15:02
Copy link

@BastienGimbert BastienGimbert left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

buy / sell working.
I did not try the create

@rckprtr
Copy link
Owner

rckprtr commented May 25, 2025

I'm going to test and merge thank you!

@vacuumDev
Copy link

I'm going to test and merge thank you!

hey? its been a while

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

9 participants