@allbridge/bridge-core-sdk
    Preparing search index...

    Interface SolUtils

    Contains usefully Solana methods

    interface SolUtils {
        addMemoToTx(
            transaction: VersionedTransaction,
            memo: string,
        ): Promise<void>;
        hasTokenAccount(
            accountAddress: string,
            token: TokenCoreFields,
        ): Promise<boolean>;
    }
    Index

    Methods

    • Add memo to solana's transaction

      Parameters

      • transaction: VersionedTransaction

        transaction to add memo

      • memo: string

        memo to add (28 char max)

      Returns Promise<void>

    • Whether the account has the associated token account of the token, the account the token is received on. A native token (SOL) needs none, so it is always true.

      Check it before a transfer to Solana that does not create the account itself, like Messenger.LIFI_INTENTS: a solver does not fill an order to an account without it, and the order is refunded.

      Parameters

      • accountAddress: string

        the owner account address

      • token: TokenCoreFields

        the token on Solana

      Returns Promise<boolean>

      SdkError if the token is not on Solana or its mint is not owned by a token program