-
Notifications
You must be signed in to change notification settings - Fork 2
How to migrate DApp to Makki
chengchen edited this page Apr 25, 2019
·
3 revisions
If you're familiar with other browser-based wallets, it's quite similar. We are based on aion-web3 v1.15. Just declare aion-web3 after window.onLoad.
We're handling the following functions as promises :
- sign(not yet implemented)
- send
- getAccounts
Use aionweb3 the same way as web3, You can refer to this tutorial to use it.
In makkii, aionweb3.eth.sendTransaction only return a Promise
, It's not support function .on
or .once
and we also don't support such contract.methods.func().send()
, please use eth.sendTransction()
instead;
window.onLoad(){
let contractInstance = new aionweb3.eth.Contract(ABI, ADDRESS);
}
contractInstance.methods.functionName(param..).call({}).then((res)=>{
console.log(res)
})
aionweb3.eth.sendTransaction({
from: aionweb3.eth.accounts.toString(), //required
to: contractInstance._address,
data: contractInstance.methods.functionName().encodeABI(),
gas: 210000,
}).then((res)=>{
console.log(res);
})