Skip to main content

accid

Configuration Description

  • accid is the account address in the hymatrix environment, either an Ethereum address or an Arweave address.
  • When calling the hymatrix-js Basic Query API, this accid configuration serves as the default accid parameter 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)