Step 2: Receiving Assets
1. Getting Your Vault ID
Before you can query vault's APIs to view all inbound and outbound transactions, you'll need to obtain the 'VaultId' from either the dashboard or the /v1/vaults
endpoint.
Simply navigate to your vault of choice, and the suffix of your vault can be found in the URL.
2. Viewing Incoming & Outgoing Transactions
Now that you have your vault ID, you can make use of the /v1/vaults/{vaultId}/network/statement
endpoint to receive a statement of all inbound and outbound transactions.
const getNetworkStatement = async (vaultId: string, accessToken: string, limit = 30) => {
const response = await fetch(`https://api.iofinnet.com/v1/vaults/${vaultId}/network/statement?limit=${limit}`, {
method: 'GET',
headers: {
'Authorization': `Bearer ${accessToken}`,
'Content-Type': 'application/json'
}
});
const data = await response.json();
return data.data.map(tx => ({
id: tx.id,
status: tx.status,
transactionHash: tx.transactionHash,
amount: tx.amount,
type: tx.type,
sendingAddress: tx.sendingAddress,
createdAt: tx.createdAt
}));
};
Updated about 13 hours ago