# Usage without UI

If you don't want to use the pre-built react UI components, we also expose a core package that you can use with your custom UI.

### Installation

```bash
yarn add @leapwallet/embedded-wallet-sdk-core
```

### Usage

#### User Balances

You can use the `fetchBalance` function to balances of a wallet

```typescript
const result = await fetchBalance(restUrl, address, params)
```

**Parameters -**

1. `restUrl` - base URL of the node
2. `address` - wallet address
3. `params` (optional) -&#x20;

```typescript
const params = {
    pagination: {
        limit: 1000, // results per page
        key: '' // key for pagination
    }
}
```

**Return Value -**

A list of object of the following type

```typescript
{
  denom: string;
  amount: string;
}
```

#### User Transactions

You can use the `fetchTransactions` function

```typescript
// specify if the address was the sender or the recipeint of the transactions
const transfer: 'sender' | 'receipient' = 'sender'

const result = fetchTransactions(
  restUrl,
  address,
  {
    pagination: {
      limit: 100,
      offset: 0,
    },
    transfer,
  }
);
```

**Parameters -**

* `restUrl` - base URL of the node
* `address` - wallet address
* `params` - pagination and related parameters

**Return Value -**

The return value is an object with two properties -

1. total - the total number of transactions for this address
2. transactions - the list of transactions on the current page (pagination)

```typescript
{
    total: number;
    transactions: unknown[];
}
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.leapwallet.io/cosmos/embedded-wallet-sdk/usage-without-ui.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
