tokenlon-sdk
Version:
imToken Tokenlon API for node
18 lines • 894 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
var token = require("0x.js/lib/src/artifacts/Token.json");
var exchange = require("0x.js/lib/src/artifacts/Exchange.json");
var etherToken = require("0x.js/lib/src/artifacts/EtherToken.json");
var types_1 = require("../types");
var helper_1 = require("./helper");
var contractStack = { token: token, exchange: exchange, etherToken: etherToken };
exports.getAbiInputTypes = function (contractName, method) {
var ct = contractStack[contractName];
if (!ct)
throw helper_1.newError(types_1.TokenlonError.InvalidContractName);
var abiMethod = ct.abi.find(function (abi) { return abi.name === method; });
if (!abiMethod)
throw helper_1.newError(types_1.TokenlonError.InvalidContractMethod);
return abiMethod.inputs.map(function (i) { return i.type; });
};
//# sourceMappingURL=abi.js.map