Getting the Transaction Status

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.

  • Kima Subgraph url: https://graphql.kima.finance/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.finance/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: txId.toString(),  
    },  
  }),  
}).then((res) => res.json());

For liquidity pool transactions:

const result = await fetch("https://graphql.kima.finance/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: txId.toString(),  
    },  
  }),  
}).then((res) => res.json());

Last updated