fsl-js-sdk
Version:
sdk for web
41 lines (40 loc) • 1.5 kB
JavaScript
;
var _a;
Object.defineProperty(exports, "__esModule", { value: true });
exports.getTokenDecimals = exports.TokenDecimals = exports.PolygonERC20Tokens = exports.EthereumERC20Tokens = exports.PolygonERC20Token = exports.EthereumERC20Token = void 0;
var _1 = require(".");
exports.EthereumERC20Token = {
SAND: '0x3845badade8e6dff049820680d1f14bd3903a5d0',
BAT: '0x0D8775F648430679A709E98d2b0Cb6250d2887EF',
};
exports.PolygonERC20Token = {
SAND: '0xBbba073C31bF03b8ACf7c28EF0738DeCF3695683',
};
exports.EthereumERC20Tokens = Object.values(exports.EthereumERC20Token);
exports.PolygonERC20Tokens = Object.values(exports.PolygonERC20Token);
exports.TokenDecimals = (_a = {},
_a[_1.TOKEN_NAME.SAND] = 18,
_a[_1.TOKEN_NAME.ETH] = 18,
_a[_1.TOKEN_NAME.POL] = 18,
_a[_1.TOKEN_NAME.SUT] = 18,
_a[_1.TOKEN_NAME.BNB] = 18,
_a[_1.TOKEN_NAME.USDC] = 6,
_a[_1.TOKEN_NAME.USDT] = 6,
_a[_1.TOKEN_NAME.GMT] = 8,
_a[_1.TOKEN_NAME.GST] = 8,
_a[_1.TOKEN_NAME.GGT] = 8,
_a[_1.TOKEN_NAME.SOL] = 9,
_a[_1.TOKEN_NAME.GGUSD] = 6,
_a[_1.TOKEN_NAME.BAT] = 8,
_a);
var getTokenDecimals = function (tokenName, chain) {
if ([_1.TOKEN_NAME.USDC, _1.TOKEN_NAME.USDT].includes(tokenName) &&
chain === _1.Chains.binance) {
return 18;
}
if (tokenName === _1.TOKEN_NAME.BAT && chain === _1.Chains.ethereum) {
return 18;
}
return exports.TokenDecimals[tokenName];
};
exports.getTokenDecimals = getTokenDecimals;