viem-erc20
Version:
Viem extensions for erc20 tokens
19 lines • 611 B
JavaScript
;
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