Finance app
This is an app connector for the Finance app (finance.aragonpm.eth
). It only supports The Graph for now.
Usage
To connect a Finance app, you need to pass it to connectFinance()
:
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 Finance
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 |
Finance
An object representing the Finance app, returned by connectFinance()
. Use the following API to retrieve its data:
Finance#transactions(filters)
Get the list of transactions in the Finance app.
Name | Type | Description |
---|---|---|
|
| Optional object allowing to filter the votes. |
|
| Maximum number of votes. Defaults to |
|
| Skip a number of votes. Defaults to |
returns |
| The list of transactions. |
This method can throw one of the following errors:
Error type | Description |
---|---|
The response seems incorrect. | |
The connection to the remote source failed. |
Finance#onTransactions(filters, callback)
Subscribe to the list of transactions in the Finance app. The callback is optional, not passing it will return a partially applied function.
Name | Type | Description |
---|---|---|
|
| Optional object allowing to filter the votes. 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. |
Finance#balance(tokenAddress, filters)
Get the balance of a token in the Finance app.
Name | Type | Description |
---|---|---|
|
| The address of the token. |
|
| Optional object allowing to filter the votes. |
|
| Maximum number of votes. Defaults to |
|
| Skip a number of votes. Defaults to |
returns |
| The balance of the token. |
This method can throw one of the following errors:
Error type | Description |
---|---|
The response seems incorrect. | |
The connection to the remote source failed. |
Finance#onBalance(tokenAddress, filters, callback)
Subscribe to the balance of a token in the Finance app. The callback is optional, not passing it will return a partially applied function.
Name | Type | Description |
---|---|---|
|
| The address of the token. |
|
| Optional object allowing to filter the votes. 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. |
TokenBalance
Represents the balance in a given token. It gets returned by Finance#balance()
for example.
Name | Type | Description |
---|---|---|
|
| Unique identifier representing this token balance. |
|
| Address of the token contract. |
|
| The actual balance. |
Transaction
Name | Type | Description |
---|---|---|
|
| Unique identifier representing this transaction. |
|
| Address of the token contract. |
|
| Recipient or sender for the transfer. |
|
| Whether the transaction is incoming or outgoing. |
|
| The amount of tokens transferred. |
|
| Date of the transfer, in Unix time. |
|
| An optional reference attached to the transaction. |
Last updated