Skip to main content
Helpful?

NativeCurrency

@uniswap/sdk-core / Exports / NativeCurrency

Class: NativeCurrency

Represents the native currency of the chain on which it resides, e.g.

Hierarchy

  • BaseCurrency

    NativeCurrency

    ↳↳ Ether

Table of contents

Constructors

Properties

Accessors

Methods

Constructors

constructor

Protected new NativeCurrency(chainId, decimals, symbol?, name?)

Constructs an instance of the base class BaseCurrency.

Parameters

NameTypeDescription
chainIdnumberthe chain ID on which this currency resides
decimalsnumberdecimals of the currency
symbol?stringsymbol of the currency
name?stringof the currency

Inherited from

BaseCurrency.constructor

Defined in

entities/baseCurrency.ts:42

Properties

chainId

Readonly chainId: number

The chain ID on which this currency resides

Inherited from

BaseCurrency.chainId

Defined in

entities/baseCurrency.ts:21


decimals

Readonly decimals: number

The decimals used in representing currency amounts

Inherited from

BaseCurrency.decimals

Defined in

entities/baseCurrency.ts:25


isNative

Readonly isNative: true

Overrides

BaseCurrency.isNative

Defined in

entities/nativeCurrency.ts:7


isToken

Readonly isToken: false

Overrides

BaseCurrency.isToken

Defined in

entities/nativeCurrency.ts:8


name

Optional Readonly name: string

The name of the currency, i.e. a descriptive textual non-unique identifier

Inherited from

BaseCurrency.name

Defined in

entities/baseCurrency.ts:33


symbol

Optional Readonly symbol: string

The symbol of the currency, i.e. a short textual non-unique identifier

Inherited from

BaseCurrency.symbol

Defined in

entities/baseCurrency.ts:29

Accessors

wrapped

Abstract get wrapped(): Token

Return the wrapped version of this currency that can be used with the Uniswap contracts. Currencies must implement this to be used in Uniswap

Returns

Token

Inherited from

BaseCurrency.wrapped

Defined in

entities/baseCurrency.ts:62

Methods

equals

Abstract equals(other): boolean

Returns whether this currency is functionally equivalent to the other currency

Parameters

NameTypeDescription
otherCurrencythe other currency

Returns

boolean

Inherited from

BaseCurrency.equals

Defined in

entities/baseCurrency.ts:56

Helpful?