codecamp

Moralis 地址外壳

当从交易或智能合约同步地址时,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);


Moralis 智能合约事件
Moralis 对象
温馨提示
下载编程狮App,免费阅读超1000+编程语言教程
取消
确定
目录

Moralis 文件

Moralis 工具

关闭

MIP.setData({ 'pageTheme' : getCookie('pageTheme') || {'day':true, 'night':false}, 'pageFontSize' : getCookie('pageFontSize') || 20 }); MIP.watch('pageTheme', function(newValue){ setCookie('pageTheme', JSON.stringify(newValue)) }); MIP.watch('pageFontSize', function(newValue){ setCookie('pageFontSize', newValue) }); function setCookie(name, value){ var days = 1; var exp = new Date(); exp.setTime(exp.getTime() + days*24*60*60*1000); document.cookie = name + '=' + value + ';expires=' + exp.toUTCString(); } function getCookie(name){ var reg = new RegExp('(^| )' + name + '=([^;]*)(;|$)'); return document.cookie.match(reg) ? JSON.parse(document.cookie.match(reg)[2]) : null; }