wallet の残高を取得する
Moralis Wallet API を使って Chiliz Chain 上の wallet の CHZ およびトークン残高を取得します。単一アセットおよび複数アセットのクエリ向けのコードサンプル付きです。
wallet の CHZ 残高とは何か?
Moralis で行う方法
import Moralis from "moralis";
const runApp = async() => {
await Moralis.start({
apiKey: "YOUR_API_KEY",
// ...and any other configuration
});
const address = "0xYourWalletAddress";
const chain = "0x15b38", // This is for Chiliz Chain Mainnet.
// For Spicy Testnet, use "0x15b32".
const response = await Moralis.EvmApi.balance.getNativeBalance({
address,
chain,
});
console.log(response.toJSON());
};
runApp();Tatum で行う方法
thirdweb で行う方法
Nodit を使って行う方法
最終更新
役に立ちましたか?