Lấy số dư ví
Truy xuất số dư CHZ và token cho một ví trên Chiliz Chain bằng Moralis Wallet API, với các mẫu code cho truy vấn đơn lẻ và đa tài sản.
Số dư CHZ của một ví là gì?
Cách thực hiện với 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();Cách thực hiện với Tatum
Cách thực hiện với thirdweb
Cách thực hiện với Nodit
Cập nhật lần cuối
Nội dung này có hữu ích không?