THORSwap SwapKit
Playground
  • ⚠️Updated documentation
  • 🏡Getting Started
    • ❓FAQ
    • Terms of Service
  • ⚡Powered by SwapKit
  • 💰Monetization / Earn Fees
  • 🤝Partnership
  • SwapKit SDK
    • 1️⃣1️⃣ Install SwapKit SDK
    • 2️⃣2️⃣ Set up the SDK
    • 3️⃣3️⃣ Request Route & Execute Swap
    • 📦Packages
      • @swapkit/api
      • @swapkit/core
      • @swapkit/helpers
      • @swapkit/sdk
      • @swapkit/tokens
      • @swapkit/chainflip
      • @swapkit/thorchain
    • 👛Wallets
      • @swapkit/wallet-coinbase
      • @swapkit/wallet-evm-extensions
      • @swapkit/wallet-keepkey
      • @swapkit/wallet-keplr
      • @swapkit/wallet-keystore
      • @swapkit/wallet-ledger
      • @swapkit/wallet-okx
      • @swapkit/wallet-trezor
      • @swapkit/wallet-wc
      • @swapkit/wallet-xdefi
    • 🧰Toolboxes
      • @swapkit/toolbox-cosmos
      • @swapkit/toolbox-evm
      • @swapkit/toolbox-substrate
      • @swapkit/toolbox-utxo
  • SwapKit API
    • API Reference
      • Gas API
      • Lending API
      • Liquidity API
      • Quote API
      • THORName API
      • Token API
      • Token List API
      • Tracker API
      • Aggregator API
      • Resource Worker API
      • Full API Reference
    • ⚙️SwapKit API
      • Requesting supported Chains
      • Requesting supported Providers
      • Requesting a Quote
      • Requesting a Gas Price
      • Requesting to Add Liquidity
      • Requesting to Withdraw Liquidity
      • Request a transactions status
      • Lookup a Thorname
    • Advanced - Integrating SwapKit API
  • References
    • ✨Smart Contracts
Powered by GitBook
On this page
  • Installation
  • Integration
  • Wallet Support

Was this helpful?

Edit on GitHub
  1. SwapKit SDK
  2. Wallets

@swapkit/wallet-ledger

Installation

<pnpm|bun> add @swapkit/wallet-ledger

Integration

Implementation with @swapkit/core

import { SwapKit, getDerivaitionPathFor } from '@swapkit/core'
import { ledgerWallet } from '@swapkit/wallet-ledger'

const swapKitClient = SwapKit({
  wallets: { ...ledgerWallet },
});

// [84, 0, 1, 0, 0]
const derivationPath = getDerivationPathFor({ 
  chain: Chain.Bitcoin, index: 1, type: "nativeSegwitMiddleAccount"
});

await swapKitClient.connectLedger([Chain.Bitcoin], derivationPath)

const btcWallet = await swapKitClient.getWalletWithBalance(Chain.Bitcoin)

Wallet Support

Supported Chains
Toolbox

[Chain.Binance, Chain.Cosmos, Chain.THORChain]

[Chain.Arbitrum, Chain.Avalanche, Chain.BinanceSmartChain, Chain.Ethereum, Chain.Optimism, Chain.Polygon]

[Chain.Bitcoin, Chain.BitcoinCash, Chain.Dash, Chain.Dogecoin]

Previous@swapkit/wallet-keystoreNext@swapkit/wallet-okx

Last updated 1 year ago

Was this helpful?

👛
COSMOS
EVM
UTXO