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
  1. Community Edition
  2. SDK guides
  3. Queries

Get fees information

Get transaction fee information from blockchain.

sdk.transaction.getFee(opts)

If you wish to get estimate fee information for a transfer of the native token like ether, the parameters type, from, destination and amount should be passed as follows:

  • opts.type (string)(required) - type of the transaction. It should be TRANSFER in this case.

  • opts.from (string)(required) - origin or signing address.

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

  • opts.protocol (string)(required) - blockchain protocol.

For smart contract method calls, just pass with the additional parameters:

  • opts.type (string)(required) - type of the transaction. It should be CALL_CONTRACT_METHOD in this case.

  • opts.from (string)(required) - origin or signing address.

  • opts.contractAddress (string)(required) - contract address.

  • opts.contractAbi (array)(required) - method ABI to be used.

  • opts.method (string)(required) - method name.

  • opts.params (array) - method parameters.

  • opts.protocol (string)(required) - blockchain protocol.

And for smart contract deployments:

  • opts.type (string)(required) - type of the transaction. It should be DEPLOY_CONTRACT in this case.

  • opts.from (string)(required) - origin or signing address.

  • opts.contractName (string)(required) - contract name.

  • opts.source (string)(required) - contract source code.

  • opts.params (array) - contract constructor parameters.

  • opts.protocol (string)(required) - blockchain protocol.

const fee = await sdk.transaction.getFee({
  type: 'TRANSFER',
  from: '0xaaaaaa',
  destination: '0xbbbbbbbb',
  protocol: 'POLYGON',
})
// Fee information object
// {
//   "chainId": 137,
//   "estimateValue": "0.000021",
//   "unit": "wei",
//   "gas": 21000,
//   "gasPrice": "1000000000"
// }
PreviousGet transaction receipt by hashNextGet NFT data

Last updated 1 year ago

💻