Kima Network Documentation
  • What is Kima?
  • Supported blockchains
  • Supported tokens
  • Supported fiat currencies and payment methods
  • Adding Kima to your wallet
  • Try Kima with the Demo App
    • The Kima Light Demo App
    • The Kima Advanced Demo App
    • Kima Faucets
    • Kima Block Explorer
  • Become a Kima validator
    • Hardware and operating system requirements
    • Installation
    • Appendix
  • Become a Kima delegator
    • Benefits
    • How does it work?
    • Preparations
    • Delegate
    • Reclaim delegation
  • Become a liquidity provider
    • Benefits
    • Supported blockchains
    • Prepare to provide liquidity
    • Deposit assets in Kima pools
    • Withdraw liquidity
  • Kima governance
    • Draft a proposal
    • On-chain proposal
    • Off-chain proposal
    • References
  • The Kima SDK
    • Kima Use Cases for Developers
    • The Kima Transaction Back End
    • The Kima Transaction Widget
      • Installation
      • React
      • NextJS
      • Payment Mode
      • Bridge Mode
      • Status Mode
      • Configuration Options
    • Upgrading
      • v1.4.x
    • Using the Kima SDK Without the Widget
      • Approval
      • Submitting the Transaction
      • Getting the Transaction Status
    • v1.4
      • Credit Card Transactions
      • Kima Use Cases for Developers
      • The Kima Transaction Back End
      • The Kima Transaction Widget
        • Installation
        • React
        • NextJS
        • Payment Mode
        • Bridge Mode
        • Status Mode
        • Configuration Options
      • Upgrading
        • v1.4.x
      • Using the Kima SDK Without the Widget
        • Transaction Data
        • Message Signing
        • Approval
        • Submitting the Transaction
        • Getting the Transaction Status
  • Further reading
  • Legal
    • Terms and conditions
    • Privacy policy
    • Disclaimer
  • FAQ
Powered by GitBook
On this page
  • From the Kima Backend
  • From the Kima Subgraph
Export as PDF
  1. The Kima SDK
  2. v1.4
  3. Using the Kima SDK Without the Widget

Getting the Transaction Status

From the Kima Backend

Using the Kima Backend, you can get the transaction status by calling two /tx endpoints depending on the type of transaction.

For regular transactions: GET /tx/:txId/status

For liquidity pool transactions: GET /tx/lp/:txId/status

Parameters:

  • txId number: the transaction id number. This is a sequential number assigned to each transaction, NOT the transaction hash (tx_id below).

Success Response:

{
  "data": {
    "transaction_data": [
      {
        "failreason": "",
        "pullfailcount": 0,
        "pullhash": "0x479c907fe8c92970e99fa102d440e805fa7d5d436469d4bbc003dec21349230f",
        "releasefailcount": 0,
        "releasehash": "4r58fVKEL6q6dZ7xdqTUXrL3adVLH23EYavwh7EjavPTu2mCwiqGJqtoWRHiSC17rsVJA2jdcAjF3ZoGbG5e1y86",
        "txstatus": "Completed",
        "amount": "6.00",
        "creator": "kima18lhurd62myjv0c73dfrzej9wamvs4rffugd948",
        "originaddress": "0x366Aa85aFd7e5Cb657748f2142009a04750AD081",
        "originchain": "ARB",
        "originsymbol": "USDK",
        "targetsymbol": "USDK",
        "targetaddress": "64tSEV9Rc5L7LaYDnSwaEgi4YGZMkBr4VnT9S7Va8fNE",
        "targetchain": "SOL",
        "tx_id": 15519,
        "kimahash": "4C9135132C88B05C78B89B208A9655428AF3E86A43D6E4D0680463364037F5DD"
      }
    ]
  }
}

From the Kima Subgraph

Once the transaction has been submitted to the Kima Transaction Backend, you’ll want to display the transaction progress in the frontend. There are 2 GraphQL queries on the Kima subgraph for this purpose.

  • Mainnet Kima Subgraph url: https://graphql.kima.finance/v1/graphql

  • Sardis Testnet url: https://graphql.sardis.kima.network/v1/graphql

Here is a code snippet for regular transactions using plain fetch. See the docs for your favorite graphql client for constructing queries.

const result = await fetch("https://graphql.kima.network/v1/graphql", {  
  method: "POST",  
  headers: {  
    "Content-Type": "application/json",  
  },  
  body: JSON.stringify({  
    query: `  
      query TransactionDetailsKima($txId: String) {  
        transaction_data(where: { tx_id: { _eq: $txId } }, limit: 1\) {  
          failreason  
          pullfailcount  
          pullhash  
          releasefailcount  
          releasehash  
          txstatus  
          amount  
          creator  
          originaddress  
          originchain  
          originsymbol  
          targetsymbol  
          targetaddress  
          targetchain  
          tx_id  
          kimahash  
        }  
      }`,
    variables: {
      txId: BigInt(txId),
    },
  }),
}).then((res) => res.json());

For liquidity pool transactions:

const result = await fetch("https://graphql.kima.network/v1/graphql", {  
  method: "POST",  
  headers: {  
    "Content-Type": "application/json",  
  },  
  body: JSON.stringify({  
    query: `  
      query TransactionDetailsKima($txId: String) {  
        liquidity_transaction_data(where: { tx_id: { _eq: $txId } }, limit: 1\) {  
          failreason  
          pullfailcount  
          pullhash  
          releasefailcount  
          releasehash  
          txstatus  
          amount  
          creator  
          chain  
          providerchainaddress  
          symbol  
          tx_id  
          kimahash  
        }  
      }`,
    variables: {
      txId: BigInt(txId),
    },
  }),
}).then((res) => res.json());
PreviousSubmitting the TransactionNextFurther reading

Last updated 3 months ago