Transactions API
Transactions
are blockchain transactions that are already sent to the blockchain by the time you retrieve them, and are immutable. The transactions that you retrieve can be found on-chain via public block explorers.
Refer to the Transaction Workflow for more information on the transaction request status
es.
Currently, transactions are nested under the Wallet
object and the Deposit Address
object.
Retrieve
Wallet Transactions By Transaction Hash
You can retrieve a wallet's transaction by its hash using the following GraphQL query with the Transaction
object. It requires the transactionHash
as an input and returns details related to the specified transaction.
query WalletTransactionByHash($walletId: ID!, $transactionHash: String!) {
wallet(walletId: $walletId) {
transaction(transactionHash: $transactionHash) {
hash
tokenTransferData {
to # Token transferred to
tokenAddress # Token contract address
amount # Raw amount
tokenDecimals # Token decimal places
}
amount # Amount used in native token
timestamp
gasUsed # Gas units used for this transaction
gasPrice # Gas price at the time of this transaction
status
}
}
}
{
"variables": {
"walletId": "22cf4347-405a-47df-8267-26bfecac7b11",
"transactionHash": "0xae44592c4a3b4ff93c8dba0f5c9b837337f18e3079691ac3519c571cd161e9d6"
}
}
{
"data": {
"wallet": {
"transaction": {
"hash": "0xae44592c4a3b4ff93c8dba0f5c9b837337f18e3079691ac3519c571cd161e9d6",
"tokenTransferData": [
{
"to": "0x6886c0a002C3dE06481330ADB9e25E76d5bf2d2e",
"tokenAddress": "0x1f9840a85d5aF5bf1D1762F925BDADdC4201F984",
"amount": "50000000000000000",
"tokenDecimals": 18
}
],
"amount": "0",
"timestamp": "1696656240",
"gasUsed": "57182",
"gasPrice": "1500000018",
"status": "CONFIRMED"
}
}
}
}
Deposit Address Transactions by Transaction Hash
Similarly for deposit addresses, you can retrieve a deposit address' transaction by its hash using the following GraphQL query with the Transaction
object. It requires the transactionHash
as an input and returns details related to the specified transaction.
query DepositAddressTransactionByHash($walletId: ID!, $walletDepositAddressId: ID!, $transactionHash: String!) {
wallet(walletId: $walletId) {
mainAddress
name
organizationNetwork {
network {
protocolName
networkName
cryptoSymbol
}
}
depositAddress(walletDepositAddressId: $walletDepositAddressId) {
label
status
address
transaction(transactionHash: $transactionHash) {
hash
from
to
status
blockHeight
timestamp
amount
symbol
decimals
networkFee
tokenTransferData {
tokenAddress
tokenSymbol
tokenDecimals
}
}
}
}
}
{
"variables": {
"walletId": "f57965aa-4022-433d-93df-2c8b197fb3cd",
"walletDepositAddressId": "326186fd-18af-47ba-b52a-935fe8667d05",
"transactionHash": "0x5a5c55c869ca0f831b6dd0b4704ab7292c5c2893be311194d58eb943a119c24b"
}
}
{
"data": {
"wallet": {
"mainAddress": "0xA5bA9D68890D0BA1C7d5c6D1AE9B2836a5c4F4f1",
"name": "Ethereum Mainnet Customer Funds 1",
"organizationNetwork": {
"network": {
"protocolName": "Ethereum",
"networkName": "Mainnet",
"cryptoSymbol": "ETH"
}
},
"depositAddress": {
"label": "Address 2",
"status": "ACTIVE",
"address": "0x4e1f6378C0a40F452191E3dD5FFb676EB23BF2A7",
"transaction": {
"hash": "0x5a5c55c869ca0f831b6dd0b4704ab7292c5c2893be311194d58eb943a119c24b",
"from": "0x411eF10562689735dE42b1c8287FFA1Bd59D40f6",
"to": "0x4e1f6378C0a40F452191E3dD5FFb676EB23BF2A7",
"status": "CONFIRMED",
"blockHeight": 18063397,
"timestamp": "1693833887",
"amount": "100000000000000",
"symbol": "ETH",
"decimals": 18,
"networkFee": "11232116976",
"tokenTransferData": []
}
}
}
}
}
Delete
At Levain, we do not allow you to delete transactions because they are immutable, due to the nature of how blockchains work.