UNPKG

viem-erc20

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