Stake flow
Unstake flow
Cancel delegation flow
Claim rewards flow
Get SKL balances
GET
https://app.unagii.com/api/v1 /eth/skale/delegator/available_balance/{address}
Path Parameters
200
Copy {
"success": true,
"result": {
"balance": "1000",
"locked": "5000",
"forbidden": "10000",
"token": "SKL"
}
}
Get delegations
GET
https://app.unagii.com/api/v1/eth/skale/delegator/delegations/{address}
This endpoint allows you to get all delegations for an address
Path Parameters
200
Copy {
"success": true,
"result": [
{
"delegationId": "786",
"state": "COMPLETED",
"holder": "0x10aD752202fd4c7bBE3107fEDba7A225bAc85578",
"amount": "38386",
"delegationPeriod": "2",
"validator": {
"validatorId": 4,
"name": "StakeWithUs",
"address": "0x278e093C7100376bAd789465E4B68F6175ff3e7D",
"description": "Secured Staking Made Easy. Put Your Crypto to Work - Hassle Free. Disclaimer: Delegators should understand that delegation comes with slashing risk. By delegating to StakeWithUs Pte Ltd, you acknowledge that StakeWithUs Pte Ltd is not liable for any losses on your investment.",
"feeRate": 0.15,
"registrationTime": "1600485554",
"minimumDelegationAmount": "10000",
"acceptNewRequests": true
},
"created": "1600997339",
"started": "9",
"finished": "11",
"info": "Activate"
}
]
}
Get rewards
GET
https://app.unagii.com/api/v1/eth/skale/delegator/earned_bounty/{address}
Path Parameters
200
Copy {
"success": true,
"result": {
"unclaimed": "1000",
"claimed": "2000",
"address": "0x10ad752202fd4c7bbe3107fedba7a225bac85578"
}
}
Get data to build Stake transaction object
GET
https://app.unagii.com/api/v1/eth/skale/delegator/digest/delegate/{address}?amount={amount}&delegation_period={period}
Path Parameters
Query Parameters
200
Copy {
"success": true,
"result": {
"to": "0x06dD71dAb27C1A3e0B172d53735f00Bf1a66Eb79",
"digest": "0x21eb585900000000000000000000000000000000000000000000000000000000000000040000000000000000000000000000000000000000000f7a2e6a279ddf6bcd5000000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000800000000000000000000000000000000000000000000000000000000000000000",
"gasLimit": 476653,
"contractAddress": "0x06dD71dAb27C1A3e0B172d53735f00Bf1a66Eb79"
}
}
Copy 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/eth/skale/delegator/digest/request_undelegation/{address}?delegation_id={delegationId}
Path Parameters
Query Parameters
200
Copy {
"success": true,
"result": {
"to": "0x06dD71dAb27C1A3e0B172d53735f00Bf1a66Eb79",
"digest": "0x27e5455a0000000000000000000000000000000000000000000000000000000000000f44",
"gasLimit": 345960,
"contractAddress": "0x06dD71dAb27C1A3e0B172d53735f00Bf1a66Eb79"
}
}
Copy 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 );
Get data to build Cancel Request transaction object
GET
https://app.unagii.com/api/v1/eth/skale/delegator/digest/cancel_pending_delegation/{address}?delegation_id={delegationId}
Path Parameters
Query Parameters
200
Copy {
"success": true,
"result": {
"to": "0x06dD71dAb27C1A3e0B172d53735f00Bf1a66Eb79",
"digest": "0x27e5455a0000000000000000000000000000000000000000000000000000000000000f44",
"gasLimit": 345960,
"contractAddress": "0x06dD71dAb27C1A3e0B172d53735f00Bf1a66Eb79"
}
}
Copy const cancelTxn = {
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 (cancelTxn) .then ( // do something );
Get data to build Claim Rewards transaction object
GET
https://app.unagii.com/api/v1/eth/skale/delegator/digest/withdraw_bounty/{address}?validator_id={validatorId}&to={destAddress}
Path Parameters
Query Parameters
Name Type Description Account address to receive rewards
200
Copy {
"success": true,
"result": {
"to": "0x06dD71dAb27C1A3e0B172d53735f00Bf1a66Eb79",
"digest": "0x27e5455a0000000000000000000000000000000000000000000000000000000000000f44",
"gasLimit": 345960,
"contractAddress": "0x06dD71dAb27C1A3e0B172d53735f00Bf1a66Eb79"
}
}
Copy const claimTxn = {
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 (claimTxn) .then ( // do somethi