Vault Integration
If you require assistance or need additional information to integrate Unagii Vault, reach out to us at [email protected] Instructions for V2 Vault integrations are coming soon.

Deposit flow

Withdraw flow

get
https://app.unagii.com/api/v1
/sc/vault/allowance/{vaultType}/{token}/{address}
Get token allowance
get
https://app.unagii.com/api/v1
/sc/vault/balance/{vaultType}/{token}/{address}
Get deposited balance
get
https://app.unagii.com/api/v1
/sc/vault/digest/approve/{vaultType}/{token}/{address}?amount={amount}
Get data to build Approve Token transaction object
1
const approveTxn = {
2
from: address,
3
gasPrice: "20000000000", // 20 Gwei
4
gas: String(result.gasLimit),
5
to: result.contractAddress,
6
value: "0x0",
7
nonce: "10", // tx nonce
8
data: result.digest
9
}
10
web3.eth.sendTransaction(approveTxn).then( // do something );
Copied!
get
https://app.unagii.com/api/v1
/sc/vault/digest/deposit/{vaultType}/{token}/{address}?amount={amount}
Get data to build Deposit transaction object
1
const depositTxn = {
2
from: address,
3
gasPrice: "20000000000", // 20 Gwei
4
gas: String(result.gasLimit),
5
to: result.contractAddress,
6
value: "0x0",
7
nonce: "10", // tx nonce
8
data: result.digest
9
}
10
web3.eth.sendTransaction(depositTxn).then( // do something );
Copied!
get
https://app.unagii.com/api/v1
/sc/vault/digest/withdraw_by_amount/{vaultType}/{token}/{address}?amount={amount}
Get data to build Withdraw transaction object
1
const withdrawalTxn = {
2
from: address,
3
gasPrice: "20000000000", // 20 Gwei
4
gas: String(result.gasLimit),
5
to: result.contractAddress,
6
value: "0x0",
7
nonce: "10", // tx nonce
8
data: result.digest
9
}
10
web3.eth.sendTransaction(withdrawalTxn).then( // do something );
Copied!
Last modified 4mo ago