Kyber
If you require assistance or need additional information to integrate Unagii Stake, reach out to us at [email protected]

Stake flow

Unstake flow

get
https://app.unagii.com/api/v1
/kyberdao/staker/allowance/{address}
Get KNC allowance
get
https://app.unagii.com/api/v1
/kyberdao/staking/digest/approve/{address}
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
/kyberdao/staking/digest/deposit/{address}?amount={amount}
Get data to build Stake transaction object
1
const stakeTxn = {
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(stakeTxn).then( // do something );
Copied!
The amount of KNC to stake must not be greater than the amount of KNC allowance able to spend on our PoolMaster smart contract.
get
https://app.unagii.com/api/v1
/kyberdao/staking/digest/withdraw/{address}?amount={amount}
Get data to build Unstake transaction object
1
const unstakeTxn = {
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(unstakeTxn).then( // do something );
Copied!