TokenList

@dataxfi/datax.js / Exports / TokenList

Class: TokenList

Hierarchy

  • default

    TokenList

Table of contents

Constructors

  • constructor

Properties

  • config

  • networkId

  • pinataApiKey

  • pinataSecretKey

  • web3

Methods

  • fetchDataTokenList

  • fetchGlobalTokenList

  • fetchPreparedTokenList

  • pinTokenListToIPFS

  • prepareDataTokenList

  • prepareGlobalTokenList

  • publishDataTokenList

  • publishGlobalTokenList

Constructors

constructor

new TokenList(web3, networkId, pinataAPIKey, pinataSecretKey)

Parameters

NameType

web3

any

networkId

any

pinataAPIKey

string

pinataSecretKey

string

Overrides

Base.constructor

Defined in

TokenList.ts:11

Properties

config

config: any = null

Inherited from

Base.config

Defined in

Base.ts:5


networkId

networkId: any = null

Inherited from

Base.networkId

Defined in

Base.ts:7


pinataApiKey

Private pinataApiKey: string

Defined in

TokenList.ts:8


pinataSecretKey

Private pinataSecretKey: string

Defined in

TokenList.ts:9


web3

web3: any = null

Inherited from

Base.web3

Defined in

Base.ts:6

Methods

fetchDataTokenList

fetchDataTokenList(chainId): Promise<TokenList>

fetch list of all Datatokens

Parameters

NameType

chainId

number

Returns

Promise<TokenList>

Defined in

TokenList.ts:47


fetchGlobalTokenList

fetchGlobalTokenList(chainId): Promise<TokenList>

fetch global token list with all ERC20 tokens + Datatokens

Parameters

NameType

chainId

number

Returns

Promise<TokenList>

Defined in

TokenList.ts:26


fetchPreparedTokenList

fetchPreparedTokenList(chainId, CLIENT_EMAIL, PRIVATE_KEY, TOKEN_URI, SCOPE, PRIVATE_KEY_ID): Promise<TokenList>

Fetch a prepared datatoken list from google drive This function will be used instead of prepareDateTokenList, the schema is the same for each of their responses. This funciton uses axios which means it will function in dataxjs via the dapp without dep issues

Parameters

NameType

chainId

number

CLIENT_EMAIL

string

PRIVATE_KEY

string

TOKEN_URI

string

SCOPE

string

PRIVATE_KEY_ID

string

Returns

Promise<TokenList>

Datatoken list to be published (OCEAN + datatokens)

Defined in

TokenList.ts:318


pinTokenListToIPFS

Private pinTokenListToIPFS(listname, list): Promise<string>

pin token list to IPFS

Parameters

NameType

listname

string

list

TokenList

Returns

Promise<string>

Defined in

TokenList.ts:403


prepareDataTokenList

Private prepareDataTokenList(tokens, chainId): Promise<TokenList>

prepare datatokens list (OCEAN + datatokens) to be published

Parameters

NameType

tokens

any

chainId

any

Returns

Promise<TokenList>

Defined in

TokenList.ts:237


prepareGlobalTokenList

Private prepareGlobalTokenList(tokens, chainId): Promise<TokenList>

prepare global token list (ERC20 + datatokens) to be published

Parameters

NameType

tokens

any

chainId

any

Returns

Promise<TokenList>

Defined in

TokenList.ts:162


publishDataTokenList

publishDataTokenList(listname, chainId): Promise<any>

publish datatoken list to IPFS

Parameters

NameType

listname

string

chainId

number

Returns

Promise<any>

Defined in

TokenList.ts:70


publishGlobalTokenList

publishGlobalTokenList(listname, chainId): Promise<any>

publish ERC20 tokenlist to IPFS

Parameters

NameType

listname

string

chainId

number

Returns

Promise<any>

Defined in

TokenList.ts:117

Last updated