Moralis 地址外殼

2022-05-11 10:23 更新

當(dāng)從交易或智能合約同步地址時(shí),Moralis 會(huì)將它們標(biāo)準(zhǔn)化為小寫(xiě)。 這使得基于地址創(chuàng)建查詢(xún)變得更加容易,因?yàn)樗恍枰獎(jiǎng)?chuàng)建校驗(yàn)和地址。 請(qǐng)確保在比較來(lái)自外部來(lái)源(如 ?MetaMask ?或 ?Etherscan?)的地址時(shí),首先將其轉(zhuǎn)換為小寫(xiě)。

// 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);


以上內(nèi)容是否對(duì)您有幫助:
在線(xiàn)筆記
App下載
App下載

掃描二維碼

下載編程獅App

公眾號(hào)
微信公眾號(hào)

編程獅公眾號(hào)