api/currency/erc20

@requestnetwork/request-client.jsGlobals"api/currency/erc20"

Index

Interfaces

Variables

Functions

Object literals

Variables

Const supportedERC20Tokens

supportedERC20Tokens: ITokenMap = require('eth-contract-metadata') as ITokenMap

Defined in request-client.js/src/api/currency/erc20.ts:20


Const supportedRinkebyERC20

supportedRinkebyERC20: Map‹string, object› = new Map([ // Request Central Bank token, used for testing on rinkeby. [ 'CTBK', { network: 'rinkeby', type: RequestLogicTypes.CURRENCY.ERC20, value: '0x995d6a8c21f24be1dd04e105dd0d83758343e258', }, ],

// Faucet Token on rinkeby network. Easy to use on tests. [ 'FAU', { network: 'rinkeby', type: RequestLogicTypes.CURRENCY.ERC20, value: '0xFab46E002BbF0b4509813474841E0716E6730136', }, ], ])

Defined in request-client.js/src/api/currency/erc20.ts:23

Functions

getErc20Currency

getErc20Currency(symbol: string, network: string): ICurrency | undefined

Defined in request-client.js/src/api/currency/erc20.ts:68

Returns a Currency object for an ERC20, if found

Parameters:

NameTypeDescription
symbolstringThe ERC20 token symbol
networkstringThe ERC20 contract network

Returns: ICurrency | undefined


getErc20Decimals

getErc20Decimals(currency: ICurrency): number

Defined in request-client.js/src/api/currency/erc20.ts:101

Get the amount of decimals for an ERC20 currency

Parameters:

NameTypeDescription
currencyICurrencyThe ERC20 Currency object

Returns: number

The number of decimals for the ERC20 currency


getErc20FromSymbol

getErc20FromSymbol(symbol: string): ITokenDescription | undefined

Defined in request-client.js/src/api/currency/erc20.ts:144

Get an ERC20 currency from the currency value string

Parameters:

NameTypeDescription
symbolstringthe ERC20 currency symbol string

Returns: ITokenDescription | undefined

the ERC20 ITokenDescription


getErc20Symbol

getErc20Symbol(currency: ICurrency): string | null

Defined in request-client.js/src/api/currency/erc20.ts:170

Get an ERC20 symbol from the Currency object

Parameters:

NameType
currencyICurrency

Returns: string | null

the ERC20 currency symbol string


getMainnetErc20FromAddress

getMainnetErc20FromAddress(address: string): ITokenDescription | undefined

Defined in request-client.js/src/api/currency/erc20.ts:129

Get an ERC20 currency from the currency address

Parameters:

NameTypeDescription
addressstringthe ERC20 currency address

Returns: ITokenDescription | undefined

the ERC20 ITokenDescription


getSupportedERC20Tokens

getSupportedERC20Tokens(): Array‹object›

Defined in request-client.js/src/api/currency/erc20.ts:195

Returns a list of supported ERC20 currencies

Returns: Array‹object›

List of supported ERC20 currencies


validERC20Address

validERC20Address(address: string): boolean

Defined in request-client.js/src/api/currency/erc20.ts:160

Returns true if the address is a valid checksum address

Parameters:

NameTypeDescription
addressstringThe address to validate

Returns: boolean

If the address is valid or not

Object literals

Const supportedRinkebyERC20Details

supportedRinkebyERC20Details: object

Defined in request-client.js/src/api/currency/erc20.ts:46

CTBK: object

Defined in request-client.js/src/api/currency/erc20.ts:48

  • address: string = "0x995d6a8c21f24be1dd04e105dd0d83758343e258"

  • decimals: number = 18

  • name: string = "Central Bank Token"

FAU: object

Defined in request-client.js/src/api/currency/erc20.ts:55

  • address: string = "0xFab46E002BbF0b4509813474841E0716E6730136"

  • decimals: number = 18

  • name: string = "Faucet Token"