Deposits and Withdrawals

Introduction

These queries allow for the indexing of all deposits and withdrawals.

Core Concepts

Transaction Tracking

SameChainTransaction

This represents a same chain deposit or withdrawal that has been completed into either single vault or multivaults. It can be queried using-

{
  sameChainTransactions(first:5){
    id
    transactionHash
    txInfo
    payloadId
    superformID
    txType
    multiTransaction
    blockNumber
    blockTimestamp
  }
}

The fields of SameChainTransaction are as follows-

  1. id- ID used to refer the Same Chain Transactions is the Transaction Hash which did the same chain withdrawal/ deposit.

  2. transactionHash- Hash of the transaction that did the deposit or withdrawal

  3. txInfo- payload header for the same chain deposit or withdrawal

  4. payloadId- Payload Id for the deposit/ withdawal payload. This is used to track the flow across the steps of deposit and withdrawal.

  5. superformID- This is a list of Superform Ids for which the deposit or withdrawal was done. In case it has single Superform Id, it represents a singleVault deposit or withdrawal whereas multiple superform Id represent multiVault withdrawal or deposit

  6. txType- Its an integer value that can be 0 or 1. This represents whether the transaction is deposit (0) or withdrawal (1).

  7. multiTransaction- It is a boolean which is false if it is a single vault deposit/ withdrawal and is true if it is multiVault deposit/ withdrawal

  8. blockNumber- Block in which the transaction was done for deposit/ withdrawal

  9. blockTimestamp- Timestamp for Block in which the transaction was done for deposit/ withdrawal

CrossChainInitiatedTransaction

This represents a cross chain withdrawal or deposit that was initiated from the specific chain. This does not represent a completed withdrawal or deposit and the transactions eventually can fail in the destination chains. This is useful to track everything that has been started in the chain and can be used in conjunction with events on destination chain to see the complete flow of a deposit or withdrawal. This can be queried using-

{
  crossChainInitiatedTransactions(first:5){
    id
    transactionHash
    srcPayloadId
    blockNumber
    blockTimestamp
  }
}

The fields of SameChainTransaction are as follows-

  1. id- ID is the transaction hash which initiated the Cross Chain Transaction.

  2. transactionHash- Hash of the transaction that initiated the deposit or withdrawal across the chain

  3. srcPayloadId- Payload Id for the deposit/ withdrawal. In destination chain this is used as srcChain Payload ID.

  4. blockNumber- Block in which the transaction was done for deposit/ withdrawal

  5. blockTimestamp- Timestamp for Block in which the transaction was done for deposit/ withdrawal

Message Tracking

PayloadRecieved

This represents various payloads that are received on the destination chains. This has most of the fields that help in establishing connection between source chain and destination chain for cross chain transactions. This can be queried as follows-

{
  payloadReceiveds(first:5){
    id
    srcChainId
    dstChainId
    superformIDs
    dstPayloadId
    srcPayloadId
    blockNumber
    transactionHash
  }
}

The fields are as follows-

  1. id- ID is the transaction in which the payload ID was received in the destination chain.

  2. srcChainId- Chain Id of the chain from which the payload has been received

  3. dstChainId- Chain ID of the destination chain for the payload

  4. superformIDs- This is a list of Superform Ids for which the deposit or withdrawal was done. In case it has single Superform Id, it represents a singleVault deposit or withdrawal whereas multiple superform Id represent multiVault withdrawal or deposit

  5. dstPayloadId- This is the ID of the payload on the destination chain.

  6. srcPayloadId- This is the ID of the payload on the source chain. This can be used along with payloadId of CrossChainInitiatedTransaction to create a complete flow of transactions across chains from source chain to destination chain.

  7. transactionHash- Hash of the transaction that did the deposit or withdrawal

PayloadProcessed

This represents the various Payloads that are processed on the destination chain. It can be queried using-

{
  payloadProcessed{
    id
    superformIDs
    dstPayloadId
    srcChainID
    srcPayloadId
    blockNumber
    transactionHash
  }
}

