Wrapper
aragonAPI for Aragon client implementations
Install
npm install --save @aragon/wrapperImport
ES6
import AragonWrapper, { providers } from '@aragon/wrapper'ES5 (CommonJS)
const AragonWrapper = require('@aragon/wrapper').default
const providers = require('@aragon/wrapper').providersAPI Reference
AragonWrapper
Parameters
daoAddressstring The address of the DAO.optionsObject Wrapper options. (optional, default{})options.providerany The Web3 provider to use for blockchain communication. Defaults toweb3.currentProviderif web3 is injected, otherwise will fallback to wss://rinkeby.eth.aragon.network/ws (optional)options.apmObject Options for fetching information from aragonPMoptions.apm.ensRegistryAddressString The address of the ENS registryoptions.apm.ipfsObject IPFS options for fetching information from aragonPM (optional)options.apm.ipfs.gatewayString The IPFS gateway to use for fetching information (optional)options.apm.ipfs.fetchTimeoutNumber The timeout before a request to IPFS is automatically failed in milliseconds (optional, default 10s)options.cacheObject Cache options (optional)options.cache.forceLocalStorageboolean On browser environments, downgrade to localStorage even if IndexedDB is available (optional)
Examples
const aragon = new Aragon(
'0xdeadbeef',
{ apm: { ensRegistryAddress: '0x...' } }
)
// Initialises the wrapper
await aragon.init({
accounts: {
providedAccounts: ['0xbeefdead', '0xbeefbeef'],
},
})init
Initialise the wrapper.
Parameters
optionsObject An optional options object for configuring the wrapper.accountsArray<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
proxyAddressstring The address of the proxy to get metadata from
isApp
Check if an object is an app.
Parameters
appObject
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
sandboxObject An object that is compatible with the PostMessage API.proxyAddressstring 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
addressstring 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
addressstring Address to request modification
Returns a Promise<void> that delegates resolution to the handler.
removeLocalIdentities
Remove specific local identities.
Parameters
addressesArray<string> Addresses to remove from local identities
searchIdentities
Search identites using the highest priority provider.
Parameters
searchTermstring 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
appearancestring Eitherlightordark. Other values could be passed in the future (e.g.blackfor OLED screens). Apps should display a corresponding theme, unlessthemehas also been set.themeObject 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
Was this helpful?
