Links

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
const approveTxn = {
from: address,
gasPrice: "20000000000", // 20 Gwei
gas: String(result.gasLimit),
to: result.contractAddress,
value: "0x0",
nonce: "10", // tx nonce
data: result.digest
}
web3.eth.sendTransaction(approveTxn).then( // do something );
get
https://app.unagii.com/api/v1
/sc/vault/digest/deposit/{vaultType}/{token}/{address}?amount={amount}
Get data to build Deposit transaction object
const depositTxn = {
from: address,
gasPrice: "20000000000", // 20 Gwei
gas: String(result.gasLimit),
to: result.contractAddress,
value: "0x0",
nonce: "10", // tx nonce
data: result.digest
}
web3.eth.sendTransaction(depositTxn).then( // do something );
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
const withdrawalTxn = {
from: address,
gasPrice: "20000000000", // 20 Gwei
gas: String(result.gasLimit),
to: result.contractAddress,
value: "0x0",
nonce: "10", // tx nonce
data: result.digest
}
web3.eth.sendTransaction(withdrawalTxn).then( // do something );