import type { Currency } from './currency-type.js'; import { NativeCurrency, nativeCurrencyToSerializableErc20TokenType } from './native-currency.js'; import { WXDAI } from './common-tokens.js'; import type { SerializableErc20TokenType } from './base-currency.js'; /** * xDAI is the native currency of the Gnosis Chain chain */ class xDAICurrency extends NativeCurrency { constructor() { super({ chainId: 100, decimals: 18, symbol: 'xDAI', name: 'xDAI', }); } get wrapped() { return WXDAI; } /** * Returns true if the two tokens are equivalent, i.e. have the same chainId and address. * @param other other token to compare */ public equals(other: Currency): boolean { return other.isNative && this.chainId === other.chainId && this.address === other.address; } public toObject(): SerializableErc20TokenType { return nativeCurrencyToSerializableErc20TokenType(this); } } export const xDAI = new xDAICurrency();