client
Classes
- Client
Provider a generic client with high level methods to manage and interact with DAO's
- ClientDecoding
Decoding module the SDK Generic Client
- ClientEncoding
Encoding module the SDK Generic Client
- ClientEstimation
Estimation module the SDK Generic Client
- ClientMethods
Methods module the SDK Generic Client
Client
Provider a generic client with high level methods to manage and interact with DAO's
Kind: global class
ClientDecoding
Decoding module the SDK Generic Client
Kind: global class
- ClientDecoding
- .applyInstallationAction(Uint8Array) ⇒
DecodedApplyInstallationParams
- .applyUninstallationAction(Uint8Array) ⇒
DecodedApplyInstallationParams
- .applyUpdateAction(data) ⇒
DecodedApplyUpdateParams
- .grantAction(data) ⇒
GrantPermissionDecodedParams
- .grantWithConditionAction(data) ⇒
GrantPermissionWithConditionParams
- .revokeAction(data) ⇒
RevokePermissionDecodedParams
- .withdrawAction(data) ⇒
WithdrawParams
- .updateDaoMetadataRawAction(data) ⇒
string
- .updateDaoMetadataAction(data) ⇒
Promise.<DaoMetadata>
- .setDaoUriAction(data) ⇒
string
- .registerStandardCallbackAction(data) ⇒
RegisterStandardCallbackParams
- .setSignatureValidatorAction(data) ⇒
string
- .upgradeToAndCallAction(data) ⇒
UpgradeToAndCallParams
- .initializeFromAction(data) ⇒
InitializeFromParams
- .findInterface(data) ⇒
InterfaceParams
|null
- .daoUpdateAction(data) ⇒
DaoUpdateDecodedParams
- .applyInstallationAction(Uint8Array) ⇒
clientDecoding.applyInstallationAction(Uint8Array) ⇒ DecodedApplyInstallationParams
Kind: instance method of ClientDecoding
Returns: DecodedApplyInstallationParams
Param | Type |
---|---|
Uint8Array | data |
clientDecoding.applyUninstallationAction(Uint8Array) ⇒ DecodedApplyInstallationParams
Kind: instance method of ClientDecoding
Returns: DecodedApplyInstallationParams
Param | Type |
---|---|
Uint8Array | data |
clientDecoding.applyUpdateAction(data) ⇒ DecodedApplyUpdateParams
Decodes the apply update parameters from an encoded apply update action
Kind: instance method of ClientDecoding
Returns: DecodedApplyUpdateParams
Param | Type |
---|---|
data | Uint8Array |
clientDecoding.grantAction(data) ⇒ GrantPermissionDecodedParams
Decodes the permission parameters from an encoded grant action
Kind: instance method of ClientDecoding
Returns: GrantPermissionDecodedParams
Param | Type |
---|---|
data | Uint8Array |
clientDecoding.grantWithConditionAction(data) ⇒ GrantPermissionWithConditionParams
Decodes the grant permission with condition parameters from an encoded grant with condition action
Kind: instance method of ClientDecoding
Returns: GrantPermissionWithConditionParams
Param | Type |
---|---|
data | Uint8Array |
clientDecoding.revokeAction(data) ⇒ RevokePermissionDecodedParams
Decodes the permission parameters from an encoded revoke action
Kind: instance method of ClientDecoding
Returns: RevokePermissionDecodedParams
Param | Type |
---|---|
data | Uint8Array |
clientDecoding.withdrawAction(data) ⇒ WithdrawParams
Decodes the withdraw parameters from an encoded withdraw action
Kind: instance method of ClientDecoding
Returns: WithdrawParams
Param | Type |
---|---|
data | Uint8Array |
clientDecoding.updateDaoMetadataRawAction(data) ⇒ string
Decodes a dao metadata ipfs uri from an encoded update metadata action
Kind: instance method of ClientDecoding
Returns: string
Param | Type |
---|---|
data | Uint8Array |
clientDecoding.updateDaoMetadataAction(data) ⇒ Promise.<DaoMetadata>
Decodes a dao metadata from an encoded update metadata raw action
Kind: instance method of ClientDecoding
Returns: Promise.<DaoMetadata>
Param | Type |
---|---|
data | Uint8Array |
clientDecoding.setDaoUriAction(data) ⇒ string
Decodes the daoUri from a setDaoUriAction
Kind: instance method of ClientDecoding
Returns: string
Param | Type |
---|---|
data | Uint8Array |
clientDecoding.registerStandardCallbackAction(data) ⇒ RegisterStandardCallbackParams
Decodes the RegisterStandardCallbackParams from a registerStandardCallbackAction
Kind: instance method of ClientDecoding
Returns: RegisterStandardCallbackParams
Param | Type |
---|---|
data | Uint8Array |
clientDecoding.setSignatureValidatorAction(data) ⇒ string
Decodes the implementation address from an encoded upgradeToAction
Kind: instance method of ClientDecoding
Returns: string
Param | Type |
---|---|
data | Uint8Array |
clientDecoding.upgradeToAndCallAction(data) ⇒ UpgradeToAndCallParams
Decodes upgradeToAndCallback params from an upgradeToAndCallAction
Kind: instance method of ClientDecoding
Returns: UpgradeToAndCallParams
Param | Type |
---|---|
data | Uint8Array |
clientDecoding.initializeFromAction(data) ⇒ InitializeFromParams
Decodes the initializeFrom params from an initializeFromAction
Kind: instance method of ClientDecoding
Returns: InitializeFromParams
Param | Type |
---|---|
data | Uint8Array |
clientDecoding.findInterface(data) ⇒ InterfaceParams
| null
Returns the decoded function info given the encoded data of an action
Kind: instance method of ClientDecoding
Returns: InterfaceParams
| null
Param | Type |
---|---|
data | Uint8Array |
clientDecoding.daoUpdateAction(data) ⇒ DaoUpdateDecodedParams
Decodes the dao update params from a daoUpdateAction
Kind: instance method of ClientDecoding
Returns: DaoUpdateDecodedParams
Param | Type |
---|---|
data | Uint8Array |
ClientEncoding
Encoding module the SDK Generic Client
Kind: global class
- ClientEncoding
- .applyInstallationAction(daoAddress, params) ⇒
DaoAction
- .applyUpdateAndPermissionsActionBlock(daoAddress, params) ⇒
Array.<DaoAction>
- .grantAction(daoAddress, params) ⇒
DaoAction
- .grantWithConditionAction(daoAddress, params) ⇒
DaoAction
- .revokeAction(daoAddress, params) ⇒
DaoAction
- .withdrawAction(recipientAddressOrEns, value) ⇒
Promise.<DaoAction>
- .updateDaoMetadataAction(daoAddressOrEns, params) ⇒
Promise.<DaoAction>
- .setDaoUriAction(daoAddressOrEns, daoUri) ⇒
DaoAction
- .registerStandardCallbackAction(daoAddressOrEns, daoUri) ⇒
DaoAction
- .setSignatureValidatorAction(daoAddressOrEns, signatureValidator) ⇒
DaoAction
- .upgradeToAction(daoAddressOrEns, implementationAddress) ⇒
DaoAction
- .upgradeToAndCallAction(daoAddressOrEns, params) ⇒
DaoAction
- .initializeFromAction(daoAddressOrEns, params) ⇒
DaoAction
- .daoUpdateAction(daoAddressOrEns, params) ⇒
Promise.<DaoAction>
- .applyInstallationAction(daoAddress, params) ⇒
clientEncoding.applyInstallationAction(daoAddress, params) ⇒ DaoAction
Kind: instance method of ClientEncoding
Returns: DaoAction
Param | Type |
---|---|
daoAddress | string |
params | ApplyInstallationParams |
clientEncoding.applyUpdateAndPermissionsActionBlock(daoAddress, params) ⇒ Array.<DaoAction>
Computes the payload to be given when creating a proposal that applies an update to a plugin
Kind: instance method of ClientEncoding
Returns: Array.<DaoAction>
Param | Type |
---|---|
daoAddress | string |
params | ApplyUpdateParams |
clientEncoding.grantAction(daoAddress, params) ⇒ DaoAction
Computes the payload to be given when creating a proposal that grants a permission within a DAO
Kind: instance method of ClientEncoding
Returns: DaoAction
Param | Type |
---|---|
daoAddress | string |
params | GrantPermissionParams |
clientEncoding.grantWithConditionAction(daoAddress, params) ⇒ DaoAction
Computes the payload to be given when creating a proposal that grants a permission within a DAO given a certain condition
Kind: instance method of ClientEncoding
Returns: DaoAction
Param | Type |
---|---|
daoAddress | string |
params | GrantPermissionWithConditionParams |
clientEncoding.revokeAction(daoAddress, params) ⇒ DaoAction
Computes the payload to be given when creating a proposal that revokes a permission within a DAO
Kind: instance method of ClientEncoding
Returns: DaoAction
Param | Type |
---|---|
daoAddress | string |
params | RevokePermissionParams |
clientEncoding.withdrawAction(recipientAddressOrEns, value) ⇒ Promise.<DaoAction>
Computes the payload to be given when creating a proposal that withdraws ether from the DAO
Kind: instance method of ClientEncoding
Returns: Promise.<DaoAction>
Param | Type |
---|---|
recipientAddressOrEns | string |
value | WithdrawParams |
clientEncoding.updateDaoMetadataAction(daoAddressOrEns, params) ⇒ Promise.<DaoAction>
Computes the payload to be given when creating a proposal that updates the metadata the DAO
Kind: instance method of ClientEncoding
Returns: Promise.<DaoAction>
Param | Type |
---|---|
daoAddressOrEns | string |
params | DaoMetadata |
clientEncoding.setDaoUriAction(daoAddressOrEns, daoUri) ⇒ DaoAction
Computes the payload to be given when creating a proposal that sets the dao uri
Kind: instance method of ClientEncoding
Returns: DaoAction
Param | Type |
---|---|
daoAddressOrEns | string |
daoUri | string |
clientEncoding.registerStandardCallbackAction(daoAddressOrEns, daoUri) ⇒ DaoAction
Computes the payload to be given when creating a proposal that registers a new standard callback
Kind: instance method of ClientEncoding
Returns: DaoAction
Param | Type |
---|---|
daoAddressOrEns | string |
daoUri | string |
clientEncoding.setSignatureValidatorAction(daoAddressOrEns, signatureValidator) ⇒ DaoAction
Computes the payload to be given when creating a proposal that sets the signature validator
Kind: instance method of ClientEncoding
Returns: DaoAction
Param | Type |
---|---|
daoAddressOrEns | string |
signatureValidator | string |
clientEncoding.upgradeToAction(daoAddressOrEns, implementationAddress) ⇒ DaoAction
Computes the payload to be given when creating a proposal that sets a new implementation for the proxy
Kind: instance method of ClientEncoding
Returns: DaoAction
Param | Type |
---|---|
daoAddressOrEns | string |
implementationAddress | string |
clientEncoding.upgradeToAndCallAction(daoAddressOrEns, params) ⇒ DaoAction
Computes the payload to be given when creating a proposal that sets a new implementation for the proxy and calls the callback function with the specified data
Kind: instance method of ClientEncoding
Returns: DaoAction
Param | Type |
---|---|
daoAddressOrEns | string |
params | UpgradeToAndCallParams |
clientEncoding.initializeFromAction(daoAddressOrEns, params) ⇒ DaoAction
Computes an action to be passed to the upgradeToAndCallAction method when upgrading a DAO to a new version.
Kind: instance method of ClientEncoding
Returns: DaoAction
Param | Type |
---|---|
daoAddressOrEns | string |
params | InitializeFromParams |
clientEncoding.daoUpdateAction(daoAddressOrEns, params) ⇒ Promise.<DaoAction>
Does the necessary steps to encode an action that updates a DAO
Kind: instance method of ClientEncoding
Returns: Promise.<DaoAction>
Param | Type |
---|---|
daoAddressOrEns | string |
params | DaoUpdateParams |
ClientEstimation
Estimation module the SDK Generic Client
Kind: global class
- ClientEstimation
- .createDao(_params) ⇒
Promise.<GasFeeEstimation>
- .deposit(params) ⇒
Promise.<GasFeeEstimation>
- .setAllowance(_params) ⇒
Promise.<GasFeeEstimation>
- .prepareUpdate(params) ⇒
Promise.<GasFeeEstimation>
- .createDao(_params) ⇒
clientEstimation.createDao(_params) ⇒ Promise.<GasFeeEstimation>
Estimates the gas fee of creating a DAO
Kind: instance method of ClientEstimation
Returns: Promise.<GasFeeEstimation>
Param | Type |
---|---|
_params | CreateDaoParams |
clientEstimation.deposit(params) ⇒ Promise.<GasFeeEstimation>
Estimates the gas fee of depositing ether or an ERC20 token into the DAO This does not estimate the gas cost of updating the allowance of an ERC20 token
Kind: instance method of ClientEstimation
Returns: Promise.<GasFeeEstimation>
Param | Type |
---|---|
params | DepositParams |
clientEstimation.setAllowance(_params) ⇒ Promise.<GasFeeEstimation>
Estimates the gas fee of updating the allowance of an ERC20 token
Kind: instance method of ClientEstimation
Returns: Promise.<GasFeeEstimation>
Param | Type |
---|---|
_params | SetAllowanceParams |
clientEstimation.prepareUpdate(params) ⇒ Promise.<GasFeeEstimation>
Estimates the gas fee of preparing an update
Kind: instance method of ClientEstimation
Returns: Promise.<GasFeeEstimation>
Param | Type |
---|---|
params | PrepareUpdateParams |
ClientMethods
Methods module the SDK Generic Client
Kind: global class
- ClientMethods
- .createDao(params) ⇒
AsyncGenerator.<DaoCreationStepValue>
- .pinMetadata(params) ⇒
Promise.<string>
- .deposit(params) ⇒
AsyncGenerator.<DaoDepositStepValue>
- .setAllowance(params) ⇒
AsyncGenerator.<SetAllowanceStepValue>
- .prepareUninstallation(params) ⇒
AsyncGenerator.<PrepareUninstallationStepValue>
- .prepareUpdate(params) ⇒
AsyncGenerator.<PrepareUpdateStepValue>
- .hasPermission(params) ⇒
Promise.<boolean>
- .getDao(daoAddressOrEns) ⇒
Promise.<(DaoDetails|null)>
- .getDaos(params) ⇒
Promise.<Array.<DaoListItem>>
- .getDaoBalances(params) ⇒
Promise.<(Array.<AssetBalance>|null)>
- .getDaoTransfers(params) ⇒
Promise.<(Array.<Transfer>|null)>
- .getPlugins(params) ⇒
Promise.<(Array.<PluginRepo>|null)>
- .getPlugin(pluginAddress) ⇒
Promise.<PluginRepo>
- .getProtocolVersion(contractAddress) ⇒
Promise.<Array.<number>>
- .isDaoUpdateProposal(proposalId) ⇒
Promise.<boolean>
- .isPluginUpdateProposal(proposalId) ⇒
Promise.<boolean>
- .isPluginUpdateProposalValid(proposalId) ⇒
Promise.<PluginUpdateProposalValidity>
- .isDaoUpdateProposalValid(proposalId, [version]) ⇒
Promise.<DaoUpdateProposalValidity>
- .getDaoImplementation(daoFactoryAddress) ⇒
Promise.<string>
- .createDao(params) ⇒
clientMethods.createDao(params) ⇒ AsyncGenerator.<DaoCreationStepValue>
Creates a DAO with the given settings and plugins
Kind: instance method of ClientMethods
Returns: AsyncGenerator.<DaoCreationStepValue>
Param | Type |
---|---|
params | CreateDaoParams |
clientMethods.pinMetadata(params) ⇒ Promise.<string>
Pins a metadata object into IPFS and retruns the generated hash
Kind: instance method of ClientMethods
Returns: Promise.<string>
Param | Type |
---|---|
params | DaoMetadata |
clientMethods.deposit(params) ⇒ AsyncGenerator.<DaoDepositStepValue>
Deposits ether or an ERC20 token into the DAO
Kind: instance method of ClientMethods
Returns: AsyncGenerator.<DaoDepositStepValue>
Param | Type |
---|---|
params | DepositParams |
clientMethods.setAllowance(params) ⇒ AsyncGenerator.<SetAllowanceStepValue>
Checks if the allowance is enough and updates it
Kind: instance method of ClientMethods
Returns: AsyncGenerator.<SetAllowanceStepValue>
Param | Type |
---|---|
params | SetAllowanceParams |
clientMethods.prepareUninstallation(params) ⇒ AsyncGenerator.<PrepareUninstallationStepValue>
Prepare uninstallation of a plugin
Kind: instance method of ClientMethods
Returns: AsyncGenerator.<PrepareUninstallationStepValue>
Param | Type |
---|---|
params | PrepareUninstallationParams |
clientMethods.prepareUpdate(params) ⇒ AsyncGenerator.<PrepareUpdateStepValue>
Prepare update of a plugin
Kind: instance method of ClientMethods
Returns: AsyncGenerator.<PrepareUpdateStepValue>
Param | Type |
---|---|
params | PrepareUpdateParams |
clientMethods.hasPermission(params) ⇒ Promise.<boolean>
Checks whether a role is granted by the current DAO's ACL settings
Kind: instance method of ClientMethods
Returns: Promise.<boolean>
Param | Type |
---|---|
params | HasPermissionParams |
clientMethods.getDao(daoAddressOrEns) ⇒ Promise.<(DaoDetails|null)>
Retrieves metadata for DAO with given identifier (address or ens domain)
Kind: instance method of ClientMethods
Returns: Promise.<(DaoDetails|null)>
Param | Type |
---|---|
daoAddressOrEns | string |
clientMethods.getDaos(params) ⇒ Promise.<Array.<DaoListItem>>
Retrieves metadata for DAO with given identifier (address or ens domain)
Kind: instance method of ClientMethods
Returns: Promise.<Array.<DaoListItem>>
Param | Type | Description |
---|---|---|
params | DaoQueryParams |
|
clientMethods.getDaoBalances(params) ⇒ Promise.<(Array.<AssetBalance>|null)>
Retrieves the asset balances of the given DAO, by default, ETH, DAI, USDC and USDT on Mainnet
Kind: instance method of ClientMethods
Returns: Promise.<(Array.<AssetBalance>|null)>
Param | Type | Description |
---|---|---|
params | DaoBalancesQueryParams |
|
clientMethods.getDaoTransfers(params) ⇒ Promise.<(Array.<Transfer>|null)>
Retrieves the list of asset transfers to and from the given DAO (by default, from ETH, DAI, USDC and USDT, on Mainnet)
Kind: instance method of ClientMethods
Returns: Promise.<(Array.<Transfer>|null)>
Param | Type | Description |
---|---|---|
params | TransferQueryParams |
|
clientMethods.getPlugins(params) ⇒ Promise.<(Array.<PluginRepo>|null)>
Retrieves the list of plugins available on the PluginRegistry
Kind: instance method of ClientMethods
Returns: Promise.<(Array.<PluginRepo>|null)>
Param | Type | Description |
---|---|---|
params | PluginQueryParams |
|
clientMethods.getPlugin(pluginAddress) ⇒ Promise.<PluginRepo>
Get plugin details given an address, release and build
Kind: instance method of ClientMethods
Returns: Promise.<PluginRepo>
Param | Type |
---|---|
pluginAddress | string |
clientMethods.getProtocolVersion(contractAddress) ⇒ Promise.<Array.<number>>
Returns the protocol version of a contract if the transaction fails returns [1,0,0]
Kind: instance method of ClientMethods
Returns: Promise.<Array.<number>>
Param | Type |
---|---|
contractAddress | string |
clientMethods.isDaoUpdateProposal(proposalId) ⇒ Promise.<boolean>
Given a proposal id returns if that proposal is a dao update proposal
Kind: instance method of ClientMethods
Returns: Promise.<boolean>
Param | Type |
---|---|
proposalId | string |
clientMethods.isPluginUpdateProposal(proposalId) ⇒ Promise.<boolean>
Given a proposal id returns if that proposal is a plugin update proposal
Kind: instance method of ClientMethods
Returns: Promise.<boolean>
Param | Type |
---|---|
proposalId | string |
clientMethods.isPluginUpdateProposalValid(proposalId) ⇒ Promise.<PluginUpdateProposalValidity>
Check if the specified proposal id is valid for updating a plugin
Kind: instance method of ClientMethods
Returns: Promise.<PluginUpdateProposalValidity>
Param | Type |
---|---|
proposalId | string |
clientMethods.isDaoUpdateProposalValid(proposalId, [version]) ⇒ Promise.<DaoUpdateProposalValidity>
Check if the specified proposalId actions are valid for updating a dao
Kind: instance method of ClientMethods
Returns: Promise.<DaoUpdateProposalValidity>
Param | Type |
---|---|
proposalId | string |
[version] | SupportedVersion |
clientMethods.getDaoImplementation(daoFactoryAddress) ⇒ Promise.<string>
Return the implementation address for the specified dao factory
Kind: instance method of ClientMethods
Returns: Promise.<string>
Param | Type |
---|---|
daoFactoryAddress | string |