Tokens app
This is an app connector for the Tokens app (token-manager.aragonpm.eth
). It only supports The Graph for now.
Usage
To connect a Tokens app, you need to pass it to connectTokens()
:
It extends the App
object, which means that every method and property of App
is also available on this object.
connect(app, connector)
Connects and returns a Tokens
instance.
Name | Type | Description |
---|---|---|
|
| The app to extend with connected capabilities. |
|
| Accepts either a string describing the desired connector (only |
returns |
| An |
It can throw the following errors:
Error type | Description |
---|---|
Either the passed value is not a valid app object, or its name is not | |
Either the connector configuration format is not valid, or the connector name is not supported. | |
A subgraph couldn’t be found with the current network. Pass a |
Tokens
An object representing the Tokens app, returned by connectTokens()
. Use the following API to retrieve its data:
Tokens#token()
Get the Token
instance used with the app.
Name | Type | Description |
---|---|---|
returns |
| A |
This method can throw one of the following errors:
Error type | Description |
---|---|
The response seems incorrect. | |
The connection to the remote source failed. |
Tokens#holders(filters)
Get a list of token holders.
Name | Type | Description |
---|---|---|
|
| Optional object allowing to filter the token holders. |
|
| Maximum number of token holders. Defaults to |
|
| Skip a number of token holders. Defaults to |
returns |
| List of token holders. |
This method can throw one of the following errors:
Error type | Description |
---|---|
The response seems incorrect. | |
The connection to the remote source failed. |
Tokens#onHolders(filters, callback)
Subscribe to a list of token holders. The callback is optional, not passing it will return a partially applied function.
Name | Type | Description |
---|---|---|
|
| Optional object allowing to filter the token holders. See |
|
| A callback that will get called every time the result gets updated. |
returns |
| Unsubscribe function. |
The error passed to callback
can be null
(no error) or one of the following:
Error type | Description |
---|---|
The data couldn’t be fetched. | |
The connection to the remote source failed. |
Token
This object represents the token contract (based on MiniMe) used by the Tokens app. It gets returned by Tokens#token()
for example.
Name | Type | Description |
---|---|---|
|
| Unique identifier representing this token. |
|
| Address of the MiniMe Token contract. |
|
| The token name (e.g. “Aragon Network Token”). |
|
| The token symbol (e.g. “ANT”). |
|
| The total supply for the token. |
|
| Whether the token is transferable. |
TokenHolder
This object represents a single token holder. It gets returned by Tokens#holders()
for example.
Name | Type | Description |
---|---|---|
|
| Unique identifier representing the token holder. |
|
| Address of the token holder. |
|
| Current balance. |
Last updated