capi
capi copied to clipboard
misc. example ideas
- faucet service
- differentiating between tokens on chain with numerous Balances impls
I want to call the system_properties rpc method but couldn't find an rpc call example on main.
For Westend it should return:
{
ss58Format: 42
tokenDecimals: [
12
]
tokenSymbol: [
WND
]
}
Also interesting to have an example of querying chain constants like depositBase and depositFactor
You can achieve this like so.
import { chain } from "westend_dev/mod.js"
const properties = await chain.connection
.call("system_properties")
.run()
You could also access this from the FRAME metadata if I'm not mistaken. Ie.
const ss58Prefix = await chain
.pallet("System")
.constant("Ss58Prefix").decoded
.run()
Asset differentiation is definitely an area in which some nice patterns can make a big difference... adding that to the list.