Skip to content

Aragon App

An Aragon app.

This class handles communicating with the wrapper using Aragon RPC.

The class itself contains "magic methods", that is, undefined methods will instead become an intent that is sent to the wrapper.

For example:

app.transfer('foo', 'bar')

will result in an intent to send a transaction to the application proxy, invoking the contract function transfer with the parameters foo and bar.

Parameters

  • rpc Object? An RPC provider (will default to using the PostMessage API)

events

Get events from the application contract.

Returns Observable An observable of contract events (as defined in Web3)

cache

Cache a value for the application.

Parameters

Returns string Will pass through value

notify

Send a notification.

Parameters

  • title string The notification title
  • body string The notification body
  • context Object The application context to send back if the notification is clicked (optional, default {})
  • date Date The notification's timestamp

Returns void

state

Observe the application state.

Returns Observable An observable of application states over time.

store

Listens for events, passes them through reducer, caches the resulting state and returns that state.

The reducer takes the signature (state, event) a lá Redux.

Parameters

Returns Observable An observable of the resulting state from reducing events

call

Perform a call to the application contract.

Parameters

  • method string The method to call
  • params ...any Parameters for the call

Returns Observable An observable that emits the return value(s) of the call.

reducer

A state reducer a lá Redux.

Type: Function

Parameters

Returns Object The next state