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
Name | Type |
---|---|
|
|
|
|
|
|
|
|
Overrides
Base.constructor
Defined in
Properties
config
• config: any
= null
Inherited from
Base.config
Defined in
networkId
• networkId: any
= null
Inherited from
Base.networkId
Defined in
pinataApiKey
• Private
pinataApiKey: string
Defined in
pinataSecretKey
• Private
pinataSecretKey: string
Defined in
web3
• web3: any
= null
Inherited from
Base.web3
Defined in
Methods
fetchDataTokenList
▸ fetchDataTokenList(chainId
): Promise
<TokenList
>
fetch list of all Datatokens
Parameters
Name | Type |
---|---|
|
|
Returns
Promise
<TokenList
>
Defined in
fetchGlobalTokenList
▸ fetchGlobalTokenList(chainId
): Promise
<TokenList
>
fetch global token list with all ERC20 tokens + Datatokens
Parameters
Name | Type |
---|---|
|
|
Returns
Promise
<TokenList
>
Defined in
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
Name | Type |
---|---|
|
|
|
|
|
|
|
|
|
|
|
|
Returns
Promise
<TokenList
>
Datatoken list to be published (OCEAN + datatokens)
Defined in
pinTokenListToIPFS
▸ Private
pinTokenListToIPFS(listname
, list
): Promise
<string
>
pin token list to IPFS
Parameters
Name | Type |
---|---|
|
|
|
|
Returns
Promise
<string
>
Defined in
prepareDataTokenList
▸ Private
prepareDataTokenList(tokens
, chainId
): Promise
<TokenList
>
prepare datatokens list (OCEAN + datatokens) to be published
Parameters
Name | Type |
---|---|
|
|
|
|
Returns
Promise
<TokenList
>
Defined in
prepareGlobalTokenList
▸ Private
prepareGlobalTokenList(tokens
, chainId
): Promise
<TokenList
>
prepare global token list (ERC20 + datatokens) to be published
Parameters
Name | Type |
---|---|
|
|
|
|
Returns
Promise
<TokenList
>
Defined in
publishDataTokenList
▸ publishDataTokenList(listname
, chainId
): Promise
<any
>
publish datatoken list to IPFS
Parameters
Name | Type |
---|---|
|
|
|
|
Returns
Promise
<any
>
Defined in
publishGlobalTokenList
▸ publishGlobalTokenList(listname
, chainId
): Promise
<any
>
publish ERC20 tokenlist to IPFS
Parameters
Name | Type |
---|---|
|
|
|
|
Returns
Promise
<any
>
Defined in
Last updated