Roboqo Studio
  • Roboqo Studio
  • OVERVIEW
    • Quickstart
    • Fees and Tokens
  • Basics
    • Roboqo Scripts
    • Transactions
    • UI Elements
    • Helper Functions
  • Global Objects
    • Solana Object
    • Positions Object
    • Jito Object
    • Raydium Object
    • Jupiter Object
    • Pumpfun Object
    • Rugcheck Object
    • Warp Object
    • Memes Object
    • Script / CLI
    • Storage Object
  • Instances
    • Solana Transaction
    • Solana Bundle
    • Jito Bundle
    • Solana Position
    • Solana Aggregate Position
Powered by GitBook
On this page
  1. Basics

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).

solToLamports(solAmount: number | string): string

fromTokenUnits Converts a token amount from its smallest unit to a human-readable format based on the token's decimal places.

fromTokenUnits(tokenUnits: number | string, decimals: number): string

toTokenUnits Converts a human-readable token amount to its smallest unit based on the token's decimal places.

toTokenUnits(amount: number, decimals: number): string

getMint Fetches the mint address for a given token symbol.

getMint(symbol: string): Promise<string>

getTokenInfo Retrieves detailed information about a token by its mint address.

getTokenInfo(mint: string): Promise<TokenInfo>

inspectTransaction Inspects and logs the details of a transaction for debugging purposes.

inspectTransaction(transaction: Transaction): void

signTransaction Signs a given transaction using the currently configured wallet. Supports both Transaction and VersionedTransaction types.

signTransaction(transaction: Transaction | VersionedTransaction | string): Transaction | VersionedTransaction | string

signTransactions Signs an array of transactions using the currently configured wallet.

signTransactions(transactions: (Transaction | VersionedTransaction)[]): (Transaction | VersionedTransaction)[]

Usage Notes

  • Conversions: solToLamports, fromTokenUnits, and toTokenUnits 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.

PreviousUI ElementsNextSolana Object

Last updated 6 months ago