Download App
YouTube
For more information please see the website.
dependencies {
implementation 'io.eosnova:auth-sdk:1.0.0'
}
http://dev.cryptolions.io:38888
Junglenet.apk
http://jungle2.cryptolions.io
Junglenet2.apk
apk is required!!
NovaAuth.test = true
If you use Activity
instead of AppCompatActivity
, please change NovaAuth.class
to NovaAuthCompat.class
.
Also, register
and unregister
are required.
NovaAuth.class to NovaAuthCompat.class
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
...
NovaAuthCompat.register(this)
...
}
override fun onDestroy() {
super.onDestroy()
NovaAuthCompat.unregister(this)
}
please see JavaActivity, JavaCompatActivity.
...
// Testnet
NovaAuth.INSTANCE.setTest(true);
// Account
findViewById(R.id.account).setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
NovaAuth.INSTANCE.requestAccount(MainJavaActivity.this, callback);
}
});
// Transfer
findViewById(R.id.transfer).setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
NovaTransfer transfer = new NovaTransfer(
"shinhyo", "eosio.token", "emart", 0.0001, 4, "EOS", "from EOSNOVA"
);
NovaAuth.INSTANCE.requestTransfer(MainJavaActivity.this, transfer, callback);
}
});
...
NovaAuth.requestAccount(this, callBack)
val transfer = NovaTransfer("test2eosnova")
transfer.contract = "eosio.token"
transfer.to = "wzdworksnova"
transfer.amount = 0.0001
transfer.precision = 1 // must >= 0, minus num will replace 0
transfer.symbol = "EOS"
transfer.memo = "memo here"
NovaAuth.requestTransfer(this, transfer, callBack)
val stake = NovaStake("test2eosnova")
stake.action = NovaStake.Stake.STAKE //unstake : NovaStake.Stake.UNSTAKE
stake.receiver = "wzdworksnova"
stake.cpu = 1.0
stake.net = 1.0
stake.transfer = false
NovaAuth.requestStake(this, stake, callBack)
val signature = NovaSignature("test2eosnova")
signature.data = JsonObject().apply {
addProperty("key1", "this message")
addProperty("key2", "will")
addProperty("key3", "be signed")
}
NovaAuth.requestSignature(this, signature, callBack)
val transfer = NovaAction("test2eosnova")
transfer.contract = "eosio.token"
transfer.action = "transfer"
transfer.args = JsonObject().apply {
addProperty("to", "wzdworksnova")
addProperty("quantity", "1.0000 EOS")
addProperty("memo", "memo here")
}.toString()
val delegatebw = NovaAction("test2eosnova")
delegatebw.contract = "eosio"
delegatebw.action = "delegatebw"
delegatebw.args = JsonObject().apply {
addProperty("receiver", "wzdworksnova")
addProperty("stake_cpu_quantity", "1.0000 EOS")
addProperty("stake_net_quantity", "1.0000 EOS")
addProperty("transfer", false)
}.toString()
val list = ArrayList<NovaAction>()
list.add(delegatebw)
list.add(transfer)
NovaAuth.requestTransaction(this, list, callBack)
val callBack = object : OnNovaListener {
override fun callback(map: HashMap<String, String>) {
val code:String? = map.get("code")
val msg:String? = map.get("msg") // simple response message
val raw:String? = map.get("raw") // success or fail response message(JSON format) from network or sdk
}
}
0 : success
100: User pressed 'cancel' button
101: Parameter of your request is wrong
200: Account list empty in nova.
201: Can't find account in nova.
300: Fail to push transaction. because of bad network or other reason.
500: User back to dapp without any action
501: not use yet.
Copyright 2018 WizardWorks Inc. All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.