accid
Configuration Description
accidis the account address in thehymatrixenvironment, either anEthereumaddress or anArweaveaddress.- When calling the hymatrix-js
Basic Query API, thisaccidconfiguration serves as the defaultaccidparameter passed to the Basic Query API.
Basic Query API Examples
Query basic info of the default account
const hyMatrix = new HyMatrix({
debug: false, // defaults to production environment
accid: '0xfc65E09Ef6674DdB4D8a6f3b6a6c8D9d55d67716', // account address
})
// Query the balance of account 0xfc65E09Ef6674DdB4D8a6f3b6a6c8D9d55d67716 in HyMatrix production environment
hyMatrix.balanceOf().then(console.log)
Query basic info of another account
const hyMatrix = new HyMatrix({
debug: false, // defaults to production environment
accid: '0xfc65E09Ef6674DdB4D8a6f3b6a6c8D9d55d67716', // account address
})
// Query the balance of another account _qrhp4_c-jl1IwLKcwlDGMCqs3Bx73eJeptAhYN9wNo in HyMatrix production environment
hyMatrix.balanceOf('_qrhp4_c-jl1IwLKcwlDGMCqs3Bx73eJeptAhYN9wNo').then(console.log)
// The above call does NOT overwrite the initially configured account address
// Query the balance of account 0xfc65E09Ef6674DdB4D8a6f3b6a6c8D9d55d67716 in HyMatrix production environment
hyMatrix.balanceOf().then(console.log)