Sample app
Install
Clone repository https://github.com/Blade-Labs/kotlin-blade
Open in Android studio
Run
sampleon your device or emulator

Video
Latest APK Build
Download apk from latest release assets
App structure
Demo app uses BottomNavigationView with 3 tabs, loading different fragments. Every fragment have controls and output section. In output section app shows serialized result of method call and execution time.
On Init fragment there are fields for Blade SDK init and some demo data like testnet account, private key, token id and contract id. This data temporary stores in Config object singleton.
In every fragment on onViewCreated method calling Blade.getInfo() to check if SDK initialized and enable or disable controls
As Blade object is singleton it may be initialized once and use in every other fragment.
Explore app
Init
Blade SDK init data
Demo account, contract id, token id, message for signature verification
Init and Stop buttons
Examples
Get balance - getting balance of account id from field (preset from init page)
Get transactions - getting transactions of account id
Create account - create new account through Blade API, using config of current dAppCode
Delete account - after creating account - new account data temporary saved and may be deleted
From mnemonic - getting ECDSA keys from field
Mnemonic / Message / SignatureSign - getting signature from field
Mnemonic / Message / Signature. Mind that on verification, message will be used fromInitscreenVerify - verifying signature using public key and message from
Initscreen from fieldMnemonic / Message / Signature.Contract call - calling contractId (from
Initscreen) functionset_message- setting string from fieldMnemonic / Message / SignatureContact query - querying function
get_messageand get message that we set with timestamp, and it's lengthSend HBARs - sending amount HBARs to receiver id
Send tokens - sending amount tokens (from
Initscreen) to receiver idSome other examples
Exchange
Strategy
Buy,SellorSwapGet quotes - getting quotes for
strategy,source code,amountandtarget codeService - after getting quote, you can pick one of the services, and press enabled button
Buy,Sellbuttons - getting configured url, and open in browserSwapbutton - call swap contract
Last updated
