Skip to main content

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

Kind: instance method of ClientDecoding
Returns: DecodedApplyInstallationParams

ParamType
Uint8Arraydata

clientDecoding.applyUninstallationAction(Uint8Array) ⇒ DecodedApplyInstallationParams

Kind: instance method of ClientDecoding
Returns: DecodedApplyInstallationParams

ParamType
Uint8Arraydata

clientDecoding.applyUpdateAction(data) ⇒ DecodedApplyUpdateParams

Decodes the apply update parameters from an encoded apply update action

Kind: instance method of ClientDecoding
Returns: DecodedApplyUpdateParams

ParamType
dataUint8Array

clientDecoding.grantAction(data) ⇒ GrantPermissionDecodedParams

Decodes the permission parameters from an encoded grant action

Kind: instance method of ClientDecoding
Returns: GrantPermissionDecodedParams

ParamType
dataUint8Array

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

ParamType
dataUint8Array

clientDecoding.revokeAction(data) ⇒ RevokePermissionDecodedParams

Decodes the permission parameters from an encoded revoke action

Kind: instance method of ClientDecoding
Returns: RevokePermissionDecodedParams

ParamType
dataUint8Array

clientDecoding.withdrawAction(data) ⇒ WithdrawParams

Decodes the withdraw parameters from an encoded withdraw action

Kind: instance method of ClientDecoding
Returns: WithdrawParams

ParamType
dataUint8Array

clientDecoding.updateDaoMetadataRawAction(data) ⇒ string

Decodes a dao metadata ipfs uri from an encoded update metadata action

Kind: instance method of ClientDecoding
Returns: string

ParamType
dataUint8Array

clientDecoding.updateDaoMetadataAction(data) ⇒ Promise.<DaoMetadata>

Decodes a dao metadata from an encoded update metadata raw action

Kind: instance method of ClientDecoding
Returns: Promise.<DaoMetadata>

ParamType
dataUint8Array

clientDecoding.setDaoUriAction(data) ⇒ string

Decodes the daoUri from a setDaoUriAction

Kind: instance method of ClientDecoding
Returns: string

ParamType
dataUint8Array

clientDecoding.registerStandardCallbackAction(data) ⇒ RegisterStandardCallbackParams

Decodes the RegisterStandardCallbackParams from a registerStandardCallbackAction

Kind: instance method of ClientDecoding
Returns: RegisterStandardCallbackParams

ParamType
dataUint8Array

clientDecoding.setSignatureValidatorAction(data) ⇒ string

Decodes the implementation address from an encoded upgradeToAction

Kind: instance method of ClientDecoding
Returns: string

ParamType
dataUint8Array

clientDecoding.upgradeToAndCallAction(data) ⇒ UpgradeToAndCallParams

Decodes upgradeToAndCallback params from an upgradeToAndCallAction

Kind: instance method of ClientDecoding
Returns: UpgradeToAndCallParams

ParamType
dataUint8Array

clientDecoding.initializeFromAction(data) ⇒ InitializeFromParams

Decodes the initializeFrom params from an initializeFromAction

Kind: instance method of ClientDecoding
Returns: InitializeFromParams

ParamType
dataUint8Array

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

ParamType
dataUint8Array

clientDecoding.daoUpdateAction(data) ⇒ DaoUpdateDecodedParams

Decodes the dao update params from a daoUpdateAction

Kind: instance method of ClientDecoding
Returns: DaoUpdateDecodedParams

ParamType
dataUint8Array

ClientEncoding

Encoding module the SDK Generic Client

Kind: global class

clientEncoding.applyInstallationAction(daoAddress, params) ⇒ DaoAction

Kind: instance method of ClientEncoding
Returns: DaoAction

ParamType
daoAddressstring
paramsApplyInstallationParams

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>

ParamType
daoAddressstring
paramsApplyUpdateParams

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

ParamType
daoAddressstring
paramsGrantPermissionParams

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

ParamType
daoAddressstring
paramsGrantPermissionWithConditionParams

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

ParamType
daoAddressstring
paramsRevokePermissionParams

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>

ParamType
recipientAddressOrEnsstring
valueWithdrawParams

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>

ParamType
daoAddressOrEnsstring
paramsDaoMetadata

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

ParamType
daoAddressOrEnsstring
daoUristring

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

ParamType
daoAddressOrEnsstring
daoUristring

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

ParamType
daoAddressOrEnsstring
signatureValidatorstring

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

ParamType
daoAddressOrEnsstring
implementationAddressstring

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

