Helper Functions
Helper functions are globally available from Roboqo Scripts.
Globally Available Helper Functions in Roboqo
Roboqo provides a set of globally available helper functions to simplify common tasks related to Solana transactions, token conversions, and public key handling. These functions streamline development and improve efficiency when working with Solana-based trading operations.
solToLamports
Converts a SOL amount to lamports (the smallest unit of SOL).
fromTokenUnits
Converts a token amount from its smallest unit to a human-readable format based on the token's decimal places.
toTokenUnits
Converts a human-readable token amount to its smallest unit based on the token's decimal places.
getMint
Fetches the mint address for a given token symbol.
getTokenInfo
Retrieves detailed information about a token by its mint address.
inspectTransaction
Inspects and logs the details of a transaction for debugging purposes.
signTransaction
Signs a given transaction using the currently configured wallet. Supports both Transaction
and VersionedTransaction
types.
signTransactions
Signs an array of transactions using the currently configured wallet.
Usage Notes
Conversions:
solToLamports
,fromTokenUnits
, andtoTokenUnits
are essential for converting between different representations of token amounts.Signing:
signTransaction
securely signs transactions, ensuring they are ready for submission to the blockchain.
These helper functions are designed to facilitate efficient and error-free development within the Roboqo ecosystem.
Last updated