UNPKG

@soundsright/chain

Version:

soundsright contracts

25 lines (24 loc) 1.01 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.TransactionError = exports.Erc20AssetType = exports.PayType = void 0; var PayType; (function (PayType) { PayType[PayType["ETH"] = 0] = "ETH"; PayType[PayType["ERC20"] = 1] = "ERC20"; })(PayType = exports.PayType || (exports.PayType = {})); var Erc20AssetType; (function (Erc20AssetType) { Erc20AssetType[Erc20AssetType["WETH"] = 0] = "WETH"; Erc20AssetType[Erc20AssetType["USDT"] = 1] = "USDT"; Erc20AssetType[Erc20AssetType["USDC"] = 2] = "USDC"; Erc20AssetType[Erc20AssetType["DAI"] = 3] = "DAI"; })(Erc20AssetType = exports.Erc20AssetType || (exports.Erc20AssetType = {})); class TransactionError extends Error { constructor(error) { super(); this.name = 'TransactionError'; this.message = `${error.message && error.message.split(/ \[| \(/)[0]}`; console.log('Tx Error: ', error); } } exports.TransactionError = TransactionError;