UNPKG

viem-erc20

Version:
19 lines 611 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.totalSupply = void 0; const viem_1 = require("viem"); const actions_1 = require("viem/actions"); const totalSupply = async function (client, parameters) { const { address } = parameters ?? {}; if (!(0, viem_1.isAddress)(address)) { throw new Error("Invalid address"); } return (0, actions_1.readContract)(client, { abi: viem_1.erc20Abi, address, args: [], functionName: "totalSupply", }); }; exports.totalSupply = totalSupply; //# sourceMappingURL=totalSupply.js.map