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 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

Name
Type
Description

address

string

Account address

Headers

Name
Type
Description

X-UNAGII-AUTH-TOKEN

string

Access Token

{
  "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

Name
Type
Description

address

string

Account address

Headers

Name
Type
Description

X-UNAGII-AUTH-TOKEN

string

Access token

{
  "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

Name
Type
Description

address

string

Account address

Query Parameters

Name
Type
Description

amount

number

KNC amount to stake

Headers

Name
Type
Description

X-UNAGII-AUTH-TOKEN

string

Access token

{
  "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 );

Get data to build Unstake transaction object

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

Path Parameters

Name
Type
Description

address

string

Account address

Query Parameters

Name
Type
Description

amount

number

KNC amount to unstake

Headers

Name
Type
Description

X-UNAGII-AUTH-TOKEN

string

Access token

{
  "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

Was this helpful?