Documentation
    Preparing search index...
    Index

    Constructors

    Methods

    • Create an ix to send a spl-token / native-mint to another wallet. This function will handle the associated token accounts internally for spl-token. SOL is sent directly to the user's wallet.

      Parameters

      • connection: Connection

        Connection object

      • sourceWallet: PublicKey

        PublicKey for the sender's wallet

      • destinationWallet: PublicKey

        PublicKey for the receiver's wallet

      • tokenMint: PublicKey

        Mint for the token that is being sent.

      • tokenDecimals: number

        Decimal for the token that is being sent.

      • amount: BN

        Amount of token to send

      • getAccountRentExempt: () => Promise<number>

        Fn to fetch the account rent exempt value

      • Optionalpayer: PublicKey

        PublicKey for the payer that would fund the possibly new token-accounts. (must sign the txn)

      • allowPDASourceWallet: boolean = false

        Allow PDA to be used as the source wallet.

      Returns Promise<Instruction>

    • Create an ix to send a native-mint and unwrap it to the user's wallet.

      Parameters

      • owner: PublicKey

        PublicKey for the owner of the temporary WSOL account.

      • amountIn: BN

        Amount of SOL to wrap.

      • rentExemptLamports: number

        Rent exempt lamports for the temporary WSOL account.

      • Optionalpayer: PublicKey

        PublicKey for the payer that would fund the temporary WSOL accounts. (must sign the txn)

      • OptionalunwrapDestination: PublicKey

        PublicKey for the receiver that would receive the unwrapped SOL including rent.

      • createAccountMethod: WrappedSolAccountCreateMethod = "keypair"

        How to create the temporary WSOL account.

      Returns ResolvedTokenAddressInstruction

    • Parameters

      • mint: PublicKey

      Returns boolean