butterjs-sdk
Version:
Butter Network SDK
28 lines (27 loc) • 1.06 kB
JavaScript
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.EVMNativeCoin = void 0;
const tiny_invariant_1 = __importDefault(require("tiny-invariant"));
const NativeCurrency_1 = require("../NativeCurrency");
const wcoin_1 = require("../wcoin");
const constants_1 = require("../../constants");
/**
* EVMNativCoin is the main usage of a 'native' currency, i.e. for Ethereum mainnet and all testnets
*/
class EVMNativeCoin extends NativeCurrency_1.NativeCurrency {
constructor(chainId, decimal, symbol, name, logo) {
super(chainId, decimal, constants_1.ZERO_ADDRESS, symbol, name, logo);
}
get wrapped() {
const weth9 = (0, wcoin_1.WCOIN)(this.chainId);
(0, tiny_invariant_1.default)(!!weth9, 'WRAPPED');
return weth9;
}
equals(other) {
return other.isNative && other.chainId === this.chainId;
}
}
exports.EVMNativeCoin = EVMNativeCoin;
;