14. Export PKey
Dapp
Get PKey
Dapp
confirm UI
Ethereumjs-tx
signTransaction
Block chain
Web3
sendRawTransaction
All in the
DApp
javascript
runtime
User Input
or
Edge wallet
Check
transaction
data
Sign transaction
Send transaction
TxHash event
or
callback
32. WS Provider
var poolAddress = this.poolAddress;
var web3WS = new Web3(new Web3.providers.WebsocketProvider(this.chainNetworkWS));
// wss://mainnet.infura.io/ws
var czEvents = new web3WS.eth.Contract(ERC20Interface, this.tokenAddress);
var options = {}
czEvents.events.Transfer(options, async (error, event) => {
if (error) {
console.log(error)
return
}
// some code
})
33. PageInit
Server
Watch Address Event
Block
ChainScan Polling Check
Set Polling Status
On Event
Ignore
Polling Check Transction
Polling Check BlockNumber > 3
Polling Server
Get Token Addr
Has Polling StatusNo Polling Status
Check TxHash