Wrapper
aragonAPI for Aragon client implementations
Install
Import
ES6
ES5 (CommonJS)
API Reference
AragonWrapper
Parameters
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)
Examples
init
Initialise the wrapper.
Parameters
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
initAccounts
Initialise user-controlled accounts.
Parameters
Returns Promise<void>
initAcl
Initialise the ACL.
Parameters
Returns Promise<void>
getProxyValues
Get proxy metadata (appId
, address of the kernel, ...).
Parameters
proxyAddress
string The address of the proxy to get metadata from
isApp
Check if an object is an app.
Parameters
app
Object
Returns boolean
initApps
Initialise apps observable.
Returns void
initForwarders
Initialise forwarder observable.
Returns void
initNetwork
Initialise connected network details observable.
Returns Promise<void>
runApp
Run an app.
Parameters
sandbox
Object An object that is compatible with the PostMessage API.proxyAddress
string The address of the app proxy.
Returns Object
getAccounts
Get the available accounts for the current user.
Returns Promise<Array<string>> An array of addresses
getTransactionPath
Calculate the transaction path for a transaction to destination
that invokes methodName
with params
.
Parameters
Returns Array<Object> An array of Ethereum transactions that describe each step in the path
calculateTransactionPath
Calculate the transaction path for a transaction to destination
that invokes methodName
with params
.
Parameters
Returns Array<Object> An array of Ethereum transactions that describe each step in the path
modifyAddressIdentity
Modify the identity metadata for an address using the highest priority provider.
Parameters
Returns a Promise<void> that resolves if the modification was successful.
resolveAddressIdentity
Resolve the identity metadata for an address using the highest priority provider.
Parameters
address
string Address to resolve
Returns a Promise<Object> that resolves with the identity or null if not found.
requestAddressIdentityModification
Request an identity modification using the highest priority provider.
Parameters
address
string Address to request modification
Returns a Promise<void> that delegates resolution to the handler.
removeLocalIdentities
Remove specific local identities.
Parameters
addresses
Array<string> Addresses to remove from local identities
searchIdentities
Search identites using the highest priority provider.
Parameters
searchTerm
string String to search for
Returns a Promise<Array<string>> which resolves with the found identities or an empty array.
setGuiStyle
Set the current GUI style of the client to the apps.
Parameters
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.
Last updated