npm install --save @aragon/wrapper
import AragonWrapper, { providers } from '@aragon/wrapper'
const AragonWrapper = require('@aragon/wrapper').default
const providers = require('@aragon/wrapper').providers
daoAddress
string The address of the DAO.options
Object Wrapper options. (optional, default{}
)options.provider
any The Web3 provider to use for blockchain communication. Defaults toweb3.currentProvider
if web3 is injected, otherwise will fallback to wss://rinkeby.eth.aragon.network/ws (optional)options.apm
Object Options for fetching information from aragonPMoptions.apm.ensRegistryAddress
String The address of the ENS registryoptions.apm.ipfs
Object IPFS options for fetching information from aragonPM (optional)options.apm.ipfs.gateway
String The IPFS gateway to use for fetching information (optional)options.apm.ipfs.fetchTimeout
Number The timeout before a request to IPFS is automatically failed in milliseconds (optional, default 10s)options.cache
Object Cache options (optional)options.cache.forceLocalStorage
boolean On browser environments, downgrade to localStorage even if IndexedDB is available (optional)
const aragon = new Aragon(
'0xdeadbeef',
{ apm: { ensRegistryAddress: '0x...' } }
)
// Initialises the wrapper
await aragon.init({
accounts: {
providedAccounts: ['0xbeefdead', '0xbeefbeef'],
},
})
Initialise the wrapper.
options
Object An optional options object for configuring the wrapper.accounts
Array<string> Options object forinitAccounts()
Returns Promise<void>
Throws Error if the daoAddress
provided during constructor is detected to not be a Kernel
instance
Initialise user-controlled accounts.
options
Object
Returns Promise<void>
Initialise the ACL.
options
Object
Returns Promise<void>
Get proxy metadata (appId
, address of the kernel, ...).
proxyAddress
string The address of the proxy to get metadata from
Check if an object is an app.
app
Object
Returns boolean
Initialise apps observable.
Returns void
Initialise forwarder observable.
Returns void
Initialise connected network details observable.
Returns Promise<void>
Run an app.
sandbox
Object An object that is compatible with the PostMessage API.proxyAddress
string The address of the app proxy.
Returns Object
Get the available accounts for the current user.
Returns Promise<Array<string>> An array of addresses
Calculate the transaction path for a transaction to destination
that invokes methodName
with params
.
Returns Array<Object> An array of Ethereum transactions that describe each step in the path
Calculate the transaction path for a transaction to destination
that invokes methodName
with params
.
Returns Array<Object> An array of Ethereum transactions that describe each step in the path
Modify the identity metadata for an address using the highest priority provider.
Returns a Promise<void> that resolves if the modification was successful.
Resolve the identity metadata for an address using the highest priority provider.
address
string Address to resolve
Returns a Promise<Object> that resolves with the identity or null if not found.
Request an identity modification using the highest priority provider.
address
string Address to request modification
Returns a Promise<void> that delegates resolution to the handler.
Remove specific local identities.
addresses
Array<string> Addresses to remove from local identities
Search identites using the highest priority provider.
searchTerm
string String to search for
Returns a Promise<Array<string>> which resolves with the found identities or an empty array.
Set the current GUI style of the client to the apps.
appearance
string Eitherlight
ordark
. Other values could be passed in the future (e.g.black
for OLED screens). Apps should display a corresponding theme, unlesstheme
has also been set.theme
Object An entire theme (e.g. aragonUI's light theme) that should be displayed by app frontends. It is optional and apps should respect it when present. If not possible, apps should respect the value ofappearance
.
Returns void