A simple library to add Everstake support to your wallet.
Simple API and integration for an android wallet
allprojects {
repositories {
....
maven {
url = uri("https://maven.pkg.github.com/everstake/staking-sdk-android")
credentials {
username = GITHUB_USER_NAME
password = GITHUB_PERSONAL_ACCESS_TOKEN
}
}
}
}
dependencies {
...
implementation 'com.everstake:staking-sdk:1.0.2'
}
// Init SDK. Syncs coinList, if required
override fun onCreate() {
super.onCreate()
....
EverstakeStaking.init(this)
}
val stakeListener: EverstakeListener = object : EverstakeListener {
override fun onAction(
actionType: EverstakeAction,
coinSymbol: String,
amount: String,
validatorsInfo: List<ValidatorInfo>
) {
// ... Transaction creation
EverstakeStaking.refreshStaked(refreshMap)
}
}
// Provide all available balances or use EverstakeStaking.getAvailableCoins() method
// Note: without this method staking options will be empty
EverstakeStaking.updateBalances(balances)
EverstakeStaking.launchStaking(this, stakeListener)
- Sync staked info
EverstakeStaking.refreshStaked(coinSymbolToAddressMap) // updates staked amount in Everstake UI
- Get available coins
EverstakeStaking.getAvailableCoins() // returns list of coin symbols
- Update address balance
EverstakeStaking.updateBalances(balances) // list of models with coin symbol, address and balance
See sample usage in sample
module.