⚛️
Leap Cosmos
  • Introduction
  • for dapps: Connect to Leap
    • Introduction
    • Optimizing Wallet Connectivity for Cosmos Dapps
    • Add Leap to existing Keplr integration
    • Add Leap to a new dapp
    • Suggest chain : Add Leap to a non-native chain
    • Add Leap to a Secret dapp
    • Wallet Connect
    • Wallet Adapters
      • Cosmos Kit
      • Shuttle
    • API Reference
  • for chains: integrate into Leap
    • Introduction
  • for SEI dapps: Connect to Compass
    • Connect to Compass
  • FOR SEI EVM DAPPS: CONNECT TO COMPASS
    • Connect to Compass
    • Supported RPC methods
  • Leap Metamask Snap
    • Introduction
    • Integrating Snaps
      • Metamask Cosmos Snap
      • Cosmos Snap Provider
      • Cosmos Kit
  • Embedded Wallet SDK
    • Embedded Wallet SDK React
    • Embedded Wallet Provider
    • Migration
    • Usage without UI
  • Elements
    • Introduction
    • Get Started
    • Integrate via CDN / Script Tag
    • Integrate as an Embed
    • Components
      • Aggregated Swaps
      • IBC Only Swaps
      • Fiat On-ramp
      • IBC Transfer
      • Multi View
    • Theming
      • Using CSS Variables
      • Advanced Customisations
    • Use Elements Without the UI
    • Tab Config
    • Using Skip API Key
  • Cosmos Nodes
    • Fallback Falooda : Node Fallback System
    • (Coming Soon) Blockchain Node Setup Guide
    • (Coming Soon) Monitoring Blockchain Node Performance
  • RESOURCES
    • Leap Assets
Powered by GitBook
On this page
  • Installation
  • Usage
  1. Embedded Wallet SDK

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

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

Usage

User Balances

You can use the fetchBalance function to balances of a wallet

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

Parameters -

  1. restUrl - base URL of the node

  2. address - wallet address

  3. params (optional) -

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

Return Value -

A list of object of the following type

{
  denom: string;
  amount: string;
}

User Transactions

You can use the fetchTransactions function

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

{
    total: number;
    transactions: unknown[];
}
PreviousMigrationNextIntroduction

Last updated 9 months ago