ParamType
daoAddressOrEnsstring
paramsUpgradeToAndCallParams

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

ParamType
daoAddressOrEnsstring
paramsInitializeFromParams

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>

ParamType
daoAddressOrEnsstring
paramsDaoUpdateParams

ClientEstimation

Estimation module the SDK Generic Client

Kind: global class

clientEstimation.createDao(_params) ⇒ Promise.<GasFeeEstimation>

Estimates the gas fee of creating a DAO

Kind: instance method of ClientEstimation
Returns: Promise.<GasFeeEstimation>

ParamType
_paramsCreateDaoParams

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>

ParamType
paramsDepositParams

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>

ParamType
_paramsSetAllowanceParams

clientEstimation.prepareUpdate(params) ⇒ Promise.<GasFeeEstimation>

Estimates the gas fee of preparing an update

Kind: instance method of ClientEstimation
Returns: Promise.<GasFeeEstimation>

ParamType
paramsPrepareUpdateParams

ClientMethods

Methods module the SDK Generic Client

Kind: global class

clientMethods.createDao(params) ⇒ AsyncGenerator.<DaoCreationStepValue>

Creates a DAO with the given settings and plugins

Kind: instance method of ClientMethods
Returns: AsyncGenerator.<DaoCreationStepValue>

ParamType
paramsCreateDaoParams

clientMethods.pinMetadata(params) ⇒ Promise.<string>

Pins a metadata object into IPFS and retruns the generated hash

Kind: instance method of ClientMethods
Returns: Promise.<string>

ParamType
paramsDaoMetadata

clientMethods.deposit(params) ⇒ AsyncGenerator.<DaoDepositStepValue>

Deposits ether or an ERC20 token into the DAO

Kind: instance method of ClientMethods
Returns: AsyncGenerator.<DaoDepositStepValue>

ParamType
paramsDepositParams

clientMethods.setAllowance(params) ⇒ AsyncGenerator.<SetAllowanceStepValue>

Checks if the allowance is enough and updates it

Kind: instance method of ClientMethods
Returns: AsyncGenerator.<SetAllowanceStepValue>

ParamType
paramsSetAllowanceParams

clientMethods.prepareUninstallation(params) ⇒ AsyncGenerator.<PrepareUninstallationStepValue>

Prepare uninstallation of a plugin

Kind: instance method of ClientMethods
Returns: AsyncGenerator.<PrepareUninstallationStepValue>

ParamType
paramsPrepareUninstallationParams

clientMethods.prepareUpdate(params) ⇒ AsyncGenerator.<PrepareUpdateStepValue>

Prepare update of a plugin

Kind: instance method of ClientMethods
Returns: AsyncGenerator.<PrepareUpdateStepValue>

ParamType
paramsPrepareUpdateParams

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>

ParamType
paramsHasPermissionParams

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)>

ParamType
daoAddressOrEnsstring

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>>

ParamTypeDescription
paramsDaoQueryParams
  • limit = 10
    • skip = 0
    • direction = SortDirection.ASC
    • sortBy = DaoSortBy.CREATED_AT

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)>

ParamTypeDescription
paramsDaoBalancesQueryParams
  • daoAddressOrEns
    • limit = 10
    • skip = 0
    • direction = SortDirection.ASC
    • sortBy = AssetBalanceSortBy.LAST_UPDATED

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)>

ParamTypeDescription
paramsTransferQueryParams
  • daoAddressOrEns
    • type
    • limit = 10
    • skip = 0
    • direction = SortDirection.ASC
    • sortBy = TransferSortBy.CREATED_AT

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)>

ParamTypeDescription
paramsPluginQueryParams
  • limit = 10
    • skip = 0
    • direction = SortDirection.ASC
    • sortBy = PluginSortBy.SUBDOMAIN
    • subdomain

clientMethods.getPlugin(pluginAddress) ⇒ Promise.<PluginRepo>

Get plugin details given an address, release and build

Kind: instance method of ClientMethods
Returns: Promise.<PluginRepo>

ParamType
pluginAddressstring

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>>

ParamType
contractAddressstring

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>

ParamType
proposalIdstring

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>

ParamType
proposalIdstring

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>

ParamType
proposalIdstring

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>

ParamType
proposalIdstring
[version]SupportedVersion

clientMethods.getDaoImplementation(daoFactoryAddress) ⇒ Promise.<string>

Return the implementation address for the specified dao factory

Kind: instance method of ClientMethods
Returns: Promise.<string>

ParamType
daoFactoryAddressstring
© 2024