Unagii Docs
  • Introduction
  • Unagii Vaults
    • Overview
    • Understanding Vaults
    • Strategies
    • Architecture
    • Smart Contracts
    • Security
    • F.A.Q
    • Vault Integration
  • Unagii Stake
    • Overview
    • Ethereum
      • Kyber
      • Skale
    • Tendermint
      • Band
      • Cosmos
      • Kava
      • Persistence
      • Terra
      • Agoric
      • Akash
      • Archway
      • Shentu
      • Kujira
      • Osmosis
      • Passage
      • Quicksilver
      • Celestia
      • dYdX
    • Others
      • Sui
      • Solana
    • Security
    • F.A.Q
    • Stake Integration
      • Kyber
      • Skale
      • Tendermint Ecosystem
      • Sui
      • Solana
    • Page
  • DeFi
    • What is DeFi?
    • What are the risks in DeFi?
    • What are Stablecoins?
      • How to earn yield on Stablecoins?
        • What are Lending Pools?
        • What are Liquidity Pools?
  • Unagii Account
Powered by GitBook
On this page
  • Stake flow
  • Unstake flow
  • Get KNC allowance
  • Get data to build Approve Token transaction object
  • Get data to build Stake transaction object
  • Get data to build Unstake transaction object

Was this helpful?

  1. Unagii Stake
  2. Stake Integration

Kyber

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

PreviousStake IntegrationNextSkale

Last updated 10 months ago

Was this helpful?

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

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

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