The fields of PayloadProcessed are as follows=

  1. id- ID is hash of transaction which lead to the payload being processed on destination chain,

  2. superformIDs- This is a list of Superform Ids for which the deposit or withdrawal was done. In case it has single Superform Id, it represents a singleVault deposit or withdrawal whereas multiple superform Id represent multiVault withdrawal or deposit

  3. dstPayloadId- This is the ID of the payload on the destination chain.

  4. srcChainId- Chain Id of the chain from which the payload has been received

  5. srcPayloadId- This is the ID of the payload on the source chain. This can be used along with payloadId of CrossChainInitiatedTransaction to create a complete flow of transactions across chains from source chain to destination chain.

  6. blockNumber- Block in which the transaction was done for deposit/ withdrawal

  7. transactionHash- Hash of the transaction that did the deposit or withdrawal

ProofRecieved

Proofs received on destination chain via the data bridges. These can be queried using-

{
  proofReceiveds(first:5){
    id
    proof
    blockNumber
  }
}

The fields are as follows-

  1. id- The ID is the transaction hash through which the proof was received

  2. proof- The proof received in bytes

  3. blockNumber- Block in which the transaction was done for deposit/ withdrawal

DstPayloadID

Payload IDs for cross chain deposits and withdrawals. These can be queried using-

{
  dstPayloadID(id: $payloadID){
    id
    payloadID
    txType
    callBackType
    superFormsID
    amounts
    srcChainID
    srcPayloadID
    multiTransaction
    creationBlockNumber
    payloadProcessed{
      id
      dstPayloadId
    }
    payloadReceived {
      id
      dstPayloadId
    }
    payloadUpdated
    failedDepositsSuperforms
    failedDepositsAmounts
    rescueDisputed
    rescueFinalized
    proposedRescue(first:5){
      superformIds
      proposedAmounts
      proposedTime
      proposedBlockNumber
    }
  }
}

Destination Payloads are created when payloads are recieved on the destination chain. It has lot of fields most of which keep getting filled during the lifecycle of the payload in the destination chain. The fields are as follows-

  1. id- ID is the stringified version of the payloadID.

  2. payloadID- This is the payloadID given to the payload on destination chain. This is incremental with new payload being received getting incremented value as payloadID

  3. txType- Its an integer value that can be 0 or 1. This represents whether the transaction is deposit (0) or withdrawal (1).

  4. callBackType- This again is an integer that can be 0 or 1 and represents callback which is used to mint superPositions from Destinations. This can be RETURN(0) or FAIL(1)

  5. superformsID- This a list of superform IDs for which the deposit / withdrawal is being requested. It can be a list with a single superform if the transaction is not a multiVault deposit/ withdrawal

  6. amounts- This is a list of amounts representing how much is being deposited/ withdrawan from the corresponding superforms.

  7. multiTransaction- It is a boolean which is false if it is a single vault deposit/ withdrawal and is true if it is multiVault deposit/ withdrawal

  8. srcChainId- Chain Id of the chain from which the payload has been received

  9. srcPayloadId- Payload ID of the payload on the source chain. This can be used to uniquely relate destination paylaods to source chain initiated transaction

  10. creationBlockNumber- Block in which the Payload was created in the destination chain after recieving it

  11. payloadReceived- It is of type PayloadRecieved and represents PayloadRecieved created for this Payload.

  12. payloadProcessed- It is of type PayloadProcessed and represents PayloadProcessed created for this Payload. It is null if the payload is not processed.

  13. payloadUpdated- It is boolean representing whether the payload has been updated by the keeper or not. It is false till the payload is updated.

  14. failedDepositsSuperforms- It is a list of Superforms for which the deposit had failed. It is an empty list if deposit doesn't fail for any superforms.

  15. failedDepositsAmounts- It is a list of amount that failed for the Superforms in failedDepositsSuperforms. It is an empty list if deposit doesn't fail for any superforms.

  16. rescueDisputed- It is a boolean representing whether there has been any dispute to the rescue of failed deposits.

  17. rescueFinalized- It is a boolean representing whether there has been any dispute to the rescue of failed deposits.

    1. proposedRescue- It is a list of proposed rescues for the payload to rescue the failed deposits. It is a list because if there is dispute another proposal needs to be sent. Each RescuePayload has following-

    2. superformIds- List of Superforms for which rescue was proposed

    3. proposedAmount- Amount proposed for rescue for the Superforms

    4. proposedTime- Time in which the proposal was made

    5. proposedTransactionHash- Hash of the transaction for proposal of rescue of the funds

Last updated