Kyber

If you require assistance or need additional information to integrate Unagii Stake, reach out to us at support@unagii.com.

Stake flow

Unstake flow

Get KNC allowance

GET https://app.unagii.com/api/v1/kyberdao/staker/allowance/{address}

This endpoint allows you to get the allowance of KNC to spend on our PoolMaster smart contract

Path Parameters

Headers

{
  "success": true,
  "result": {
    "value": "115792089237316195423570985008687907853269984665640564039454134007913129639935"
  }
}

Get data to build Approve Token transaction object

GET https://app.unagii.com/api/v1/kyberdao/staking/digest/approve/{address}

Path Parameters

Headers

{
  "success": true,
  "result": {
    "digest": "0x045c6a910000000000000000000000000000000000000000000000003c5e4df3e4f30000",
    "gasLimit": 116760,
    "contractAddress": "0x791fB6A7152e980233cd94D83FD4B4630F888c5C"
  }
}
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 data to build Stake transaction object

GET https://app.unagii.com/api/v1/kyberdao/staking/digest/deposit/{address}?amount={amount}

Path Parameters

Query Parameters

Headers

{
  "success": true,
  "result": {
    "digest": "0x045c6a910000000000000000000000000000000000000000000000003c5e4df3e4f30000",
    "gasLimit": 116760,
    "contractAddress": "0x791fB6A7152e980233cd94D83FD4B4630F888c5C"
  }
}
const stakeTxn = {
    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(stakeTxn).then( // do something );

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 data to build Unstake transaction object

GET https://app.unagii.com/api/v1/kyberdao/staking/digest/withdraw/{address}?amount={amount}

Path Parameters

Query Parameters

Headers

{
  "success": true,
  "result": {
    "digest": "0x045c6a910000000000000000000000000000000000000000000000003c5e4df3e4f30000",
    "gasLimit": 116760,
    "contractAddress": "0x791fB6A7152e980233cd94D83FD4B4630F888c5C"
  }
}
const unstakeTxn = {
    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(unstakeTxn).then( // do something );

Last updated