FONSmartChain
English
English
  • 🧿Introduce
  • 🧶Tutorial
  • 🛡️Security Audit Report
  • 💫Cross-chain bridges and wallets
    • ⚡Cross-chain bridge
    • 💰Wallet
    • 🔑Key management
    • 💰Third-Party Wallet Tutorial
      • 1️⃣Metamask
      • 2️⃣TokenPocket
      • 3️⃣Bitkeep
      • 4️⃣Ave.ai
  • 🏆Core idea
    • 🎆Consensus engine
  • ⛱️Develop
    • 🟢RPC
    • 🔗FSC Browser
    • 🧊Run full node
    • 💎Validator
      • Create a validator
      • Run validator
    • 📑Validate contracts at FONSCAN
    • 🌾Logos
  • ☔ScanApi
    • RPC API Endpoints
      • Account
      • Block
      • Contract
      • Logs
      • Stats
      • Token
      • Transaction
    • ETH RPC API
    • 📔White Paper
      • Background overview
        • Introduction to FON smart chain
        • Design Principles
        • Application target
        • Advantages of implementation
      • Ecological sector overview
        • RosSwap
        • Time Farm
        • HieSwap
        • Myth NFT
      • Token economy
        • Economic model
        • Staking and governance
        • Circulation example
      • FSC technology systemFSC will
        • Proof of Stake
        • Cross-chain mechanism
        • Repeater
        • Hard forks, specifications and dispute resolution
      • Risk assessment and decision-making
      • Disclaimer
Powered by GitBook
On this page
  • Get transaction info
  • Get transaction receipt status
  • Get error status and message
  1. ScanApi
  2. RPC API Endpoints

Transaction

?module=transaction

https://fonscan.io/api?module=transaction

Get transaction info

gettxinfo

Information related to a specified transaction. Includes:

  • blockNumber

  • confirmations

  • from

  • gasLimit (in wei)

  • gasPrice (in wei)

  • gasUsed

  • hash

  • input

  • logs (array)

  • revert reason

  • success

  • timeStamp

  • to

  • value (in wei)

Example

https://fonscan.io/api
   ?module=transaction
   &action=gettxinfo
   &txhash={transactionHash}

Parameter
Description

txhash

string containing the transaction hash

index

optional nonnegative integer that represents the log index used for pagination.

{
  "result": {
    "revertReason": "No credit of that type",
    "blockNumber": "3",
    "confirmations": "0",
    "from": "0x000000000000000000000000000000000000000c",
    "gasLimit": "91966",
    "gasPrice": "100000",
    "gasUsed": "95123",
    "hash": "0x0000000000000000000000000000000000000000000000000000000000000004",
    "input": "0x04",
    "logs": [
      {
        "address": "0x000000000000000000000000000000000000000e",
        "data": "0x00",
        "topics": [
          "First Topic",
          "Second Topic",
          "Third Topic",
          "Fourth Topic"
        ]
      }
    ],
    "success": true,
    "timeStamp": "1541018182",
    "to": "0x000000000000000000000000000000000000000d",
    "value": "67612"
  },
  "status": "1"
}

Get transaction receipt status

gettxreceiptstatus

Also available through a GraphQL 'transaction' query. Status field return:

  • 0 = failed transaction

  • 1 = successful transaction

Example

https://fonscan.io/api
   ?module=transaction
   &action=gettxreceiptstatus
   &txhash={transactionHash}

Parameter
Description

txhash

string containing the transaction hash

{
  "message": "OK",
  "result": {
    "status": "1"
  },
  "status": "1"
}

Get error status and message

getstatus

Also available through a GraphQL 'transaction' query. Includes the following:

  • errDescription: string with error message

  • isError

    • 0 = pass, no error

    • 1 = error

Example

https://fonscan.io/api
   ?module=transaction
   &action=getstatus
   &txhash={transactionHash}

Parameter
Description

txhash

string containing the transaction hash

{
  "message": "OK",
  "result": {
    "errDescription": "Out of gas",
    "isError": "1"
  },
  "status": "1"
}
PreviousTokenNextETH RPC API

Last updated 1 year ago

☔