Skip to content

pumpswap-sdk : This is SDK for pumpswap web3 integration

Notifications You must be signed in to change notification settings

vvizardev/pumpswap-sdk

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

pumpswap-sdk

PumpSwap SDK for Web3 Integration.

PumpSwap SDK is upgrading now.

npm i pump-swap-core-v1

yarn add pump-swap-core-v1

How to use

Buy Instruction

 const buyTx = new Transaction()
        .add(
            createAssociatedTokenAccountIdempotentInstruction(payer.publicKey, user_base_token_account, payer.publicKey, base_mint),
            createAssociatedTokenAccountIdempotentInstruction(payer.publicKey, user_quote_token_account, payer.publicKey, NATIVE_MINT),
            SystemProgram.transfer({
                fromPubkey: payer.publicKey,
                toPubkey: user_quote_token_account,
                lamports: Number(quote_amt),
            }),
            createSyncNativeInstruction(user_quote_token_account)
        );
        
    buyTx.add(
        await pSwap.getBuyInstruction(base_amt, quote_amt, {
            pool,
            baseMint: base_mint,
            quoteMint: NATIVE_MINT,
            baseTokenProgram: TOKEN_PROGRAM_ID,
            quoteTokenProgram: TOKEN_PROGRAM_ID,
            user: payer.publicKey
        })
    )

Preference

You can find example file for Transaction in Here

Contact for debug & report

About

pumpswap-sdk : This is SDK for pumpswap web3 integration

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published