# Helper Functions

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

```typescript
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.

```typescript
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.

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

**`getMint`**\
Fetches the mint address for a given token symbol.

```typescript
getMint(symbol: string): Promise<string>
```

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

```typescript
getTokenInfo(mint: string): Promise<TokenInfo>
```

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

```typescript
inspectTransaction(transaction: Transaction): void
```

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

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

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

```typescript
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.
