Created
March 4, 2020 11:58
-
-
Save jimmychu0807/d26d88deb9dbf82e64336a863f41d8e1 to your computer and use it in GitHub Desktop.
Markdium-用 Polkadot-JS API 輕鬆搭建 Substrate 前端
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const unsub = await api.queryMulti([ | |
// 一個 getter function | |
api.query.timestamp.now, | |
// 另一個 getter function,及所需參數 | |
[api.query.balances.freeBalance, ADDR], | |
[api.query.system.accountNonce, ADDR], | |
], ([now, balance, nonce]) => { // 回調函數 | |
console.log(`${now}: balance of ${balance} and a nonce of ${nonce}`); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment