LogoLogo
Cryptum.ioGitHub
  • 🌐Cryptum
    • What is Cryptum
    • DeFi Market
    • Ecosystem
      • Bitcoin
      • Ethereum
      • Polygon
      • Avalanche C-Chain
      • BNB Chain
      • Cardano
      • Celo
      • Hathor
      • Solana
      • Stellar
      • XRP Ledger
      • Stratus
      • Hyperledger Besu
  • 👝Products
    • Dashboard Analytics
    • Tokenization
    • Crypto Checkout
      • Overview
      • Getting started
      • Checkout Dashboard
        • Creating your Store
        • Customer Checkout screens
        • Analytics
        • Managing Wallets
        • Creating Collections and NFTs
        • Linking Products to NFTs
        • Monitoring Orders
      • Checkout API
        • Authentication
        • Store
        • Orders
          • Handling Orders
    • Wallets
    • DeFi-as-a-Service
    • On & Off Ramp (soon)
    • E-commerce Plugins
      • Wordpress NFT Plugin
        • How to install NFT Plugin
        • Connect your Credentials to NFT Plugin
      • Wordpress Checkout Plugin
        • How to install Checkout Plugin
        • Connect your Credentials to Checkout Plugin
      • Plugins Guides
        • Creating your Store
        • Manage your Wallets
        • Creating Collections and NFTs
        • Linking Products to NFTs
        • Monitoring Orders
        • Monitoring Store (Analytics)
  • 💻Community Edition
    • Overview
    • Architecture
    • Start for free
    • Getting started
    • Dashboard guide
      • 🔑Creating a Project (API Key)
      • 🛠️Start building!
      • 📊Monitoring your Project
      • 📈Monitoring Requests
    • SDK guides
      • Get test currencies
      • Chainlink
        • 📈Price Feeds
        • ⚙️Automation
        • 🎲VRF
        • 🛤️CCIP
        • 🛤️CCIP
        • Project Examples
          • Lottery
          • Send Message CCIP
      • Wallets
      • Balances
      • Prices
      • Tokens
        • EVM Tokens (ERC-20)
        • Solana Tokens (SPL)
        • Cardano Tokens
        • Stellar Tokens
        • XRP Tokens
        • Hathor Tokens
      • NFTs
        • EVM NFTs (Ethereum, Polygon and others)
        • NFTs on Solana
        • NFTs on Hathor Network
      • Queries
        • Wallet information
        • Get transaction by hash
        • Get block information
        • Get transaction receipt by hash
        • Get fees information
        • Get NFT data
        • Get NFT balance
        • Get UTXOs (Unspent transaction outputs)
      • Uniswap
      • Staking
      • Smart Contracts
        • Deploy custom Smart Contracts
        • Loot Box
    • Features and credits
      • Avalanche C Chain
      • Bitcoin
      • BNB Chain
      • Cardano
      • Celo
      • Ethereum
      • Hathor
      • Polygon
      • Solana
      • Stellar
      • XRP Ledger
      • Stratus
    • API guides
      • API Cryptum
      • API Connector
  • 📃GLOSSARY
    • Blockchain terms
    • Cryptum terms
Powered by GitBook
On this page
  • Transfer tokens
  • Establish trustline in Ripple
  1. Community Edition
  2. SDK guides
  3. Tokens

XRP Tokens

Instantiate Cryptum SDK first:

const sdk = new CryptumSdk({
  environment: 'testnet',
  apiKey: 'YOUR-API-KEY'
})

Transfer tokens

Transfer tokens in XRPL blockchain.

sdk.token.transfer(opts)

  • opts.protocol (string)(required) - blockchain protocol must be RIPPLE.

  • opts.wallet (Wallet)(required) - wallet to sign the transaction with.

  • opts.token (string)(required) - token symbol to transfer or XRP if you're transferring the native token.

  • opts.issuer (string)(optional) - token issuer account. Required only if you're not transferring the native token.

  • opts.amount (string)(required) - token amount to be transferred.

  • opts.destination (string)(required) - destination address.

  • opts.memo (string)(optional) - memo string.

This function returns the transaction hash.

const { hash } = await sdk.token.transfer({
  protocol: 'RIPPLE',
  wallet,
  token: 'FOO',
  issuer: 'rPT1Sjq2YGr...jKu9dyfzbpAYe'
  destination: 'rmpvgigZ4p...sbK8pyV45WtP',
  amount: '7.5',
  memo: ''
})

Establish trustline in Ripple

sdk.token.setTrustline(opts)

Create a trustline transaction in XRPL blockchain. It is used to create or delete tokens (trustline).

  • opts.protocol (Wallet)(required) - blockchain protocol must be RIPPLE.

  • opts.wallet (Wallet)(required) - wallet to sign the transaction with.

  • opts.symbol (string)(required) - asset to transfer.

  • opts.issuer (string) - required if you are transferring a custom asset so this is the issuer account, otherwise leave undefined.

  • opts.limit (string)(required) - limit for the trustline. To create the trustline this limit should be bigger than 0 and to delete the trustline it should be 0.

  • opts.memo (string)(optional) - message to be attached with this transaction, otherwise leave it undefined.

This function returns the hash of the transaction.

Example:

// Ripple
const { hash } = await sdk.token.setTrustline({
  protocol: 'RIPPLE',
  wallet,
  symbol: 'FOO',
  issuer: 'rPT1Sjq2YGr...jKu9dyfzbpAYe',
  limit: '100000000',
  memo: 'create-trustline',
})
PreviousStellar TokensNextHathor Tokens

Last updated 2 years ago

💻