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