Moralis 地址外壳
2022-05-11 10:23 更新
当从交易或智能合约同步地址时,Moralis 会将它们标准化为小写。 这使得基于地址创建查询变得更加容易,因为它不需要创建校验和地址。 请确保在比较来自外部来源(如 MetaMask
或 Etherscan
)的地址时,首先将其转换为小写。
// this is a checksum address (note the mixed cases)
let address = "0xEDe998b7BdE2467732b748613a1Aab4e5528dE15";
// In order to make queries based on the address you can convert it to lowercase
address = address.toLowerCase();
// Now we can use the address in our queries
const query = new Moralis.Query("EthTokenBalance");
query.equalTo("owner_of", address);
以上内容是否对您有帮助:
更多建议: