Skip to main content

Module token

Module token 

Source
Expand description

SPL Token / Token-2022 instruction helpers used by the SDK.

wrap_sol_instructions and unwrap_sol_instruction cover the wSOL roundtrip every wSOL-quoted buy needs. create_associated_token_account_idempotent is re-exported from spl-associated-token-account so all token-instruction imports live in one place.

Functions§

create_associated_token_account_idempotent
Creates CreateIdempotent instruction
unwrap_sol_instruction
close_account(user_wsol_ata) with destination and owner both user. Unwraps the wSOL balance back to lamports on the user’s main account.
wrap_sol_instructions
system_transfer(user → user_wsol_ata, lamports) followed by sync_native(user_wsol_ata). Used before any wSOL-quoted buy.