diff --git a/docusaurus.config.js b/docusaurus.config.js index 1294c292..3e7ba407 100644 --- a/docusaurus.config.js +++ b/docusaurus.config.js @@ -163,10 +163,10 @@ const config = { '@graphql-markdown/docusaurus', { schema: `./static/subgraph/schema-introspection-partial.json`, - rootPath: './docs/', + rootPath: './versioned_docs/version-1.3.0', baseURL: 'osx/subgraph/reference-guide', homepage: './static/subgraph/index.md', - linkRoot: '/docs/1.4.0', + linkRoot: '/docs', loaders: { JsonFileLoader: { module: '@graphql-tools/json-file-loader', diff --git a/versioned_docs/version-1.3.0/osx/01-how-it-works/01-core/index.md b/versioned_docs/version-1.3.0/osx/01-how-it-works/01-core/index.md index e5d42bef..d9f4bff0 100644 --- a/versioned_docs/version-1.3.0/osx/01-how-it-works/01-core/index.md +++ b/versioned_docs/version-1.3.0/osx/01-how-it-works/01-core/index.md @@ -1,5 +1,5 @@ --- -title: The Smart Contracts behind DAOs +title: Smart Contracts --- ## The Contracts Constituting Your DAO diff --git a/versioned_docs/version-1.3.0/osx/01-how-it-works/02-framework/index.md b/versioned_docs/version-1.3.0/osx/01-how-it-works/02-framework/index.md index adc424a2..4af52b56 100644 --- a/versioned_docs/version-1.3.0/osx/01-how-it-works/02-framework/index.md +++ b/versioned_docs/version-1.3.0/osx/01-how-it-works/02-framework/index.md @@ -1,5 +1,5 @@ --- -title: Framework - How Everything Connects +title: Framework --- ## The Infrastructure Running the Aragon OSx Protocol diff --git a/versioned_docs/version-1.3.0/osx/02-how-to-guides/01-dao/index.md b/versioned_docs/version-1.3.0/osx/02-how-to-guides/01-dao/index.md index e50ec109..5c52f526 100644 --- a/versioned_docs/version-1.3.0/osx/02-how-to-guides/01-dao/index.md +++ b/versioned_docs/version-1.3.0/osx/02-how-to-guides/01-dao/index.md @@ -1,5 +1,5 @@ --- -title: How to Operate a DAO +title: Operate a DAO --- DAOs are decentralized autonomous organizations. They are a group of people managing on-chain assets through a set of smart contracts. diff --git a/versioned_docs/version-1.3.0/osx/02-how-to-guides/02-plugin-development/index.md b/versioned_docs/version-1.3.0/osx/02-how-to-guides/02-plugin-development/index.md index 869b37a7..df7c55a4 100644 --- a/versioned_docs/version-1.3.0/osx/02-how-to-guides/02-plugin-development/index.md +++ b/versioned_docs/version-1.3.0/osx/02-how-to-guides/02-plugin-development/index.md @@ -1,5 +1,5 @@ --- -title: How to build a DAO Plugin +title: Plugin Development --- ## Plugin Development Quickstart Guide diff --git a/versioned_docs/version-1.3.0/osx/02-how-to-guides/index.md b/versioned_docs/version-1.3.0/osx/02-how-to-guides/index.md index 2bf68843..31686516 100644 --- a/versioned_docs/version-1.3.0/osx/02-how-to-guides/index.md +++ b/versioned_docs/version-1.3.0/osx/02-how-to-guides/index.md @@ -1,5 +1,5 @@ --- -title: How-to Guides +title: Tutorials --- ## Welcome to our How To Guides on Using the Aragon OSx Protocol! diff --git a/docs/sdk/01-examples/01-client/01-create-dao.md b/versioned_docs/version-1.3.0/osx/04-sdk/01-examples/01-client/01-create-dao.md similarity index 100% rename from docs/sdk/01-examples/01-client/01-create-dao.md rename to versioned_docs/version-1.3.0/osx/04-sdk/01-examples/01-client/01-create-dao.md diff --git a/docs/sdk/01-examples/01-client/02-deposit-eth.md b/versioned_docs/version-1.3.0/osx/04-sdk/01-examples/01-client/02-deposit-eth.md similarity index 100% rename from docs/sdk/01-examples/01-client/02-deposit-eth.md rename to versioned_docs/version-1.3.0/osx/04-sdk/01-examples/01-client/02-deposit-eth.md diff --git a/docs/sdk/01-examples/01-client/03-deposit-erc20.md b/versioned_docs/version-1.3.0/osx/04-sdk/01-examples/01-client/03-deposit-erc20.md similarity index 100% rename from docs/sdk/01-examples/01-client/03-deposit-erc20.md rename to versioned_docs/version-1.3.0/osx/04-sdk/01-examples/01-client/03-deposit-erc20.md diff --git a/docs/sdk/01-examples/01-client/04-deposit-erc721.md b/versioned_docs/version-1.3.0/osx/04-sdk/01-examples/01-client/04-deposit-erc721.md similarity index 100% rename from docs/sdk/01-examples/01-client/04-deposit-erc721.md rename to versioned_docs/version-1.3.0/osx/04-sdk/01-examples/01-client/04-deposit-erc721.md diff --git a/docs/sdk/01-examples/01-client/05-deposit-erc1155.md b/versioned_docs/version-1.3.0/osx/04-sdk/01-examples/01-client/05-deposit-erc1155.md similarity index 100% rename from docs/sdk/01-examples/01-client/05-deposit-erc1155.md rename to versioned_docs/version-1.3.0/osx/04-sdk/01-examples/01-client/05-deposit-erc1155.md diff --git a/docs/sdk/01-examples/01-client/06-get-dao.md b/versioned_docs/version-1.3.0/osx/04-sdk/01-examples/01-client/06-get-dao.md similarity index 100% rename from docs/sdk/01-examples/01-client/06-get-dao.md rename to versioned_docs/version-1.3.0/osx/04-sdk/01-examples/01-client/06-get-dao.md diff --git a/docs/sdk/01-examples/01-client/07-get-daos.md b/versioned_docs/version-1.3.0/osx/04-sdk/01-examples/01-client/07-get-daos.md similarity index 100% rename from docs/sdk/01-examples/01-client/07-get-daos.md rename to versioned_docs/version-1.3.0/osx/04-sdk/01-examples/01-client/07-get-daos.md diff --git a/docs/sdk/01-examples/01-client/08-get-balances.md b/versioned_docs/version-1.3.0/osx/04-sdk/01-examples/01-client/08-get-balances.md similarity index 100% rename from docs/sdk/01-examples/01-client/08-get-balances.md rename to versioned_docs/version-1.3.0/osx/04-sdk/01-examples/01-client/08-get-balances.md diff --git a/docs/sdk/01-examples/01-client/09-get-transfers.md b/versioned_docs/version-1.3.0/osx/04-sdk/01-examples/01-client/09-get-transfers.md similarity index 100% rename from docs/sdk/01-examples/01-client/09-get-transfers.md rename to versioned_docs/version-1.3.0/osx/04-sdk/01-examples/01-client/09-get-transfers.md diff --git a/docs/sdk/01-examples/01-client/10-set-allowance.md b/versioned_docs/version-1.3.0/osx/04-sdk/01-examples/01-client/10-set-allowance.md similarity index 100% rename from docs/sdk/01-examples/01-client/10-set-allowance.md rename to versioned_docs/version-1.3.0/osx/04-sdk/01-examples/01-client/10-set-allowance.md diff --git a/docs/sdk/01-examples/01-client/11-pin-metadata.md b/versioned_docs/version-1.3.0/osx/04-sdk/01-examples/01-client/11-pin-metadata.md similarity index 100% rename from docs/sdk/01-examples/01-client/11-pin-metadata.md rename to versioned_docs/version-1.3.0/osx/04-sdk/01-examples/01-client/11-pin-metadata.md diff --git a/docs/sdk/01-examples/01-client/12-prepare-installation.md b/versioned_docs/version-1.3.0/osx/04-sdk/01-examples/01-client/12-prepare-installation.md similarity index 100% rename from docs/sdk/01-examples/01-client/12-prepare-installation.md rename to versioned_docs/version-1.3.0/osx/04-sdk/01-examples/01-client/12-prepare-installation.md diff --git a/docs/sdk/01-examples/01-client/13-get-protocol-version.md b/versioned_docs/version-1.3.0/osx/04-sdk/01-examples/01-client/13-get-protocol-version.md similarity index 100% rename from docs/sdk/01-examples/01-client/13-get-protocol-version.md rename to versioned_docs/version-1.3.0/osx/04-sdk/01-examples/01-client/13-get-protocol-version.md diff --git a/docs/sdk/01-examples/01-client/14-prepare-uninstallation.md b/versioned_docs/version-1.3.0/osx/04-sdk/01-examples/01-client/14-prepare-uninstallation.md similarity index 100% rename from docs/sdk/01-examples/01-client/14-prepare-uninstallation.md rename to versioned_docs/version-1.3.0/osx/04-sdk/01-examples/01-client/14-prepare-uninstallation.md diff --git a/docs/sdk/01-examples/01-client/15-prepare-update.md b/versioned_docs/version-1.3.0/osx/04-sdk/01-examples/01-client/15-prepare-update.md similarity index 100% rename from docs/sdk/01-examples/01-client/15-prepare-update.md rename to versioned_docs/version-1.3.0/osx/04-sdk/01-examples/01-client/15-prepare-update.md diff --git a/docs/sdk/01-examples/01-client/16-is-plugin-update-valid.md b/versioned_docs/version-1.3.0/osx/04-sdk/01-examples/01-client/16-is-plugin-update-valid.md similarity index 100% rename from docs/sdk/01-examples/01-client/16-is-plugin-update-valid.md rename to versioned_docs/version-1.3.0/osx/04-sdk/01-examples/01-client/16-is-plugin-update-valid.md diff --git a/docs/sdk/01-examples/01-client/17-is-plugin-update-proposal.md b/versioned_docs/version-1.3.0/osx/04-sdk/01-examples/01-client/17-is-plugin-update-proposal.md similarity index 100% rename from docs/sdk/01-examples/01-client/17-is-plugin-update-proposal.md rename to versioned_docs/version-1.3.0/osx/04-sdk/01-examples/01-client/17-is-plugin-update-proposal.md diff --git a/docs/sdk/01-examples/01-client/18-is-dao-update-valid.md b/versioned_docs/version-1.3.0/osx/04-sdk/01-examples/01-client/18-is-dao-update-valid.md similarity index 100% rename from docs/sdk/01-examples/01-client/18-is-dao-update-valid.md rename to versioned_docs/version-1.3.0/osx/04-sdk/01-examples/01-client/18-is-dao-update-valid.md diff --git a/docs/sdk/01-examples/01-client/19-is-dao-update-proposal.md b/versioned_docs/version-1.3.0/osx/04-sdk/01-examples/01-client/19-is-dao-update-proposal.md similarity index 100% rename from docs/sdk/01-examples/01-client/19-is-dao-update-proposal.md rename to versioned_docs/version-1.3.0/osx/04-sdk/01-examples/01-client/19-is-dao-update-proposal.md diff --git a/docs/sdk/01-examples/01-client/20-get-plugin-preparations.md b/versioned_docs/version-1.3.0/osx/04-sdk/01-examples/01-client/20-get-plugin-preparations.md similarity index 100% rename from docs/sdk/01-examples/01-client/20-get-plugin-preparations.md rename to versioned_docs/version-1.3.0/osx/04-sdk/01-examples/01-client/20-get-plugin-preparations.md diff --git a/docs/sdk/01-examples/01-client/index.md b/versioned_docs/version-1.3.0/osx/04-sdk/01-examples/01-client/index.md similarity index 100% rename from docs/sdk/01-examples/01-client/index.md rename to versioned_docs/version-1.3.0/osx/04-sdk/01-examples/01-client/index.md diff --git a/docs/sdk/01-examples/02-multisig-client/01-installation.md b/versioned_docs/version-1.3.0/osx/04-sdk/01-examples/02-multisig-client/01-installation.md similarity index 100% rename from docs/sdk/01-examples/02-multisig-client/01-installation.md rename to versioned_docs/version-1.3.0/osx/04-sdk/01-examples/02-multisig-client/01-installation.md diff --git a/docs/sdk/01-examples/02-multisig-client/02-create-proposal.md b/versioned_docs/version-1.3.0/osx/04-sdk/01-examples/02-multisig-client/02-create-proposal.md similarity index 100% rename from docs/sdk/01-examples/02-multisig-client/02-create-proposal.md rename to versioned_docs/version-1.3.0/osx/04-sdk/01-examples/02-multisig-client/02-create-proposal.md diff --git a/docs/sdk/01-examples/02-multisig-client/03-create-proposal-with-actions.md b/versioned_docs/version-1.3.0/osx/04-sdk/01-examples/02-multisig-client/03-create-proposal-with-actions.md similarity index 100% rename from docs/sdk/01-examples/02-multisig-client/03-create-proposal-with-actions.md rename to versioned_docs/version-1.3.0/osx/04-sdk/01-examples/02-multisig-client/03-create-proposal-with-actions.md diff --git a/docs/sdk/01-examples/02-multisig-client/04-can-approve.md b/versioned_docs/version-1.3.0/osx/04-sdk/01-examples/02-multisig-client/04-can-approve.md similarity index 100% rename from docs/sdk/01-examples/02-multisig-client/04-can-approve.md rename to versioned_docs/version-1.3.0/osx/04-sdk/01-examples/02-multisig-client/04-can-approve.md diff --git a/docs/sdk/01-examples/02-multisig-client/05-approve-proposal.md b/versioned_docs/version-1.3.0/osx/04-sdk/01-examples/02-multisig-client/05-approve-proposal.md similarity index 100% rename from docs/sdk/01-examples/02-multisig-client/05-approve-proposal.md rename to versioned_docs/version-1.3.0/osx/04-sdk/01-examples/02-multisig-client/05-approve-proposal.md diff --git a/docs/sdk/01-examples/02-multisig-client/06-can-execute.md b/versioned_docs/version-1.3.0/osx/04-sdk/01-examples/02-multisig-client/06-can-execute.md similarity index 100% rename from docs/sdk/01-examples/02-multisig-client/06-can-execute.md rename to versioned_docs/version-1.3.0/osx/04-sdk/01-examples/02-multisig-client/06-can-execute.md diff --git a/docs/sdk/01-examples/02-multisig-client/07-execute-proposal.md b/versioned_docs/version-1.3.0/osx/04-sdk/01-examples/02-multisig-client/07-execute-proposal.md similarity index 100% rename from docs/sdk/01-examples/02-multisig-client/07-execute-proposal.md rename to versioned_docs/version-1.3.0/osx/04-sdk/01-examples/02-multisig-client/07-execute-proposal.md diff --git a/docs/sdk/01-examples/02-multisig-client/08-get-proposal.md b/versioned_docs/version-1.3.0/osx/04-sdk/01-examples/02-multisig-client/08-get-proposal.md similarity index 100% rename from docs/sdk/01-examples/02-multisig-client/08-get-proposal.md rename to versioned_docs/version-1.3.0/osx/04-sdk/01-examples/02-multisig-client/08-get-proposal.md diff --git a/docs/sdk/01-examples/02-multisig-client/09-get-proposals.md b/versioned_docs/version-1.3.0/osx/04-sdk/01-examples/02-multisig-client/09-get-proposals.md similarity index 100% rename from docs/sdk/01-examples/02-multisig-client/09-get-proposals.md rename to versioned_docs/version-1.3.0/osx/04-sdk/01-examples/02-multisig-client/09-get-proposals.md diff --git a/docs/sdk/01-examples/02-multisig-client/10-get-voting-settings.md b/versioned_docs/version-1.3.0/osx/04-sdk/01-examples/02-multisig-client/10-get-voting-settings.md similarity index 100% rename from docs/sdk/01-examples/02-multisig-client/10-get-voting-settings.md rename to versioned_docs/version-1.3.0/osx/04-sdk/01-examples/02-multisig-client/10-get-voting-settings.md diff --git a/docs/sdk/01-examples/02-multisig-client/11-get-members.md b/versioned_docs/version-1.3.0/osx/04-sdk/01-examples/02-multisig-client/11-get-members.md similarity index 100% rename from docs/sdk/01-examples/02-multisig-client/11-get-members.md rename to versioned_docs/version-1.3.0/osx/04-sdk/01-examples/02-multisig-client/11-get-members.md diff --git a/docs/sdk/01-examples/02-multisig-client/12-pin-metadata.md b/versioned_docs/version-1.3.0/osx/04-sdk/01-examples/02-multisig-client/12-pin-metadata.md similarity index 100% rename from docs/sdk/01-examples/02-multisig-client/12-pin-metadata.md rename to versioned_docs/version-1.3.0/osx/04-sdk/01-examples/02-multisig-client/12-pin-metadata.md diff --git a/docs/sdk/01-examples/02-multisig-client/13-prepare-installation.md b/versioned_docs/version-1.3.0/osx/04-sdk/01-examples/02-multisig-client/13-prepare-installation.md similarity index 100% rename from docs/sdk/01-examples/02-multisig-client/13-prepare-installation.md rename to versioned_docs/version-1.3.0/osx/04-sdk/01-examples/02-multisig-client/13-prepare-installation.md diff --git a/docs/sdk/01-examples/02-multisig-client/14-prepare-update.md b/versioned_docs/version-1.3.0/osx/04-sdk/01-examples/02-multisig-client/14-prepare-update.md similarity index 100% rename from docs/sdk/01-examples/02-multisig-client/14-prepare-update.md rename to versioned_docs/version-1.3.0/osx/04-sdk/01-examples/02-multisig-client/14-prepare-update.md diff --git a/docs/sdk/01-examples/02-multisig-client/15-is-member.md b/versioned_docs/version-1.3.0/osx/04-sdk/01-examples/02-multisig-client/15-is-member.md similarity index 100% rename from docs/sdk/01-examples/02-multisig-client/15-is-member.md rename to versioned_docs/version-1.3.0/osx/04-sdk/01-examples/02-multisig-client/15-is-member.md diff --git a/docs/sdk/01-examples/02-multisig-client/index.md b/versioned_docs/version-1.3.0/osx/04-sdk/01-examples/02-multisig-client/index.md similarity index 100% rename from docs/sdk/01-examples/02-multisig-client/index.md rename to versioned_docs/version-1.3.0/osx/04-sdk/01-examples/02-multisig-client/index.md diff --git a/docs/sdk/01-examples/03-tokenVoting-client/01-installation.md b/versioned_docs/version-1.3.0/osx/04-sdk/01-examples/03-tokenVoting-client/01-installation.md similarity index 100% rename from docs/sdk/01-examples/03-tokenVoting-client/01-installation.md rename to versioned_docs/version-1.3.0/osx/04-sdk/01-examples/03-tokenVoting-client/01-installation.md diff --git a/docs/sdk/01-examples/03-tokenVoting-client/02-create-proposal.md b/versioned_docs/version-1.3.0/osx/04-sdk/01-examples/03-tokenVoting-client/02-create-proposal.md similarity index 100% rename from docs/sdk/01-examples/03-tokenVoting-client/02-create-proposal.md rename to versioned_docs/version-1.3.0/osx/04-sdk/01-examples/03-tokenVoting-client/02-create-proposal.md diff --git a/docs/sdk/01-examples/03-tokenVoting-client/03-create-proposal-with-actions.md b/versioned_docs/version-1.3.0/osx/04-sdk/01-examples/03-tokenVoting-client/03-create-proposal-with-actions.md similarity index 100% rename from docs/sdk/01-examples/03-tokenVoting-client/03-create-proposal-with-actions.md rename to versioned_docs/version-1.3.0/osx/04-sdk/01-examples/03-tokenVoting-client/03-create-proposal-with-actions.md diff --git a/docs/sdk/01-examples/03-tokenVoting-client/04-can-vote.md b/versioned_docs/version-1.3.0/osx/04-sdk/01-examples/03-tokenVoting-client/04-can-vote.md similarity index 100% rename from docs/sdk/01-examples/03-tokenVoting-client/04-can-vote.md rename to versioned_docs/version-1.3.0/osx/04-sdk/01-examples/03-tokenVoting-client/04-can-vote.md diff --git a/docs/sdk/01-examples/03-tokenVoting-client/05-vote-on-proposal.md b/versioned_docs/version-1.3.0/osx/04-sdk/01-examples/03-tokenVoting-client/05-vote-on-proposal.md similarity index 100% rename from docs/sdk/01-examples/03-tokenVoting-client/05-vote-on-proposal.md rename to versioned_docs/version-1.3.0/osx/04-sdk/01-examples/03-tokenVoting-client/05-vote-on-proposal.md diff --git a/docs/sdk/01-examples/03-tokenVoting-client/06-can-execute.md b/versioned_docs/version-1.3.0/osx/04-sdk/01-examples/03-tokenVoting-client/06-can-execute.md similarity index 100% rename from docs/sdk/01-examples/03-tokenVoting-client/06-can-execute.md rename to versioned_docs/version-1.3.0/osx/04-sdk/01-examples/03-tokenVoting-client/06-can-execute.md diff --git a/docs/sdk/01-examples/03-tokenVoting-client/07-execute-proposal.md b/versioned_docs/version-1.3.0/osx/04-sdk/01-examples/03-tokenVoting-client/07-execute-proposal.md similarity index 100% rename from docs/sdk/01-examples/03-tokenVoting-client/07-execute-proposal.md rename to versioned_docs/version-1.3.0/osx/04-sdk/01-examples/03-tokenVoting-client/07-execute-proposal.md diff --git a/docs/sdk/01-examples/03-tokenVoting-client/08-get-proposal.md b/versioned_docs/version-1.3.0/osx/04-sdk/01-examples/03-tokenVoting-client/08-get-proposal.md similarity index 100% rename from docs/sdk/01-examples/03-tokenVoting-client/08-get-proposal.md rename to versioned_docs/version-1.3.0/osx/04-sdk/01-examples/03-tokenVoting-client/08-get-proposal.md diff --git a/docs/sdk/01-examples/03-tokenVoting-client/09-get-proposals.md b/versioned_docs/version-1.3.0/osx/04-sdk/01-examples/03-tokenVoting-client/09-get-proposals.md similarity index 100% rename from docs/sdk/01-examples/03-tokenVoting-client/09-get-proposals.md rename to versioned_docs/version-1.3.0/osx/04-sdk/01-examples/03-tokenVoting-client/09-get-proposals.md diff --git a/docs/sdk/01-examples/03-tokenVoting-client/10-get-voting-settings.md b/versioned_docs/version-1.3.0/osx/04-sdk/01-examples/03-tokenVoting-client/10-get-voting-settings.md similarity index 100% rename from docs/sdk/01-examples/03-tokenVoting-client/10-get-voting-settings.md rename to versioned_docs/version-1.3.0/osx/04-sdk/01-examples/03-tokenVoting-client/10-get-voting-settings.md diff --git a/docs/sdk/01-examples/03-tokenVoting-client/11-get-members.md b/versioned_docs/version-1.3.0/osx/04-sdk/01-examples/03-tokenVoting-client/11-get-members.md similarity index 100% rename from docs/sdk/01-examples/03-tokenVoting-client/11-get-members.md rename to versioned_docs/version-1.3.0/osx/04-sdk/01-examples/03-tokenVoting-client/11-get-members.md diff --git a/docs/sdk/01-examples/03-tokenVoting-client/12-get-token.md b/versioned_docs/version-1.3.0/osx/04-sdk/01-examples/03-tokenVoting-client/12-get-token.md similarity index 100% rename from docs/sdk/01-examples/03-tokenVoting-client/12-get-token.md rename to versioned_docs/version-1.3.0/osx/04-sdk/01-examples/03-tokenVoting-client/12-get-token.md diff --git a/docs/sdk/01-examples/03-tokenVoting-client/13-pin-metadata.md b/versioned_docs/version-1.3.0/osx/04-sdk/01-examples/03-tokenVoting-client/13-pin-metadata.md similarity index 100% rename from docs/sdk/01-examples/03-tokenVoting-client/13-pin-metadata.md rename to versioned_docs/version-1.3.0/osx/04-sdk/01-examples/03-tokenVoting-client/13-pin-metadata.md diff --git a/docs/sdk/01-examples/03-tokenVoting-client/14-prepare-installation.md b/versioned_docs/version-1.3.0/osx/04-sdk/01-examples/03-tokenVoting-client/14-prepare-installation.md similarity index 100% rename from docs/sdk/01-examples/03-tokenVoting-client/14-prepare-installation.md rename to versioned_docs/version-1.3.0/osx/04-sdk/01-examples/03-tokenVoting-client/14-prepare-installation.md diff --git a/docs/sdk/01-examples/03-tokenVoting-client/15-wrap-tokens.md b/versioned_docs/version-1.3.0/osx/04-sdk/01-examples/03-tokenVoting-client/15-wrap-tokens.md similarity index 100% rename from docs/sdk/01-examples/03-tokenVoting-client/15-wrap-tokens.md rename to versioned_docs/version-1.3.0/osx/04-sdk/01-examples/03-tokenVoting-client/15-wrap-tokens.md diff --git a/docs/sdk/01-examples/03-tokenVoting-client/16-unwrap-tokens.md b/versioned_docs/version-1.3.0/osx/04-sdk/01-examples/03-tokenVoting-client/16-unwrap-tokens.md similarity index 100% rename from docs/sdk/01-examples/03-tokenVoting-client/16-unwrap-tokens.md rename to versioned_docs/version-1.3.0/osx/04-sdk/01-examples/03-tokenVoting-client/16-unwrap-tokens.md diff --git a/docs/sdk/01-examples/03-tokenVoting-client/17-delegate-tokens.md b/versioned_docs/version-1.3.0/osx/04-sdk/01-examples/03-tokenVoting-client/17-delegate-tokens.md similarity index 100% rename from docs/sdk/01-examples/03-tokenVoting-client/17-delegate-tokens.md rename to versioned_docs/version-1.3.0/osx/04-sdk/01-examples/03-tokenVoting-client/17-delegate-tokens.md diff --git a/docs/sdk/01-examples/03-tokenVoting-client/18-undelegate-tokens.md b/versioned_docs/version-1.3.0/osx/04-sdk/01-examples/03-tokenVoting-client/18-undelegate-tokens.md similarity index 100% rename from docs/sdk/01-examples/03-tokenVoting-client/18-undelegate-tokens.md rename to versioned_docs/version-1.3.0/osx/04-sdk/01-examples/03-tokenVoting-client/18-undelegate-tokens.md diff --git a/docs/sdk/01-examples/03-tokenVoting-client/19-get-delegate.md b/versioned_docs/version-1.3.0/osx/04-sdk/01-examples/03-tokenVoting-client/19-get-delegate.md similarity index 100% rename from docs/sdk/01-examples/03-tokenVoting-client/19-get-delegate.md rename to versioned_docs/version-1.3.0/osx/04-sdk/01-examples/03-tokenVoting-client/19-get-delegate.md diff --git a/docs/sdk/01-examples/03-tokenVoting-client/20-is-governance-token-compatible.md b/versioned_docs/version-1.3.0/osx/04-sdk/01-examples/03-tokenVoting-client/20-is-governance-token-compatible.md similarity index 100% rename from docs/sdk/01-examples/03-tokenVoting-client/20-is-governance-token-compatible.md rename to versioned_docs/version-1.3.0/osx/04-sdk/01-examples/03-tokenVoting-client/20-is-governance-token-compatible.md diff --git a/docs/sdk/01-examples/03-tokenVoting-client/21-prepare-update.md b/versioned_docs/version-1.3.0/osx/04-sdk/01-examples/03-tokenVoting-client/21-prepare-update.md similarity index 100% rename from docs/sdk/01-examples/03-tokenVoting-client/21-prepare-update.md rename to versioned_docs/version-1.3.0/osx/04-sdk/01-examples/03-tokenVoting-client/21-prepare-update.md diff --git a/docs/sdk/01-examples/03-tokenVoting-client/22-is-member.md b/versioned_docs/version-1.3.0/osx/04-sdk/01-examples/03-tokenVoting-client/22-is-member.md similarity index 100% rename from docs/sdk/01-examples/03-tokenVoting-client/22-is-member.md rename to versioned_docs/version-1.3.0/osx/04-sdk/01-examples/03-tokenVoting-client/22-is-member.md diff --git a/docs/sdk/01-examples/03-tokenVoting-client/index.md b/versioned_docs/version-1.3.0/osx/04-sdk/01-examples/03-tokenVoting-client/index.md similarity index 100% rename from docs/sdk/01-examples/03-tokenVoting-client/index.md rename to versioned_docs/version-1.3.0/osx/04-sdk/01-examples/03-tokenVoting-client/index.md diff --git a/docs/sdk/01-examples/04-addresslistVoting-client/01-installation.md b/versioned_docs/version-1.3.0/osx/04-sdk/01-examples/04-addresslistVoting-client/01-installation.md similarity index 100% rename from docs/sdk/01-examples/04-addresslistVoting-client/01-installation.md rename to versioned_docs/version-1.3.0/osx/04-sdk/01-examples/04-addresslistVoting-client/01-installation.md diff --git a/docs/sdk/01-examples/04-addresslistVoting-client/02-create-proposal.md b/versioned_docs/version-1.3.0/osx/04-sdk/01-examples/04-addresslistVoting-client/02-create-proposal.md similarity index 100% rename from docs/sdk/01-examples/04-addresslistVoting-client/02-create-proposal.md rename to versioned_docs/version-1.3.0/osx/04-sdk/01-examples/04-addresslistVoting-client/02-create-proposal.md diff --git a/docs/sdk/01-examples/04-addresslistVoting-client/03-create-proposal-with-actions.md b/versioned_docs/version-1.3.0/osx/04-sdk/01-examples/04-addresslistVoting-client/03-create-proposal-with-actions.md similarity index 100% rename from docs/sdk/01-examples/04-addresslistVoting-client/03-create-proposal-with-actions.md rename to versioned_docs/version-1.3.0/osx/04-sdk/01-examples/04-addresslistVoting-client/03-create-proposal-with-actions.md diff --git a/docs/sdk/01-examples/04-addresslistVoting-client/04-can-vote.md b/versioned_docs/version-1.3.0/osx/04-sdk/01-examples/04-addresslistVoting-client/04-can-vote.md similarity index 100% rename from docs/sdk/01-examples/04-addresslistVoting-client/04-can-vote.md rename to versioned_docs/version-1.3.0/osx/04-sdk/01-examples/04-addresslistVoting-client/04-can-vote.md diff --git a/docs/sdk/01-examples/04-addresslistVoting-client/05-vote-proposal.md b/versioned_docs/version-1.3.0/osx/04-sdk/01-examples/04-addresslistVoting-client/05-vote-proposal.md similarity index 100% rename from docs/sdk/01-examples/04-addresslistVoting-client/05-vote-proposal.md rename to versioned_docs/version-1.3.0/osx/04-sdk/01-examples/04-addresslistVoting-client/05-vote-proposal.md diff --git a/docs/sdk/01-examples/04-addresslistVoting-client/06-can-execute.md b/versioned_docs/version-1.3.0/osx/04-sdk/01-examples/04-addresslistVoting-client/06-can-execute.md similarity index 100% rename from docs/sdk/01-examples/04-addresslistVoting-client/06-can-execute.md rename to versioned_docs/version-1.3.0/osx/04-sdk/01-examples/04-addresslistVoting-client/06-can-execute.md diff --git a/docs/sdk/01-examples/04-addresslistVoting-client/07-execute-proposal.md b/versioned_docs/version-1.3.0/osx/04-sdk/01-examples/04-addresslistVoting-client/07-execute-proposal.md similarity index 100% rename from docs/sdk/01-examples/04-addresslistVoting-client/07-execute-proposal.md rename to versioned_docs/version-1.3.0/osx/04-sdk/01-examples/04-addresslistVoting-client/07-execute-proposal.md diff --git a/docs/sdk/01-examples/04-addresslistVoting-client/08-get-proposal.md b/versioned_docs/version-1.3.0/osx/04-sdk/01-examples/04-addresslistVoting-client/08-get-proposal.md similarity index 100% rename from docs/sdk/01-examples/04-addresslistVoting-client/08-get-proposal.md rename to versioned_docs/version-1.3.0/osx/04-sdk/01-examples/04-addresslistVoting-client/08-get-proposal.md diff --git a/docs/sdk/01-examples/04-addresslistVoting-client/09-get-proposals.md b/versioned_docs/version-1.3.0/osx/04-sdk/01-examples/04-addresslistVoting-client/09-get-proposals.md similarity index 100% rename from docs/sdk/01-examples/04-addresslistVoting-client/09-get-proposals.md rename to versioned_docs/version-1.3.0/osx/04-sdk/01-examples/04-addresslistVoting-client/09-get-proposals.md diff --git a/docs/sdk/01-examples/04-addresslistVoting-client/10-get-voting-settings.md b/versioned_docs/version-1.3.0/osx/04-sdk/01-examples/04-addresslistVoting-client/10-get-voting-settings.md similarity index 100% rename from docs/sdk/01-examples/04-addresslistVoting-client/10-get-voting-settings.md rename to versioned_docs/version-1.3.0/osx/04-sdk/01-examples/04-addresslistVoting-client/10-get-voting-settings.md diff --git a/docs/sdk/01-examples/04-addresslistVoting-client/11-get-members.md b/versioned_docs/version-1.3.0/osx/04-sdk/01-examples/04-addresslistVoting-client/11-get-members.md similarity index 100% rename from docs/sdk/01-examples/04-addresslistVoting-client/11-get-members.md rename to versioned_docs/version-1.3.0/osx/04-sdk/01-examples/04-addresslistVoting-client/11-get-members.md diff --git a/docs/sdk/01-examples/04-addresslistVoting-client/12-pin-metadata.md b/versioned_docs/version-1.3.0/osx/04-sdk/01-examples/04-addresslistVoting-client/12-pin-metadata.md similarity index 100% rename from docs/sdk/01-examples/04-addresslistVoting-client/12-pin-metadata.md rename to versioned_docs/version-1.3.0/osx/04-sdk/01-examples/04-addresslistVoting-client/12-pin-metadata.md diff --git a/docs/sdk/01-examples/04-addresslistVoting-client/13-prepare-installation.md b/versioned_docs/version-1.3.0/osx/04-sdk/01-examples/04-addresslistVoting-client/13-prepare-installation.md similarity index 100% rename from docs/sdk/01-examples/04-addresslistVoting-client/13-prepare-installation.md rename to versioned_docs/version-1.3.0/osx/04-sdk/01-examples/04-addresslistVoting-client/13-prepare-installation.md diff --git a/docs/sdk/01-examples/04-addresslistVoting-client/14-prepare-update.md b/versioned_docs/version-1.3.0/osx/04-sdk/01-examples/04-addresslistVoting-client/14-prepare-update.md similarity index 100% rename from docs/sdk/01-examples/04-addresslistVoting-client/14-prepare-update.md rename to versioned_docs/version-1.3.0/osx/04-sdk/01-examples/04-addresslistVoting-client/14-prepare-update.md diff --git a/docs/sdk/01-examples/04-addresslistVoting-client/15-is-member.md b/versioned_docs/version-1.3.0/osx/04-sdk/01-examples/04-addresslistVoting-client/15-is-member.md similarity index 100% rename from docs/sdk/01-examples/04-addresslistVoting-client/15-is-member.md rename to versioned_docs/version-1.3.0/osx/04-sdk/01-examples/04-addresslistVoting-client/15-is-member.md diff --git a/docs/sdk/01-examples/04-addresslistVoting-client/index.md b/versioned_docs/version-1.3.0/osx/04-sdk/01-examples/04-addresslistVoting-client/index.md similarity index 100% rename from docs/sdk/01-examples/04-addresslistVoting-client/index.md rename to versioned_docs/version-1.3.0/osx/04-sdk/01-examples/04-addresslistVoting-client/index.md diff --git a/docs/sdk/01-examples/05-encoders-decoders/01-find-interface.md b/versioned_docs/version-1.3.0/osx/04-sdk/01-examples/05-encoders-decoders/01-find-interface.md similarity index 100% rename from docs/sdk/01-examples/05-encoders-decoders/01-find-interface.md rename to versioned_docs/version-1.3.0/osx/04-sdk/01-examples/05-encoders-decoders/01-find-interface.md diff --git a/docs/sdk/01-examples/05-encoders-decoders/02-grant-permission.md b/versioned_docs/version-1.3.0/osx/04-sdk/01-examples/05-encoders-decoders/02-grant-permission.md similarity index 100% rename from docs/sdk/01-examples/05-encoders-decoders/02-grant-permission.md rename to versioned_docs/version-1.3.0/osx/04-sdk/01-examples/05-encoders-decoders/02-grant-permission.md diff --git a/docs/sdk/01-examples/05-encoders-decoders/03-grant-with-condition.md b/versioned_docs/version-1.3.0/osx/04-sdk/01-examples/05-encoders-decoders/03-grant-with-condition.md similarity index 100% rename from docs/sdk/01-examples/05-encoders-decoders/03-grant-with-condition.md rename to versioned_docs/version-1.3.0/osx/04-sdk/01-examples/05-encoders-decoders/03-grant-with-condition.md diff --git a/docs/sdk/01-examples/05-encoders-decoders/04-revoke-permissions.md b/versioned_docs/version-1.3.0/osx/04-sdk/01-examples/05-encoders-decoders/04-revoke-permissions.md similarity index 100% rename from docs/sdk/01-examples/05-encoders-decoders/04-revoke-permissions.md rename to versioned_docs/version-1.3.0/osx/04-sdk/01-examples/05-encoders-decoders/04-revoke-permissions.md diff --git a/docs/sdk/01-examples/05-encoders-decoders/05-register-standard-callback.md b/versioned_docs/version-1.3.0/osx/04-sdk/01-examples/05-encoders-decoders/05-register-standard-callback.md similarity index 100% rename from docs/sdk/01-examples/05-encoders-decoders/05-register-standard-callback.md rename to versioned_docs/version-1.3.0/osx/04-sdk/01-examples/05-encoders-decoders/05-register-standard-callback.md diff --git a/docs/sdk/01-examples/05-encoders-decoders/06-withdraw.md b/versioned_docs/version-1.3.0/osx/04-sdk/01-examples/05-encoders-decoders/06-withdraw.md similarity index 100% rename from docs/sdk/01-examples/05-encoders-decoders/06-withdraw.md rename to versioned_docs/version-1.3.0/osx/04-sdk/01-examples/05-encoders-decoders/06-withdraw.md diff --git a/docs/sdk/01-examples/05-encoders-decoders/07-update-metadata.md b/versioned_docs/version-1.3.0/osx/04-sdk/01-examples/05-encoders-decoders/07-update-metadata.md similarity index 100% rename from docs/sdk/01-examples/05-encoders-decoders/07-update-metadata.md rename to versioned_docs/version-1.3.0/osx/04-sdk/01-examples/05-encoders-decoders/07-update-metadata.md diff --git a/docs/sdk/01-examples/05-encoders-decoders/08-set-dao-uri.md b/versioned_docs/version-1.3.0/osx/04-sdk/01-examples/05-encoders-decoders/08-set-dao-uri.md similarity index 100% rename from docs/sdk/01-examples/05-encoders-decoders/08-set-dao-uri.md rename to versioned_docs/version-1.3.0/osx/04-sdk/01-examples/05-encoders-decoders/08-set-dao-uri.md diff --git a/docs/sdk/01-examples/05-encoders-decoders/09-set-signature-validator.md b/versioned_docs/version-1.3.0/osx/04-sdk/01-examples/05-encoders-decoders/09-set-signature-validator.md similarity index 100% rename from docs/sdk/01-examples/05-encoders-decoders/09-set-signature-validator.md rename to versioned_docs/version-1.3.0/osx/04-sdk/01-examples/05-encoders-decoders/09-set-signature-validator.md diff --git a/docs/sdk/01-examples/05-encoders-decoders/10-upgrade-to.md b/versioned_docs/version-1.3.0/osx/04-sdk/01-examples/05-encoders-decoders/10-upgrade-to.md similarity index 100% rename from docs/sdk/01-examples/05-encoders-decoders/10-upgrade-to.md rename to versioned_docs/version-1.3.0/osx/04-sdk/01-examples/05-encoders-decoders/10-upgrade-to.md diff --git a/docs/sdk/01-examples/05-encoders-decoders/11-upgrade-to-and-call.md b/versioned_docs/version-1.3.0/osx/04-sdk/01-examples/05-encoders-decoders/11-upgrade-to-and-call.md similarity index 100% rename from docs/sdk/01-examples/05-encoders-decoders/11-upgrade-to-and-call.md rename to versioned_docs/version-1.3.0/osx/04-sdk/01-examples/05-encoders-decoders/11-upgrade-to-and-call.md diff --git a/docs/sdk/01-examples/05-encoders-decoders/12-apply-installation.md b/versioned_docs/version-1.3.0/osx/04-sdk/01-examples/05-encoders-decoders/12-apply-installation.md similarity index 100% rename from docs/sdk/01-examples/05-encoders-decoders/12-apply-installation.md rename to versioned_docs/version-1.3.0/osx/04-sdk/01-examples/05-encoders-decoders/12-apply-installation.md diff --git a/docs/sdk/01-examples/05-encoders-decoders/12-multisig/01-find-interface.md b/versioned_docs/version-1.3.0/osx/04-sdk/01-examples/05-encoders-decoders/12-multisig/01-find-interface.md similarity index 100% rename from docs/sdk/01-examples/05-encoders-decoders/12-multisig/01-find-interface.md rename to versioned_docs/version-1.3.0/osx/04-sdk/01-examples/05-encoders-decoders/12-multisig/01-find-interface.md diff --git a/docs/sdk/01-examples/05-encoders-decoders/12-multisig/02-add-addresses.md b/versioned_docs/version-1.3.0/osx/04-sdk/01-examples/05-encoders-decoders/12-multisig/02-add-addresses.md similarity index 100% rename from docs/sdk/01-examples/05-encoders-decoders/12-multisig/02-add-addresses.md rename to versioned_docs/version-1.3.0/osx/04-sdk/01-examples/05-encoders-decoders/12-multisig/02-add-addresses.md diff --git a/docs/sdk/01-examples/05-encoders-decoders/12-multisig/03-remove-addresses.md b/versioned_docs/version-1.3.0/osx/04-sdk/01-examples/05-encoders-decoders/12-multisig/03-remove-addresses.md similarity index 100% rename from docs/sdk/01-examples/05-encoders-decoders/12-multisig/03-remove-addresses.md rename to versioned_docs/version-1.3.0/osx/04-sdk/01-examples/05-encoders-decoders/12-multisig/03-remove-addresses.md diff --git a/docs/sdk/01-examples/05-encoders-decoders/12-multisig/04-update-plugin-settings.md b/versioned_docs/version-1.3.0/osx/04-sdk/01-examples/05-encoders-decoders/12-multisig/04-update-plugin-settings.md similarity index 100% rename from docs/sdk/01-examples/05-encoders-decoders/12-multisig/04-update-plugin-settings.md rename to versioned_docs/version-1.3.0/osx/04-sdk/01-examples/05-encoders-decoders/12-multisig/04-update-plugin-settings.md diff --git a/docs/sdk/01-examples/05-encoders-decoders/12-multisig/index.md b/versioned_docs/version-1.3.0/osx/04-sdk/01-examples/05-encoders-decoders/12-multisig/index.md similarity index 100% rename from docs/sdk/01-examples/05-encoders-decoders/12-multisig/index.md rename to versioned_docs/version-1.3.0/osx/04-sdk/01-examples/05-encoders-decoders/12-multisig/index.md diff --git a/docs/sdk/01-examples/05-encoders-decoders/13-addresslist-voting/01-find-interface.md b/versioned_docs/version-1.3.0/osx/04-sdk/01-examples/05-encoders-decoders/13-addresslist-voting/01-find-interface.md similarity index 100% rename from docs/sdk/01-examples/05-encoders-decoders/13-addresslist-voting/01-find-interface.md rename to versioned_docs/version-1.3.0/osx/04-sdk/01-examples/05-encoders-decoders/13-addresslist-voting/01-find-interface.md diff --git a/docs/sdk/01-examples/05-encoders-decoders/13-addresslist-voting/02-add-members.md b/versioned_docs/version-1.3.0/osx/04-sdk/01-examples/05-encoders-decoders/13-addresslist-voting/02-add-members.md similarity index 100% rename from docs/sdk/01-examples/05-encoders-decoders/13-addresslist-voting/02-add-members.md rename to versioned_docs/version-1.3.0/osx/04-sdk/01-examples/05-encoders-decoders/13-addresslist-voting/02-add-members.md diff --git a/docs/sdk/01-examples/05-encoders-decoders/13-addresslist-voting/03-remove-members.md b/versioned_docs/version-1.3.0/osx/04-sdk/01-examples/05-encoders-decoders/13-addresslist-voting/03-remove-members.md similarity index 100% rename from docs/sdk/01-examples/05-encoders-decoders/13-addresslist-voting/03-remove-members.md rename to versioned_docs/version-1.3.0/osx/04-sdk/01-examples/05-encoders-decoders/13-addresslist-voting/03-remove-members.md diff --git a/docs/sdk/01-examples/05-encoders-decoders/13-addresslist-voting/04-update-plugin-settings.md b/versioned_docs/version-1.3.0/osx/04-sdk/01-examples/05-encoders-decoders/13-addresslist-voting/04-update-plugin-settings.md similarity index 100% rename from docs/sdk/01-examples/05-encoders-decoders/13-addresslist-voting/04-update-plugin-settings.md rename to versioned_docs/version-1.3.0/osx/04-sdk/01-examples/05-encoders-decoders/13-addresslist-voting/04-update-plugin-settings.md diff --git a/docs/sdk/01-examples/05-encoders-decoders/13-addresslist-voting/index.md b/versioned_docs/version-1.3.0/osx/04-sdk/01-examples/05-encoders-decoders/13-addresslist-voting/index.md similarity index 100% rename from docs/sdk/01-examples/05-encoders-decoders/13-addresslist-voting/index.md rename to versioned_docs/version-1.3.0/osx/04-sdk/01-examples/05-encoders-decoders/13-addresslist-voting/index.md diff --git a/docs/sdk/01-examples/05-encoders-decoders/13-apply-uninstallation.md b/versioned_docs/version-1.3.0/osx/04-sdk/01-examples/05-encoders-decoders/13-apply-uninstallation.md similarity index 100% rename from docs/sdk/01-examples/05-encoders-decoders/13-apply-uninstallation.md rename to versioned_docs/version-1.3.0/osx/04-sdk/01-examples/05-encoders-decoders/13-apply-uninstallation.md diff --git a/docs/sdk/01-examples/05-encoders-decoders/14-initialize-from.md b/versioned_docs/version-1.3.0/osx/04-sdk/01-examples/05-encoders-decoders/14-initialize-from.md similarity index 100% rename from docs/sdk/01-examples/05-encoders-decoders/14-initialize-from.md rename to versioned_docs/version-1.3.0/osx/04-sdk/01-examples/05-encoders-decoders/14-initialize-from.md diff --git a/docs/sdk/01-examples/05-encoders-decoders/14-token-voting/01-find-interface.md b/versioned_docs/version-1.3.0/osx/04-sdk/01-examples/05-encoders-decoders/14-token-voting/01-find-interface.md similarity index 100% rename from docs/sdk/01-examples/05-encoders-decoders/14-token-voting/01-find-interface.md rename to versioned_docs/version-1.3.0/osx/04-sdk/01-examples/05-encoders-decoders/14-token-voting/01-find-interface.md diff --git a/docs/sdk/01-examples/05-encoders-decoders/14-token-voting/02-mint-token.md b/versioned_docs/version-1.3.0/osx/04-sdk/01-examples/05-encoders-decoders/14-token-voting/02-mint-token.md similarity index 100% rename from docs/sdk/01-examples/05-encoders-decoders/14-token-voting/02-mint-token.md rename to versioned_docs/version-1.3.0/osx/04-sdk/01-examples/05-encoders-decoders/14-token-voting/02-mint-token.md diff --git a/docs/sdk/01-examples/05-encoders-decoders/14-token-voting/03-update-plugin-settings.md b/versioned_docs/version-1.3.0/osx/04-sdk/01-examples/05-encoders-decoders/14-token-voting/03-update-plugin-settings.md similarity index 100% rename from docs/sdk/01-examples/05-encoders-decoders/14-token-voting/03-update-plugin-settings.md rename to versioned_docs/version-1.3.0/osx/04-sdk/01-examples/05-encoders-decoders/14-token-voting/03-update-plugin-settings.md diff --git a/docs/sdk/01-examples/05-encoders-decoders/14-token-voting/index.md b/versioned_docs/version-1.3.0/osx/04-sdk/01-examples/05-encoders-decoders/14-token-voting/index.md similarity index 100% rename from docs/sdk/01-examples/05-encoders-decoders/14-token-voting/index.md rename to versioned_docs/version-1.3.0/osx/04-sdk/01-examples/05-encoders-decoders/14-token-voting/index.md diff --git a/docs/sdk/01-examples/05-encoders-decoders/15-apply-update.md b/versioned_docs/version-1.3.0/osx/04-sdk/01-examples/05-encoders-decoders/15-apply-update.md similarity index 100% rename from docs/sdk/01-examples/05-encoders-decoders/15-apply-update.md rename to versioned_docs/version-1.3.0/osx/04-sdk/01-examples/05-encoders-decoders/15-apply-update.md diff --git a/docs/sdk/01-examples/05-encoders-decoders/16-dao-update.md b/versioned_docs/version-1.3.0/osx/04-sdk/01-examples/05-encoders-decoders/16-dao-update.md similarity index 100% rename from docs/sdk/01-examples/05-encoders-decoders/16-dao-update.md rename to versioned_docs/version-1.3.0/osx/04-sdk/01-examples/05-encoders-decoders/16-dao-update.md diff --git a/docs/sdk/01-examples/05-encoders-decoders/index.md b/versioned_docs/version-1.3.0/osx/04-sdk/01-examples/05-encoders-decoders/index.md similarity index 100% rename from docs/sdk/01-examples/05-encoders-decoders/index.md rename to versioned_docs/version-1.3.0/osx/04-sdk/01-examples/05-encoders-decoders/index.md diff --git a/docs/sdk/01-examples/index.md b/versioned_docs/version-1.3.0/osx/04-sdk/01-examples/index.md similarity index 100% rename from docs/sdk/01-examples/index.md rename to versioned_docs/version-1.3.0/osx/04-sdk/01-examples/index.md diff --git a/docs/sdk/02-reference-guide/01-client.md b/versioned_docs/version-1.3.0/osx/04-sdk/02-reference-guide/01-client.md similarity index 100% rename from docs/sdk/02-reference-guide/01-client.md rename to versioned_docs/version-1.3.0/osx/04-sdk/02-reference-guide/01-client.md diff --git a/docs/sdk/02-reference-guide/02-multisig.md b/versioned_docs/version-1.3.0/osx/04-sdk/02-reference-guide/02-multisig.md similarity index 100% rename from docs/sdk/02-reference-guide/02-multisig.md rename to versioned_docs/version-1.3.0/osx/04-sdk/02-reference-guide/02-multisig.md diff --git a/docs/sdk/02-reference-guide/03-token-voting.md b/versioned_docs/version-1.3.0/osx/04-sdk/02-reference-guide/03-token-voting.md similarity index 100% rename from docs/sdk/02-reference-guide/03-token-voting.md rename to versioned_docs/version-1.3.0/osx/04-sdk/02-reference-guide/03-token-voting.md diff --git a/docs/sdk/02-reference-guide/04-addresslist-voting.md b/versioned_docs/version-1.3.0/osx/04-sdk/02-reference-guide/04-addresslist-voting.md similarity index 100% rename from docs/sdk/02-reference-guide/04-addresslist-voting.md rename to versioned_docs/version-1.3.0/osx/04-sdk/02-reference-guide/04-addresslist-voting.md diff --git a/docs/sdk/02-reference-guide/index.md b/versioned_docs/version-1.3.0/osx/04-sdk/02-reference-guide/index.md similarity index 100% rename from docs/sdk/02-reference-guide/index.md rename to versioned_docs/version-1.3.0/osx/04-sdk/02-reference-guide/index.md diff --git a/docs/sdk/03-update-security-check/index.md b/versioned_docs/version-1.3.0/osx/04-sdk/03-update-security-check/index.md similarity index 96% rename from docs/sdk/03-update-security-check/index.md rename to versioned_docs/version-1.3.0/osx/04-sdk/03-update-security-check/index.md index 212b1bae..892d4bdb 100644 --- a/docs/sdk/03-update-security-check/index.md +++ b/versioned_docs/version-1.3.0/osx/04-sdk/03-update-security-check/index.md @@ -168,12 +168,12 @@ The `applyUpdate` action CAN be wrapped by `grant` and `revoke` actions: | | `"invalidGrantRootPermissionPermissionName"` | The `permissionName` must be `ROOT_PERMISSION`. | | | `"invalidRevokeRootPermissionPermissionName"` | " | -[execute]: ../../osx/01-how-it-works/01-core/01-dao/01-actions.md#a-deep-dive-into-actions-and-execution -[action]: ../../osx/01-how-it-works/01-core/01-dao/01-actions.md#actions -[allowfailuremap]: ../../osx/01-how-it-works/01-core/01-dao/01-actions.md#allowing-for-failure -[initializefrom]: ../../osx/03-reference-guide/core/dao/DAO.md#external-function-initializefrom +[execute]: ../../01-how-it-works/01-core/01-dao/01-actions.md#a-deep-dive-into-actions-and-execution +[action]: ../../01-how-it-works/01-core/01-dao/01-actions.md#actions +[allowfailuremap]: ../../01-how-it-works/01-core/01-dao/01-actions.md#allowing-for-failure +[initializefrom]: ../../03-reference-guide/core/dao/DAO.md#external-function-initializefrom [oz-upgradeto]: https://github.com/OpenZeppelin/openzeppelin-contracts-upgradeable/blob/3d4c0d5741b131c231e558d7a6213392ab3672a5/contracts/proxy/utils/UUPSUpgradeable.sol#L74-L77 [oz-upgradetoandcall]: https://github.com/OpenZeppelin/openzeppelin-contracts-upgradeable/blob/3d4c0d5741b131c231e558d7a6213392ab3672a5/contracts/proxy/utils/UUPSUpgradeable.sol#L89-L92 -[applyupdate]: ../../osx/03-reference-guide/framework/plugin/setup/PluginSetupProcessor.md#external-function-applyupdate -[grant]: ../../osx/03-reference-guide/core/permission/PermissionManager.md#external-function-grant -[revoke]: ../../osx/03-reference-guide/core/permission/PermissionManager.md#external-function-revoke \ No newline at end of file +[applyupdate]: ../../03-reference-guide/framework/plugin/setup/PluginSetupProcessor.md#external-function-applyupdate +[grant]: ../../03-reference-guide/core/permission/PermissionManager.md#external-function-grant +[revoke]: ../../03-reference-guide/core/permission/PermissionManager.md#external-function-revoke diff --git a/docs/sdk/index.md b/versioned_docs/version-1.3.0/osx/04-sdk/index.md similarity index 98% rename from docs/sdk/index.md rename to versioned_docs/version-1.3.0/osx/04-sdk/index.md index 200aab32..d2382495 100644 --- a/docs/sdk/index.md +++ b/versioned_docs/version-1.3.0/osx/04-sdk/index.md @@ -1,7 +1,7 @@ --- title: Aragon SDK -sidebar_label: Intro -sidebar_position: 0 +sidebar_label: OSX's SDK +sidebar_position: 5 --- ## The JavaScript/TypeScript SDK for Aragon OSx diff --git a/docs/subgraph/01-query-examples/01-dao-query.md b/versioned_docs/version-1.3.0/osx/subgraph/01-query-examples/01-dao-query.md similarity index 100% rename from docs/subgraph/01-query-examples/01-dao-query.md rename to versioned_docs/version-1.3.0/osx/subgraph/01-query-examples/01-dao-query.md diff --git a/docs/subgraph/01-query-examples/02-balances-query.md b/versioned_docs/version-1.3.0/osx/subgraph/01-query-examples/02-balances-query.md similarity index 100% rename from docs/subgraph/01-query-examples/02-balances-query.md rename to versioned_docs/version-1.3.0/osx/subgraph/01-query-examples/02-balances-query.md diff --git a/docs/subgraph/01-query-examples/index.md b/versioned_docs/version-1.3.0/osx/subgraph/01-query-examples/index.md similarity index 100% rename from docs/subgraph/01-query-examples/index.md rename to versioned_docs/version-1.3.0/osx/subgraph/01-query-examples/index.md diff --git a/docs/osx/subgraph/_category_.yml b/versioned_docs/version-1.3.0/osx/subgraph/_category_.yml similarity index 100% rename from docs/osx/subgraph/_category_.yml rename to versioned_docs/version-1.3.0/osx/subgraph/_category_.yml diff --git a/docs/subgraph/index.md b/versioned_docs/version-1.3.0/osx/subgraph/index.md similarity index 96% rename from docs/subgraph/index.md rename to versioned_docs/version-1.3.0/osx/subgraph/index.md index 157ab145..d879a2bb 100644 --- a/docs/subgraph/index.md +++ b/versioned_docs/version-1.3.0/osx/subgraph/index.md @@ -1,7 +1,7 @@ --- title: Aragon Subgraph [WIP] sidebar_label: Introduction -sidebar_position: 0 +sidebar_position: 6 --- ## The On-Chain Information @@ -16,4 +16,4 @@ You can use the [Aragon subgraph-satsuma playground](https://subgraph.satsuma-pr ### Walkthrough -This documentation includes some [example queries](./01-query-examples/index.md) to get you familiarized with subgraph protocol and the [Reference Guide](./reference-guide/index.md) generated from the latest version of our `@aragon/osx` [subgraph schema](https://github.com/aragon/osx/blob/develop/packages/subgraph/schema.graphql). \ No newline at end of file +This documentation includes some [example queries](./01-query-examples/index.md) to get you familiarized with subgraph protocol and the [Reference Guide](./reference-guide/index.md) generated from the latest version of our `@aragon/osx` [subgraph schema](https://github.com/aragon/osx/blob/develop/packages/subgraph/schema.graphql). diff --git a/versioned_docs/version-1.3.0/sdk/01-examples/01-client/01-create-dao.md b/versioned_docs/version-1.3.0/sdk/01-examples/01-client/01-create-dao.md deleted file mode 100644 index 26f344f6..00000000 --- a/versioned_docs/version-1.3.0/sdk/01-examples/01-client/01-create-dao.md +++ /dev/null @@ -1,111 +0,0 @@ ---- -title: Create a DAO ---- - -## Create a DAO - -The `createDao` function allows you to create a DAO using the parameters you set for it. - -```ts -import { - Client, - CreateDaoParams, - DaoCreationSteps, - DaoMetadata, - TokenVotingClient, - TokenVotingPluginInstall, - VotingMode, -} from "@aragon/sdk-client"; -import { GasFeeEstimation } from "@aragon/sdk-client-common"; -import { context } from "../index"; - -// Instantiate the general purpose client from the Aragon OSx SDK context. -const client: Client = new Client(context); - -const metadata: DaoMetadata = { - name: "My DAO", - description: "This is a description", - avatar: "image-url", - links: [{ - name: "Web site", - url: "https://...", - }], -}; - -// Through pinning the metadata in IPFS, we can get the IPFS URI. You can read more about it here: https://docs.ipfs.tech/how-to/pin-files/ -const metadataUri = await client.methods.pinMetadata(metadata); - - -// You need at least one plugin in order to create a DAO. In this example, we'll use the TokenVoting plugin, but feel free to install whichever one best suites your needs. You can find resources on how to do this in the plugin sections. -// These would be the plugin params if you need to mint a new token for the DAO to enable TokenVoting. -const tokenVotingPluginInstallParams: TokenVotingPluginInstall = { - votingSettings: { - minDuration: 60 * 60 * 24 * 2, // seconds - minParticipation: 0.25, // 25% - supportThreshold: 0.5, // 50% - minProposerVotingPower: BigInt("5000"), // default 0 - votingMode: VotingMode.EARLY_EXECUTION, // default is STANDARD. other options: EARLY_EXECUTION, VOTE_REPLACEMENT - }, - newToken: { - name: "Token", // the name of your token - symbol: "TOK", // the symbol for your token. shouldn't be more than 5 letters - decimals: 18, // the number of decimals your token uses - minter: "0x...", // optional. if you don't define any, we'll use the standard OZ ERC20 contract. Otherwise, you can define your own token minter contract address. - balances: [ - { // Defines the initial balances of the new token - address: "0x2371238740123847102983471022", // address of the account to receive the newly minted tokens - balance: BigInt(10), // amount of tokens that address should receive - }, - ], - }, -}; - -// Creates a TokenVoting plugin client with the parameteres defined above (with an existing token). -const tokenVotingInstallItem = TokenVotingClient.encoding - .getPluginInstallItem(tokenVotingPluginInstallParams, "goerli"); - -const createDaoParams: CreateDaoParams = { - metadataUri, - ensSubdomain: "my-org", // my-org.dao.eth - plugins: [tokenVotingInstallItem], // plugin array cannot be empty or the transaction will fail. you need at least one governance mechanism to create your DAO. -}; - -// Estimate how much gas the transaction will cost. -const estimatedGas: GasFeeEstimation = await client.estimation.createDao( - createDaoParams, -); -console.log({ avg: estimatedGas.average, maximum: estimatedGas.max }); - -// Create the DAO. -const steps = client.methods.createDao(createDaoParams); - -for await (const step of steps) { - try { - switch (step.key) { - case DaoCreationSteps.CREATING: - console.log({ txHash: step.txHash }); - break; - case DaoCreationSteps.DONE: - console.log({ - daoAddress: step.address, - pluginAddresses: step.pluginAddresses, - }); - break; - } - } catch (err) { - console.error(err); - } -} -``` - - -Returns: -```tsx -{ - txHash: "0xb1c14a49...3e8620b0f5832d61c" -} -{ - daoAddress: "0xb1c14a49...3e8620b0f5832d61c", - pluginAddresses: ["0xb1c14a49...3e8620b0f5832d61c", "0xb1c14a49...3e8620b0f5832d61c"] -} -``` \ No newline at end of file diff --git a/versioned_docs/version-1.3.0/sdk/01-examples/01-client/02-deposit-eth.md b/versioned_docs/version-1.3.0/sdk/01-examples/01-client/02-deposit-eth.md deleted file mode 100644 index 3b77a01c..00000000 --- a/versioned_docs/version-1.3.0/sdk/01-examples/01-client/02-deposit-eth.md +++ /dev/null @@ -1,56 +0,0 @@ ---- -title: Deposit ETH ---- - -## Deposit ETH to a DAO - -Handles the flow of depositing the native EVM token (when in mainnet, it's ETH) to an Aragon OSx DAO. - -```ts -import { Client, DaoDepositSteps, DepositParams } from "@aragon/sdk-client"; -import { GasFeeEstimation, TokenType } from "@aragon/sdk-client-common"; -import { context } from "../index"; - -// Instantiate the general purpose client from the Aragon OSx SDK context. -const client: Client = new Client(context); - -const depositParams: DepositParams = { - daoAddressOrEns: "my-dao.dao.eth", - amount: BigInt(10), // amount in wei - type: TokenType.NATIVE, // "native" for ETH, otherwise "erc20" for ERC20 tokens -}; - -// Estimate how much gas the transaction will cost. -const estimatedGas: GasFeeEstimation = await client.estimation.deposit( - depositParams, -); -console.log({ avg: estimatedGas.average, max: estimatedGas.max }); - -// Deposit ETH to the DAO. -const steps = client.methods.deposit(depositParams); -for await (const step of steps) { - try { - switch (step.key) { - case DaoDepositSteps.DEPOSITING: - console.log({ txHash: step.txHash }); - break; - case DaoDepositSteps.DONE: - console.log({ amount: step.amount }); - break; - } - } catch (err) { - console.error(err); - } -} -``` - - -Returns: -```tsx -{ - txHash: "0xb1c14a49...3e8620b0f5832d61c" -} -{ - amount: 10n, -} -``` \ No newline at end of file diff --git a/versioned_docs/version-1.3.0/sdk/01-examples/01-client/03-deposit-erc20.md b/versioned_docs/version-1.3.0/sdk/01-examples/01-client/03-deposit-erc20.md deleted file mode 100644 index 04c5ec41..00000000 --- a/versioned_docs/version-1.3.0/sdk/01-examples/01-client/03-deposit-erc20.md +++ /dev/null @@ -1,85 +0,0 @@ ---- -title: Deposit ERC-20 ---- - -### Deposit ERC-20 Tokens to a DAO - -Deposits ERC-20 tokens to a DAO. - -- Similar to the ETH deposit flow -- The `tokenAddress` field is required. This is the contract address of the ERC-20 token. -- Will attempt to increase the ERC20 allowance if not sufficient. -- More intermediate steps are yielded. - -```ts -import { - Client, - DaoDepositSteps, - DepositParams, - SetAllowanceSteps, -} from "@aragon/sdk-client"; -import { GasFeeEstimation, TokenType } from "@aragon/sdk-client-common"; -import { context } from "../index"; - -// Instantiate the general purpose client from the Aragon OSx SDK context. -const client: Client = new Client(context); - -const depositParams: DepositParams = { - daoAddressOrEns: "0x1234567890123456789012345678901234567890", // my-dao.dao.eth - amount: BigInt(10), // amount in wei - tokenAddress: "0x1234567890123456789012345678901234567890", // token contract adddress - type: TokenType.ERC20, // "erc20" for ERC20 token, otherwise "native" for ETH -}; - -// Estimate how much gas the transaction will cost. -const estimatedGas: GasFeeEstimation = await client.estimation.deposit( - depositParams, -); -console.log({ avg: estimatedGas.average, max: estimatedGas.max }); - -// Deposit the ERC20 tokens. -const steps = client.methods.deposit(depositParams); -for await (const step of steps) { - try { - switch (step.key) { - case DaoDepositSteps.CHECKED_ALLOWANCE: - console.log({ checkedAllowance: step.allowance }); - break; - case SetAllowanceSteps.SETTING_ALLOWANCE: - console.log({ updateAllowanceTxHash: step.txHash }); - break; - case SetAllowanceSteps.ALLOWANCE_SET: - console.log({ updatedAllowance: step.allowance }); - break; - case DaoDepositSteps.DEPOSITING: - console.log({ depositingTxHash: step.txHash }); - break; - case DaoDepositSteps.DONE: - console.log({ amount: step.amount }); - break; - } - } catch (err) { - console.error(err); - } -} -``` - - -Returns: -```tsx -{ - checkedAllowance: 0n -} -{ - updateAllowanceTxHash: "0xb1c14a49...3e8620b0f5832d61c" -} -{ - updatedAllowance: 10n -} -{ - depositingTxHash: "0xb1c14a49...3e8620b0f5832d61c" -} -{ - amount: 10n -} -``` \ No newline at end of file diff --git a/versioned_docs/version-1.3.0/sdk/01-examples/01-client/04-deposit-erc721.md b/versioned_docs/version-1.3.0/sdk/01-examples/01-client/04-deposit-erc721.md deleted file mode 100644 index 616c4203..00000000 --- a/versioned_docs/version-1.3.0/sdk/01-examples/01-client/04-deposit-erc721.md +++ /dev/null @@ -1,73 +0,0 @@ ---- -title: Deposit ERC-721 ---- - -### Deposit ERC-721 Tokens to a DAO - -Deposits ERC-721 tokens to a DAO. - -- Similar to the ERC20 deposit flow -- The `tokenAddress` field is required. This is the contract address of the ERC-721 token. -- TokenId is required. This is the token ID of the ERC-721 token. -- Calls the safeTransferFrom function of the ERC-721 token contract. - -```ts -import { - Client, - DaoDepositSteps, - DepositParams, - SetAllowanceSteps, - } from "@aragon/sdk-client"; - import { GasFeeEstimation, TokenType } from "@aragon/sdk-client-common"; - import { context } from "../index"; - - // Instantiate the general purpose client from the Aragon OSx SDK context. - const client: Client = new Client(context); - - const depositParams: DepositParams = { - daoAddressOrEns: "0x1234567890123456789012345678901234567890", // my-dao.dao.eth - tokenAddress: "0x1234567890123456789012345678901234567890", // token contract adddress - type: TokenType.ERC721, // "erc721" for ERC721 token - tokenId: BigInt(1), // token ID of the ERC-721 token - }; - - // Estimate how much gas the transaction will cost. - const estimatedGas: GasFeeEstimation = await client.estimation.deposit( - depositParams, - ); - console.log({ avg: estimatedGas.average, max: estimatedGas.max }); - - // Deposit the ERC721 tokens. - const steps = client.methods.deposit(depositParams); - for await (const step of steps) { - try { - switch (step.key) { - case DaoDepositSteps.DEPOSITING: - console.log({ depositingTxHash: step.txHash }); - break; - case DaoDepositSteps.DONE: - console.log({ tokenId: step.tokenId }); - break; - } - } catch (err) { - console.error(err); - } - } -``` - - -Returns: - ```tsx - { - depositingTxHash: "0xb1c14a49...3e8620b0f5832d61c" - } - { - tokenId: 1n - } - ``` - -```ts - -``` - - diff --git a/versioned_docs/version-1.3.0/sdk/01-examples/01-client/05-deposit-erc1155.md b/versioned_docs/version-1.3.0/sdk/01-examples/01-client/05-deposit-erc1155.md deleted file mode 100644 index 575e28ca..00000000 --- a/versioned_docs/version-1.3.0/sdk/01-examples/01-client/05-deposit-erc1155.md +++ /dev/null @@ -1,78 +0,0 @@ ---- -title: Deposit ERC-1155 ---- - -### Deposit ERC-1155 Tokens to a DAO - -Deposits ERC-1155 tokens to a DAO. - -- Similar to the ERC20 deposit flow -- The `tokenAddress` field is required. This is the contract address of the ERC-1155 token. -- TokenIds is required. This is the token ID of the ERC-1155 token. -- Amounts is required. This is the amount of the ERC-1155 token to deposit. -- Supports depositing multiple ERC-1155 tokens in a single transaction. -- Calls the safeTransferFrom or safeBatchTransferFrom function of the ERC-1155 token contract. -- If only one token ID is provided, the safeTransferFrom function is called. -- If multiple token IDs are provided, the safeBatchTransferFrom function is called. - -```ts -import { - Client, - DaoDepositSteps, - DepositParams, - } from "@aragon/sdk-client"; - import { GasFeeEstimation, TokenType } from "@aragon/sdk-client-common"; - import { context } from "../index"; - - // Instantiate the general purpose client from the Aragon OSx SDK context. - const client: Client = new Client(context); - - const depositParams: DepositParams = { - daoAddressOrEns: "0x1234567890123456789012345678901234567890", // my-dao.dao.eth - tokenAddress: "0x1234567890123456789012345678901234567890", // token contract adddress - type: TokenType.ERC1155, // "erc1155" for ERC1155 token - tokenIds: [BigInt(1)], // token ID of the ERC-1155 token - amounts: [BigInt(1)], // amount of the ERC-1155 token to deposit - }; - - // Estimate how much gas the transaction will cost. - const estimatedGas: GasFeeEstimation = await client.estimation.deposit( - depositParams, - ); - console.log({ avg: estimatedGas.average, max: estimatedGas.max }); - - // Deposit the ERC1155 tokens. - const steps = client.methods.deposit(depositParams); - for await (const step of steps) { - try { - switch (step.key) { - case DaoDepositSteps.DEPOSITING: - console.log({ depositingTxHash: step.txHash }); - break; - case DaoDepositSteps.DONE: - console.log({ tokenId: step.tokenIds, amount: step.amounts }); - break; - } - } catch (err) { - console.error(err); - } - } -``` - - -Returns: - ```tsx - { - depositingTxHash: "0xb1c14a49...3e8620b0f5832d61c" - } - { - tokenIds: [1n], - amounts: [1n] - } - ``` - -```ts - -``` - - diff --git a/versioned_docs/version-1.3.0/sdk/01-examples/01-client/06-get-dao.md b/versioned_docs/version-1.3.0/sdk/01-examples/01-client/06-get-dao.md deleted file mode 100644 index f17b759e..00000000 --- a/versioned_docs/version-1.3.0/sdk/01-examples/01-client/06-get-dao.md +++ /dev/null @@ -1,54 +0,0 @@ ---- -title: Get DAO Details ---- - -## Get the DAO details - -Gets a DAO's details using its address or ENS domain. - -```ts -import { Client, DaoDetails } from "@aragon/sdk-client"; -import { context } from "../index"; - -// Instantiate the general purpose client from the Aragon OSx SDK context. -const client: Client = new Client(context); - -// Address or ENS of the DAO whose metadata you want to retrieve. -const daoAddressOrEns: string = "0x1234567890123456789012345678901234567890"; // test.dao.eth - -// Get a DAO's details. -const dao: DaoDetails | null = await client.methods.getDao(daoAddressOrEns); -console.log(dao); -``` - - -Returns: - -```json -{ - address: "0x1234567890123456789012345678901234567890", - ensDomain: "test.dao.eth", - metadata: { - name: "test", - description: "this is a description", - avatar?: "https://wbsite.com/image.jpeg", - links: [ - { - name: "Website", - url: "https://website..." - }, - { - name: "Discord", - url: "https://discord.com/..." - } - ] - }, - creationDate: , - plugins: [ - { - id: token-voting.plugin.dao.eth, - instanceAddress: "0x12345..." - } - ] -} -``` \ No newline at end of file diff --git a/versioned_docs/version-1.3.0/sdk/01-examples/01-client/07-get-daos.md b/versioned_docs/version-1.3.0/sdk/01-examples/01-client/07-get-daos.md deleted file mode 100644 index 19afbdca..00000000 --- a/versioned_docs/version-1.3.0/sdk/01-examples/01-client/07-get-daos.md +++ /dev/null @@ -1,82 +0,0 @@ ---- -title: Get DAOs ---- - -## Get Existing DAOs from the DAO Registry - -Gets a list of DAOs from the Aragon OSx DAO registry. - -```ts -import { - Client, - DaoListItem, - DaoQueryParams, - DaoSortBy, -} from "@aragon/sdk-client"; -import { SortDirection } from "@aragon/sdk-client-common"; -import { context } from "../index"; - -// Instantiate the general purpose client from the Aragon OSx SDK context. -const client: Client = new Client(context); - -const queryParams: DaoQueryParams = { - skip: 0, // optional - limit: 10, // optional, - direction: SortDirection.ASC, // optional - sortBy: DaoSortBy.CREATED_AT, //optional, alternatively "SUBDOMAIN" (and "POPULARITY" coming soon) -}; - -// Get a list of DAOs from the Aragon DAO registry. -const daos: DaoListItem[] = await client.methods.getDaos(queryParams); -console.log(daos); -``` - - -Returns: - -```json -[ - { - address: "0x12345...", - ensDomain: "test.dao.eth", - metadata: { - name: "Test", - description: "This is a description" - }; - plugins: [ - { - id: "token-voting.plugin.dao.eth", - instanceAddress: "0x12345..." - } - ] - }, - { - address: "0x12345...", - ensDomain: "test-1.dao.eth", - metadata: { - name: "Test 1", - description: "This is a description 1" - }; - plugins: [ - { - id: "address-list-voting.plugin.dao.eth", - instanceAddress: "0x12345..." - } - ] - }, - { - address: "0x12345...", - ensDomain: "test-2.dao.eth", - metadata: { - name: "Test 2", - description: "This is a description 2" - }; - plugins: [ - { - id: "token-voting.plugin.dao.eth", - instanceAddress: "0x12345..." - } - ] - } -] - ``` \ No newline at end of file diff --git a/versioned_docs/version-1.3.0/sdk/01-examples/01-client/08-get-balances.md b/versioned_docs/version-1.3.0/sdk/01-examples/01-client/08-get-balances.md deleted file mode 100644 index 43e7630d..00000000 --- a/versioned_docs/version-1.3.0/sdk/01-examples/01-client/08-get-balances.md +++ /dev/null @@ -1,47 +0,0 @@ ---- -title: Get DAO Balance ---- - -## Get the Balance of a DAO - -Gets a DAO's financial assets based on the DAO address or its ENS domain. - -```ts -import { AssetBalance, Client } from "@aragon/sdk-client"; -import { context } from "../index"; - -// Instantiate the general purpose client from the Aragon OSx SDK context. -const client: Client = new Client(context); - -// Address of the DAO whose asset balances you want to retrieve. -const daoAddressOrEns: string = "0x12345..."; - -// Get a DAO's asset balances. -const daoBalances: AssetBalance[] | null = await client.methods.getDaoBalances({ - daoAddressOrEns, -}); -console.log(daoBalances); -``` - - -Returns: - -```json -[ - { - type: "native", - balance: 100000n, - updateDate: - }, - { - type: "erc20", - address: "0x1234567890123456789012345678901234567890" - name: "The Token", - symbol: "TOK", - decimals: 18, - balance: 200000n - updateDate: - }, - ... -] -``` \ No newline at end of file diff --git a/versioned_docs/version-1.3.0/sdk/01-examples/01-client/09-get-transfers.md b/versioned_docs/version-1.3.0/sdk/01-examples/01-client/09-get-transfers.md deleted file mode 100644 index ab0f9d39..00000000 --- a/versioned_docs/version-1.3.0/sdk/01-examples/01-client/09-get-transfers.md +++ /dev/null @@ -1,85 +0,0 @@ ---- -title: Get DAO Transfers ---- - -## Get Transfers from DAO's Activity - -Gets the list of asset transfers to and from DAOs. -If passed a `daoAddressOrEns`, will only retrieve transfers for that DAO. Otherwise, it returns for all DAOs. - -By default, retrieves ETH, DAI, USDC and USDT, on Mainnet). - -```ts -import { - Client, - Transfer, - TransferQueryParams, - TransferSortBy, - TransferType, -} from "@aragon/sdk-client"; -import { SortDirection } from "@aragon/sdk-client-common"; -import { context } from "../index"; - -// Instantiate the general purpose client from the Aragon OSx SDK context. -const client: Client = new Client(context); - -const params: TransferQueryParams = { - daoAddressOrEns: "0x1234567890123456789012345678901234567890", // optional - sortBy: TransferSortBy.CREATED_AT, // optional - limit: 10, // optional - skip: 0, // optional - direction: SortDirection.ASC, // optional, options: DESC or ASC - type: TransferType.DEPOSIT, // optional, options: DEPOSIT or WITHDRAW -}; - -// Get a list of DAO transfers based on params set. -const daoTransfers: Transfer[] | null = await client.methods.getDaoTransfers( - params, -); -console.log(daoTransfers); -``` - - -Returns: - -```json -[ - { - type: "withdraw", - tokenType: "erc20", - token: { - address: "0xc7ad46e0b8a400bb3c915120d284aafba8fc4735", - name: "Dai Stablecoin", - symbol: "DAI", - decimals: 18, - }, - amount: 1000000000000000n, - creationDate: - transactionId: "0xdb0f9422b5c3199021481c98a655741ca16119ff8a59571854a94a6f31dad7ba", - to: "0xc8541aae19c5069482239735ad64fac3dcc52ca2", - proposalId: "0x1234567890123456789012345678901234567890_0x0" - }, - { - type: "deposit", - tokenType: "native", - amount: 1000000000000000n, - creationDate: - transactionId: "0xc18b310b2f8cf427d95fa905dc842df2cf999075f18579afbcbdce19f8db0a30", - from: "0xc8541aae19c5069482239735ad64fac3dcc52ca2", - }, - { - type: "deposit", - tokenType: "erc20", - token: { - address: "0xc7ad46e0b8a400bb3c915120d284aafba8fc4735", - name: "Dai Stablecoin", - symbol: "DAI", - decimals: 18, - }, - amount: 1000000000000000n, - creationDate: - transactionId: "0xdd8fff77c1f3e819d4224f8d02a00583c7e5d55475b8a9d70867aee0d6d16f07", - from: "0xc8541aae19c5069482239735ad64fac3dcc52ca2", - } -] -``` \ No newline at end of file diff --git a/versioned_docs/version-1.3.0/sdk/01-examples/01-client/10-set-allowance.md b/versioned_docs/version-1.3.0/sdk/01-examples/01-client/10-set-allowance.md deleted file mode 100644 index b7423d73..00000000 --- a/versioned_docs/version-1.3.0/sdk/01-examples/01-client/10-set-allowance.md +++ /dev/null @@ -1,60 +0,0 @@ ---- -title: Update ERC-20 Allowance ---- - -## Updates an ERC-20 Tokens' Allowance - -In order for an address to deposit an ERC20 token into the DAO, the allowance approval for that token needs to be set to the amount the person wants to deposit. -This function ensures the allowance approval is set to that amount. -Refer to OpenZeppelin docs here on ERC20's token allowance methods: https://docs.openzeppelin.com/contracts/2.x/api/token/erc20#IERC20-allowance-address-address-). - -This function updates the allowance approval to the amount specified. - -```ts -import { - Client, - SetAllowanceParams, - SetAllowanceSteps, -} from "@aragon/sdk-client"; -import { context } from "../index"; - -// Instantiate the general purpose client from the Aragon OSx SDK context. -const client: Client = new Client(context); - -const setAllowanceParams: SetAllowanceParams = { - spender: "0x1234567890123456789012345678901234567890", - amount: BigInt(10), // amount - tokenAddress: "0x1234567890123456789012345678901234567890", // token contract adddress -}; - -const steps = client.methods.setAllowance(setAllowanceParams); - -for await (const step of steps) { - try { - switch (step.key) { - case SetAllowanceSteps.SETTING_ALLOWANCE: - console.log({ updateAllowanceTxHash: step.txHash }); - break; - case SetAllowanceSteps.ALLOWANCE_SET: - console.log({ updatedAllowance: step.allowance }); - break; - } - } catch (err) { - console.error(err); - } -} -``` - - -Returns: -```tsx -{ - checkedAllowance: 0n -} -{ - updateAllowanceTxHash: "0xb1c14a49...3e8620b0f5832d61c" -} -{ - updatedAllowance: 10n -} -``` \ No newline at end of file diff --git a/versioned_docs/version-1.3.0/sdk/01-examples/01-client/11-pin-metadata.md b/versioned_docs/version-1.3.0/sdk/01-examples/01-client/11-pin-metadata.md deleted file mode 100644 index 4c6b9cc1..00000000 --- a/versioned_docs/version-1.3.0/sdk/01-examples/01-client/11-pin-metadata.md +++ /dev/null @@ -1,38 +0,0 @@ ---- -title: Pin Metadata to IPFS ---- - -## Pins Metadata for a DAO within IPFS - -Adds a pin data set into the specified IPFS nodes. -Return an IPFS CID preceded by "ipfs://". - -```ts -import { Client, DaoMetadata } from "@aragon/sdk-client"; -import { context } from "../index"; - -// Instantiate the general purpose client from the Aragon OSx SDK context. -const client: Client = new Client(context); - -// The Metadata object containing the details of the DAO. -const metadata: DaoMetadata = { - name: "My DAO", - description: "This is a description", - avatar: "", - links: [{ - name: "Web site", - url: "https://...", - }], -}; - -// Pin the metadata in IPFS. -const metadataUri = await client.methods.pinMetadata(metadata); -console.log(metadataUri); -``` - - -Returns: - -```json - "ipfs://Qm..." -``` \ No newline at end of file diff --git a/versioned_docs/version-1.3.0/sdk/01-examples/01-client/12-prepare-installation.md b/versioned_docs/version-1.3.0/sdk/01-examples/01-client/12-prepare-installation.md deleted file mode 100644 index 5e00853a..00000000 --- a/versioned_docs/version-1.3.0/sdk/01-examples/01-client/12-prepare-installation.md +++ /dev/null @@ -1,81 +0,0 @@ ---- -title: Prepare Installation ---- -### Prepare installation of a plugin - -The `prepareInstallation` method performs the prior steps so that a DAO proposal can eventually apply the installation of a Plugin to the given DAO. -A governance proposal will need to be created with an action calling `applyInstallation`. - -For more details see https://devs.aragon.org/docs/sdk/examples/encoders-decoders/apply-installation#encoding - -```ts -import { Client } from "@aragon/sdk-client"; -import { - PrepareInstallationParams, - PrepareInstallationStep, -} from "@aragon/sdk-client-common"; -import { context } from "../index"; - -// Instantiate the general purpose client from the Aragon OSx SDK context. -const client: Client = new Client(context); - -// Obtained from the plugin metadata -// See an example: https://github.com/aragon/simple-storage-example-plugin/blob/main/contracts/release1/build3/build-metadata-R1B3.json#L7-L20 -const installationAbi = [/* ... */]; - -const prepareInstallationParams: PrepareInstallationParams = { - daoAddressOrEns: "0x1234567890123456789012345678901234567890", // my-dao.dao.eth - pluginRepo: "0x2345678901234567890123456789012345678901", - installationParams: [ - // Example parameters needed by the plugin's prepareInstall function - 1234, - "0x1234567890123456789012345678901234567890", - ], - installationAbi, -}; - -// Prepare the installation -const steps = client.methods.prepareInstallation(prepareInstallationParams); -for await (const step of steps) { - try { - switch (step.key) { - case PrepareInstallationStep.PREPARING: - console.log({ txHash: step.txHash }); - break; - case PrepareInstallationStep.DONE: - console.log({ step }); - break; - } - } catch (err) { - console.error(err); - } -} -``` - - -Returns: -```tsx -{ - txhash: "0xb1c14a49...3e8620b0f5832d61c" -} -{ - step: { - helpers: ["0x12345...", "0x12345..."] - pluginRepo: "0x12345...", - pluginAdddres: "0x12345...", - versionTag: { - build: 1, - release: 1 - }, - permissions: [ - { - condition: "0x12345...", - who: "0x12345...", - where: "0x12345...", - operation: 1, // GRANT - permissionId: "0x1234567890..." - } - ] - } -} -``` \ No newline at end of file diff --git a/versioned_docs/version-1.3.0/sdk/01-examples/01-client/13-get-protocol-version.md b/versioned_docs/version-1.3.0/sdk/01-examples/01-client/13-get-protocol-version.md deleted file mode 100644 index f65f0b4f..00000000 --- a/versioned_docs/version-1.3.0/sdk/01-examples/01-client/13-get-protocol-version.md +++ /dev/null @@ -1,35 +0,0 @@ ---- -title: Get Protocol Version ---- - -### Get the protocol version of a DAO - -The `getProtocolVersion` method returns the protocol version of a DAO in the form of an array of three numbers. - -```ts -import { - Client, - } from "@aragon/sdk-client"; - import { context } from "../index"; - - // Instantiate the general purpose client from the Aragon OSx SDK context. - const client: Client = new Client(context); - - const protocolVersion = await client.methods - .getProtocolVersion( - "0x1234567890123456789012345678901234567890", - ); - console.log(protocolVersion); -``` - - -Returns: - ```tsx - [1, 0, 0] - ``` - -```ts - -``` - - diff --git a/versioned_docs/version-1.3.0/sdk/01-examples/01-client/14-prepare-uninstallation.md b/versioned_docs/version-1.3.0/sdk/01-examples/01-client/14-prepare-uninstallation.md deleted file mode 100644 index bfcb5cfb..00000000 --- a/versioned_docs/version-1.3.0/sdk/01-examples/01-client/14-prepare-uninstallation.md +++ /dev/null @@ -1,90 +0,0 @@ ---- -title: Prepare Uninstallation ---- - -### Prepare the uninstallation of a plugin - -The `prepareUninstallation` method performs the prior steps so that a DAO proposal can eventually apply the removal of a Plugin. -The proposal will need an Action calling the `applyUninstallation` function. - -For more details see https://devs.aragon.org/docs/sdk/examples/encoders-decoders/apply-uninstallation#encoding - -```ts -import { Client, PrepareUninstallationSteps } from "@aragon/sdk-client"; -import { - PrepareUninstallationParams, - GasFeeEstimation, -} from "@aragon/sdk-client-common"; -import { context } from "../index"; - -// Instantiate the general purpose client from the Aragon OSx SDK context. -const client: Client = new Client(context); - -const prepareUninstallationParams: PrepareUninstallationParams = { - daoAddressOrEns: "0x1234567890123456789012345678901234567890", // my-dao.dao.eth - pluginAddress: "0x2345678901234567890123456789012345678901", - uninstallationParams: [ - // Example parameters needed by the plugin's prepareUninstall function - 1234, - "0x1234567890123456789012345678901234567890", - ], - uninstallationAbi: ["uint256", "adress"], -}; - -// Estimate how much gas the transaction will cost. -const estimatedGas: GasFeeEstimation = - await client.estimation.prepareUninstallation(prepareUninstallationParams); -console.log({ avg: estimatedGas.average, max: estimatedGas.max }); - -// Deposit the ERC20 tokens. -const steps = client.methods.prepareUninstallation(prepareUninstallationParams); -for await (const step of steps) { - try { - switch (step.key) { - case PrepareUninstallationSteps.PREPARING: - console.log({ txHash: step.txHash }); - break; - case PrepareUninstallationSteps.DONE: - console.log({ - permissions: step.permissions, - pluginAddress: step.pluginAddress, - pluginRepo: step.pluginRepo, - versionTag: step.versionTag, - }); - break; - } - } catch (err) { - console.error(err); - } -} -``` - - -Returns: -```tsx -{ - txhash: "0xb1c14a49...3e8620b0f5832d61c" -} -{ - permissions: [ - { - operation: 1, // revoke - where: "0x12345...", - who: "0x23456...", - permissionId: "0x1234567890..." - }, - { - operation: 1, //REVOKE - where: "0x3456...", - who: "0x4567...", - permissionId: "0x1234567890..." - } - ], - pluginAddress: "0x1234567890...", - pluginRepo: "0x1234567890..." - versionTag: { - build: 1, - release: 1 - } -} -``` \ No newline at end of file diff --git a/versioned_docs/version-1.3.0/sdk/01-examples/01-client/15-prepare-update.md b/versioned_docs/version-1.3.0/sdk/01-examples/01-client/15-prepare-update.md deleted file mode 100644 index c4ec668e..00000000 --- a/versioned_docs/version-1.3.0/sdk/01-examples/01-client/15-prepare-update.md +++ /dev/null @@ -1,101 +0,0 @@ ---- -title: Prepare Update ---- - -### Prepare the Update of a plugin - -The `prepareUpdate` method performs the prior steps so that a DAO proposal can eventually apply the the update of a Plugin. -The proposal will need an Action calling the `applyUpdate` function. - -```ts -import { - Client, - PrepareUpdateParams, - PrepareUpdateStep, -} from "@aragon/sdk-client"; -import { context } from "../index"; - -// Instantiate the general purpose client from the Aragon OSx SDK context. -const client: Client = new Client(context); - -const updateAbi = [/* ... */]; - -const prepareUpdateParams: PrepareUpdateParams = { - daoAddressOrEns: "0x1234567890123456789012345678901234567890", // my-dao.dao.eth - pluginAddress: "0x2345678901234567890123456789012345678901", - pluginRepo: "0x2345678901234567890123456789012345678901", - newVersion: { - build: 2, - release: 1, - }, - updateParams: [ - // Example parameters needed by the plugin's prepareUpdate function - 1234, - "0x1234567890123456789012345678901234567890", - ], - updateAbi, -}; - -// Estimate how much gas the transaction will cost. -const estimatedGas = await client.estimation - .prepareUpdate( - prepareUpdateParams, - ); -console.log({ avg: estimatedGas.average, max: estimatedGas.max }); - -// Deposit the ERC20 tokens. -const steps = client.methods.prepareUpdate(prepareUpdateParams); -for await (const step of steps) { - try { - switch (step.key) { - case PrepareUpdateStep.PREPARING: - console.log({ txHash: step.txHash }); - break; - case PrepareUpdateStep.DONE: - console.log({ - permissions: step.permissions, - pluginAddress: step.pluginAddress, - pluginRepo: step.pluginRepo, - versionTag: step.versionTag, - initData: step.initData, - helpers: step.helpers, - }); - break; - } - } catch (err) { - console.error(err); - } -} -``` - - -Returns: - ```tsx - { - txhash: "0xb1c14a49...3e8620b0f5832d61c" - } - { - permissions: [ - { - operation: 1, // revoke - where: "0x12345...", - who: "0x23456...", - permissionId: "0x1234567890..." - }, - { - operation: 1, //REVOKE - where: "0x3456...", - who: "0x4567...", - permissionId: "0x1234567890..." - } - ], - pluginAddress: "0x1234567890...", - pluginRepo: "0x1234567890...", - initData: Uint8Array(0) [], - versionTag: { - build: 1, - release: 1 - }, - helpers: ["0x12345...", "0x12345..."] - } - ``` \ No newline at end of file diff --git a/versioned_docs/version-1.3.0/sdk/01-examples/01-client/16-is-plugin-update-valid.md b/versioned_docs/version-1.3.0/sdk/01-examples/01-client/16-is-plugin-update-valid.md deleted file mode 100644 index ae411d2e..00000000 --- a/versioned_docs/version-1.3.0/sdk/01-examples/01-client/16-is-plugin-update-valid.md +++ /dev/null @@ -1,38 +0,0 @@ ---- -title: Check plugin update proposal ---- - -### Check if a plugin update proposal is valid - -Goes though the actions of an `IProposal` compatible proposal and checks that the actions are valid for updating a plugin - -```ts -import { Client } from "@aragon/sdk-client"; -import { context } from "../index"; - -// Instantiate the general purpose client from the Aragon OSx SDK context. -const client: Client = new Client(context); - -// The Id of the proposal. This is the address of the governance plugin and the proposal number in hexadecimal -// you can find it at the last part of the URL to the proposal for example -// https://app.aragon.org/#/daos/polygon/0x6c30c1a36ac486456932b2f106053c42443514b2/governance/proposals/0x0cff359a7455de5bb50aa0567517536d3dfe002d_0x10 -const proposalId = "0x0cff359a7455de5bb50aa0567517536d3dfe002d_0x10" - - -// check if a plugin update proposal is valid -const isValid = client.methods.isPluginUpdateProposalValid(proposalId); - -console.log(isValid); -``` - - -Returns: - ```tsx - { - isValid: false, - causes: [ - "invalidRevokePermission", - "invalidGrantPermission", - ] - } - ``` \ No newline at end of file diff --git a/versioned_docs/version-1.3.0/sdk/01-examples/01-client/17-is-plugin-update-proposal.md b/versioned_docs/version-1.3.0/sdk/01-examples/01-client/17-is-plugin-update-proposal.md deleted file mode 100644 index 27436846..00000000 --- a/versioned_docs/version-1.3.0/sdk/01-examples/01-client/17-is-plugin-update-proposal.md +++ /dev/null @@ -1,31 +0,0 @@ ---- -title: Check proposal is a plugin update proposal ---- - -### Check if a proposal contains the actions required to update a plugin - -Goes though a list of actions and checks that contains the necessary actions for updating a plugin - -```ts -import { Client } from "@aragon/sdk-client"; -import { context } from "../index"; - -// Instantiate the general purpose client from the Aragon OSx SDK context. -const client: Client = new Client(context); - -// The Id of the proposal. This is the address of the governance plugin and the proposal number in hexadecimal -// you can find it at the last part of the URL to the proposal for example -// https://app.aragon.org/#/daos/polygon/0x6c30c1a36ac486456932b2f106053c42443514b2/governance/proposals/0x0cff359a7455de5bb50aa0567517536d3dfe002d_0x10 -const proposalId = "0x0cff359a7455de5bb50aa0567517536d3dfe002d_0x10"; - -// check if a plugin update proposal is valid -const isValid = client.methods.isPluginUpdateProposal(proposalId); - -console.log(isValid); -``` - - -Returns: - ```tsx - false - ``` \ No newline at end of file diff --git a/versioned_docs/version-1.3.0/sdk/01-examples/01-client/18-is-dao-update-valid.md b/versioned_docs/version-1.3.0/sdk/01-examples/01-client/18-is-dao-update-valid.md deleted file mode 100644 index db67ce9c..00000000 --- a/versioned_docs/version-1.3.0/sdk/01-examples/01-client/18-is-dao-update-valid.md +++ /dev/null @@ -1,36 +0,0 @@ ---- -title: Check dao update proposal ---- - -### Check if a dap update proposal is valid - -Goes though the actions of an `IProposal` compatible proposal and checks that the actions are valid for updating a dao - -```ts -import { Client } from "@aragon/sdk-client"; -import { context } from "../index"; - -// Instantiate the general purpose client from the Aragon OSx SDK context. -const client: Client = new Client(context); - -// The Id of the proposal. This is the address of the governance plugin and the proposal number in hexadecimal -// you can find it at the last part of the URL to the proposal for example -// https://app.aragon.org/#/daos/polygon/0x6c30c1a36ac486456932b2f106053c42443514b2/governance/proposals/0x0cff359a7455de5bb50aa0567517536d3dfe002d_0x10 -const proposalId = "0x0cff359a7455de5bb50aa0567517536d3dfe002d_0x11"; - -// check if a dap update proposal is valid -const isValid = client.methods.isDaoUpdateProposalValid(proposalId); - -console.log(isValid); -``` - - -Returns: - ```tsx - { - isValid: false, - causes: [ - "invalidImplementation", - ] - } - ``` \ No newline at end of file diff --git a/versioned_docs/version-1.3.0/sdk/01-examples/01-client/19-is-dao-update-proposal.md b/versioned_docs/version-1.3.0/sdk/01-examples/01-client/19-is-dao-update-proposal.md deleted file mode 100644 index 9d578a2b..00000000 --- a/versioned_docs/version-1.3.0/sdk/01-examples/01-client/19-is-dao-update-proposal.md +++ /dev/null @@ -1,31 +0,0 @@ ---- -title: Check proposal is a dao update proposal ---- - -### Check if a proposal contains the actions required to update a dao - -Goes though a list of actions and checks that contains the necessary actions for updating a dao - -```ts -import { Client } from "@aragon/sdk-client"; -import { context } from "../index"; - -// Instantiate the general purpose client from the Aragon OSx SDK context. -const client: Client = new Client(context); - -// The Id of the proposal. This is the address of the governance plugin and the proposal number in hexadecimal -// you can find it at the last part of the URL to the proposal for example -// https://app.aragon.org/#/daos/polygon/0x6c30c1a36ac486456932b2f106053c42443514b2/governance/proposals/0x0cff359a7455de5bb50aa0567517536d3dfe002d_0x10 -const proposalId = "0x0cff359a7455de5bb50aa0567517536d3dfe002d_0x11"; - -// check if a plugin update proposal is valid -const isValid = client.methods.isDaoUpdateProposal(proposalId); - -console.log(isValid); -``` - - -Returns: - ```tsx - false - ``` \ No newline at end of file diff --git a/versioned_docs/version-1.3.0/sdk/01-examples/01-client/20-get-plugin-preparations.md b/versioned_docs/version-1.3.0/sdk/01-examples/01-client/20-get-plugin-preparations.md deleted file mode 100644 index 746f62f2..00000000 --- a/versioned_docs/version-1.3.0/sdk/01-examples/01-client/20-get-plugin-preparations.md +++ /dev/null @@ -1,74 +0,0 @@ ---- -title: Get Plugin Preparations ---- - -## Get Plugin Preparations - -Returns plugin preparations filtered by: - -- pluginAddress -- daoAddressOrEns -- pluginRepoAddress -- type(Installation or Update) - -```ts -import { - Client, - PluginPreparationListItem, - PluginPreparationQueryParams, - PluginPreparationSortBy, -} from "@aragon/sdk-client"; -import { SortDirection } from "@aragon/sdk-client-common"; -import { context } from "../index"; - -// Instantiate the general purpose client from the Aragon OSx SDK context. -const client: Client = new Client(context); - -const params: PluginPreparationQueryParams = { - limit: 10, - skip: 0, - direction: SortDirection.ASC, - sortBy: PluginPreparationSortBy.ID, - pluginAddress: "0x1234567890123456789012345678901234567890", - daoAddressOrEns: "0x1234567890123456789012345678901234567890", - pluginRepoAddress: "0x1234567890123456789012345678901234567890", -}; - -// Get a list of DAOs from the Aragon DAO registry. -const pluginPreparations: PluginPreparationListItem[] = await client.methods - .getPluginPreparations(params); -console.log(pluginPreparations); -``` - - -Returns: - -```json -[ - { - id: string, - type: "Installation", - creator: "0x1234567890123456789012345678901234567890", - dao: "0x1234567890123456789012345678901234567890", - pluginRepo: { - id: "0x1234567890123456789012345678901234567890", - subdomain: "multisig" - }, - versionTag: { - build: 1, - release: 1 - }, - pluginAddress: "0x1234567890123456789012345678901234567890", - permissions: [ - { - who: "0x1234567890123456789012345678901234567890", - where: "0x1234567890123456789012345678901234567890", - permissionId: "0x12345678", - condition: "0x1234567890123456789012345678901234567890" - } - ] - helpers: ["0x1234567890123456789012345678901234567890"],; - data: new Uint8Array() - } -] - ``` \ No newline at end of file diff --git a/versioned_docs/version-1.3.0/sdk/01-examples/01-client/index.md b/versioned_docs/version-1.3.0/sdk/01-examples/01-client/index.md deleted file mode 100644 index 9bbe7be1..00000000 --- a/versioned_docs/version-1.3.0/sdk/01-examples/01-client/index.md +++ /dev/null @@ -1,24 +0,0 @@ ---- -title: Client Setup ---- - -## Setting Up the SDK Client - -Next thing you'll want to do is set up the general purpose client so you can call on the SDK functions. This client is used to interact with any DAO on the network you're connected to. - -The `Client` class that can be imported via `@aragon/sdk-client` allows you to perform operations that apply to all DAOs, regardless of the plugins they use. - -We also have clients for each plugin, which allow us to use the plugin-specific functions. - -Clients can be stored in a singleton and inherited from there. Can also be stored in a [context hook](https://www.freecodecamp.org/news/react-context-for-beginners/) for easier use throughout your Javascript framework. - -```ts -import { Client } from "@aragon/sdk-client"; -import { context } from "../index"; - -// Instantiate the general purpose client from the Aragon OSx SDK context. -const client: Client = new Client(context); -console.log(client); -``` - - diff --git a/versioned_docs/version-1.3.0/sdk/01-examples/02-multisig-client/01-installation.md b/versioned_docs/version-1.3.0/sdk/01-examples/02-multisig-client/01-installation.md deleted file mode 100644 index 05fac9f4..00000000 --- a/versioned_docs/version-1.3.0/sdk/01-examples/02-multisig-client/01-installation.md +++ /dev/null @@ -1,100 +0,0 @@ ---- -title: Create Multisig DAO ---- - -## Create a DAO with a Multisig Installed - -The Mutisig plugin is a governance plugin which enables x out of y signers to approve a proposal in order for it to pass. -It establishes a minimum approval threshold and a list of addresses which are allowed to vote. - -In order to create a DAO with a Multisig plugin, you will need to first instantiate the Multisig plugin client, then use it when creating your DAO. - -```ts -import { - Client, - CreateDaoParams, - DaoCreationSteps, - MultisigClient, - MultisigPluginInstallParams, -} from "@aragon/sdk-client"; -import { GasFeeEstimation } from "@aragon/sdk-client-common"; -import { context } from "../index"; - -// Instantiate a client from the Aragon OSx SDK context. -const client: Client = new Client(context); - -// Addresses which will be allowed to vote in the Multisig plugin. -const members: string[] = [ - "0x1234567890123456789012345678901234567890", - "0x2345678901234567890123456789012345678901", - "0x3456789012345678901234567890123456789012", - "0x4567890123456789012345678901234567890123", -]; - -const multisigPluginIntallParams: MultisigPluginInstallParams = { - votingSettings: { - minApprovals: 1, - onlyListed: true, - }, - members, -}; - -// Encodes the parameters of the Multisig plugin. These will get used in the installation plugin for the DAO. -const multisigPluginInstallItem = MultisigClient.encoding - .getPluginInstallItem(multisigPluginIntallParams, "goerli"); - -// Pin metadata to IPFS, returns IPFS CID string. -const metadataUri: string = await client.methods.pinMetadata({ - name: "My DAO", - description: "This is a description", - avatar: "", // image url - links: [{ - name: "Web site", - url: "https://...", - }], -}); - -const createParams: CreateDaoParams = { - metadataUri, - ensSubdomain: "my-org", // my-org.dao.eth - plugins: [multisigPluginInstallItem], -}; - -// Estimate gas for the transaction. -const estimatedGas: GasFeeEstimation = await client.estimation.createDao( - createParams, -); -console.log({ avg: estimatedGas.average, max: estimatedGas.max }); - -// Creates a DAO with a Multisig plugin installed. -const steps = client.methods.createDao(createParams); -for await (const step of steps) { - try { - switch (step.key) { - case DaoCreationSteps.CREATING: - console.log({ txHash: step.txHash }); - break; - case DaoCreationSteps.DONE: - console.log({ - daoAddress: step.address, - pluginAddresses: step.pluginAddresses, - }); - break; - } - } catch (err) { - console.error(err); - } -} -``` - - -Returns: -```tsx -{ - txHash: "0xb1c14a49...3e8620b0f5832d61c" -} -{ - daoAddress: "0xb1c14a49...3e8620b0f5832d61c", - pluginAddresses: ["0xb1c14a49...3e8620b0f5832d61c", "0xb1c14a49...3e8620b0f5832d61c"] -} -``` \ No newline at end of file diff --git a/versioned_docs/version-1.3.0/sdk/01-examples/02-multisig-client/02-create-proposal.md b/versioned_docs/version-1.3.0/sdk/01-examples/02-multisig-client/02-create-proposal.md deleted file mode 100644 index 5e1a4f02..00000000 --- a/versioned_docs/version-1.3.0/sdk/01-examples/02-multisig-client/02-create-proposal.md +++ /dev/null @@ -1,83 +0,0 @@ ---- -title: Create a Proposal ---- - -## Create a Multisig Proposal - -Creates a proposal whose governance mechanism is the Multisig plugin and its defined configuration. - -```ts -import { - CreateMultisigProposalParams, - MultisigClient, - ProposalCreationSteps, -} from "@aragon/sdk-client"; -import { ProposalMetadata } from "@aragon/sdk-client-common"; -import { context } from "../index"; - -// Insantiate a Multisig plugin client. -const multisigClient: MultisigClient = new MultisigClient(context); - -const proposalMetadata: ProposalMetadata = { - title: "Test Proposal", - summary: "This is a short description", - description: "This is a long description", - resources: [ - { - name: "Discord", - url: "https://discord.com/...", - }, - { - name: "Website", - url: "https://website...", - }, - ], - media: { - logo: "https://...", - header: "https://...", - }, -}; - -// Pins the metadata to IPFS and gets back an IPFS URI. -const metadataUri: string = await multisigClient.methods.pinMetadata( - proposalMetadata, -); - -const proposalParams: CreateMultisigProposalParams = { - pluginAddress: "0x1234567890123456789012345678901234567890", - metadataUri, - // Boolean array indicating the actions that can and cannot fail - // when the proposal is executed. - failSafeActions: [], - actions: [], // optional - if left as an empty array, no action will be set for the proposal. the action needs to be encoded and will be executed once a proposal passes. -}; - -// Generates a proposal with the withdraw action as passed in the proposalParams. -const steps = multisigClient.methods.createProposal(proposalParams); - -for await (const step of steps) { - try { - switch (step.key) { - case ProposalCreationSteps.CREATING: - console.log({ txHash: step.txHash }); - break; - case ProposalCreationSteps.DONE: - console.log({ proposalId: step.proposalId }); - break; - } - } catch (err) { - console.error(err); - } -} -``` - - -Returns: -```tsx -{ - txHash: "0xb1c14a49...3e8620b0f5832d61c" -} -{ - proposalId: "0xb1c14a49...3e862_0x0", -} -``` \ No newline at end of file diff --git a/versioned_docs/version-1.3.0/sdk/01-examples/02-multisig-client/03-create-proposal-with-actions.md b/versioned_docs/version-1.3.0/sdk/01-examples/02-multisig-client/03-create-proposal-with-actions.md deleted file mode 100644 index e4a1fe52..00000000 --- a/versioned_docs/version-1.3.0/sdk/01-examples/02-multisig-client/03-create-proposal-with-actions.md +++ /dev/null @@ -1,97 +0,0 @@ ---- -title: Create a Proposal with Actions ---- - -## Create a Multisig Proposal - -Creates a proposal with actions whose governance mechanism is the Multisig plugin and its defined configuration. -The actions are what will get executed once the proposal passes. - -```ts -import { - Client, - CreateMultisigProposalParams, - MultisigClient, - ProposalCreationSteps, - WithdrawParams, -} from "@aragon/sdk-client"; -import { ProposalMetadata, TokenType } from "@aragon/sdk-client-common"; -import { context } from "../index"; - -// Instantiate an Aragon OSx SDK client. -const client: Client = new Client(context); - -// Insantiate a Multisig plugin client. -const multisigClient: MultisigClient = new MultisigClient(context); - -const proposalMetadata: ProposalMetadata = { - title: "Test Proposal", - summary: "This is a short description", - description: "This is a long description", - resources: [ - { - name: "Discord", - url: "https://discord.com/...", - }, - { - name: "Website", - url: "https://website...", - }, - ], - media: { - logo: "https://...", - header: "https://...", - }, -}; - -// Pins the metadata to IPFS and gets back an IPFS URI. -const metadataUri: string = await multisigClient.methods.pinMetadata( - proposalMetadata, -); - -// An action the proposal could take. This is only an example of an action. You can find all encoded actions within our encoders section. -const withdrawParams: WithdrawParams = { - amount: BigInt(10), // amount in wei - tokenAddress: "0x1234567890123456789012345678901234567890", // ERC20 token's contract address to withdraw - type: TokenType.ERC20, - recipientAddressOrEns: "0x1234567890123456789012345678901234567890", // address or ENS name to send the assets to -}; - -// Encodes the action of withdrawing assets from a given DAO's vault and transfers them over to the recipient address. -const withdrawAction = await client.encoding.withdrawAction(withdrawParams); - -const proposalParams: CreateMultisigProposalParams = { - pluginAddress: "0x1234567890123456789012345678901234567890", - metadataUri, - actions: [withdrawAction], // optional - if left as an empty array, no action will be set for the proposal. the action needs to be encoded and will be executed once a proposal passes. -}; - -// Generates a proposal with the withdraw action as passed in the proposalParams. -const steps = multisigClient.methods.createProposal(proposalParams); - -for await (const step of steps) { - try { - switch (step.key) { - case ProposalCreationSteps.CREATING: - console.log({ txHash: step.txHash }); - break; - case ProposalCreationSteps.DONE: - console.log({ proposalId: step.proposalId }); - break; - } - } catch (err) { - console.error(err); - } -} -``` - - -Returns: -```tsx -{ - txHash: "0xb1c14a49...3e8620b0f5832d61c" -} -{ - proposalId: "0xb1c14a49...3e862_0x0", -} -``` \ No newline at end of file diff --git a/versioned_docs/version-1.3.0/sdk/01-examples/02-multisig-client/04-can-approve.md b/versioned_docs/version-1.3.0/sdk/01-examples/02-multisig-client/04-can-approve.md deleted file mode 100644 index 05c4081c..00000000 --- a/versioned_docs/version-1.3.0/sdk/01-examples/02-multisig-client/04-can-approve.md +++ /dev/null @@ -1,31 +0,0 @@ ---- -title: Check Approval Rights ---- - -## Check if a User Can Approve in a Multisig Proposal - -Checks whether a user is able to participate in a proposal created using the Multisig plugin. - -```ts -import { CanApproveParams, MultisigClient } from "@aragon/sdk-client"; -import { context } from "../index"; - -// Instantiate a Multisig client. -const client: MultisigClient = new MultisigClient(context); - -const canApproveParams: CanApproveParams = { - approverAddressOrEns: "0x1234567890123456789012345678901234567890", - proposalId: "0x1234567890123456789012345678901234567890_0x0", -}; - -// Checks whether the addressOrEns provided is able to approve a given proposal created with the pluginAddress. -const canApprove = await client.methods.canApprove(canApproveParams); -console.log(canApprove); -``` - - -Returns: - -``` - true -``` \ No newline at end of file diff --git a/versioned_docs/version-1.3.0/sdk/01-examples/02-multisig-client/05-approve-proposal.md b/versioned_docs/version-1.3.0/sdk/01-examples/02-multisig-client/05-approve-proposal.md deleted file mode 100644 index 80884b84..00000000 --- a/versioned_docs/version-1.3.0/sdk/01-examples/02-multisig-client/05-approve-proposal.md +++ /dev/null @@ -1,51 +0,0 @@ ---- -title: Approve Proposal ---- - -## Approve a Multisig Proposal - -A member of a Multisig plugin is an address that is able to give their approval for a transaction to go through. -This function enables Multisig members to approve a proposal. - -```ts -import { - ApproveMultisigProposalParams, - ApproveProposalStep, - MultisigClient, -} from "@aragon/sdk-client"; -import { context } from "../index"; - -// Insantiate a plugin context from the Aragon OSx SDK context. - -// Instantiate a Multisig client -const multisigClient = new MultisigClient(context); - -const approveParams: ApproveMultisigProposalParams = { - proposalId: "0x1234567890123456789012345678901234567890_0x0", - tryExecution: true, -}; - -const steps = multisigClient.methods.approveProposal(approveParams); - -for await (const step of steps) { - try { - switch (step.key) { - case ApproveProposalStep.APPROVING: - console.log({ txHash: step.txHash }); - break; - case ApproveProposalStep.DONE: - break; - } - } catch (err) { - console.error(err); - } -} -``` - - -Returns: -```tsx -{ - txHash: "0xb1c14a49...3e8620b0f5832d61c" -} -``` \ No newline at end of file diff --git a/versioned_docs/version-1.3.0/sdk/01-examples/02-multisig-client/06-can-execute.md b/versioned_docs/version-1.3.0/sdk/01-examples/02-multisig-client/06-can-execute.md deleted file mode 100644 index f3f281f4..00000000 --- a/versioned_docs/version-1.3.0/sdk/01-examples/02-multisig-client/06-can-execute.md +++ /dev/null @@ -1,28 +0,0 @@ ---- -title: Check Execution ---- - -## Check if a User Can Execute an Proposal - -Checks whether the signer of the transaction is able to execute actions approved and created by proposals from the Multisig plugin. - -```ts -import { MultisigClient } from "@aragon/sdk-client"; -import { context } from "../index"; - -// Instantiate a Multisig client. -const multisigClient: MultisigClient = new MultisigClient(context); - -const proposalId: string = "0x1234567890123456789012345678901234567890_0x0"; - -// Checks whether the signer of the transaction can execute a given proposal. -const canExecute = await multisigClient.methods.canExecute(proposalId); -console.log(canExecute); -``` - - -Returns: - -``` -true -``` \ No newline at end of file diff --git a/versioned_docs/version-1.3.0/sdk/01-examples/02-multisig-client/07-execute-proposal.md b/versioned_docs/version-1.3.0/sdk/01-examples/02-multisig-client/07-execute-proposal.md deleted file mode 100644 index c46163d0..00000000 --- a/versioned_docs/version-1.3.0/sdk/01-examples/02-multisig-client/07-execute-proposal.md +++ /dev/null @@ -1,44 +0,0 @@ ---- -title: Execute Proposal ---- - -## Execute a Multisig Proposal - -Executes the actions set within a proposal made using the Multisig plugin. - -```ts -import { ExecuteProposalStep, MultisigClient } from "@aragon/sdk-client"; -import { context } from "../index"; - -// Insantiate a plugin context from the Aragon OSx SDK context. - -// Insantiate a Multisig client. -const multisigClient = new MultisigClient(context); - -const proposalId: string = "0x1234567890123456789012345678901234567890_0x0"; - -// Executes the actions of a Multisig proposal. -const steps = multisigClient.methods.executeProposal(proposalId); - -for await (const step of steps) { - try { - switch (step.key) { - case ExecuteProposalStep.EXECUTING: - console.log({ txHash: step.txHash }); - break; - case ExecuteProposalStep.DONE: - break; - } - } catch (err) { - console.error(err); - } -} -``` - - -Returns: -```tsx -{ - txHash: "0xb1c14a49...3e8620b0f5832d61c" -} -``` \ No newline at end of file diff --git a/versioned_docs/version-1.3.0/sdk/01-examples/02-multisig-client/08-get-proposal.md b/versioned_docs/version-1.3.0/sdk/01-examples/02-multisig-client/08-get-proposal.md deleted file mode 100644 index 7fa2501a..00000000 --- a/versioned_docs/version-1.3.0/sdk/01-examples/02-multisig-client/08-get-proposal.md +++ /dev/null @@ -1,67 +0,0 @@ ---- -title: Get Proposal ---- - -## Get a Multisig Proposal by Its ID - -Get the proposal details of a given proposal made using the Multisig plugin. - -```ts -import { MultisigClient, MultisigProposal } from "@aragon/sdk-client"; -import { context } from "../index"; - -// Instantiate a Multisig client -const multisigClient: MultisigClient = new MultisigClient(context); - -const proposalId: string = "0x1234567890123456789012345678901234567890_0x0"; - -const multisigProposal: MultisigProposal | null = await multisigClient.methods - .getProposal(proposalId); -console.log(multisigProposal); -``` - - -Returns: - -``` -{ - id: "0x1234567890123456789012345678901234567890_0x0", - dao: { - address: "0x1234567890123456789012345678901234567890", - name: "Cool DAO" - }, - creatorAddress: "0x1234567890123456789012345678901234567890", - metadata: { - title: "Test Proposal", - summary: "Test Proposal Summary", - description: "This is a long description", - resources: [ - { - url: "https://dicord.com/...", - name: "Discord" - }, - { - url: "https://docs.com/...", - name: "Document" - } - ], - media: { - header: "https://.../image.jpeg", - logo: "https://.../image.jpeg" - } - }, - creationDate: , - actions: [ - { - to: "0x12345..." - value: 10n - data: [12,13,154...] - } - ], - status: "Executed", - approvals: [ - "0x123456789123456789123456789123456789", - "0x234567891234567891234567891234567890" - ] -} -``` \ No newline at end of file diff --git a/versioned_docs/version-1.3.0/sdk/01-examples/02-multisig-client/09-get-proposals.md b/versioned_docs/version-1.3.0/sdk/01-examples/02-multisig-client/09-get-proposals.md deleted file mode 100644 index 0e928cd0..00000000 --- a/versioned_docs/version-1.3.0/sdk/01-examples/02-multisig-client/09-get-proposals.md +++ /dev/null @@ -1,68 +0,0 @@ ---- -title: Get Proposals ---- - -## Get All Multisig Proposals That Have Been Created - -Gets the proposals made using the Multisig plugin for a given DAO. - -```ts -import { - MultisigClient, - MultisigProposalListItem, - ProposalQueryParams, - ProposalSortBy, -} from "@aragon/sdk-client"; -import { ProposalStatus, SortDirection } from "@aragon/sdk-client-common"; -import { context } from "../index"; - -// Instantiate a Multisig client -const multisigClient: MultisigClient = new MultisigClient(context); - -const queryParams: ProposalQueryParams = { - skip: 0, // optional - limit: 10, // optional - direction: SortDirection.ASC, // optional. otherwise, DESC - sortBy: ProposalSortBy.CREATED_AT, //optional. otherwise, NAME, VOTES (POPULARITY coming soon) - status: ProposalStatus.ACTIVE, // optional. otherwise, PENDING, SUCCEEDED, EXECUTED, DEFEATED - daoAddressOrEns: "0x1234348529348570294650287698237520938574284357", // or my-dao.dao.eth -}; - -const multisigProposals: MultisigProposalListItem[] = await multisigClient - .methods.getProposals(queryParams); -console.log(multisigProposals); -``` - - -Returns: - -``` -[ - { - id: "0x12345...", - dao: { - address: "0x1234567890123456789012345678901234567890", - name: "Cool DAO" - }; - creatorAddress: "0x1234567890123456789012345678901234567890", - metadata: { - title: "Test Proposal", - summary: "Test Proposal Summary" - }; - status: "Executed" - }, - { - id: "0x12345...", - dao: { - address: "0x1234567890123456789012345678901234567890", - name: "Cool DAO" - }; - creatorAddress: "0x1234567890123456789012345678901234567890", - metadata: { - title: "Test Proposal 2", - summary: "Test Proposal Summary 2" - }; - status: "Pending" - } -] -``` \ No newline at end of file diff --git a/versioned_docs/version-1.3.0/sdk/01-examples/02-multisig-client/10-get-voting-settings.md b/versioned_docs/version-1.3.0/sdk/01-examples/02-multisig-client/10-get-voting-settings.md deleted file mode 100644 index f2b34651..00000000 --- a/versioned_docs/version-1.3.0/sdk/01-examples/02-multisig-client/10-get-voting-settings.md +++ /dev/null @@ -1,30 +0,0 @@ ---- -title: Get Settings ---- - -## Get the Multisig Plugin Settings - -Get the settings of a Multisig plugin from a specific DAO. - -```ts -import { MultisigClient, MultisigVotingSettings } from "@aragon/sdk-client"; -import { context } from "../index"; - -// Insantiate a Multisig client. -const multisigClient: MultisigClient = new MultisigClient(context); - -const daoAddressorEns: string = "0x12345348523485623984752394854320"; - -const multisigVotingSettings: MultisigVotingSettings = await multisigClient - .methods.getVotingSettings(daoAddressorEns); -console.log(multisigVotingSettings); -``` - - -Returns: -```json -{ - minApprovals: 4, - onlyListed: true -} -``` \ No newline at end of file diff --git a/versioned_docs/version-1.3.0/sdk/01-examples/02-multisig-client/11-get-members.md b/versioned_docs/version-1.3.0/sdk/01-examples/02-multisig-client/11-get-members.md deleted file mode 100644 index 828010dc..00000000 --- a/versioned_docs/version-1.3.0/sdk/01-examples/02-multisig-client/11-get-members.md +++ /dev/null @@ -1,33 +0,0 @@ ---- -title: Get Members ---- - -## Get DAO Members Introduced by the Multisig Plugin - -Gets the list of addresses able to participate in a Multisig proposal for a given DAO that has the Multisig plugin installed. - -```ts -import { MultisigClient } from "@aragon/sdk-client"; -import { context } from "../index"; - -// Instantiate a Multisig plugin client. -const multisigClient: MultisigClient = new MultisigClient(context); - -const daoPluginAddress: string = "0x1234548357023847502348"; // The address of the plugin that DAO has installed. You can find this through calling `getDao(daoAddress)` and getting the DAO details . - -const multisigMembers: string[] = await multisigClient.methods.getMembers( - { pluginAddress: daoPluginAddress }, -); -console.log(multisigMembers); -``` - - -Returns: - -``` -[ - "0x1234567890...", - "0x2345678901...", - "0x3456789012..." -] -``` \ No newline at end of file diff --git a/versioned_docs/version-1.3.0/sdk/01-examples/02-multisig-client/12-pin-metadata.md b/versioned_docs/version-1.3.0/sdk/01-examples/02-multisig-client/12-pin-metadata.md deleted file mode 100644 index 8b9edd98..00000000 --- a/versioned_docs/version-1.3.0/sdk/01-examples/02-multisig-client/12-pin-metadata.md +++ /dev/null @@ -1,46 +0,0 @@ ---- -title: Pin Metadata ---- - -## Add and Pin Metadata for the Multisig plugin - -Adds an pin data into one of the specified IPFS nodes and return a IPFS CID preceded by "ipfs://" - -```ts -import { MultisigClient } from "@aragon/sdk-client"; -import { ProposalMetadata } from "@aragon/sdk-client-common"; -import { context } from "../index"; - -// Instantiate a Multisig plugin client. -const multisigClient: MultisigClient = new MultisigClient(context); - -const metadata: ProposalMetadata = { - title: "Test Proposal", - summary: "This is a short description", - description: "This is a long description", - resources: [ - { - name: "Discord", - url: "https://discord.com/...", - }, - { - name: "Website", - url: "https://website...", - }, - ], - media: { - logo: "https://...", - header: "https://...", - }, -}; - -const metadataUri: string = await multisigClient.methods.pinMetadata(metadata); -console.log(metadataUri); -``` - - -Returns: - -```json -"ipfs://Qm..." -``` \ No newline at end of file diff --git a/versioned_docs/version-1.3.0/sdk/01-examples/02-multisig-client/13-prepare-installation.md b/versioned_docs/version-1.3.0/sdk/01-examples/02-multisig-client/13-prepare-installation.md deleted file mode 100644 index d792b0ea..00000000 --- a/versioned_docs/version-1.3.0/sdk/01-examples/02-multisig-client/13-prepare-installation.md +++ /dev/null @@ -1,71 +0,0 @@ ---- -title: Prepare Installation ---- - -## Prepare the Installation of a Multisig Plugin - -```ts -import { - MultisigClient, - MultisigPluginPrepareInstallationParams, -} from "@aragon/sdk-client"; -import { PrepareInstallationStep } from "@aragon/sdk-client-common"; -import { context } from "../index"; - -// Create an Multisig client. -const multisigClient: MultisigClient = new MultisigClient( - context, -); - -const installationParams: MultisigPluginPrepareInstallationParams = { - settings: { - votingSettings: { - minApprovals: 5, - onlyListed: true, - }, - members: [ - "0x1234567890123456789012345678901234567890", - ], - }, - daoAddressOrEns: "0x1234567890123456789012345678901234567890", -}; -const steps = multisigClient.methods.prepareInstallation(installationParams); -for await (const step of steps) { - switch (step.key) { - case PrepareInstallationStep.PREPARING: - console.log({ txHash: step.txHash }); - break; - case PrepareInstallationStep.DONE: - console.log({ step }); - break; - } -} -``` - - -Returns: -```tsx -{ - txHash: "0xb1c14a49...3e8620b0f5832d61c" -} -{ - step: { - helpers: ["0x12345...", "0x12345..."] - pluginRepo: "0x12345...", - pluginAdddres: "0x12345...", - versionTag: { - build: 1, - release: 1 - }, - permissions: [ - { - condition: "0x12345...", - who: "0x12345...", - where: "0x12345...", - operation: 1, // GRANT - permissionId: "0x1234567890..." - } - ] - } -} -``` \ No newline at end of file diff --git a/versioned_docs/version-1.3.0/sdk/01-examples/02-multisig-client/14-prepare-update.md b/versioned_docs/version-1.3.0/sdk/01-examples/02-multisig-client/14-prepare-update.md deleted file mode 100644 index 383cd7fc..00000000 --- a/versioned_docs/version-1.3.0/sdk/01-examples/02-multisig-client/14-prepare-update.md +++ /dev/null @@ -1,100 +0,0 @@ ---- -title: Prepare Update ---- - -### Prepare the Update of the Multisig plugin - -The `prepareUpdate` method performs the prior steps so that a DAO proposal can eventually apply the the update the multisig plugin. -The proposal will need an Action calling the `applyUpdate` function. - -```ts -import { - MultisigClient, - MultisigPluginPrepareUpdateParams, - PrepareUpdateStep, -} from "@aragon/sdk-client"; -import { context } from "../index"; - -// Instantiate the general purpose client from the Aragon OSx SDK context. -const client: MultisigClient = new MultisigClient(context); - -const updateAbi = [/* ... */]; - -const prepareUpdateParams: MultisigPluginPrepareUpdateParams = { - daoAddressOrEns: "0x1234567890123456789012345678901234567890", // my-dao.dao.eth - pluginAddress: "0x2345678901234567890123456789012345678901", - newVersion: { - build: 2, - release: 1, - }, - updateParams: [ - // Example parameters needed by the plugin's prepareUpdate function - 1234, - "0x1234567890123456789012345678901234567890", - ], - updateAbi, -}; - -// Estimate how much gas the transaction will cost. -const estimatedGas = await client.estimation - .prepareUpdate( - prepareUpdateParams, - ); -console.log({ avg: estimatedGas.average, max: estimatedGas.max }); - -// Deposit the ERC20 tokens. -const steps = client.methods.prepareUpdate(prepareUpdateParams); -for await (const step of steps) { - try { - switch (step.key) { - case PrepareUpdateStep.PREPARING: - console.log({ txHash: step.txHash }); - break; - case PrepareUpdateStep.DONE: - console.log({ - permissions: step.permissions, - pluginAddress: step.pluginAddress, - pluginRepo: step.pluginRepo, - versionTag: step.versionTag, - initData: step.initData, - helpers: step.helpers, - }); - break; - } - } catch (err) { - console.error(err); - } -} -``` - - -Returns: - ```tsx - { - txhash: "0xb1c14a49...3e8620b0f5832d61c" - } - { - permissions: [ - { - operation: 1, // revoke - where: "0x12345...", - who: "0x23456...", - permissionId: "0x1234567890..." - }, - { - operation: 1, //REVOKE - where: "0x3456...", - who: "0x4567...", - permissionId: "0x1234567890..." - } - ], - pluginAddress: "0x1234567890...", - pluginRepo: "0x1234567890...", - initData: Uint8Array(0) [], - versionTag: { - build: 1, - release: 1 - }, - helpers: ["0x12345...", "0x12345..."] - } - ``` \ No newline at end of file diff --git a/versioned_docs/version-1.3.0/sdk/01-examples/02-multisig-client/15-is-member.md b/versioned_docs/version-1.3.0/sdk/01-examples/02-multisig-client/15-is-member.md deleted file mode 100644 index 726954b6..00000000 --- a/versioned_docs/version-1.3.0/sdk/01-examples/02-multisig-client/15-is-member.md +++ /dev/null @@ -1,29 +0,0 @@ ---- -title: Is Member ---- - -### Check if an address is a member of Multisig DAO in a specific block and plugin - -The is member function receives the plugin address and the address to check as parameters and returns a boolean value. - -```ts -import { MultisigClient } from "@aragon/sdk-client"; -import { context } from "../index"; - -// Instantiate the multisig client from the Aragon OSx SDK context. -const client: MultisigClient = new MultisigClient(context); - -const isMember = await client.methods.isMember({ - pluginAddress: "0x2345678901234567890123456789012345678901", - address: "0x1234567890123456789012345678901234567890", - blockNumber: 12345678, -}); - -console.log(isMember); -``` - - -Returns: - ```tsx - true - ``` \ No newline at end of file diff --git a/versioned_docs/version-1.3.0/sdk/01-examples/02-multisig-client/index.md b/versioned_docs/version-1.3.0/sdk/01-examples/02-multisig-client/index.md deleted file mode 100644 index 5bfb6a48..00000000 --- a/versioned_docs/version-1.3.0/sdk/01-examples/02-multisig-client/index.md +++ /dev/null @@ -1,21 +0,0 @@ ---- -title: Multisig Client ---- - -## Create a Multisig Client - -Creating a Multisig plugin Client allows you to access the Multisig plugin from your DAO. -In order to interact with the Multisig plugin, you need to create a `MultisigClient`. This is created using the `ContextPlugin`. - -```ts -import { MultisigClient } from "@aragon/sdk-client"; -import { context } from "../index"; - -// Create a plugin context from the Aragon OSx SDK context. - -// Creates a Multisig plugin client. -const multisigClient: MultisigClient = new MultisigClient(context); -console.log(multisigClient); -``` - - diff --git a/versioned_docs/version-1.3.0/sdk/01-examples/03-tokenVoting-client/01-installation.md b/versioned_docs/version-1.3.0/sdk/01-examples/03-tokenVoting-client/01-installation.md deleted file mode 100644 index 1196d318..00000000 --- a/versioned_docs/version-1.3.0/sdk/01-examples/03-tokenVoting-client/01-installation.md +++ /dev/null @@ -1,139 +0,0 @@ ---- -title: Create Token Voting DAO ---- - -## Create a DAO with a Token Voting Plugin Installed - -Creates a DAO with the TokenVoting plugin installed off the bat. - -```ts -import { - Client, - CreateDaoParams, - DaoCreationSteps, - DaoMetadata, - TokenVotingClient, - TokenVotingPluginInstall, - VotingMode, -} from "@aragon/sdk-client"; -import { GasFeeEstimation } from "@aragon/sdk-client-common"; -import { context } from "../index"; - -// Insantiate the general purpose client from the Aragon OSx SDK context. -const client: Client = new Client(context); - -// You can do different types of installations, depending on your needs. -// For ex, these would be the plugin params if you want to use an already-existing ERC20 token. -const tokenVotingPluginInstallParams1: TokenVotingPluginInstall = { - votingSettings: { - minDuration: 60 * 60 * 24 * 2, // seconds (minimum amount is 3600) - minParticipation: 0.25, // 25% - supportThreshold: 0.5, // 50% - minProposerVotingPower: BigInt("5000"), // default 0 - votingMode: VotingMode.STANDARD, // default standard, other options: EARLY_EXECUTION, VOTE_REPLACEMENT - }, - useToken: { - tokenAddress: "0x23847102387419273491234", // contract address of the token to use as the voting token - wrappedToken: { - name: "Wrapped Token", // the name of your token - symbol: "WTK", // the symbol for your token. shouldn't be more than 5 letters - }, - }, -}; - -// These would be the plugin params if you need to mint a new token for the DAO to enable TokenVoting. -const tokenVotingPluginInstallParams2: TokenVotingPluginInstall = { - votingSettings: { - minDuration: 60 * 60 * 24 * 2, // seconds (minimum amount is 3600) - minParticipation: 0.25, // 25% - supportThreshold: 0.5, // 50% - minProposerVotingPower: BigInt("5000"), // default 0 - votingMode: VotingMode.EARLY_EXECUTION, // default is STANDARD. other options: EARLY_EXECUTION, VOTE_REPLACEMENT - }, - newToken: { - name: "Token", // the name of your token - symbol: "TOK", // the symbol for your token. shouldn't be more than 5 letters - decimals: 18, // the number of decimals your token uses - minter: "0x...", // optional. if you don't define any, we'll use the standard OZ ERC20 contract. Otherwise, you can define your own token minter contract address. - balances: [ - { // Defines the initial balances of the new token - address: "0x2371238740123847102983471022", // address of the account to receive the newly minted tokens - balance: BigInt(10), // amount of tokens that address should receive - }, - { - address: "0x0237123874012384710298347102", - balance: BigInt(10), - }, - { - address: "0x2237123874012384710298347102", - balance: BigInt(10), - }, - ], - }, -}; - -// Creates a TokenVoting plugin client with the parameteres defined above (with an existing token). -const tokenVotingPluginInstallItem1 = TokenVotingClient.encoding - .getPluginInstallItem(tokenVotingPluginInstallParams1, "goerli"); -// Creates a TokenVoting plugin client with the parameteres defined above (with newly minted tokens). -const tokenVotingPluginInstallItem2 = TokenVotingClient.encoding - .getPluginInstallItem(tokenVotingPluginInstallParams2, "goerli"); - -const daoMetadata: DaoMetadata = { - name: "My DAO", - description: "This is a description", - avatar: "", - links: [{ - name: "Web site", - url: "https://...", - }], -}; - -// Pins the DAO's metadata in IPFS to get back the URI. -const metadataUri: string = await client.methods.pinMetadata(daoMetadata); - -const createParams: CreateDaoParams = { - metadataUri, - ensSubdomain: "my-org", // my-org.dao.eth - plugins: [tokenVotingPluginInstallItem1, tokenVotingPluginInstallItem2], // optional, this will determine the plugins installed in your DAO upon creation. 1 is mandatory, more than that is optional based on the DAO's needs. -}; - -// Estimate how much gas the transaction will cost. -const estimatedGas: GasFeeEstimation = await client.estimation.createDao( - createParams, -); -console.log({ avg: estimatedGas.average, max: estimatedGas.max }); - -// Create the DAO with the two token voting plugins installed. This means that the DAO will be able to use either of the two tokens to vote depending on which TokenVoting plugin created the proposal. -const steps = client.methods.createDao(createParams); - -for await (const step of steps) { - try { - switch (step.key) { - case DaoCreationSteps.CREATING: - console.log({ txHash: step.txHash }); - break; - case DaoCreationSteps.DONE: - console.log({ - daoAddress: step.address, - pluginAddresses: step.pluginAddresses, - }); - break; - } - } catch (err) { - console.error(err); - } -} -``` - - -Returns: -```tsx -{ - txHash: "0xb1c14a49...3e8620b0f5832d61c" -} -{ - daoAddress: "0xb1c14a49...3e8620b0f5832d61c", - pluginAddresses: ["0xb1c14a49...3e8620b0f5832d61c", "0xb1c14a49...3e8620b0f5832d61c"] -} -``` \ No newline at end of file diff --git a/versioned_docs/version-1.3.0/sdk/01-examples/03-tokenVoting-client/02-create-proposal.md b/versioned_docs/version-1.3.0/sdk/01-examples/03-tokenVoting-client/02-create-proposal.md deleted file mode 100644 index 2a30ecc2..00000000 --- a/versioned_docs/version-1.3.0/sdk/01-examples/03-tokenVoting-client/02-create-proposal.md +++ /dev/null @@ -1,90 +0,0 @@ ---- -title: Create Proposal ---- - -## Create a Token Voting Proposal - -In order to use the Token Voting governance mechanism within your DAO, you'll want to ensure your DAO has the TokenVoting plugin installed. -Then, you can create proposals using the `createProposal` method in your `TokenVotingClient`. - -```ts -import { - CreateMajorityVotingProposalParams, - ProposalCreationSteps, - TokenVotingClient, - VoteValues, -} from "@aragon/sdk-client"; -import { ProposalMetadata } from "@aragon/sdk-client-common"; -import { context } from "../index"; - -// Create a TokenVoting client. -const tokenVotingClient: TokenVotingClient = new TokenVotingClient( - context, -); - -const metadata: ProposalMetadata = { - title: "Test Proposal", - summary: "This is a short description", - description: "This is a long description", - resources: [ - { - name: "Discord", - url: "https://discord.com/...", - }, - { - name: "Website", - url: "https://website...", - }, - ], - media: { - logo: "https://...", - header: "https://...", - }, -}; - -// Pin the metadata in IPFS to get back the URI. -const metadataUri: string = await tokenVotingClient.methods.pinMetadata( - metadata, -); - -const pluginAddress: string = "0x1234567890123456789012345678901234567890"; // the address of the plugin contract containing all plugin logic. - -const proposalParams: CreateMajorityVotingProposalParams = { - pluginAddress, - metadataUri, - actions: [], - startDate: new Date(), - endDate: new Date(), - executeOnPass: false, - creatorVote: VoteValues.YES, // default NO, other options: ABSTAIN, YES. This saves gas for the voting transaction. -}; - -// Create a proposal where members participate through token voting. -const steps = tokenVotingClient.methods.createProposal(proposalParams); - -for await (const step of steps) { - try { - switch (step.key) { - case ProposalCreationSteps.CREATING: - console.log({ txHash: step.txHash }); - break; - case ProposalCreationSteps.DONE: - console.log({ proposalId: step.proposalId }); - break; - } - } catch (err) { - console.error(err); - } -} -``` - - -Returns: -```tsx -{ - txHash: "0xb1c14a49...3e8620b0f5832d61c" -} -{ - proposalId: "0xb1c14a49...3e862_0x0", -} -``` \ No newline at end of file diff --git a/versioned_docs/version-1.3.0/sdk/01-examples/03-tokenVoting-client/03-create-proposal-with-actions.md b/versioned_docs/version-1.3.0/sdk/01-examples/03-tokenVoting-client/03-create-proposal-with-actions.md deleted file mode 100644 index 9a8444ef..00000000 --- a/versioned_docs/version-1.3.0/sdk/01-examples/03-tokenVoting-client/03-create-proposal-with-actions.md +++ /dev/null @@ -1,98 +0,0 @@ ---- -title: Create Proposal with Action ---- - -## Create a Token Voting Proposal with Actions - -Create a proposal with an action using the TokenVoting plugin as its governance mechanism. -An action is the encoded transaction which will get executed when a proposal passes. - -```ts -import { - CreateMajorityVotingProposalParams, - ProposalCreationSteps, - TokenVotingClient, - VoteValues, - VotingMode, - VotingSettings, -} from "@aragon/sdk-client"; -import { DaoAction } from "@aragon/sdk-client-common"; -import { context } from "../index"; - -// Create a TokenVoting client. -const tokenVotingClient: TokenVotingClient = new TokenVotingClient( - context, -); - -// The contract address of the token voting plugin you have installed in your DAO -const pluginAddress: string = "0x1234567890123456789012345678901234567890"; - -// Update -// [Optional] In case you wanted to pass an action to the proposal, you can configure it here and pass it immediately. An action is the encoded transaction which will get executed when a proposal passes. -// In this example, we are creating an action to change the settings of a governance plugin to demonstrate how to set it up. -const configActionParams: VotingSettings = { - minDuration: 60 * 60 * 24 * 2, // seconds - minParticipation: 0.25, // 25% - supportThreshold: 0.5, // 50% - minProposerVotingPower: BigInt("5000"), // default 0 - votingMode: VotingMode.EARLY_EXECUTION, // default STANDARD, other options: EARLY_EXECUTION, VOTE_REPLACEMENT -}; -// We need to encode the action so it can executed once the proposal passes. -const updatePluginSettingsAction: DaoAction = tokenVotingClient.encoding - .updatePluginSettingsAction(pluginAddress, configActionParams); - -const metadataUri: string = await tokenVotingClient.methods.pinMetadata({ - title: "Test proposal", - summary: "This is a test proposal", - description: "This is the description of a long test proposal", - resources: [ - { - url: "https://thforumurl.com", - name: "Forum", - }, - ], - media: { - header: "https://fileserver.com/header.png", - logo: "https://fileserver.com/logo.png", - }, -}); - -const proposalParams: CreateMajorityVotingProposalParams = { - pluginAddress: "0x1234567890123456789012345678901234567890", // the address of the TokenVoting plugin contract containing all plugin logic. - metadataUri, - actions: [updatePluginSettingsAction], // optional, if none, leave an empty array `[]` - startDate: new Date(), - endDate: new Date(), - executeOnPass: false, - creatorVote: VoteValues.YES, // default NO, other options: ABSTAIN, YES -}; - -// Creates a proposal using the token voting governance mechanism, which executes with the parameters set in the configAction object. -const steps = tokenVotingClient.methods.createProposal(proposalParams); - -for await (const step of steps) { - try { - switch (step.key) { - case ProposalCreationSteps.CREATING: - console.log(step.txHash); - break; - case ProposalCreationSteps.DONE: - console.log(step.proposalId); - break; - } - } catch (err) { - console.error(err); - } -} -``` - - -Returns: -```tsx -{ - txHash: "0xb1c14a49...3e8620b0f5832d61c" -} -{ - proposalId: "0xb1c14a49...3e862_0x0", -} -``` \ No newline at end of file diff --git a/versioned_docs/version-1.3.0/sdk/01-examples/03-tokenVoting-client/04-can-vote.md b/versioned_docs/version-1.3.0/sdk/01-examples/03-tokenVoting-client/04-can-vote.md deleted file mode 100644 index 3fae84c9..00000000 --- a/versioned_docs/version-1.3.0/sdk/01-examples/03-tokenVoting-client/04-can-vote.md +++ /dev/null @@ -1,38 +0,0 @@ ---- -title: Check Voting Rights ---- - -## Check if an Address Can Vote in a Token Voting proposal - -This function returns a boolean indicating whether an address can vote in a specific TokenVoting proposal. - -```ts -import { - CanVoteParams, - TokenVotingClient, - VoteValues, -} from "@aragon/sdk-client"; -import { context } from "../index"; - -// Create an TokenVoting client. -const tokenVotingClient: TokenVotingClient = new TokenVotingClient( - context, -); - -const canVoteParams: CanVoteParams = { - proposalId: "0x1234567890123456789012345678901234567890_0x0", - voterAddressOrEns: "0x1234567890123456789012345678901234567890", // your-plugin.plugin.dao.eth - vote: VoteValues.YES, // alternatively, could be NO or ABSTAIN. -}; - -// Returns true or false depending on whether the address can vote in the specific proposal. -const canVote: boolean = await tokenVotingClient.methods.canVote(canVoteParams); -console.log(canVote); -``` - - -Returns: - -``` -true -``` \ No newline at end of file diff --git a/versioned_docs/version-1.3.0/sdk/01-examples/03-tokenVoting-client/05-vote-on-proposal.md b/versioned_docs/version-1.3.0/sdk/01-examples/03-tokenVoting-client/05-vote-on-proposal.md deleted file mode 100644 index dbb20c11..00000000 --- a/versioned_docs/version-1.3.0/sdk/01-examples/03-tokenVoting-client/05-vote-on-proposal.md +++ /dev/null @@ -1,53 +0,0 @@ ---- -title: Vote ---- - -## Vote on a Token Voting Proposal - -Adds a vote to a proposal using the TokenVoting governance mechanism. -The amount of votes submitted depends on the amount of tokens the signer address has. - -```ts -import { - TokenVotingClient, - VoteProposalParams, - VoteProposalStep, - VoteValues, -} from "@aragon/sdk-client"; -import { context } from "../index"; - -// Create a TokenVoting client. -const tokenVotingClient: TokenVotingClient = new TokenVotingClient( - context, -); - -const voteParams: VoteProposalParams = { - proposalId: "0x1234567890123456789012345678901234567890_0x0", - vote: VoteValues.YES, // alternatively NO, or ABSTAIN -}; - -// Creates a vote on a given proposal created by the token voting governance mechanism. -const steps = tokenVotingClient.methods.voteProposal(voteParams); - -for await (const step of steps) { - try { - switch (step.key) { - case VoteProposalStep.VOTING: - console.log({ txHash: step.txHash }); - break; - case VoteProposalStep.DONE: - break; - } - } catch (err) { - console.error(err); - } -} -``` - - -Returns: -```tsx -{ - txHash: "0xb1c14a49...3e8620b0f5832d61c" -} -``` \ No newline at end of file diff --git a/versioned_docs/version-1.3.0/sdk/01-examples/03-tokenVoting-client/06-can-execute.md b/versioned_docs/version-1.3.0/sdk/01-examples/03-tokenVoting-client/06-can-execute.md deleted file mode 100644 index 27f5b64c..00000000 --- a/versioned_docs/version-1.3.0/sdk/01-examples/03-tokenVoting-client/06-can-execute.md +++ /dev/null @@ -1,30 +0,0 @@ ---- -title: Check Execution ---- - -## Check if a User Can Execute an Proposal - -Checks whether the signer of the transaction is able to execute actions approved and created by proposals from the TokenVoting plugin. - -```ts -import { TokenVotingClient } from "@aragon/sdk-client"; -import { context } from "../index"; - -// Instantiate a TokenVoting client. -const tokenVotingClient: TokenVotingClient = new TokenVotingClient( - context, -); - -const proposalId: string = "0x1234567890123456789012345678901234567890_0x0"; - -// Checks whether the signer of the transaction can execute a given proposal. -const canExecute = await tokenVotingClient.methods.canExecute(proposalId); -console.log(canExecute); -``` - - -Returns: - -``` -true -``` \ No newline at end of file diff --git a/versioned_docs/version-1.3.0/sdk/01-examples/03-tokenVoting-client/07-execute-proposal.md b/versioned_docs/version-1.3.0/sdk/01-examples/03-tokenVoting-client/07-execute-proposal.md deleted file mode 100644 index 83360fbd..00000000 --- a/versioned_docs/version-1.3.0/sdk/01-examples/03-tokenVoting-client/07-execute-proposal.md +++ /dev/null @@ -1,44 +0,0 @@ ---- -title: Execute Proposal ---- - -## Execute a TokenVoting Proposal - -Executes the actions set within a proposal made using the TokenVoting plugin. - -```ts -import { ExecuteProposalStep, TokenVotingClient } from "@aragon/sdk-client"; -import { context } from "../index"; - -// Insantiate a plugin context from the Aragon OSx SDK context. - -// Insantiate a TokenVoting client. -const tokenVotingClient = new TokenVotingClient(context); - -const proposalId: string = "0x1234567890123456789012345678901234567890_0x0"; - -// Executes the actions of a TokenVoting proposal. -const steps = tokenVotingClient.methods.executeProposal(proposalId); - -for await (const step of steps) { - try { - switch (step.key) { - case ExecuteProposalStep.EXECUTING: - console.log({ txHash: step.txHash }); - break; - case ExecuteProposalStep.DONE: - break; - } - } catch (err) { - console.error(err); - } -} -``` - - -Returns: -```tsx -{ - txHash: "0xb1c14a49...3e8620b0f5832d61c" -} -``` \ No newline at end of file diff --git a/versioned_docs/version-1.3.0/sdk/01-examples/03-tokenVoting-client/08-get-proposal.md b/versioned_docs/version-1.3.0/sdk/01-examples/03-tokenVoting-client/08-get-proposal.md deleted file mode 100644 index 8189e16b..00000000 --- a/versioned_docs/version-1.3.0/sdk/01-examples/03-tokenVoting-client/08-get-proposal.md +++ /dev/null @@ -1,105 +0,0 @@ ---- -title: Get Proposal ---- - -## Get a Token Voting Proposal by Its ID - -Gets a specific proposal using the TokenVoting plugin as its governance mechanism. - -```ts -import { TokenVotingClient, TokenVotingProposal } from "@aragon/sdk-client"; -import { context } from "../index"; - -// Instantiate a plugin context from an Aragon OSx SDK context. - -// Create a TokenVoting client. -const tokenVotingClient: TokenVotingClient = new TokenVotingClient( - context, -); - -// The address of the proposal you want to retrieve. -const proposalId: string = "0x1234567890123456789012345678901234567890_0x0"; - -// Get a specific proposal created using the TokenVoting plugin. -const tokenVotingProposal: TokenVotingProposal | null = await tokenVotingClient - .methods - .getProposal(proposalId); -console.log(tokenVotingProposal); -``` - - -Returns: - -``` -{ - id: "0x1234567890123456789012345678901234567890_0x0", - dao: { - address: "0x1234567890123456789012345678901234567890", - name: "Cool DAO" - }, - creatorAddress: "0x1234567890123456789012345678901234567890", - metadata: { - title: "Test Proposal", - summary: "test proposal summary", - description: "this is a long description", - resources: [ - { - url: "https://dicord.com/...", - name: "Discord" - }, - { - url: "https://docs.com/...", - "name: "Document" - } - ], - media: { - header: "https://.../image.jpeg", - logo: "https://.../image.jpeg" - } - }, - startDate: , - endDate: , - creationDate: , - creationBlockNumber: 812345, - executionDate: , - executionBlockNumber: 812345, - actions: [ - { - to: "0x12345..." - value: 10n - data: [12,13,154...] - } - ], - result { - yes: 700000n, - no: 300000n, - abstain: 0n - } - settings:{ - minParticipation: 0.5, - supportThreshold: 0.25, - minDuration: 7200 - }, - token: { - address: "0x1234567890123456789012345678901234567890, - name: "The Token", - symbol: "TOK", - decimals: 18 - }, - usedVotingWeight: 1000000n, - votes: [ - { - address: "0x123456789123456789123456789123456789", - vote: 2, // VoteValues.YES - voteWeight: 700000n - }, - { - address: "0x234567891234567891234567891234567890", - vote: 3, // VoteValues.NO - voteWeight: 300000n - } - ] - status: "Executed" -} - -``` \ No newline at end of file diff --git a/versioned_docs/version-1.3.0/sdk/01-examples/03-tokenVoting-client/09-get-proposals.md b/versioned_docs/version-1.3.0/sdk/01-examples/03-tokenVoting-client/09-get-proposals.md deleted file mode 100644 index 0e185384..00000000 --- a/versioned_docs/version-1.3.0/sdk/01-examples/03-tokenVoting-client/09-get-proposals.md +++ /dev/null @@ -1,97 +0,0 @@ ---- -title: Get Proposals ---- - -## Get All Token Voting Proposals That Have Been Created - -Gets all proposals from a DAO that are created using the TokenVoting plugin as its governance mechanism. - -```ts -import { - ProposalQueryParams, - ProposalSortBy, - TokenVotingClient, - TokenVotingProposalListItem, -} from "@aragon/sdk-client"; -import { ProposalStatus, SortDirection } from "@aragon/sdk-client-common"; -import { context } from "../index"; - -// Create a plugin context from the Aragon SDK. - -// Create a TokenVoting client. -const tokenVotingClient: TokenVotingClient = new TokenVotingClient( - context, -); - -const queryParams: ProposalQueryParams = { - skip: 0, // optional - limit: 10, // optional - direction: SortDirection.ASC, // optional, otherwise DESC ("descending") - sortBy: ProposalSortBy.CREATED_AT, // optional, otherwise NAME, VOTES (POPULARITY coming soon) - status: ProposalStatus.ACTIVE, // optional, otherwise PENDING, SUCCEEDED, EXECUTED, DEFEATED -}; - -const tokenVotingProposals: TokenVotingProposalListItem[] = - await tokenVotingClient.methods.getProposals(queryParams); -console.log(tokenVotingProposals); -``` - - -Returns: - -``` -[ - { - id: "0x12345...", - dao: { - address: "0x1234567890123456789012345678901234567890", - name: "Cool DAO" - }, - creatorAddress: "0x1234567890123456789012345678901234567890", - metadata: { - title: "Test Proposal", - summary: "Test Proposal Summary" - }, - startDate: , - endDate: , - status: "Executed", - token: { - address: "0x1234567890123456789012345678901234567890, - name: "The Token", - symbol: "TOK", - decimals: 18 - }, - results { - yes: 100000n, - no: 77777n, - abstain: 0n - } - }, - { - id: "0x12345...", - dao: { - address: "0x1234567890123456789012345678901234567890", - name: "Cool DAO" - }, - creatorAddress: "0x1234567890123456789012345678901234567890", - metadata: { - title: "Test Proposal 2", - summary: "Test Proposal Summary 2" - }, - startDate: , - endDate: , - status: "Pending", - token: { - address: "0x1234567890123456789012345678901234567890, - name: "The Token", - symbol: "TOK", - decimals: 18 - }, - results { - yes: 100000n, - no: 77777n, - abstain: 0n - } - } -] -``` \ No newline at end of file diff --git a/versioned_docs/version-1.3.0/sdk/01-examples/03-tokenVoting-client/10-get-voting-settings.md b/versioned_docs/version-1.3.0/sdk/01-examples/03-tokenVoting-client/10-get-voting-settings.md deleted file mode 100644 index 166e066b..00000000 --- a/versioned_docs/version-1.3.0/sdk/01-examples/03-tokenVoting-client/10-get-voting-settings.md +++ /dev/null @@ -1,36 +0,0 @@ ---- -title: Get Settings ---- - -## Get the Token Voting Plugin Settings - -Gets the settings defined for a specific TokenVoting plugin governance mechanism installed in a DAO. - -```ts -import { TokenVotingClient, VotingSettings } from "@aragon/sdk-client"; -import { context } from "../index"; - -// Create an Addresslist Client -const tokenVotingClient: TokenVotingClient = new TokenVotingClient( - context, -); - -const pluginAddress: string = "0x1234567890123456789012345678901234567890"; - -const tokenVotingSettings: VotingSettings | null = await tokenVotingClient - .methods.getVotingSettings(pluginAddress); -console.log(tokenVotingSettings); -``` - - -Returns: - -``` -{ - minDuration: 10000, // 10 seconds - minParticipation: 0.25, // 25% - supportThreshold: 0.5, // 50% - minProposerVotingPower: BigInt("5000"), - votingMode: "Standard" -} -``` \ No newline at end of file diff --git a/versioned_docs/version-1.3.0/sdk/01-examples/03-tokenVoting-client/11-get-members.md b/versioned_docs/version-1.3.0/sdk/01-examples/03-tokenVoting-client/11-get-members.md deleted file mode 100644 index 3b163949..00000000 --- a/versioned_docs/version-1.3.0/sdk/01-examples/03-tokenVoting-client/11-get-members.md +++ /dev/null @@ -1,58 +0,0 @@ ---- -title: Get Members ---- - -## Get DAO Members Introduced by the Token Voting Plugin - -Returns an array with the addresses of all the members of a specific DAO which has the TokenVoting plugin installed. - -```ts -import { TokenVotingClient, TokenVotingMember } from "@aragon/sdk-client"; -import { context } from "../index"; - -// Create a TokenVoting client -const tokenVotingClient: TokenVotingClient = new TokenVotingClient( - context, -); - -const pluginAddress: string = "0x12345384572394756239846529574932532985"; // The address of the plugin that DAO has installed. You can find this by calling `getDao(daoAddress)` and getting the DAO details . - -const members: TokenVotingMember[] = await tokenVotingClient.methods.getMembers( - { pluginAddress }, -); -console.log(members); -``` - - -Returns: - -```json -[ - { - "address": "0x1234567890123456789012345678901234567890", - "balance": 100n, - "delegatee": "0x2345678901234567890123456789012345678901", - "votingPower": 0n, - "delegators": [] - }, - { - "address": "0x2345678901234567890123456789012345678901", - "balance": 0n, - "delegatee": null, - "votingPower": 100n, - "delegators": [ - { - "address": "0x1234567890123456789012345678901234567890", - "balance": 100n - } - ] - }, - { - "address": "0x3456789012345678901234567890123456789012", - "balance": 200n, - "delegatee": null, - "votingPower": 200n, - "delegators": [] - } -] -``` \ No newline at end of file diff --git a/versioned_docs/version-1.3.0/sdk/01-examples/03-tokenVoting-client/12-get-token.md b/versioned_docs/version-1.3.0/sdk/01-examples/03-tokenVoting-client/12-get-token.md deleted file mode 100644 index 786dcf52..00000000 --- a/versioned_docs/version-1.3.0/sdk/01-examples/03-tokenVoting-client/12-get-token.md +++ /dev/null @@ -1,65 +0,0 @@ ---- -title: Get Token Details ---- - -## Get Token Details - -Returns the token details used in the TokenVoting plugin for a given DAO. -These are the details of the token used to vote in that specific DAO. - -```ts -import { TokenVotingClient } from "@aragon/sdk-client"; -import { context } from "../index"; - -// Create a TokenVoting client. -const tokenVotingClient: TokenVotingClient = new TokenVotingClient( - context, -); - -// The address of the TokenVoting plugin whose token you want to retrieve details about. -const pluginAddress: string = "0x1234567890123456789012345678901234567890"; - -// Get the token details used in the TokenVoting plugin for a given DAO. -// ERC721 Token coming soon! -const tokenDetails = await tokenVotingClient.methods.getToken(pluginAddress); -console.log(tokenDetails); -``` - - -Returns: - -``` -{ - type: 'erc20', - address: "0x1234567890987654323112345678900987654321", - name: "Token", - symbol: "TOK", - decimals: 18 -} -``` -Or: -``` -{ - address: '0x1234567890987654323112345678900987654321', - name: 'Wrapped Token', - symbol: 'wTOK', - decimals: 18, - underlyingToken: { - address: '0x012345678900098765432311234567890098765432', - name: 'Token', - symbol: 'TOK', - decimals: 18, - type: 'erc20' - }, - type: 'erc20' -} -``` -Or: -``` -{ - type: 'erc721', - address: "0x1234567890987654323112345678900987654321", - name: "Token", - symbol: "TOK" -} -``` \ No newline at end of file diff --git a/versioned_docs/version-1.3.0/sdk/01-examples/03-tokenVoting-client/13-pin-metadata.md b/versioned_docs/version-1.3.0/sdk/01-examples/03-tokenVoting-client/13-pin-metadata.md deleted file mode 100644 index 1a46ef2e..00000000 --- a/versioned_docs/version-1.3.0/sdk/01-examples/03-tokenVoting-client/13-pin-metadata.md +++ /dev/null @@ -1,51 +0,0 @@ ---- -title: Pin Metadata ---- - -## Add and Pin Metadata - -Adds and pins data with into one of the specified IPFS nodes and return an IPFS CID preceded by "ipfs://". - -```ts -import { TokenVotingClient } from "@aragon/sdk-client"; -import { ProposalMetadata } from "@aragon/sdk-client-common"; -import { context } from "../index"; - -// Create an TokenVoting client. -const tokenVotingClient: TokenVotingClient = new TokenVotingClient( - context, -); - -const metadata: ProposalMetadata = { - title: "Test Proposal", - summary: "This is a short description", - description: "This is a long description", - resources: [ - { - name: "Discord", - url: "https://discord.com/...", - }, - { - name: "Website", - url: "https://website...", - }, - ], - media: { - logo: "https://...", - header: "https://...", - }, -}; - -// Pin the metadata in IPFS to get back the URI. -const metadataUri: string = await tokenVotingClient.methods.pinMetadata( - metadata, -); -console.log(metadataUri); -``` - - -Returns: - -```json -"ipfs://Qm..." -``` \ No newline at end of file diff --git a/versioned_docs/version-1.3.0/sdk/01-examples/03-tokenVoting-client/14-prepare-installation.md b/versioned_docs/version-1.3.0/sdk/01-examples/03-tokenVoting-client/14-prepare-installation.md deleted file mode 100644 index 55dfb022..00000000 --- a/versioned_docs/version-1.3.0/sdk/01-examples/03-tokenVoting-client/14-prepare-installation.md +++ /dev/null @@ -1,83 +0,0 @@ ---- -title: Prepare Installation ---- - -## Prepare the Installation of a Token Voting Plugin - -```ts -import { - TokenVotingClient, - TokenVotingPluginPrepareInstallationParams, - VotingMode, -} from "@aragon/sdk-client"; -import { PrepareInstallationStep } from "@aragon/sdk-client-common"; -import { context } from "../index"; - -// Create an TokenVoting client. -const tokenVotingClient: TokenVotingClient = new TokenVotingClient( - context, -); - -const installationParams: TokenVotingPluginPrepareInstallationParams = { - settings: { - votingSettings: { - supportThreshold: 0.5, - minParticipation: 0.5, - minDuration: 7200, - minProposerVotingPower: BigInt(1), - votingMode: VotingMode.STANDARD, - }, - newToken: { - name: "test", - decimals: 18, - symbol: "TST", - balances: [ - { - address: "0x1234567890123456789012345678901234567890", - balance: BigInt(10), - }, - ], - }, - }, - daoAddressOrEns: "0x1234567890123456789012345678901234567890", -}; -const steps = tokenVotingClient.methods.prepareInstallation(installationParams); -for await (const step of steps) { - switch (step.key) { - case PrepareInstallationStep.PREPARING: - console.log(step.txHash); - break; - case PrepareInstallationStep.DONE: - console.log({ step }); - break; - } -} -``` - - -Returns: -```tsx -{ - txHash: "0xb1c14a49...3e8620b0f5832d61c" -} -{ - step: { - helpers: ["0x12345...", "0x12345..."] - pluginRepo: "0x12345...", - pluginAdddres: "0x12345...", - versionTag: { - build: 1, - release: 1 - }, - permissions: [ - { - condition: "0x12345...", - who: "0x12345...", - where: "0x12345...", - operation: 1, // GRANT - permissionId: "0x1234567890..." - } - ] - } -} -``` \ No newline at end of file diff --git a/versioned_docs/version-1.3.0/sdk/01-examples/03-tokenVoting-client/15-wrap-tokens.md b/versioned_docs/version-1.3.0/sdk/01-examples/03-tokenVoting-client/15-wrap-tokens.md deleted file mode 100644 index cc807230..00000000 --- a/versioned_docs/version-1.3.0/sdk/01-examples/03-tokenVoting-client/15-wrap-tokens.md +++ /dev/null @@ -1,76 +0,0 @@ ---- -title: Wrap Tokens ---- - -## Wrap ERC-20 tokens - -```ts -import { - Client, - SetAllowanceSteps, - TokenVotingClient, - WrapTokensStep, -} from "@aragon/sdk-client"; -import { context } from "../index"; - -// Create a TokenVoting client. -const tokenVotingClient: TokenVotingClient = new TokenVotingClient( - context, -); -// Create a TokenVoting client. -const client: Client = new Client( - context, -); - -const amount = BigInt(10); -const wrappedTokenAddress = "0x1234567890123456789012345678901234567890"; -const tokenAddress = "0x2345678901234567890123456789012345678901"; - -// must give the wrapped token contract allowance to wrap the tokens -const setAllowanceSteps = client.methods.setAllowance({ - amount, - spender: wrappedTokenAddress, - tokenAddress, -}); -for await (const step of setAllowanceSteps) { - try { - switch (step.key) { - case SetAllowanceSteps.SETTING_ALLOWANCE: - console.log(step.txHash); - break; - case SetAllowanceSteps.ALLOWANCE_SET: - console.log(step.allowance); - break; - } - } catch (err) { - console.error(err); - } -} - -const wrapTokenSteps = tokenVotingClient.methods.wrapTokens( - { - wrappedTokenAddress, - amount, - }, -); - -for await (const step of wrapTokenSteps) { - try { - switch (step.key) { - case WrapTokensStep.WRAPPING: - console.log(step.txHash); - break; - case WrapTokensStep.DONE: - break; - } - } catch (err) { - console.error(err); - } -} -``` - - -Returns: - ```tsx - "0xb1c14a49...3e8620b0f5832d61c" - ``` \ No newline at end of file diff --git a/versioned_docs/version-1.3.0/sdk/01-examples/03-tokenVoting-client/16-unwrap-tokens.md b/versioned_docs/version-1.3.0/sdk/01-examples/03-tokenVoting-client/16-unwrap-tokens.md deleted file mode 100644 index ff282e73..00000000 --- a/versioned_docs/version-1.3.0/sdk/01-examples/03-tokenVoting-client/16-unwrap-tokens.md +++ /dev/null @@ -1,45 +0,0 @@ ---- -title: Unwrap Tokens ---- - -## Unwrap ERC-20 tokens - -```ts -import { TokenVotingClient, UnwrapTokensStep } from "@aragon/sdk-client"; -import { context } from "../index"; - -// Create a TokenVoting client. -const tokenVotingClient: TokenVotingClient = new TokenVotingClient( - context, -); - -const amount = BigInt(10); -const wrappedTokenAddress = "0x1234567890123456789012345678901234567890"; - -const wrapTokenSteps = tokenVotingClient.methods.unwrapTokens( - { - wrappedTokenAddress, - amount, - }, -); - -for await (const step of wrapTokenSteps) { - try { - switch (step.key) { - case UnwrapTokensStep.UNWRAPPING: - console.log(step.txHash); - break; - case UnwrapTokensStep.DONE: - break; - } - } catch (err) { - console.error(err); - } -} -``` - - -Returns: - ```tsx - "0xb1c14a49...3e8620b0f5832d61c" - ``` \ No newline at end of file diff --git a/versioned_docs/version-1.3.0/sdk/01-examples/03-tokenVoting-client/17-delegate-tokens.md b/versioned_docs/version-1.3.0/sdk/01-examples/03-tokenVoting-client/17-delegate-tokens.md deleted file mode 100644 index bb5e7a35..00000000 --- a/versioned_docs/version-1.3.0/sdk/01-examples/03-tokenVoting-client/17-delegate-tokens.md +++ /dev/null @@ -1,50 +0,0 @@ ---- -title: Delegate Tokens ---- - -## Delegates yout token voting power to another address - -Delegates your token voting power to another address. To recover yout voting power back just delegate to your own address. - -```ts -import { - DelegateTokensParams, - DelegateTokensStep, - TokenVotingClient, -} from "@aragon/sdk-client"; -import { context } from "../index"; - -// Instantiate the general purpose client from the Aragon OSx SDK context. - -// Create a TokenVoting client. -const tokenVotingClient: TokenVotingClient = new TokenVotingClient( - context, -); - -const delegateTokensParams: DelegateTokensParams = { - delegatee: "0x1234567890123456789012345678901234567890", - tokenAddress: "0x1234567890123456789012345678901234567890", // token contract adddress -}; - -const steps = tokenVotingClient.methods.delegateTokens(delegateTokensParams); - -for await (const step of steps) { - try { - switch (step.key) { - case DelegateTokensStep.DELEGATING: - console.log(step.txHash); - break; - case DelegateTokensStep.DONE: - break; - } - } catch (err) { - console.error(err); - } -} -``` - - -Returns: - ```ts - "0xb1c14a49...3e8620b0f5832d61c" - ``` \ No newline at end of file diff --git a/versioned_docs/version-1.3.0/sdk/01-examples/03-tokenVoting-client/18-undelegate-tokens.md b/versioned_docs/version-1.3.0/sdk/01-examples/03-tokenVoting-client/18-undelegate-tokens.md deleted file mode 100644 index 58b0bfba..00000000 --- a/versioned_docs/version-1.3.0/sdk/01-examples/03-tokenVoting-client/18-undelegate-tokens.md +++ /dev/null @@ -1,43 +0,0 @@ ---- -title: Undelegate Tokens ---- - -## Undelegates yout token voting power from the delegatee address - -This is the same as delegating to your own address. - -```ts -import { TokenVotingClient, UndelegateTokensStep } from "@aragon/sdk-client"; -import { context } from "../index"; - -// Instantiate the general purpose client from the Aragon OSx SDK context. - -// Create a TokenVoting client. -const tokenVotingClient: TokenVotingClient = new TokenVotingClient( - context, -); - -const tokenAddress = "0x1234567890123456789012345678901234567890"; - -const steps = tokenVotingClient.methods.undelegateTokens(tokenAddress); - -for await (const step of steps) { - try { - switch (step.key) { - case UndelegateTokensStep.UNDELEGATING: - console.log(step.txHash); - break; - case UndelegateTokensStep.DONE: - break; - } - } catch (err) { - console.error(err); - } -} -``` - - -Returns: - ```ts - "0xb1c14a49...3e8620b0f5832d61c" - ``` \ No newline at end of file diff --git a/versioned_docs/version-1.3.0/sdk/01-examples/03-tokenVoting-client/19-get-delegate.md b/versioned_docs/version-1.3.0/sdk/01-examples/03-tokenVoting-client/19-get-delegate.md deleted file mode 100644 index f80223da..00000000 --- a/versioned_docs/version-1.3.0/sdk/01-examples/03-tokenVoting-client/19-get-delegate.md +++ /dev/null @@ -1,31 +0,0 @@ ---- -title: Get Delegatee ---- - -## Get the address of the signer delegatee of a specific token - -Get the address of the signer delegatee.If the signer has not delegated their voting power, it will return null. - -```ts -import { TokenVotingClient } from "@aragon/sdk-client"; -import { context } from "../index"; - -// Instantiate the general purpose client from the Aragon OSx SDK context. - -// Create a TokenVoting client. -const tokenVotingClient: TokenVotingClient = new TokenVotingClient( - context, -); - -const tokenAddress = "0x1234567890123456789012345678901234567890"; // token contract adddress - -const delegatee = tokenVotingClient.methods.getDelegatee(tokenAddress); - -console.log(delegatee); -``` - - -Returns: - ```ts - "0x1234567890123456789012345678901234567890" // null if the signer has not delegated their voting power - ``` \ No newline at end of file diff --git a/versioned_docs/version-1.3.0/sdk/01-examples/03-tokenVoting-client/20-is-governance-token-compatible.md b/versioned_docs/version-1.3.0/sdk/01-examples/03-tokenVoting-client/20-is-governance-token-compatible.md deleted file mode 100644 index b7043e06..00000000 --- a/versioned_docs/version-1.3.0/sdk/01-examples/03-tokenVoting-client/20-is-governance-token-compatible.md +++ /dev/null @@ -1,34 +0,0 @@ ---- -title: Is TokenVoting compatible token ---- - -## Check if a token is compatible with the TokenVoting Plugin as an underlying token - -Check if a token is compatible with the TokenVoting Plugin as an underlying token. This means that the token is ERC20 and ERC165 compliant and has the required methods for the TokenVoting Plugin to work. - -```ts -import { TokenVotingClient } from "@aragon/sdk-client"; -import { context } from "../index"; - -// Instantiate the general purpose client from the Aragon OSx SDK context. - -// Create a TokenVoting client. -const tokenVotingClient: TokenVotingClient = new TokenVotingClient( - context, -); - -const tokenAddress = "0x1234567890123456789012345678901234567890"; // token contract adddress - -const compatibility = tokenVotingClient.methods.isTokenVotingCompatibleToken(tokenAddress); - -console.log(compatibility); -``` - - -Returns: - ```ts - // "compatible" if is erc20 and erc165 - // "needsWrap" if is erc20 and not erc165 or compatible with voting - // "incompatible" if is not erc20 - compatible - ``` \ No newline at end of file diff --git a/versioned_docs/version-1.3.0/sdk/01-examples/03-tokenVoting-client/21-prepare-update.md b/versioned_docs/version-1.3.0/sdk/01-examples/03-tokenVoting-client/21-prepare-update.md deleted file mode 100644 index e607fc04..00000000 --- a/versioned_docs/version-1.3.0/sdk/01-examples/03-tokenVoting-client/21-prepare-update.md +++ /dev/null @@ -1,100 +0,0 @@ ---- -title: Prepare Update ---- - -### Prepare the Update of the TokenVoting plugin - -The `prepareUpdate` method performs the prior steps so that a DAO proposal can eventually apply the the update the TokenVoting plugin. -The proposal will need an Action calling the `applyUpdate` function. - -```ts -import { - PrepareUpdateStep, - TokenVotingClient, - TokenVotingPluginPrepareUpdateParams, -} from "@aragon/sdk-client"; -import { context } from "../index"; - -// Instantiate the general purpose client from the Aragon OSx SDK context. -const client: TokenVotingClient = new TokenVotingClient(context); - -const updateAbi = [/* ... */]; - -const prepareUpdateParams: TokenVotingPluginPrepareUpdateParams = { - daoAddressOrEns: "0x1234567890123456789012345678901234567890", // my-dao.dao.eth - pluginAddress: "0x2345678901234567890123456789012345678901", - newVersion: { - build: 2, - release: 1, - }, - updateParams: [ - // Example parameters needed by the plugin's prepareUpdate function - 1234, - "0x1234567890123456789012345678901234567890", - ], - updateAbi, -}; - -// Estimate how much gas the transaction will cost. -const estimatedGas = await client.estimation - .prepareUpdate( - prepareUpdateParams, - ); -console.log({ avg: estimatedGas.average, max: estimatedGas.max }); - -// Deposit the ERC20 tokens. -const steps = client.methods.prepareUpdate(prepareUpdateParams); -for await (const step of steps) { - try { - switch (step.key) { - case PrepareUpdateStep.PREPARING: - console.log({ txHash: step.txHash }); - break; - case PrepareUpdateStep.DONE: - console.log({ - permissions: step.permissions, - pluginAddress: step.pluginAddress, - pluginRepo: step.pluginRepo, - versionTag: step.versionTag, - initData: step.initData, - helpers: step.helpers, - }); - break; - } - } catch (err) { - console.error(err); - } -} -``` - - -Returns: - ```tsx - { - txhash: "0xb1c14a49...3e8620b0f5832d61c" - } - { - permissions: [ - { - operation: 1, // revoke - where: "0x12345...", - who: "0x23456...", - permissionId: "0x1234567890..." - }, - { - operation: 1, //REVOKE - where: "0x3456...", - who: "0x4567...", - permissionId: "0x1234567890..." - } - ], - pluginAddress: "0x1234567890...", - pluginRepo: "0x1234567890...", - initData: Uint8Array(0) [], - versionTag: { - build: 1, - release: 1 - }, - helpers: ["0x12345...", "0x12345..."] - } - ``` \ No newline at end of file diff --git a/versioned_docs/version-1.3.0/sdk/01-examples/03-tokenVoting-client/22-is-member.md b/versioned_docs/version-1.3.0/sdk/01-examples/03-tokenVoting-client/22-is-member.md deleted file mode 100644 index c2983c20..00000000 --- a/versioned_docs/version-1.3.0/sdk/01-examples/03-tokenVoting-client/22-is-member.md +++ /dev/null @@ -1,29 +0,0 @@ ---- -title: Is Member ---- - -### Check if an address is a member of TokenVoting DAO in a specific block and plugin - -The is member function receives the plugin address and the address to check as parameters and returns a boolean value. - -```ts -import { TokenVotingClient } from "@aragon/sdk-client"; -import { context } from "../index"; - -// Instantiate the token voting client from the Aragon OSx SDK context. -const client: TokenVotingClient = new TokenVotingClient(context); - -const isMember = await client.methods.isMember({ - pluginAddress: "0x2345678901234567890123456789012345678901", - address: "0x1234567890123456789012345678901234567890", - blockNumber: 12345678, -}); - -console.log(isMember); -``` - - -Returns: - ```tsx - true - ``` \ No newline at end of file diff --git a/versioned_docs/version-1.3.0/sdk/01-examples/03-tokenVoting-client/index.md b/versioned_docs/version-1.3.0/sdk/01-examples/03-tokenVoting-client/index.md deleted file mode 100644 index b06525a8..00000000 --- a/versioned_docs/version-1.3.0/sdk/01-examples/03-tokenVoting-client/index.md +++ /dev/null @@ -1,24 +0,0 @@ ---- -title: Token Voting Client ---- - -## Create a Token Voting Client - -The `TokenVoting` plugin allows token holders to create and vote on proposals. -The token contract created by the TokenVoting setup contract follow OpenZeppelin's ERC20Votes standard: https://docs.openzeppelin.com/contracts/4.x/api/token/erc20#ERC20Votes - -In order to interact with the `TokenVoting` plugin, you need to create a `TokenVotingClient`. -This is created using the `ContextPlugin` which grants us access to plugins within the SDK. - -```ts -import { TokenVotingClient } from "@aragon/sdk-client"; -import { context } from "../index"; - -// Instantiate the ContextPlugin from the Aragon OSx SDK context. - -// Create a TokenVoting client. -const tokenVotingClient = new TokenVotingClient(context); -console.log(tokenVotingClient); -``` - - diff --git a/versioned_docs/version-1.3.0/sdk/01-examples/04-addresslistVoting-client/01-installation.md b/versioned_docs/version-1.3.0/sdk/01-examples/04-addresslistVoting-client/01-installation.md deleted file mode 100644 index f79178e9..00000000 --- a/versioned_docs/version-1.3.0/sdk/01-examples/04-addresslistVoting-client/01-installation.md +++ /dev/null @@ -1,106 +0,0 @@ ---- -title: Create Addresslist Voting DAO ---- - -## Create a DAO with a Addresslist Voting Plugin Installed - -The Addresslist governance plugin enables DAOs to preset an address list of approved addresses that can vote on proposals. This plugin is useful for DAOs that want to have a fixed list of addresses that can vote on proposals, without them necessarily having to own any specific tokens. - -In order to create a DAO with a AddresslistVoting plugin, you need to first, encode the instructions for installing the plugin, based also on the pararmeters you define. -Then, use those encoded instructions when creating your DAO. - -```ts -import { - AddresslistVotingClient, - AddresslistVotingPluginInstall, - Client, - CreateDaoParams, - DaoCreationSteps, - DaoMetadata, - VotingMode, -} from "@aragon/sdk-client"; -import { GasFeeEstimation } from "@aragon/sdk-client-common"; -import { context } from "../index"; - -// Instantiate a client from the Aragon OSx SDK context. -const client: Client = new Client(context); - -// Define the plugins to install and their params. -const addresslistVotingPluginInstallParams: AddresslistVotingPluginInstall = { - votingSettings: { - minDuration: 60 * 60 * 24 * 2, // seconds - minParticipation: 0.25, // 25% - supportThreshold: 0.5, // 50% - minProposerVotingPower: BigInt("5000"), // default 0 - votingMode: VotingMode.VOTE_REPLACEMENT, // default is STANDARD. other options: EARLY_EXECUTION, VOTE_REPLACEMENT - }, - addresses: [ - "0x1234567890123456789012345678901234567890", - "0x2345678901234567890123456789012345678901", - "0x3456789012345678901234567890123456789012", - "0x4567890123456789012345678901234567890123", - ], -}; - -// Encodes the plugin instructions for installing into the DAO with its defined parameters. -const addresslistVotingPluginInstallItem = AddresslistVotingClient - .encoding.getPluginInstallItem(addresslistVotingPluginInstallParams, "goerli"); - -const daoMetadata: DaoMetadata = { - name: "My DAO", - description: "This is a description", - avatar: "", - links: [{ - name: "Web site", - url: "https://...", - }], -}; - -// Pin metadata to IPFS, returns IPFS CID string. -const metadataUri: string = await client.methods.pinMetadata(daoMetadata); - -const createParams: CreateDaoParams = { - metadataUri, - ensSubdomain: "my-org", // my-org.dao.eth - plugins: [addresslistVotingPluginInstallItem], -}; - -// Estimate gas for the transaction. -const estimatedGas: GasFeeEstimation = await client.estimation.createDao( - createParams, -); -console.log({ avg: estimatedGas.average, max: estimatedGas.max }); - -// Creates a DAO with a Multisig plugin installed. -const steps = client.methods.createDao(createParams); - -for await (const step of steps) { - try { - switch (step.key) { - case DaoCreationSteps.CREATING: - console.log({ txHash: step.txHash }); - break; - case DaoCreationSteps.DONE: - console.log({ - daoAddress: step.address, - pluginAddresses: step.pluginAddresses, - }); - break; - } - } catch (err) { - console.error(err); - } -} -``` - - -Returns: -```tsx -{ - txHash: "0xb1c14a49...3e8620b0f5832d61c" -} -{ - daoAddress: "0xb1c14a49...3e8620b0f5832d61c", - pluginAddresses: ["0xb1c14a49...3e8620b0f5832d61c", "0xb1c14a49...3e8620b0f5832d61c"] -} -``` \ No newline at end of file diff --git a/versioned_docs/version-1.3.0/sdk/01-examples/04-addresslistVoting-client/02-create-proposal.md b/versioned_docs/version-1.3.0/sdk/01-examples/04-addresslistVoting-client/02-create-proposal.md deleted file mode 100644 index df35da8e..00000000 --- a/versioned_docs/version-1.3.0/sdk/01-examples/04-addresslistVoting-client/02-create-proposal.md +++ /dev/null @@ -1,89 +0,0 @@ ---- -title: Create Proposal ---- - -## Create an Addresslist Voting Proposal - -Creates a proposal for a DAO with the Addresslist Voting plugin installed. -Within this proposal, only addresses in the approved list of the Addresslist Voting plugin can vote. - -```ts -import { - AddresslistVotingClient, - CreateMajorityVotingProposalParams, - ProposalCreationSteps, - VoteValues, -} from "@aragon/sdk-client"; -import { ProposalMetadata } from "@aragon/sdk-client-common"; -import { context } from "../index"; - -// Create a plugin context from the Aragon OSx SDK context. - -// Create an AddresslistVoting client. -const addresslistVotingClient = new AddresslistVotingClient(context); - -const metadata: ProposalMetadata = { - title: "Test Proposal", - summary: "This is a short description", - description: "This is a long description", - resources: [ - { - name: "Discord", - url: "https://discord.com/...", - }, - { - name: "Website", - url: "https://website...", - }, - ], - media: { - logo: "https://...", - header: "https://...", - }, -}; - -const metadataUri: string = await addresslistVotingClient.methods.pinMetadata( - metadata, -); - -const pluginAddress = "0x1234567890123456789012345678901234567890"; // the address of the AddresslistVoting plugin installed into the DAO. - -const proposalParams: CreateMajorityVotingProposalParams = { - pluginAddress, - metadataUri, - actions: [], - failSafeActions: [], - startDate: new Date(), - endDate: new Date(), - executeOnPass: false, - creatorVote: VoteValues.YES, // otherwise NO or ABSTAIN -}; - -const steps = addresslistVotingClient.methods.createProposal(proposalParams); - -for await (const step of steps) { - try { - switch (step.key) { - case ProposalCreationSteps.CREATING: - console.log({ txHash: step.txHash }); - break; - case ProposalCreationSteps.DONE: - console.log({ proposalId: step.proposalId }); - break; - } - } catch (err) { - console.error(err); - } -} -``` - - -Returns: -```tsx -{ - txHash: "0xb1c14a49...3e8620b0f5832d61c" -} -{ - proposalId: "0xb1c14a49...3e862_0x0", -} -``` \ No newline at end of file diff --git a/versioned_docs/version-1.3.0/sdk/01-examples/04-addresslistVoting-client/03-create-proposal-with-actions.md b/versioned_docs/version-1.3.0/sdk/01-examples/04-addresslistVoting-client/03-create-proposal-with-actions.md deleted file mode 100644 index d0ed651a..00000000 --- a/versioned_docs/version-1.3.0/sdk/01-examples/04-addresslistVoting-client/03-create-proposal-with-actions.md +++ /dev/null @@ -1,107 +0,0 @@ ---- -title: Create Proposal with Actions ---- - -## Create a Token Voting Proposal with Actions - -Creates a proposal with an action(s) to get executed upon the proposal passes. Within this proposal, only addresses in the approved list of the AddresslistVoting plugin can vote. - -```ts -import { - AddresslistVotingClient, - CreateMajorityVotingProposalParams, - MajorityVotingSettings, - ProposalCreationSteps, - VoteValues, - VotingMode, -} from "@aragon/sdk-client"; -import { ProposalMetadata } from "@aragon/sdk-client-common"; -import { context } from "../index"; - -// Create a plugin context from the Aragon OSx SDK context. - -// Create an AddresslistVoting client from the Aragon OSx SDK context. -const addresslistVotingClient: AddresslistVotingClient = - new AddresslistVotingClient(context); - -// [Optional] You can add encoded actions to the proposal. These actions are the encoded transactions which will be executed when a transaction passes. -// In this example, we are updating the plugin settings as an action that you may want upon a proposal approval. -const updatePluginSettingsParams: MajorityVotingSettings = { - minDuration: 60 * 60 * 24 * 2, // seconds - minParticipation: 0.25, // 25% - supportThreshold: 0.5, // 50% - minProposerVotingPower: BigInt("5000"), // default 0 - votingMode: VotingMode.EARLY_EXECUTION, // alternatively, STANDARD or VOTE_REPLACEMENT -}; - -const pluginAddress = "0x1234567890123456789012345678901234567890"; // the address of the plugin contract itself - -// Sets up the action instructions based on the above parameters. -const updatePluginSettingsAction = addresslistVotingClient.encoding - .updatePluginSettingsAction( - pluginAddress, - updatePluginSettingsParams, - ); - -const daoMetadata: ProposalMetadata = { - title: "Test Proposal", - summary: "This is a short description", - description: "This is a long descrioption", - resources: [ - { - name: "Discord", - url: "https://discord.com/...", - }, - { - name: "Website", - url: "https://website...", - }, - ], - media: { - logo: "https://...", - header: "https://...", - }, -}; - -const metadataUri: string = await addresslistVotingClient.methods.pinMetadata( - daoMetadata, -); - -const proposalParams: CreateMajorityVotingProposalParams = { - pluginAddress: "0x1234567890123456789012345678901234567890", // the address of the AddresslistVoting plugin contract installed in the DAO - metadataUri, - actions: [updatePluginSettingsAction], // the action you want to have executed upon a proposal approval - startDate: new Date(), - endDate: new Date(), - executeOnPass: false, - creatorVote: VoteValues.YES, // otherwise NO or ABSTAIN -}; - -const steps = addresslistVotingClient.methods.createProposal(proposalParams); - -for await (const step of steps) { - try { - switch (step.key) { - case ProposalCreationSteps.CREATING: - console.log({ txHash: step.txHash }); - break; - case ProposalCreationSteps.DONE: - console.log({ proposalId: step.proposalId }); - break; - } - } catch (err) { - console.error(err); - } -} -``` - - -Returns: -```tsx -{ - txHash: "0xb1c14a49...3e8620b0f5832d61c" -} -{ - proposalId: "0xb1c14a49...3e862_0x0", -} -``` \ No newline at end of file diff --git a/versioned_docs/version-1.3.0/sdk/01-examples/04-addresslistVoting-client/04-can-vote.md b/versioned_docs/version-1.3.0/sdk/01-examples/04-addresslistVoting-client/04-can-vote.md deleted file mode 100644 index 33301b2a..00000000 --- a/versioned_docs/version-1.3.0/sdk/01-examples/04-addresslistVoting-client/04-can-vote.md +++ /dev/null @@ -1,37 +0,0 @@ ---- -title: Check Voting Rights ---- - -## Check if an Address Can Vote in a Addresslist Voting proposal - -Checks whether an address is able to participate in a DAO proposal created using the Addresslist Voting plugin. - -```ts -import { - AddresslistVotingClient, - CanVoteParams, - VoteValues, -} from "@aragon/sdk-client"; -import { context } from "../index"; - -// Instantiate a plugin context from the Aragon OSx SDK context - -// Create an AddresslistVoting client -const addresslistVotingClient = new AddresslistVotingClient(context); - -const canVoteParams: CanVoteParams = { - voterAddressOrEns: "0x1234567890123456789012345678901234567890", // the address who's potential to vote you want to check - proposalId: "0x1234567890123456789012345678901234567890_0x0", - vote: VoteValues.YES, // this doesn't execute the vote itself, simply checks whether that address can execute that vote. VoteValues can be NO, YES, or ABSTAIN -}; - -const canVote = await addresslistVotingClient.methods.canVote(canVoteParams); -console.log(canVote); -``` - - -Returns: - -```json -true -``` \ No newline at end of file diff --git a/versioned_docs/version-1.3.0/sdk/01-examples/04-addresslistVoting-client/05-vote-proposal.md b/versioned_docs/version-1.3.0/sdk/01-examples/04-addresslistVoting-client/05-vote-proposal.md deleted file mode 100644 index 88030a55..00000000 --- a/versioned_docs/version-1.3.0/sdk/01-examples/04-addresslistVoting-client/05-vote-proposal.md +++ /dev/null @@ -1,53 +0,0 @@ ---- -title: Vote ---- - -## Vote on a Addresslist Voting Proposal - -Enables voting on a proposal using the Addresslist Voting plugin installed within a DAO. - -```ts -import { - AddresslistVotingClient, - VoteProposalParams, - VoteProposalStep, - VoteValues, -} from "@aragon/sdk-client"; -import { context } from "../index"; - -// Create a plugin context from the Aragon OSx SDK context. - -// Create an Addresslist client to use the Addresslist plugin. -const addresslistVotingClient: AddresslistVotingClient = - new AddresslistVotingClient(context); - -const voteParams: VoteProposalParams = { - proposalId: "0x1234567890123456789012345678901234567890_0x0", - vote: VoteValues.YES, // alternatively NO, or ABSTAIN -}; - -// Vote on an Addresslist proposal. -const steps = addresslistVotingClient.methods.voteProposal(voteParams); - -for await (const step of steps) { - try { - switch (step.key) { - case VoteProposalStep.VOTING: - console.log({ txHash: step.txHash }); - break; - case VoteProposalStep.DONE: - break; - } - } catch (err) { - console.error({ err }); - } -} -``` - - -Returns: -```tsx -{ - txHash: "0xb1c14a49...3e8620b0f5832d61c" -} -``` \ No newline at end of file diff --git a/versioned_docs/version-1.3.0/sdk/01-examples/04-addresslistVoting-client/06-can-execute.md b/versioned_docs/version-1.3.0/sdk/01-examples/04-addresslistVoting-client/06-can-execute.md deleted file mode 100644 index 27f5b64c..00000000 --- a/versioned_docs/version-1.3.0/sdk/01-examples/04-addresslistVoting-client/06-can-execute.md +++ /dev/null @@ -1,30 +0,0 @@ ---- -title: Check Execution ---- - -## Check if a User Can Execute an Proposal - -Checks whether the signer of the transaction is able to execute actions approved and created by proposals from the TokenVoting plugin. - -```ts -import { TokenVotingClient } from "@aragon/sdk-client"; -import { context } from "../index"; - -// Instantiate a TokenVoting client. -const tokenVotingClient: TokenVotingClient = new TokenVotingClient( - context, -); - -const proposalId: string = "0x1234567890123456789012345678901234567890_0x0"; - -// Checks whether the signer of the transaction can execute a given proposal. -const canExecute = await tokenVotingClient.methods.canExecute(proposalId); -console.log(canExecute); -``` - - -Returns: - -``` -true -``` \ No newline at end of file diff --git a/versioned_docs/version-1.3.0/sdk/01-examples/04-addresslistVoting-client/07-execute-proposal.md b/versioned_docs/version-1.3.0/sdk/01-examples/04-addresslistVoting-client/07-execute-proposal.md deleted file mode 100644 index 740ff73f..00000000 --- a/versioned_docs/version-1.3.0/sdk/01-examples/04-addresslistVoting-client/07-execute-proposal.md +++ /dev/null @@ -1,44 +0,0 @@ ---- -title: Execution Proposal ---- - -## Execute a TokenVoting Proposal - -Executes the actions set within a proposal made using the TokenVoting plugin. - -```ts -import { ExecuteProposalStep, TokenVotingClient } from "@aragon/sdk-client"; -import { context } from "../index"; - -// Insantiate a plugin context from the Aragon OSx SDK context. - -// Insantiate a TokenVoting client. -const tokenVotingClient = new TokenVotingClient(context); - -const proposalId: string = "0x1234567890123456789012345678901234567890_0x0"; - -// Executes the actions of a TokenVoting proposal. -const steps = tokenVotingClient.methods.executeProposal(proposalId); - -for await (const step of steps) { - try { - switch (step.key) { - case ExecuteProposalStep.EXECUTING: - console.log({ txHash: step.txHash }); - break; - case ExecuteProposalStep.DONE: - break; - } - } catch (err) { - console.error(err); - } -} -``` - - -Returns: -```tsx -{ - txHash: "0xb1c14a49...3e8620b0f5832d61c" -} -``` \ No newline at end of file diff --git a/versioned_docs/version-1.3.0/sdk/01-examples/04-addresslistVoting-client/08-get-proposal.md b/versioned_docs/version-1.3.0/sdk/01-examples/04-addresslistVoting-client/08-get-proposal.md deleted file mode 100644 index f955907e..00000000 --- a/versioned_docs/version-1.3.0/sdk/01-examples/04-addresslistVoting-client/08-get-proposal.md +++ /dev/null @@ -1,94 +0,0 @@ ---- -title: Get Proposal ---- - -## Get a Addresslist Voting Proposal by Its ID - -Gets a proposal created using the Addresslist Voting plugin. - -```ts -import { - AddresslistVotingClient, - AddresslistVotingProposal, -} from "@aragon/sdk-client"; -import { context } from "../index"; - -// Instantiates a plugin context from the Aragon OSx SDK context. - -// Instantiates an AddresslistVoting client. -const addresslistVotingClient: AddresslistVotingClient = - new AddresslistVotingClient(context); - -const proposalId: string = "0x1234567890123456789012345678901234567890_0x0"; - -const addresslistVotingProposal: AddresslistVotingProposal | null = - await addresslistVotingClient.methods.getProposal(proposalId); -console.log(addresslistVotingProposal); -``` - - -Returns: - -``` -{ - id: "0x1234567890123456789012345678901234567890_0x0", - dao: { - address: "0x1234567890123456789012345678901234567890", - name: "Cool DAO" - }, - creatorAddress: "0x1234567890123456789012345678901234567890", - metadata: { - title: "Test Proposal", - summary: "test proposal summary", - description: "this is a long description", - resources: [ - { - url: "https://dicord.com/...", - name: "Discord" - }, - { - url: "https://docs.com/...", - name: "Document" - } - ], - media: { - header: "https://.../image.jpeg", - logo: "https://.../image.jpeg" - } - }, - startDate: , - endDate: , - creationDate: , - creationBlockNumber: 812345, - executionDate: , - executionBlockNumber: 812345, - actions: [ - { - to: "0x12345..." - value: 10n - data: [12,13,154...] - } - ], - status: "Executed", - result { - yes: 1, - no: 1, - abstain: 0 - } - settings: { - minParticipation: 0.5, - supportThreshold: 0.25, - minDuration: 7200 - }, - votes: [ - { - address: "0x123456789123456789123456789123456789", - vote: 2 // VoteValues.YES - }, - { - address: "0x234567891234567891234567891234567890", - vote: 3 // VoteValues.NO - } - ] -} -``` \ No newline at end of file diff --git a/versioned_docs/version-1.3.0/sdk/01-examples/04-addresslistVoting-client/09-get-proposals.md b/versioned_docs/version-1.3.0/sdk/01-examples/04-addresslistVoting-client/09-get-proposals.md deleted file mode 100644 index 47d2c039..00000000 --- a/versioned_docs/version-1.3.0/sdk/01-examples/04-addresslistVoting-client/09-get-proposals.md +++ /dev/null @@ -1,82 +0,0 @@ ---- -title: Get Proposals ---- - -## Get All Addresslist Voting Proposals That Have Been Created - -Gets the list of proposals created using the Addresslist Voting plugin. - -```ts -import { - AddresslistVotingClient, - AddresslistVotingProposalListItem, - ProposalQueryParams, - ProposalSortBy, -} from "@aragon/sdk-client"; -import { ProposalStatus, SortDirection } from "@aragon/sdk-client-common"; -import { context } from "../index"; - -// Instantiate an AddresslistVoting client. -const addresslistVotingClient: AddresslistVotingClient = - new AddresslistVotingClient(context); - -const queryParams: ProposalQueryParams = { - skip: 0, // optional - limit: 10, // optional, - direction: SortDirection.ASC, // optional - sortBy: ProposalSortBy.CREATED_AT, //optional, alternatively NAME, VOTES (POPULARITY coming soon) - status: ProposalStatus.ACTIVE, // optional, alternatively PENDING, SUCCEEDED, EXECUTED, DEFEATED -}; - -const addresslistVotingProposals: AddresslistVotingProposalListItem[] = - await addresslistVotingClient.methods.getProposals(queryParams); -console.log(addresslistVotingProposals); -``` - - -Returns: - -```json -[ - { - id: "0x12345...", - dao: { - address: "0x1234567890123456789012345678901234567890", - name: "Cool DAO" - }, - creatorAddress: "0x1234567890123456789012345678901234567890", - metadata: { - title: "Test Proposal", - summary: "test proposal summary" - }, - startDate: , - endDate: , - status: "Executed", - results { - yes: 100000n, - no: 77777n, - abstain: 0n - } - }, - { - id: "0x12345...", - dao: { - address: "0x1234567890123456789012345678901234567890", - name: "Cool DAO" - }, - creatorAddress: "0x1234567890123456789012345678901234567890", - metadata: { - title: "Test Proposal 2", - summary: "test proposal summary 2" - }, - startDate: , - endDate: , - status: "Pending", - results { - yes: 100000n, - no: 77777n, - abstain: 0n - } - } -] -``` \ No newline at end of file diff --git a/versioned_docs/version-1.3.0/sdk/01-examples/04-addresslistVoting-client/10-get-voting-settings.md b/versioned_docs/version-1.3.0/sdk/01-examples/04-addresslistVoting-client/10-get-voting-settings.md deleted file mode 100644 index fec53278..00000000 --- a/versioned_docs/version-1.3.0/sdk/01-examples/04-addresslistVoting-client/10-get-voting-settings.md +++ /dev/null @@ -1,35 +0,0 @@ ---- -title: Get Settings ---- - -## Get the Addresslist Voting Plugin Settings - -Get the settings established for a given AddresslistVoting plugin. - -```ts -import { AddresslistVotingClient, VotingSettings } from "@aragon/sdk-client"; -import { context } from "../index"; - -// Instantiate an AddresslistVoting client. -const addresslistVotingClient: AddresslistVotingClient = - new AddresslistVotingClient(context); - -const pluginAddress: string = "0x1234567890123456789012345678901234567890"; // the address of the AddresslistVoting plugin contract installed in the DAO. - -const addresslistVotingSettings: VotingSettings | null = - await addresslistVotingClient.methods.getVotingSettings(pluginAddress); -console.log(addresslistVotingSettings); -``` - - -Returns: - -```json -{ - minDuration: 60 * 60 * 24 * 2, // seconds - minParticipation: 0.25, // 25% - supportThreshold: 0.5, // 50% - minProposerVotingPower: BigInt("5000"), // default 0 - votingMode: "Standard" // default STANDARD, otherwise EARLY_EXECUTION or VOTE_REPLACEMENT -} - ``` \ No newline at end of file diff --git a/versioned_docs/version-1.3.0/sdk/01-examples/04-addresslistVoting-client/11-get-members.md b/versioned_docs/version-1.3.0/sdk/01-examples/04-addresslistVoting-client/11-get-members.md deleted file mode 100644 index d58b9766..00000000 --- a/versioned_docs/version-1.3.0/sdk/01-examples/04-addresslistVoting-client/11-get-members.md +++ /dev/null @@ -1,38 +0,0 @@ ---- -title: Get Members ---- - -## Get DAO Members Introduced by the Addresslist Voting Plugin - -Gets an array of all addresses able to vote in a specific AddresslistVoting DAO proposal. - -```ts -import { AddresslistVotingClient } from "@aragon/sdk-client"; -import { context } from "../index"; - -// Instantiates a plugin context from the Aragon OSx SDK context. - -// Instantiates an AddressList client. -const addresslistVotingClient: AddresslistVotingClient = - new AddresslistVotingClient(context); - -const daoPluginAddress = "0x12345382947301297439127433492834"; // The address of the plugin that DAO has installed. You can find this by calling `getDao(daoAddress)` and getting the DAO details . - -const members: string[] = await addresslistVotingClient.methods.getMembers( - { pluginAddress: daoPluginAddress }, -); -console.log({ members }); -``` - - -Returns: - -```json -[ - "0x1234567890123456789012345678901234567890", - "0x2345678901234567890123456789012345678901", - "0x3456789012345678901234567890123456789012", - "0x4567890123456789012345678901234567890123", - "0x5678901234567890123456789012345678901234" -] -``` \ No newline at end of file diff --git a/versioned_docs/version-1.3.0/sdk/01-examples/04-addresslistVoting-client/12-pin-metadata.md b/versioned_docs/version-1.3.0/sdk/01-examples/04-addresslistVoting-client/12-pin-metadata.md deleted file mode 100644 index 3d2fd25f..00000000 --- a/versioned_docs/version-1.3.0/sdk/01-examples/04-addresslistVoting-client/12-pin-metadata.md +++ /dev/null @@ -1,46 +0,0 @@ ---- -title: Pin Metadata ---- - -## Add and Pin Metadata - -Adds and pin data into one of the specified IPFS nodes and return a IPFS CID preceded by "ipfs://". - -```ts -import { AddresslistVotingClient } from "@aragon/sdk-client"; -import { ProposalMetadata } from "@aragon/sdk-client-common"; -import { context } from "../index"; - -// Instantiate an AddresslistVoting plugin client. -const addresslistVotingClient: AddresslistVotingClient = - new AddresslistVotingClient(context); - -const proposalMetadata: ProposalMetadata = { - title: "Test Proposal", - summary: "This is a short description", - description: "This is a long description", - resources: [ - { - name: "Discord", - url: "https://discord.com/...", - }, - { - name: "Website", - url: "https://website...", - }, - ], - media: { - logo: "https://...", - header: "https://...", - }, -}; - -const proposalMetadataUri: string = await addresslistVotingClient.methods - .pinMetadata(proposalMetadata); -console.log(proposalMetadataUri); -``` - - -```javascript -"ipfs://Qm..." -``` \ No newline at end of file diff --git a/versioned_docs/version-1.3.0/sdk/01-examples/04-addresslistVoting-client/13-prepare-installation.md b/versioned_docs/version-1.3.0/sdk/01-examples/04-addresslistVoting-client/13-prepare-installation.md deleted file mode 100644 index 7a15c93c..00000000 --- a/versioned_docs/version-1.3.0/sdk/01-examples/04-addresslistVoting-client/13-prepare-installation.md +++ /dev/null @@ -1,75 +0,0 @@ ---- -title: Prepare Installation ---- - -## Prepare the Installation of a Addresslist Voting Plugin - -```ts -import { - AddresslistVotingPluginPrepareInstallationParams, - TokenVotingClient, - VotingMode, -} from "@aragon/sdk-client"; -import { PrepareInstallationStep } from "@aragon/sdk-client-common"; -import { context } from "../index"; - -// Create an TokenVoting client. -const tokenVotingClient: TokenVotingClient = new TokenVotingClient( - context, -); - -const installationParams: AddresslistVotingPluginPrepareInstallationParams = { - settings: { - votingSettings: { - supportThreshold: 0.5, - minParticipation: 0.5, - minDuration: 7200, - minProposerVotingPower: BigInt(1), - votingMode: VotingMode.STANDARD, - }, - addresses: [ - "0x1234567890123456789012345678901234567890", - ], - }, - daoAddressOrEns: "0x1234567890123456789012345678901234567890", -}; -const steps = tokenVotingClient.methods.prepareInstallation(installationParams); -for await (const step of steps) { - switch (step.key) { - case PrepareInstallationStep.PREPARING: - console.log(step.txHash); - break; - case PrepareInstallationStep.DONE: - console.log({ step }); - break; - } -} -``` - - -Returns: -```tsx -{ - txHash: "0xb1c14a49...3e8620b0f5832d61c" -} -{ - step:{ - helpers: ["0x12345...", "0x12345..."] - pluginRepo: "0x12345...", - pluginAdddres: "0x12345...", - versionTag: { - build: 1, - release: 1 - }, - permissions: [ - { - condition: "0x12345...", - who: "0x12345...", - where: "0x12345...", - operation: 1, // GRANT - permissionId: "0x1234567890..." - } - ] - } -} -``` \ No newline at end of file diff --git a/versioned_docs/version-1.3.0/sdk/01-examples/04-addresslistVoting-client/14-prepare-update.md b/versioned_docs/version-1.3.0/sdk/01-examples/04-addresslistVoting-client/14-prepare-update.md deleted file mode 100644 index c914a843..00000000 --- a/versioned_docs/version-1.3.0/sdk/01-examples/04-addresslistVoting-client/14-prepare-update.md +++ /dev/null @@ -1,100 +0,0 @@ ---- -title: Prepare Update ---- - -### Prepare the Update of the AddresslistVoting plugin - -The `prepareUpdate` method performs the prior steps so that a DAO proposal can eventually apply the the update the AddresslistVoting plugin. -The proposal will need an Action calling the `applyUpdate` function. - -```ts -import { - AddresslistVotingClient, - AddresslistVotingPluginPrepareUpdateParams, - PrepareUpdateStep, -} from "@aragon/sdk-client"; -import { context } from "../index"; - -// Instantiate the general purpose client from the Aragon OSx SDK context. -const client: AddresslistVotingClient = new AddresslistVotingClient(context); - -const updateAbi = [/* ... */]; - -const prepareUpdateParams: AddresslistVotingPluginPrepareUpdateParams = { - daoAddressOrEns: "0x1234567890123456789012345678901234567890", // my-dao.dao.eth - pluginAddress: "0x2345678901234567890123456789012345678901", - newVersion: { - build: 2, - release: 1, - }, - updateParams: [ - // Example parameters needed by the plugin's prepareUpdate function - 1234, - "0x1234567890123456789012345678901234567890", - ], - updateAbi, -}; - -// Estimate how much gas the transaction will cost. -const estimatedGas = await client.estimation - .prepareUpdate( - prepareUpdateParams, - ); -console.log({ avg: estimatedGas.average, max: estimatedGas.max }); - -// Deposit the ERC20 tokens. -const steps = client.methods.prepareUpdate(prepareUpdateParams); -for await (const step of steps) { - try { - switch (step.key) { - case PrepareUpdateStep.PREPARING: - console.log({ txHash: step.txHash }); - break; - case PrepareUpdateStep.DONE: - console.log({ - permissions: step.permissions, - pluginAddress: step.pluginAddress, - pluginRepo: step.pluginRepo, - versionTag: step.versionTag, - initData: step.initData, - helpers: step.helpers, - }); - break; - } - } catch (err) { - console.error(err); - } -} -``` - - -Returns: - ```tsx - { - txhash: "0xb1c14a49...3e8620b0f5832d61c" - } - { - permissions: [ - { - operation: 1, // revoke - where: "0x12345...", - who: "0x23456...", - permissionId: "0x1234567890..." - }, - { - operation: 1, //REVOKE - where: "0x3456...", - who: "0x4567...", - permissionId: "0x1234567890..." - } - ], - pluginAddress: "0x1234567890...", - pluginRepo: "0x1234567890...", - initData: Uint8Array(0) [], - versionTag: { - build: 1, - release: 1 - }, - helpers: ["0x12345...", "0x12345..."] - } - ``` \ No newline at end of file diff --git a/versioned_docs/version-1.3.0/sdk/01-examples/04-addresslistVoting-client/15-is-member.md b/versioned_docs/version-1.3.0/sdk/01-examples/04-addresslistVoting-client/15-is-member.md deleted file mode 100644 index 9ed32c6f..00000000 --- a/versioned_docs/version-1.3.0/sdk/01-examples/04-addresslistVoting-client/15-is-member.md +++ /dev/null @@ -1,29 +0,0 @@ ---- -title: Is Member ---- - -### Check if an address is a member of an Addresslist DAO in a specific block and plugin - -The is member function receives the plugin address and the address to check as parameters and returns a boolean value. - -```ts -import { AddresslistVotingClient } from "@aragon/sdk-client"; -import { context } from "../index"; - -// Instantiate the addresslist voting client from the Aragon OSx SDK context. -const client: AddresslistVotingClient = new AddresslistVotingClient(context); - -const isMember = await client.methods.isMember({ - pluginAddress: "0x2345678901234567890123456789012345678901", - address: "0x1234567890123456789012345678901234567890", - blockNumber: 12345678, -}); - -console.log(isMember); -``` - - -Returns: - ```tsx - true - ``` \ No newline at end of file diff --git a/versioned_docs/version-1.3.0/sdk/01-examples/04-addresslistVoting-client/index.md b/versioned_docs/version-1.3.0/sdk/01-examples/04-addresslistVoting-client/index.md deleted file mode 100644 index f62aed3b..00000000 --- a/versioned_docs/version-1.3.0/sdk/01-examples/04-addresslistVoting-client/index.md +++ /dev/null @@ -1,19 +0,0 @@ ---- -title: Addresslist Voting Client ---- - -## Create an Addresslist Voting Client - -Creates an AddresslistVoting client allowing you to access the AddresslistVoting plugin functionality. - -```ts -import { AddresslistVotingClient } from "@aragon/sdk-client"; -import { context } from "../index"; - -// Instantiate an AddresslistVoting client from the Aragon OSx SDK context. -const addresslistVotingClient: AddresslistVotingClient = - new AddresslistVotingClient(context); -console.log(addresslistVotingClient); -``` - - diff --git a/versioned_docs/version-1.3.0/sdk/01-examples/05-encoders-decoders/01-find-interface.md b/versioned_docs/version-1.3.0/sdk/01-examples/05-encoders-decoders/01-find-interface.md deleted file mode 100644 index d03a3b29..00000000 --- a/versioned_docs/version-1.3.0/sdk/01-examples/05-encoders-decoders/01-find-interface.md +++ /dev/null @@ -1,32 +0,0 @@ ---- -title: Get Function Parameters ---- - -## Get Function Parameters from an Encoded Action - -Decodes the parameters of a function call. - -```ts -import { Client } from "@aragon/sdk-client"; -import { context } from "../index"; - -// Instantiates an Aragon OSx SDK client. -const client: Client = new Client(context); - -const data: Uint8Array = new Uint8Array([12, 56]); - -// Decodes the parameters of a function call. -const functionParams = client.decoding.findInterface(data); -console.log(functionParams); -``` - - -Returns: - -```json -{ - id: "function functionName(param1, param2)" - functionName: "functionName" - hash: "0x12345678" -} -``` \ No newline at end of file diff --git a/versioned_docs/version-1.3.0/sdk/01-examples/05-encoders-decoders/02-grant-permission.md b/versioned_docs/version-1.3.0/sdk/01-examples/05-encoders-decoders/02-grant-permission.md deleted file mode 100644 index 60f27cc4..00000000 --- a/versioned_docs/version-1.3.0/sdk/01-examples/05-encoders-decoders/02-grant-permission.md +++ /dev/null @@ -1,72 +0,0 @@ ---- -title: Grant Permissions ---- - -## Grant a Permission - -Grants permission with the name (`permission`) to an address (`who`) to perform on a target contract (`where`). - -### Encoding - -```ts -import { - Client, - GrantPermissionDecodedParams, - GrantPermissionParams, - Permissions, -} from "@aragon/sdk-client"; -import { DaoAction } from "@aragon/sdk-client-common"; -import { context } from "../index"; - -// Instantiates an Aragon OSx SDK client. -const client: Client = new Client(context); - -const params: GrantPermissionParams = { - who: "0x1234567890123456789012345678901234567890", - where: "0x1234567890123456789012345678901234567890", - permission: Permissions.UPGRADE_PERMISSION, -}; - -const daoAddress: string = "0x1234567890123456789012345678901234567890"; - -const action: DaoAction = await client.encoding.grantAction(daoAddress, params); -console.log({ action }); -``` - - -Returns: - -```json -{ action: - { - to: "0x1234567890...", - value: 0n, - data: Uint8Array[12,34,45...] - } -} -``` - -### Decoding - -```ts -// Decodes the data of a grant permission action. -const decodedParams: GrantPermissionDecodedParams = client.decoding - .grantAction( - action.data, - ); -console.log({ decodedParams }); -``` - - -Returns: - -```json -{ decodedParams: - { - who: "0x1234567890...", - where: "0x1234567890...", - permission: "UPGRADE_PERMISSION", - permissionId: "0x12345..." - } -} -``` \ No newline at end of file diff --git a/versioned_docs/version-1.3.0/sdk/01-examples/05-encoders-decoders/03-grant-with-condition.md b/versioned_docs/version-1.3.0/sdk/01-examples/05-encoders-decoders/03-grant-with-condition.md deleted file mode 100644 index f47d5322..00000000 --- a/versioned_docs/version-1.3.0/sdk/01-examples/05-encoders-decoders/03-grant-with-condition.md +++ /dev/null @@ -1,76 +0,0 @@ ---- -title: Grant Conditional Permission ---- - -## Grant a Conditional Permission - -Grants permission with the name (`permission`) to an address (`who`) to perform on a target contract (`where`) with a condition (`condition`) defined by a contract. - -### Encoding - -```ts -import { - Client, - GrantPermissionWithConditionParams, - Permissions, -} from "@aragon/sdk-client"; -import { DaoAction } from "@aragon/sdk-client-common"; -import { context } from "../index"; - -// Instantiates an Aragon OSx SDK client. -const client: Client = new Client(context); - -const params: GrantPermissionWithConditionParams = { - who: "0x1234567890123456789012345678901234567890", // address to which the permission will be granted - where: "0x2345678901234567890123456789012345678901", // where the permission is granted - permission: Permissions.EXECUTE_PERMISSION, // the permission to grant - condition: "0x3456789012345678901234567890123456789012", // the contract address of the condition which needs to be met in order for the permission to be granted -}; - -const dao: string = "0x123123123123123123123123123123123123"; // or "my-dao" for my-dao.dao.eth address - -const action: DaoAction = client.encoding.grantWithConditionAction(dao, params); -console.log({ action }); -``` - - -Returns: -```json -{ action: - { - to: "0x123123123...", - value: 0n, - data: Uint8Array[12,34,45...] - } -} -``` - -```ts - -``` - - -### Decoding - -```ts -const decodedParams: GrantPermissionWithConditionParams = client.decoding - .grantWithConditionAction( - action.data, - ); -console.log({ decodedParams }); -``` - - -Returns: - -``` -{ decodedParams: - { - where: "0x1234567890...", - who: "0x2345678901...", - permission: "UPGRADE_PERMISSION" - condition: "0x3456789012..." - permissionId: "0x12345..." - } -} -``` \ No newline at end of file diff --git a/versioned_docs/version-1.3.0/sdk/01-examples/05-encoders-decoders/04-revoke-permissions.md b/versioned_docs/version-1.3.0/sdk/01-examples/05-encoders-decoders/04-revoke-permissions.md deleted file mode 100644 index 6fbdd405..00000000 --- a/versioned_docs/version-1.3.0/sdk/01-examples/05-encoders-decoders/04-revoke-permissions.md +++ /dev/null @@ -1,76 +0,0 @@ ---- -title: Revoke Permissions ---- - -## Revoke a Permission - -Revokes a permission to a given address (`who`) to perform an action on a contract (`where`). - -### Encoding - -```ts -import { - Client, - Permissions, - RevokePermissionDecodedParams, - RevokePermissionParams, -} from "@aragon/sdk-client"; -import { DaoAction } from "@aragon/sdk-client-common"; -import { context } from "../index"; - -// Instantiates an Aragon OSx SDK client. -const client: Client = new Client(context); - -const params: RevokePermissionParams = { - who: "0x1234567890123456789012345678901234567890", - where: "0x1234567890123456789012345678901234567890", - permission: Permissions.UPGRADE_PERMISSION, // other options: SET_METADATA_PERMISSION, EXECUTE_PERMISSION, WITHDRAW_PERMISSION, SET_SIGNATURE_VALIDATOR_PERMISSION, SET_TRUSTED_FORWARDER_PERMISSION, ROOT_PERMISSION, CREATE_VERSION_PERMISSION, REGISTER_PERMISSION, REGISTER_DAO_PERMISSION, REGISTER_ENS_SUBDOMAIN_PERMISSION, MINT_PERMISSION, MERKLE_MINT_PERMISSION, MODIFY_ALLOWLIST_PERMISSION, SET_CONFIGURATION_PERMISSION -}; - -const daoAddress: string = "0x1234567890123456789012345678901234567890"; - -// Revokes a permission to a given address to perform an action on a contract. -const action: DaoAction = await client.encoding.revokeAction( - daoAddress, - params, -); -console.log({ action }); -``` - - -Returns: - -```json -{ action: - { - to: "0x1234567890...", - value: 0n; - data: Uint8Array[12,34,45...] - } -} -``` - -### Decoding - -```ts -// Decodes the action of a revoke permission transaction. -const decodedParams: RevokePermissionDecodedParams = client.decoding - .revokeAction( - action.data, - ); -console.log({ decodedParams }); -``` - - -Returns: - -```json -{ decodedParams: - { - who: "0x1234567890...", - where: "0x1234567890...", - permission: "UPGRADE_PERMISSION", - permissionId: "0x12345..." - } -} -``` \ No newline at end of file diff --git a/versioned_docs/version-1.3.0/sdk/01-examples/05-encoders-decoders/05-register-standard-callback.md b/versioned_docs/version-1.3.0/sdk/01-examples/05-encoders-decoders/05-register-standard-callback.md deleted file mode 100644 index 0d2575c7..00000000 --- a/versioned_docs/version-1.3.0/sdk/01-examples/05-encoders-decoders/05-register-standard-callback.md +++ /dev/null @@ -1,71 +0,0 @@ ---- -title: Register Callback ---- - -## Register a New Standard Callback - -Register a new standard callback for the DAO. - -### Encoding - -```ts -import { Client, RegisterStandardCallbackParams } from "@aragon/sdk-client"; -import { DaoAction } from "@aragon/sdk-client-common"; -import { context } from "../index"; - -// Instantiates a general purpose Client from the Aragon OSx SDK context. -const client: Client = new Client(context); - -const params = { - interfaceId: "0x3134r1er213740123741207831238410972347", - callbackSelector: "0x382741239807410892375182734892", - magicNumber: "0x12192304781237401321329450123321", -}; - -const dao: string = "0x123123123123123123123123123123123123"; - -const action: DaoAction = client.encoding.registerStandardCallbackAction( - dao, - params, -); -console.log({ action }); -``` - - -Returns: - -```json -{ action: - { - to: "0x123123123...", - value: 0n, - data: Uint8Array[12,34,45...] - } -} -``` - -```ts - -``` - - -### Decoding - -```ts -const decodedParams: RegisterStandardCallbackParams = client.decoding - .registerStandardCallbackAction(action.data); -console.log({ decodedParams }); -``` - - -Returns: - -``` -{ decodedParams: - { - interfaceId: "0x12345678", - callbackSelector: "0x23456789", - magicNumber: "0x34567890" - } -} -``` \ No newline at end of file diff --git a/versioned_docs/version-1.3.0/sdk/01-examples/05-encoders-decoders/06-withdraw.md b/versioned_docs/version-1.3.0/sdk/01-examples/05-encoders-decoders/06-withdraw.md deleted file mode 100644 index 2e9ff0fa..00000000 --- a/versioned_docs/version-1.3.0/sdk/01-examples/05-encoders-decoders/06-withdraw.md +++ /dev/null @@ -1,226 +0,0 @@ ---- -title: Withdraw Tokens ---- - -## Withdraw Tokens From a DAO Vault - -:::info -This page is Work in progress. -::: - -Withdraws tokens from a DAO's vault and transfers them to another address. -In order for a withdrawal to be successful, the address executing it must have `WITHDRAW` permissions. - -### Native Tokens - -#### Encoding - -```ts -import { Client, WithdrawParams } from "@aragon/sdk-client"; -import { DaoAction, TokenType } from "@aragon/sdk-client-common"; -import { context } from "../index"; - -// Instantiates an Aragon OSx SDK client. -const client: Client = new Client(context); - -let params: WithdrawParams = { - type: TokenType.NATIVE, // "native" for ETH, otherwise use "ERC20" or "ERC721" for ERC-20 or ERC-721 Tokens, - amount: BigInt(10), // the amount in wei to withdraw - recipientAddressOrEns: "0x1234567890123456789012345678901234567890", // the address to transfer the funds to -}; - -// Withdraws ETH from a given DAO and transfers them to another address. -const nativeWithdrawAction: DaoAction = await client.encoding.withdrawAction( - params, -); -console.log({ nativeWithdrawAction }); -``` - - -Returns: - -```json -{ nativeWithdrawAction: - { - to: "0x1234567890...", - value: 0n; - data: Uint8Array[12,34,45...] - } -} -``` -#### Decoding - -```ts -// Decodes the withdraw action. -const nativeDecodedParams: WithdrawParams = client.decoding.withdrawAction( - nativeWithdrawAction.to, - nativeWithdrawAction.value, - nativeWithdrawAction.data, -); -console.log({ nativeDecodedParams }); -``` - - -Returns: - -```json -{ nativeDecodedParams: - { - type: "native", - recipientAddressOrEns: "0x1234567890123456789012345678901234567890", - amount: 10n, - } -} -``` - -```ts - -``` - - -### ERC-20 Tokens - -#### Encoding - -```ts -params = { - type: TokenType.ERC20, - tokenAddress: "0x1234567890123456789012345678901234567890", // ERC20 token's address - amount: BigInt(10), // the amount ignoring the decimals - recipientAddressOrEns: "0x1234567890123456789012345678901234567890", // the address to transfer the funds to -}; - -const erc20WithdrawAction: DaoAction = await client.encoding.withdrawAction( - params, -); -console.log({ erc20WithdrawAction }); -``` - - -Returns: - -```json -{ erc20WithdrawAction: - { - to: "0x1234567890...", - value: 0n; - data: Uint8Array[12,34,45...] - } -} -``` - -#### Decoding - -```ts -const erc20DecodedParams = client.decoding.withdrawAction( - erc20WithdrawAction.to, - erc20WithdrawAction.value, - erc20WithdrawAction.data, -); -console.log({ erc20DecodedParams }); -``` - - -Returns: - -``` -{ erc20DecodedParams: - { - type: "erc20", - recipientAddressOrEns: "0x1234567890123456789012345678901234567890", - amount: 10n, - tokenAddress: "0x1234567890123456789012345678901234567890", - } -} -``` - -```ts - -``` - - -### NFT (ERC-721) Tokens - -#### Encoding - -```ts -params = { - type: TokenType.ERC721, - tokenAddress: "0x1234567890123456789012345678901234567890", // ERFC721's token contract address - tokenId: BigInt(10), - recipientAddressOrEns: "0x1234567890123456789012345678901234567890", // the address to transfer the funds to - daoAddressOrEns: "0x1234567890123456789012345678901234567890", // the address of the DAO -}; - -const erc721WithdrawAction: DaoAction = await client.encoding.withdrawAction( - params, -); -console.log({ erc721WithdrawAction }); -``` - - -#### Decoding - -```ts -const erc721DecodedParams = client.decoding.withdrawAction( - erc721WithdrawAction.to, - erc721WithdrawAction.value, - erc721WithdrawAction.data, -); -console.log({ erc721DecodedParams }); -``` - - -Returns: -``` -{ - type: TokenType.ERC721; - tokenAddress: "0x1234567890123456789012345678901234567890"; - tokenId: 10n; - daoAddressOrEns: "0x1234567890123456789012345678901234567890"; - recipientAddressOrEns: "0x1234567890123456789012345678901234567890"; -} -```### NFT (ERC-1155) Tokens - -#### Encoding - -```ts -params = { - type: TokenType.ERC1155, - tokenAddress: "0x1234567890123456789012345678901234567890", // ERFC721's token contract address - tokenIds: [BigInt(10)], // array of token ids - amounts: [BigInt(20)], // array of amounts - recipientAddressOrEns: "0x1234567890123456789012345678901234567890", // the address to transfer the funds to - daoAddressOrEns: "0x1234567890123456789012345678901234567890", // the address of the DAO -}; - -const erc1155WithdrawAction: DaoAction = await client.encoding.withdrawAction( - params, -); -console.log({ erc1155WithdrawAction }); -``` - - -#### Decoding - -```ts -const erc1155WithdrawDecodedParams = client.decoding.withdrawAction( - erc1155WithdrawAction.to, - erc1155WithdrawAction.value, - erc1155WithdrawAction.data, -); -console.log({ erc1155WithdrawDecodedParams }); -``` - - -Returns: -``` -{ - type: TokenType.ERC1155, - tokenAddress: "0x1234567890123456789012345678901234567890", - tokenIds: [10n], - amounts: [20n], - daoAddressOrEns: "0x1234567890123456789012345678901234567890", - recipientAddressOrEns: "0x1234567890123456789012345678901234567890", -} -``` \ No newline at end of file diff --git a/versioned_docs/version-1.3.0/sdk/01-examples/05-encoders-decoders/07-update-metadata.md b/versioned_docs/version-1.3.0/sdk/01-examples/05-encoders-decoders/07-update-metadata.md deleted file mode 100644 index ee2856e1..00000000 --- a/versioned_docs/version-1.3.0/sdk/01-examples/05-encoders-decoders/07-update-metadata.md +++ /dev/null @@ -1,115 +0,0 @@ ---- -title: Update DAO Metadata ---- - -## Update a DAO's Metadata - -Updates the metadata of a given DAO. - -### Encoding - -```ts -import { Client, DaoMetadata } from "@aragon/sdk-client"; -import { DaoAction } from "@aragon/sdk-client-common"; -import { context } from "../index"; - -// Instantiates an Aragon OSx SDK client. -const client: Client = new Client(context); - -const metadataParams: DaoMetadata = { - name: "New Name", - description: "New description", - avatar: "https://theavatar.com/image.jpg", - links: [ - { - url: "https://discord.com/...", - name: "Discord", - }, - { - url: "https://twitter.com/...", - name: "Twitter", - }, - ], -}; - -const daoAddressOrEns: string = "0x123458235832745982839878932332423"; // or my-dao.dao.eth - -// Pins the metadata in IPFS and returns the IPFS URI. -const ipfsUri: string = await client.methods.pinMetadata(metadataParams); - -// Update the metadata of a given DAO. -const action: DaoAction = await client.encoding.updateDaoMetadataAction( - daoAddressOrEns, - ipfsUri, -); -console.log({ action }); -``` - - -Returns: - -```json -{ action: - { - to: "0x123123123...", - value: 0n, - data: Uint8Array[12,34,45...] - } -} -``` - -### Decoding - -```ts -// Decodes the update metadata action. -const decodedParams: DaoMetadata = await client.decoding - .updateDaoMetadataAction( - action.data, - ); -console.log({ decodedParams }); -``` - - -Returns: - -```json -{ - "name":"New Name", - "description":"New description", - "avatar":"https://theavatar.com/image.jpg", - "links":[ - { - "url":"https://discord.com/...", - "name":"Discord" - }, - { - "url":"https://twitter.com/...", - "name":"Twitter" - } - ] -} -``` - -```ts - -``` - - -#### Raw Action - -Decode an update metadata action and expect an IPFS URI containing the CID of the metadata. - -```ts -// Decodes the parameters of an update metadata raw action. -const decodedParamsRaw: string = client.decoding.updateDaoMetadataRawAction( - action.data, -); -console.log({ decodedParamsRaw }); -``` - - -Returns: - -``` - { decodedParamsRaw: "ipfs://Qm..." } -``` \ No newline at end of file diff --git a/versioned_docs/version-1.3.0/sdk/01-examples/05-encoders-decoders/08-set-dao-uri.md b/versioned_docs/version-1.3.0/sdk/01-examples/05-encoders-decoders/08-set-dao-uri.md deleted file mode 100644 index 16b08d70..00000000 --- a/versioned_docs/version-1.3.0/sdk/01-examples/05-encoders-decoders/08-set-dao-uri.md +++ /dev/null @@ -1,57 +0,0 @@ ---- -title: Set DAO URI ---- - -## Set the DAO URI - -Encodes the action of setting the DAO's URI. - -### Encoding - -```ts -import { Client } from "@aragon/sdk-client"; -import { DaoAction } from "@aragon/sdk-client-common"; -import { context } from "../index"; - -// Instantiates an Aragon OSx SDK client. -const client: Client = new Client(context); - -const daoAddressOrEns: string = "0x123123123123123123123123123123123123"; - -const daoUri: string = "https://the.dao/uri"; // the URI to be defined for the DAO. - -const action: DaoAction = client.encoding.setDaoUriAction( - daoAddressOrEns, - daoUri, -); -console.log({ action }); -``` - - -Returns: - -```json -{ action: - { - to: "0x123123123...", - value: 0n, - data: Uint8Array[12,34,45...] - } -} -``` - -### Decoding - -Decodes the action of setting a DAO's URI - -```ts -const decodedParams: string = client.decoding.setDaoUriAction(action.data); -console.log({ decodedParams }); -``` - - -Returns: - -``` - { decodedParams: "https://the.dao.uri" } -``` \ No newline at end of file diff --git a/versioned_docs/version-1.3.0/sdk/01-examples/05-encoders-decoders/09-set-signature-validator.md b/versioned_docs/version-1.3.0/sdk/01-examples/05-encoders-decoders/09-set-signature-validator.md deleted file mode 100644 index c3d9e23c..00000000 --- a/versioned_docs/version-1.3.0/sdk/01-examples/05-encoders-decoders/09-set-signature-validator.md +++ /dev/null @@ -1,56 +0,0 @@ ---- -title: Set Signature Validator ---- - -## Set the Signature Validator - -Encodes the action of setting the signatura validator of the DAO. - -### Encoding - -```ts -import { Client } from "@aragon/sdk-client"; -import { DaoAction } from "@aragon/sdk-client-common"; -import { context } from "../index"; - -// Instantiates an Aragon OSx SDK client. -const client: Client = new Client(context); - -const daoAddressOrEns: string = "0x123123123123123123123123123123123123"; -const signatureValidator: string = "0x1234567890123456789012345678901234567890"; - -const action: DaoAction = client.encoding.setSignatureValidatorAction( - daoAddressOrEns, - signatureValidator, -); -console.log({ action }); -``` - - -Returns: - -```json -{ action: - { - to: "0x123123123...", - value: 0n, - data: Uint8Array[12,34,45...] - } -} -``` - -### Decoding - -```ts -const decodedParams: string = client.decoding.setSignatureValidatorAction( - action.data, -); -console.log({ decodedParams }); -``` - - -Returns: - -``` - { decodedParams: "0x1234567890123456789012345678901234567890" } -``` \ No newline at end of file diff --git a/versioned_docs/version-1.3.0/sdk/01-examples/05-encoders-decoders/10-upgrade-to.md b/versioned_docs/version-1.3.0/sdk/01-examples/05-encoders-decoders/10-upgrade-to.md deleted file mode 100644 index fe8a9a45..00000000 --- a/versioned_docs/version-1.3.0/sdk/01-examples/05-encoders-decoders/10-upgrade-to.md +++ /dev/null @@ -1,53 +0,0 @@ ---- -title: Upgrade To a Contract Implementation ---- - -## Upgrade To a Contract Implementation - -Encodes the action of upgrading the DAO proxy contract to a new implementation address. - -### Encoding - -```ts -import { Client } from "@aragon/sdk-client"; -import { DaoAction } from "@aragon/sdk-client-common"; -import { context } from "../index"; - -// Instantiates an Aragon OSx SDK client. -const client: Client = new Client(context); - -const daoAddressOrEns: string = "0x123123123123123123123123123123123123"; -const implementationAddress: string = - "0x1234567890123456789012345678901234567890"; - -const action: DaoAction = client.encoding.upgradeToAction( - daoAddressOrEns, - implementationAddress, -); -console.log({ action }); -``` - - -```json -{ action: - { - to: "0x123123123...", - value: 0n, - data: Uint8Array[12,34,45...] - } -} -``` - -### Decoding - -```ts -const decodedParams: string = client.decoding.upgradeToAction(action.data); -console.log({ decodedParams }); -``` - - -Returns: - -``` - { decodedParams: "0x1234567890123456789012345678901234567890" } -``` \ No newline at end of file diff --git a/versioned_docs/version-1.3.0/sdk/01-examples/05-encoders-decoders/11-upgrade-to-and-call.md b/versioned_docs/version-1.3.0/sdk/01-examples/05-encoders-decoders/11-upgrade-to-and-call.md deleted file mode 100644 index ebf6f63d..00000000 --- a/versioned_docs/version-1.3.0/sdk/01-examples/05-encoders-decoders/11-upgrade-to-and-call.md +++ /dev/null @@ -1,65 +0,0 @@ ---- -title: Upgrade To And Call ---- - -## Upgrade the DAO and Call a Method - -Encodes the action of upgrading your DAO and doing a subsequent method call. - -### Encoding - -```ts -import { Client, UpgradeToAndCallParams } from "@aragon/sdk-client"; -import { DaoAction } from "@aragon/sdk-client-common"; -import { context } from "../index"; - -// Instantiates an Aragon OSx SDK client. -const client: Client = new Client(context); - -const upgradeToAndCallParams = { - implementationAddress: "0x1234567890123456789012345678901234567890", // the implementation address to be upgraded to. - data: new Uint8Array([10, 20, 130, 40]), -}; - -const daoAddressOrEns: string = "0x123123123123123123123123123123123123"; - -// Encodes the action of upgrading your DAO and doing a subsequent method call. -const action: DaoAction = client.encoding.upgradeToAndCallAction( - daoAddressOrEns, - upgradeToAndCallParams, -); -console.log({ action }); -``` - - -Returns: - -```json -{ action: - { - to: "0x123123123...", - value: 0n, - data: Uint8Array[12,34,45...] - } -} -``` - -### Decoding - -```ts -const decodedParams: UpgradeToAndCallParams = client.decoding - .upgradeToAndCallAction(action.data); -console.log({ decodedParams }); -``` - - -Returns: - -``` -{ decodedParams: - { - implementationAddress: "0x1234567890...", - data: Uint8Array[12,34,45...] - } -} -``` \ No newline at end of file diff --git a/versioned_docs/version-1.3.0/sdk/01-examples/05-encoders-decoders/12-apply-installation.md b/versioned_docs/version-1.3.0/sdk/01-examples/05-encoders-decoders/12-apply-installation.md deleted file mode 100644 index 3606ca7b..00000000 --- a/versioned_docs/version-1.3.0/sdk/01-examples/05-encoders-decoders/12-apply-installation.md +++ /dev/null @@ -1,122 +0,0 @@ ---- -title: Apply Installation ---- - -## Apply a Plugin Installation - -Encodes the action of applying a plugin installation. - -### Encoding - -```ts -import { Client, PermissionIds } from "@aragon/sdk-client"; -import { - ApplyInstallationParams, - DaoAction, - DecodedApplyInstallationParams, - PermissionOperationType, -} from "@aragon/sdk-client-common"; -import { context } from "../index"; - -// Instantiates an Aragon OSx SDK client. -const client: Client = new Client(context); - -// This variable contains the values received on the prepareInstallation() method -const applyInstallationParams: ApplyInstallationParams = { - helpers: [ - "0x1234567890123456789012345678901234567890", - "0x2345678901234567890123456789012345678901", - "0x3456789012345678901234567890123456789012", - "0x4567890123456789012345678901234567890123", - "0x5678901234567890123456789012345678901234", - ], - permissions: [{ - condition: "0x1234567890123456789012345678901234567890", - operation: PermissionOperationType.GRANT_WITH_CONDITION, - permissionId: PermissionIds.EXECUTE_PERMISSION_ID, // hash("EXECUTE_PERMISSION_ID") - where: "0x1234567890123456789012345678901234567890", - who: "0x2345678901234567890123456789012345678901", - }], - versionTag: { - build: 1, - release: 1, - }, - pluginRepo: "0x2345678901234567890123456789012345678901", - pluginAddress: "0x1234567890123456789012345678901234567890", -}; - -const daoAddressOrEns: string = "0x123123123123123123123123123123123123"; // "my-dao.eth" - -const actions: DaoAction[] = client.encoding.applyInstallationAction( - daoAddressOrEns, - applyInstallationParams, -); -console.log(actions); -``` - - -Returns three actions: - -- Grant root permission to the Plugin Setup Processor -- Ask it to apply the installation -- Revoke the root permission to the Plugin Setup Processor - -```json -[ - { - to: "0x123123123...", - value: 0n, - data: Uint8Array[12,34,45...] - }, - { - to: "0x123123123...", - value: 0n, - data: Uint8Array[12,34,45...] - }, - { - to: "0x123123123...", - value: 0n, - data: Uint8Array[12,34,45...] - } -] -``` - -### Decoding - -```ts -// Decodes the apply installation action for a Multisig plugin. -const decodedParams: DecodedApplyInstallationParams = client.decoding - .applyInstallationAction(actions[1].data); -console.log({ decodedParams }); -``` - - -Returns: - -```json -{ decodedParams: - { - helpers: [ - "0x1234567890123456789012345678901234567890", - "0x2345678901234567890123456789012345678901", - "0x3456789012345678901234567890123456789012", - "0x4567890123456789012345678901234567890123", - "0x5678901234567890123456789012345678901234", - ], - permissions: [{ - condition: "0x1234567890123456789012345678901234567890", - operation: 1, - permissionId: Uint8Array([10,20,30]), - where: "0x1234567890123456789012345678901234567890", - who: "0x2345678901234567890123456789012345678901", - }], - versionTag: { - build: 1, - release: 1, - }, - pluginRepo: "0x2345678901234567890123456789012345678901", - pluginAddress: "0x1234567890123456789012345678901234567890", - }; - } -} -``` \ No newline at end of file diff --git a/versioned_docs/version-1.3.0/sdk/01-examples/05-encoders-decoders/12-multisig/01-find-interface.md b/versioned_docs/version-1.3.0/sdk/01-examples/05-encoders-decoders/12-multisig/01-find-interface.md deleted file mode 100644 index 84c65428..00000000 --- a/versioned_docs/version-1.3.0/sdk/01-examples/05-encoders-decoders/12-multisig/01-find-interface.md +++ /dev/null @@ -1,30 +0,0 @@ ---- -title: Get Function Parameters ---- - -## Get Function Parameters from an Encoded Action - -Decodes the parameters of a function call from the Multisig plugin contract. - -### Decoding - -```ts -import { multisigClient } from "./index"; - -const data: Uint8Array = new Uint8Array([12, 56]); - -// Decodes the parameters of a function call from the Multisig plugin. -const functionParams = multisigClient.decoding.findInterface(data); -console.log(functionParams); -``` - - -Returns: - -``` -{ - id: "function functionName(param1, param2)" - functionName: "functionName" - hash: "0x12345678" -} -``` \ No newline at end of file diff --git a/versioned_docs/version-1.3.0/sdk/01-examples/05-encoders-decoders/12-multisig/02-add-addresses.md b/versioned_docs/version-1.3.0/sdk/01-examples/05-encoders-decoders/12-multisig/02-add-addresses.md deleted file mode 100644 index fc3174ba..00000000 --- a/versioned_docs/version-1.3.0/sdk/01-examples/05-encoders-decoders/12-multisig/02-add-addresses.md +++ /dev/null @@ -1,74 +0,0 @@ ---- -title: Add Members ---- - -## Add Members from the Multisig Plugin - -Adds new address as members of the Multisig plugin installed in a DAO, so they are now able to vote on proposals. - -## Caveats - -This action is usually paired with `updatePluginSettingsAction` to update the minimum approvals required for a multisig proposal to pass. -In the case of adding addresses the order in which you execute actions matter, so if you are adding members and updating the plugin setting make sure that the order of the actions is first the `addAddressesAction` and then the `updatePluginSettingsAction`. -If this is not done correctly the transaction may fail and in the worst case brick the DAO. - -### Encoding - -```ts -import { AddAddressesParams } from "@aragon/sdk-client"; -import { DaoAction } from "@aragon/sdk-client-common"; -import { multisigClient } from "./index"; - -// The addresses to add as members. -const members: string[] = [ - "0x1357924680135792468013579246801357924680", - "0x2468013579246801357924680135792468013579", - "0x0987654321098765432109876543210987654321", -]; - -const addAddressesParams: AddAddressesParams = { - members, - pluginAddress: "0x0987654321098765432109876543210987654321", // the address of the Multisig plugin contract installed in the DAO -}; - -// Adds the addresses as members of the Multisig plugin for a DAO. -const action: DaoAction = multisigClient.encoding.addAddressesAction( - addAddressesParams, -); -console.log({ action }); -``` - - -Returns: - -``` -{ action: - { - to: "0x1234567890...", - value: 0n, - data: Uint8Array[12,34,45...] - } -} -``` - -### Decoding - -```ts -const decodedParams: string[] = multisigClient.decoding.addAddressesAction( - action.data, -); -console.log({ decodedParams }); -``` - - -Returns: - -``` -{ decodedParams: - [ - "0x12345...", - "0x56789...", - "0x13579..." - ] -} -``` \ No newline at end of file diff --git a/versioned_docs/version-1.3.0/sdk/01-examples/05-encoders-decoders/12-multisig/03-remove-addresses.md b/versioned_docs/version-1.3.0/sdk/01-examples/05-encoders-decoders/12-multisig/03-remove-addresses.md deleted file mode 100644 index 125818b7..00000000 --- a/versioned_docs/version-1.3.0/sdk/01-examples/05-encoders-decoders/12-multisig/03-remove-addresses.md +++ /dev/null @@ -1,75 +0,0 @@ ---- -title: Remove Members ---- - -## Remove Members from the Multisig Plugin - -Removes a list of addresses from the Multisig plugin of a given DAO so they are no longer able to vote on Multisig proposals for that DAO. - -## Caveats - -This action is usually paired with `updatePluginSettingsAction` to update the minimum approvals required for a multisig proposal to pass. -In the case of removing addresses the order in which you execute actions matter, so if you are removing members and updating the plugin setting make sure that the order of the actions is first the `updatePluginSettingsAction` and then the `removeAddressesAction`. -If this is not done correctly the transaction may fail and in the worst case brick the DAO. - -### Encoding - -```ts -import { RemoveAddressesParams } from "@aragon/sdk-client"; -import { DaoAction } from "@aragon/sdk-client-common"; -import { multisigClient } from "./index"; - -// List of members to remove from the multisig plugin. -const members: string[] = [ - "0x1357924680135792468013579246801357924680", - "0x2468013579246801357924680135792468013579", - "0x0987654321098765432109876543210987654321", -]; - -const removeAddressesParams: RemoveAddressesParams = { - members, - pluginAddress: "0x0987654321098765432109876543210987654321", // the address of the Multisig plugin contract installed in the DAO -}; - -// Removes the addresses from the Multisig plugin of a DAO. -const action: DaoAction = multisigClient.encoding.removeAddressesAction( - removeAddressesParams, -); -console.log({ action }); -``` - - -Returns: - -``` -{ action: - { - to: "0x1234567890...", - value: 0n, - data: Uint8Array[12,34,45...] - } -} -``` - -### Decoding - -```ts -// Decodes the parameters of the remove members action from the Multisig plugin. -const decodedParams: string[] = multisigClient.decoding.removeAddressesAction( - action.data, -); -console.log({ decodedParams }); -``` - - -Returns: - -``` -{ decodedParams: - [ - "0x12345...", - "0x56789...", - "0x13579..." - ] -} -``` \ No newline at end of file diff --git a/versioned_docs/version-1.3.0/sdk/01-examples/05-encoders-decoders/12-multisig/04-update-plugin-settings.md b/versioned_docs/version-1.3.0/sdk/01-examples/05-encoders-decoders/12-multisig/04-update-plugin-settings.md deleted file mode 100644 index 410875d4..00000000 --- a/versioned_docs/version-1.3.0/sdk/01-examples/05-encoders-decoders/12-multisig/04-update-plugin-settings.md +++ /dev/null @@ -1,66 +0,0 @@ ---- -title: Update Multisig Settings ---- - -## Update the Multisig Plugin Settings - -Allows you to update the configuration of a Multisig plugin installed in a DAO. - -### Encoding - -```ts -import { - MultisigVotingSettings, - UpdateMultisigVotingSettingsParams, -} from "@aragon/sdk-client"; -import { DaoAction } from "@aragon/sdk-client-common"; -import { multisigClient } from "./index"; - -const params: UpdateMultisigVotingSettingsParams = { - votingSettings: { - minApprovals: 2, - onlyListed: false, - }, - pluginAddress: "0x0987654321098765432109876543210987654321", // the address of the Multisig plugin contract installed in the DAO -}; - -// Updates the voting configuration of a Multisig plugin installed in a DAO. -const action: DaoAction = multisigClient.encoding.updateMultisigVotingSettings( - params, -); -console.log({ action }); -``` - - -Returns: - -``` -{ action: - { - to: "0x1234567890...", - value: 0n, - data: Uint8Array[12,34,45...] - } -} -``` - -### Decoding - -```ts -// Decodes the update settings action for a Multisig plugin. -const decodedParams: MultisigVotingSettings = multisigClient.decoding - .updateMultisigVotingSettings(action.data); -console.log({ decodedParams }); -``` - - -Returns: - -``` -{ decodedParams: - { - minApprovals: 2, - onlyListed: false - } -} -``` \ No newline at end of file diff --git a/versioned_docs/version-1.3.0/sdk/01-examples/05-encoders-decoders/12-multisig/index.md b/versioned_docs/version-1.3.0/sdk/01-examples/05-encoders-decoders/12-multisig/index.md deleted file mode 100644 index 8f00cbde..00000000 --- a/versioned_docs/version-1.3.0/sdk/01-examples/05-encoders-decoders/12-multisig/index.md +++ /dev/null @@ -1,18 +0,0 @@ ---- -title: Multisig ---- - -## Actions of the Multisig Plugin - -With an instance of the `MultisigClient` - -```ts -import { MultisigClient } from "@aragon/sdk-client"; -import { context } from "../../index"; - -// Instantiate a Multisig client. -export const multisigClient = new MultisigClient(context); -``` - - -actions can encoded and decoded as demonstrated in the following examples. \ No newline at end of file diff --git a/versioned_docs/version-1.3.0/sdk/01-examples/05-encoders-decoders/13-addresslist-voting/01-find-interface.md b/versioned_docs/version-1.3.0/sdk/01-examples/05-encoders-decoders/13-addresslist-voting/01-find-interface.md deleted file mode 100644 index 61f35111..00000000 --- a/versioned_docs/version-1.3.0/sdk/01-examples/05-encoders-decoders/13-addresslist-voting/01-find-interface.md +++ /dev/null @@ -1,29 +0,0 @@ ---- -title: Get Function Parameters ---- - -## Get function parameters from encoded action (Addresslist) - -Decodes the parameters of a function call from the Addresslist plugin. - -### Encoding - -```ts -import { addresslistVotingClient } from "./index"; - -const data: Uint8Array = new Uint8Array([12, 56]); - -const functionParams = addresslistVotingClient.decoding.findInterface(data); -console.log(functionParams); -``` - - -Returns: - -``` -{ - id: "function functionName(param1, param2)" - functionName: "functionName" - hash: "0x12345678" -} -``` \ No newline at end of file diff --git a/versioned_docs/version-1.3.0/sdk/01-examples/05-encoders-decoders/13-addresslist-voting/02-add-members.md b/versioned_docs/version-1.3.0/sdk/01-examples/05-encoders-decoders/13-addresslist-voting/02-add-members.md deleted file mode 100644 index 27fd5289..00000000 --- a/versioned_docs/version-1.3.0/sdk/01-examples/05-encoders-decoders/13-addresslist-voting/02-add-members.md +++ /dev/null @@ -1,61 +0,0 @@ ---- -title: Add Members ---- - -## Add Members from the Addresslist Voting Plugin - -Adds a list of addresses to the AddressList plugin so that these new addresses are able to vote in AddresslistVoting proposals. - -### Encoding - -```ts -import { DaoAction } from "@aragon/sdk-client-common"; -import { addresslistVotingClient } from "./index"; - -const members: string[] = [ - "0x1357924680135792468013579246801357924680", - "0x2468013579246801357924680135792468013579", - "0x0987654321098765432109876543210987654321", -]; - -const pluginAddress = "0x0987654321098765432109876543210987654321"; // the address of the AddresslistVoting plugin contract installed in the DAO - -const action: DaoAction = addresslistVotingClient.encoding.addMembersAction( - pluginAddress, - members, -); -console.log({ action }); -``` - - -Returns: - -```json -{ action: - { - to: "0x1234567890...", - value: 0n, - data: Uint8Array[12,34,45...] - } -} -``` -### Decoding - -```ts -const decodedParams: string[] = addresslistVotingClient.decoding - .addMembersAction(action.data); -console.log({ decodedParams }); -``` - - -Returns: - -``` -{ decodedParams: - [ - "0x12345...", - "0x56789...", - "0x13579..." - ] -} -``` \ No newline at end of file diff --git a/versioned_docs/version-1.3.0/sdk/01-examples/05-encoders-decoders/13-addresslist-voting/03-remove-members.md b/versioned_docs/version-1.3.0/sdk/01-examples/05-encoders-decoders/13-addresslist-voting/03-remove-members.md deleted file mode 100644 index b7cd7c07..00000000 --- a/versioned_docs/version-1.3.0/sdk/01-examples/05-encoders-decoders/13-addresslist-voting/03-remove-members.md +++ /dev/null @@ -1,63 +0,0 @@ ---- -title: Remove Members ---- - -## Remove Members from the Addresslist Voting Plugin - -Removes an address from the Addresslist plugin so that this address is no longer able to vote in AddresslistVoting proposals. - -### Encoding - -```ts -import { DaoAction } from "@aragon/sdk-client-common"; -import { addresslistVotingClient } from "./index"; - -// Addresses to remove from the AddressList plugin. -const members: string[] = [ - "0x1357924680135792468013579246801357924680", - "0x2468013579246801357924680135792468013579", - "0x0987654321098765432109876543210987654321", -]; - -const pluginAddress: string = "0x0987654321098765432109876543210987654321"; // the address of the AddresslistVoting plugin contract installed in the DAO - -const action: DaoAction = addresslistVotingClient.encoding.removeMembersAction( - pluginAddress, - members, -); -console.log({ action }); -``` - - -Returns: - -```json -{ action: - { - to: "0x1234567890...", - value: 0n, - data: Uint8Array[12,34,45...] - } -} -``` - -### Decoding - -```ts -const decodedParams: string[] = addresslistVotingClient.decoding - .removeMembersAction(action.data); -console.log({ decodedParams }); -``` - - -Returns: - -``` -{ decodedParams: - [ - "0x12345...", - "0x56789...", - "0x13579..." - ] -} -``` \ No newline at end of file diff --git a/versioned_docs/version-1.3.0/sdk/01-examples/05-encoders-decoders/13-addresslist-voting/04-update-plugin-settings.md b/versioned_docs/version-1.3.0/sdk/01-examples/05-encoders-decoders/13-addresslist-voting/04-update-plugin-settings.md deleted file mode 100644 index c0045099..00000000 --- a/versioned_docs/version-1.3.0/sdk/01-examples/05-encoders-decoders/13-addresslist-voting/04-update-plugin-settings.md +++ /dev/null @@ -1,65 +0,0 @@ ---- -title: Update Addresslist Voting Settings ---- - -## Update the Addresslist Voting Plugin Settings - -Updates the settings of a given AddresslistVoting plugin. - -### Encoding - -```ts -import { VotingMode, VotingSettings } from "@aragon/sdk-client"; -import { DaoAction } from "@aragon/sdk-client-common"; -import { addresslistVotingClient } from "./index"; - -// The action object for updating the plugin settings. -const params: VotingSettings = { - minDuration: 60 * 60 * 24 * 2, // seconds - minParticipation: 0.25, // 25% - supportThreshold: 0.5, // 50% - minProposerVotingPower: BigInt("5000"), // default 0 - votingMode: VotingMode.STANDARD, // default STANDARD, otherwise EARLY_EXECUTION or VOTE_REPLACEMENT -}; - -const pluginAddress: string = "0x1234567890123456789012345678901234567890"; // the address of the AddresslistVoting plugin contract installed in the DAO - -const action: DaoAction = addresslistVotingClient.encoding - .updatePluginSettingsAction(pluginAddress, params); -console.log({ action }); -``` - - -Returns: - -``` -{ action: - { - to: "0x1234567890...", - value: 0n, - data: Uint8Array[12,34,45...] - } -} -``` - -### Decoding - -```ts -const decodedParams: VotingSettings = addresslistVotingClient.decoding - .updatePluginSettingsAction(action.data); -console.log({ decodedParams }); -``` - - -Returns: - -```json -{ decodedParams: - { - minDuration: 7200, // seconds - minParticipation: 0.25, // 25% - supportThreshold: 0.5, // 50% - minProposerVotingPower: BigInt("1") - } -} -``` \ No newline at end of file diff --git a/versioned_docs/version-1.3.0/sdk/01-examples/05-encoders-decoders/13-addresslist-voting/index.md b/versioned_docs/version-1.3.0/sdk/01-examples/05-encoders-decoders/13-addresslist-voting/index.md deleted file mode 100644 index 06334599..00000000 --- a/versioned_docs/version-1.3.0/sdk/01-examples/05-encoders-decoders/13-addresslist-voting/index.md +++ /dev/null @@ -1,22 +0,0 @@ ---- -title: Addresslist Voting ---- - -## Actions of the Addresslist Voting Plugin - -With an instance of the `AddresslistVotingClient` - -```ts -import { AddresslistVotingClient } from "@aragon/sdk-client"; -import { context } from "../../index"; - -// Instantiate a plugin context from the Aragon OSx SDK context - -// Instantiates an AddresslistVoting client. -export const addresslistVotingClient = new AddresslistVotingClient( - context, -); -``` - - -actions can encoded and decoded as demonstrated in the following examples. \ No newline at end of file diff --git a/versioned_docs/version-1.3.0/sdk/01-examples/05-encoders-decoders/13-apply-uninstallation.md b/versioned_docs/version-1.3.0/sdk/01-examples/05-encoders-decoders/13-apply-uninstallation.md deleted file mode 100644 index 8a0cc723..00000000 --- a/versioned_docs/version-1.3.0/sdk/01-examples/05-encoders-decoders/13-apply-uninstallation.md +++ /dev/null @@ -1,106 +0,0 @@ ---- -title: Apply Uninstallation ---- - -## Apply a Plugin Uninstallation - -Encodes the action of applying a plugin uninstallation. - -### Encoding - -```ts -import { - ApplyUninstallationParams, - Client, - DecodedApplyUninstallationParams, - PermissionIds, -} from "@aragon/sdk-client"; -import { DaoAction, PermissionOperationType } from "@aragon/sdk-client-common"; -import { context } from "../index"; - -// Instantiates an Aragon OSx SDK client. -const client: Client = new Client(context); - -// This variable contains the values received on the prepareUninstallation() method -const applyUninstallationParams: ApplyUninstallationParams = { - permissions: [{ - operation: PermissionOperationType.REVOKE, - permissionId: PermissionIds.EXECUTE_PERMISSION_ID, - where: "0x1234567890123456789012345678901234567890", - who: "0x2345678901234567890123456789012345678901", - }], - versionTag: { - build: 1, - release: 1, - }, - pluginRepo: "0x2345678901234567890123456789012345678901", - pluginAddress: "0x1234567890123456789012345678901234567890", -}; - -const daoAddressOrEns: string = "0x123123123123123123123123123123123123"; // "my-dao.eth" - -const actions: DaoAction[] = client.encoding.applyUninstallationAction( - daoAddressOrEns, - applyUninstallationParams, -); -console.log(actions); -``` - - -Returns three actions: - -- Grant root permission to the Plugin Setup Processor -- Ask it to apply the uniinstallation -- Revoke the root permission to the Plugin Setup Processor - -```json -[ - { - to: "0x123123123...", - value: 0n, - data: Uint8Array[12,34,45...] - }, - { - to: "0x123123123...", - value: 0n, - data: Uint8Array[12,34,45...] - }, - { - to: "0x123123123...", - value: 0n, - data: Uint8Array[12,34,45...] - } -] -``` - -### Decoding - -```ts -// Decodes the apply uniinstallation action for a Multisig plugin. -const decodedParams: DecodedApplyUninstallationParams = client.decoding - .applyUninstallationAction(actions[1].data); -console.log({ decodedParams }); -``` - - -Returns: - -```json -{ decodedParams: - { - permissions: [{ - operation: 1, // REVOKE - permissionId: Uint8Array([10,20,30]), - where: "0x1234567890123456789012345678901234567890", - who: "0x2345678901234567890123456789012345678901", - }], - versionTag: { - build: 1, - release: 1, - }, - pluginRepo: "0x2345678901234567890123456789012345678901", - pluginAddress: "0x1234567890123456789012345678901234567890", - }; - } -} -``` \ No newline at end of file diff --git a/versioned_docs/version-1.3.0/sdk/01-examples/05-encoders-decoders/14-initialize-from.md b/versioned_docs/version-1.3.0/sdk/01-examples/05-encoders-decoders/14-initialize-from.md deleted file mode 100644 index b8a5aea9..00000000 --- a/versioned_docs/version-1.3.0/sdk/01-examples/05-encoders-decoders/14-initialize-from.md +++ /dev/null @@ -1,60 +0,0 @@ ---- -title: Initialize From ---- - -## Upgrade a DAO to a new version - -Encodes the action for upgrading the dao to a new version and passing initialization data of the new version. - -### Encoding - -```ts -import { Client, InitializeFromParams } from "@aragon/sdk-client"; -import { DaoAction } from "@aragon/sdk-client-common"; -import { context } from "../index"; - -// Instantiates an Aragon OSx SDK client. -const client: Client = new Client(context); - -// This variable contains the values received on the ininitializeFrom() method -const initializeFromParams: InitializeFromParams = { - previousVersion: [1, 0, 0], - initData: new Uint8Array([12, 34, 45, 85, 95, 45, 73]), // initialization data for the new version to be pased to upgradeToAndCall() -}; - -const daoAddressOrEns: string = "0x123123123123123123123123123123123123"; // "my-dao.eth" - -const action: DaoAction = client.encoding.initializeFromAction( - daoAddressOrEns, - initializeFromParams, -); -console.log(action); -``` - - -```json - { - to: "0x123123123...", - value: 0n, - data: Uint8Array[12,34,45...] - } - ``` - - ### Decoding - -```ts -// Decodes the initialize from action. -const decodedParams: InitializeFromParams = client.decoding - .initializeFromAction(action.data); -console.log({ decodedParams }); -``` - - -Returns: - - ```json - { - previousVersion: [1, 0, 0], - initData: Uint8Array[12,34,45...] - } - ``` \ No newline at end of file diff --git a/versioned_docs/version-1.3.0/sdk/01-examples/05-encoders-decoders/14-token-voting/01-find-interface.md b/versioned_docs/version-1.3.0/sdk/01-examples/05-encoders-decoders/14-token-voting/01-find-interface.md deleted file mode 100644 index 5793b147..00000000 --- a/versioned_docs/version-1.3.0/sdk/01-examples/05-encoders-decoders/14-token-voting/01-find-interface.md +++ /dev/null @@ -1,30 +0,0 @@ ---- -title: Get Function Parameters ---- - -## Get Function Parameters from an Encoded Action - -Decodes the parameters of a function call from the TokenVoting plugin contract. - -### Decoding - -```ts -import { tokenVotingClient } from "./index"; - -const data: Uint8Array = new Uint8Array([12, 56]); - -// Decodes the parameters of a function call from the TokenVoting plugin. -const functionParams = tokenVotingClient.decoding.findInterface(data); -console.log(functionParams); -``` - - -Returns: - -``` -{ - id: "function functionName(param1, param2)" - functionName: "functionName" - hash: "0x12345678" -} -``` \ No newline at end of file diff --git a/versioned_docs/version-1.3.0/sdk/01-examples/05-encoders-decoders/14-token-voting/02-mint-token.md b/versioned_docs/version-1.3.0/sdk/01-examples/05-encoders-decoders/14-token-voting/02-mint-token.md deleted file mode 100644 index 0a0731f4..00000000 --- a/versioned_docs/version-1.3.0/sdk/01-examples/05-encoders-decoders/14-token-voting/02-mint-token.md +++ /dev/null @@ -1,62 +0,0 @@ ---- -title: Mint Tokens ---- - -## Mint Vote Tokens for the TokenVoting Plugin - -Mints vote tokens for an installed TokenVoting plugin. - -### Encoding - -```ts -import { MintTokenParams } from "@aragon/sdk-client"; -import { DaoAction } from "@aragon/sdk-client-common"; -import { tokenVotingClient } from "./index"; - -const params: MintTokenParams = { - address: "0x1234567890123456789012345678901234567890", // address which will receive the minted tokens - amount: BigInt(10), // amount of tokens they will receive -}; - -const minterAddress: string = "0x0987654321098765432109876543210987654321"; // the contract address of the token to mint - -const action: DaoAction = tokenVotingClient.encoding.mintTokenAction( - minterAddress, - params, -); -console.log({ action }); -``` - - -Returns: - -```json -{ action: - { - to: "0x0987654321098765432...", - value: 0n, - data: Uint8Array[12,34,45...] - } -} -``` - -### Decoding - -```ts -// Decodes the parameters of a mint token action. -const decodedParams: MintTokenParams = tokenVotingClient.decoding - .mintTokenAction(action.data); -console.log({ decodedParams }); -``` - - -Returns: - -```json -{ decodedParams: - { - address: "0x12345...", - amount: 10n - } -} -``` \ No newline at end of file diff --git a/versioned_docs/version-1.3.0/sdk/01-examples/05-encoders-decoders/14-token-voting/03-update-plugin-settings.md b/versioned_docs/version-1.3.0/sdk/01-examples/05-encoders-decoders/14-token-voting/03-update-plugin-settings.md deleted file mode 100644 index 49bce5c4..00000000 --- a/versioned_docs/version-1.3.0/sdk/01-examples/05-encoders-decoders/14-token-voting/03-update-plugin-settings.md +++ /dev/null @@ -1,69 +0,0 @@ ---- -title: Update Token Voting Settings ---- - -## Update the Token Voting Plugin Settings - -Updates the configuration of a given TokenVoting plugin for a DAO. - -### Encoding - -```ts -import { VotingMode, VotingSettings } from "@aragon/sdk-client"; -import { DaoAction } from "@aragon/sdk-client-common"; -import { tokenVotingClient } from "./index"; - -// The new configuration parameters for the plugin -const params: VotingSettings = { - minDuration: 60 * 60 * 24 * 2, // seconds - minParticipation: 0.25, // 25% - supportThreshold: 0.5, // 50% - minProposerVotingPower: BigInt("5000"), // default 0 - votingMode: VotingMode.STANDARD, // default standard, otherwise EARLY_EXECUTION or VOTE_REPLACEMENT -}; - -const pluginAddress: string = "0x1234567890123456789012345678901234567890"; // the address of the TokenVoting plugin contract installed in the DAO - -// Updates the configuration of a TokenVoting plugin for a DAO. -const action: DaoAction = tokenVotingClient.encoding.updatePluginSettingsAction( - pluginAddress, - params, -); -console.log({ action }); -``` - - -Returns: - -``` -{ action: - { - to: "0x1234567890...", - value: 0n, - data: Uint8Array[12,34,45...] - } -} -``` - -### Decoding - -```ts -// Decodes the parameters of an update plugin settings action. -const decodedParams: VotingSettings = tokenVotingClient - .decoding.updatePluginSettingsAction(action.data); -console.log({ decodedParams }); -``` - - -Returns: - -``` -{ decodedParams: - { - minDuration: 7200, // seconds - minParticipation: 0.25, // 25% - supportThreshold: 0.5, // 50% - minProposerVotingPower: BigInt("5000") - } -} -``` \ No newline at end of file diff --git a/versioned_docs/version-1.3.0/sdk/01-examples/05-encoders-decoders/14-token-voting/index.md b/versioned_docs/version-1.3.0/sdk/01-examples/05-encoders-decoders/14-token-voting/index.md deleted file mode 100644 index d141ff6c..00000000 --- a/versioned_docs/version-1.3.0/sdk/01-examples/05-encoders-decoders/14-token-voting/index.md +++ /dev/null @@ -1,22 +0,0 @@ ---- -title: Token Voting ---- - -## Actions of the Token Voting Plugin - -With an instance of the `TokenVotingClient` - -```ts -import { TokenVotingClient } from "@aragon/sdk-client"; -import { context } from "../../index"; - -// Instantiates a plugin context from the Aragon OSx SDK context. - -// Instantiates a TokenVoting client. -export const tokenVotingClient: TokenVotingClient = new TokenVotingClient( - context, -); -``` - - -actions can encoded and decoded as demonstrated in the following examples. \ No newline at end of file diff --git a/versioned_docs/version-1.3.0/sdk/01-examples/05-encoders-decoders/15-apply-update.md b/versioned_docs/version-1.3.0/sdk/01-examples/05-encoders-decoders/15-apply-update.md deleted file mode 100644 index 17d60c3f..00000000 --- a/versioned_docs/version-1.3.0/sdk/01-examples/05-encoders-decoders/15-apply-update.md +++ /dev/null @@ -1,110 +0,0 @@ ---- -title: Apply Update ---- - -## Apply a Plugin Update - -Encodes the action of applying a plugin update. - -### Encoding - -```ts -import { - ApplyUpdateParams, - Client, - DecodedApplyUpdateParams, - PermissionIds, -} from "@aragon/sdk-client"; -import { DaoAction, PermissionOperationType } from "@aragon/sdk-client-common"; -import { context } from "../index"; - -// Instantiates an Aragon OSx SDK client. -const client: Client = new Client(context); - -// This variable contains the values received on the prepareUpdate() method -const applyUpdateParams: ApplyUpdateParams = { - permissions: [{ - operation: PermissionOperationType.REVOKE, - permissionId: PermissionIds.EXECUTE_PERMISSION_ID, - where: "0x1234567890123456789012345678901234567890", - who: "0x2345678901234567890123456789012345678901", - }], - initData: new Uint8Array([12, 34, 45, 56]), - helpers: [], - versionTag: { - build: 1, - release: 1, - }, - pluginRepo: "0x2345678901234567890123456789012345678901", - pluginAddress: "0x1234567890123456789012345678901234567890", -}; - -const daoAddressOrEns: string = "0x123123123123123123123123123123123123"; // "my-dao.eth" - -const actions: DaoAction[] = client.encoding.applyUpdateAndPermissionsActionBlock( - daoAddressOrEns, - applyUpdateParams, -); -console.log(actions); -``` - - -Returns three actions: - -- Grant root permission to the Plugin Setup Processor -- Ask it to apply the update -- Revoke the root permission to the Plugin Setup Processor - -```json -[ - { - to: "0x123123123...", - value: 0n, - data: Uint8Array[12,34,45...] - }, - { - to: "0x123123123...", - value: 0n, - data: Uint8Array[12,34,45...] - }, - { - to: "0x123123123...", - value: 0n, - data: Uint8Array[12,34,45...] - } -] -``` - -### Decoding - -```ts -// Decodes the apply update action for a Multisig plugin. -const decodedParams: DecodedApplyUpdateParams = client.decoding - .applyUpdateAction(actions[1].data); -console.log({ decodedParams }); -``` - - -Returns: - -```json -{ decodedParams: - { - permissions: [{ - operation: 1, // REVOKE - permissionId: Uint8Array([10,20,30]), - where: "0x1234567890123456789012345678901234567890", - who: "0x2345678901234567890123456789012345678901", - }], - versionTag: { - build: 1, - release: 1, - }, - initData: Uint8Array[12,34,45...], - helpers: [], - pluginRepo: "0x2345678901234567890123456789012345678901", - pluginAddress: "0x1234567890123456789012345678901234567890", - }; - } -} -``` \ No newline at end of file diff --git a/versioned_docs/version-1.3.0/sdk/01-examples/05-encoders-decoders/16-dao-update.md b/versioned_docs/version-1.3.0/sdk/01-examples/05-encoders-decoders/16-dao-update.md deleted file mode 100644 index a132f386..00000000 --- a/versioned_docs/version-1.3.0/sdk/01-examples/05-encoders-decoders/16-dao-update.md +++ /dev/null @@ -1,69 +0,0 @@ ---- -title: Update a DAO ---- - -## Generate a DAO Update action - -Given a DAO address, the previous version and the new DAO Factory address, it generates the actions to update a DAO. - -### Encoding - -```ts -import { - Client, - DaoUpdateDecodedParams, - DaoUpdateParams, -} from "@aragon/sdk-client"; -import { - DaoAction, - LIVE_CONTRACTS, -} from "@aragon/sdk-client-common"; -import { context } from "../index"; - -// Instantiates an Aragon OSx SDK client. -const client: Client = new Client(context); - -const daoUpdateParams: DaoUpdateParams = { - previousVersion: [1, 0, 0], - daoFactoryAddress: LIVE_CONTRACTS["1.3.0"].base.daoFactoryAddress, // if not specified it will use the latest version in the context network - initData: new Uint8Array([12, 34, 45, 56]), // data needed to update specified, empty by default -}; - -const daoAddressOrEns: string = "0x123123123123123123123123123123123123"; // "my-dao.eth" - -const actions: DaoAction = await client.encoding.daoUpdateAction( - daoAddressOrEns, - daoUpdateParams, -); -console.log(actions); -``` - - -```json -{ - to: "0x123123123...", - value: 0n, - data: Uint8Array[12,34,45...] -}, - ``` - - ### Decoding - -```ts -// Decodes the apply update action for a Multisig plugin. -const decodedParams: DaoUpdateDecodedParams = client.decoding - .daoUpdateAction(actions[1].data); -console.log({ decodedParams }); -``` - - -Returns: - ```json - { decodedParams: - { - previousVersion: [1, 0, 0], - implementationAddress: "0x123123123...", // DAO base implementation address - initData: Uint8Array[12,34,45...] - } - } - ``` \ No newline at end of file diff --git a/versioned_docs/version-1.3.0/sdk/01-examples/05-encoders-decoders/index.md b/versioned_docs/version-1.3.0/sdk/01-examples/05-encoders-decoders/index.md deleted file mode 100644 index 8737f75f..00000000 --- a/versioned_docs/version-1.3.0/sdk/01-examples/05-encoders-decoders/index.md +++ /dev/null @@ -1,22 +0,0 @@ ---- -title: Action Encoders & Decoders ---- - -## Encoding Actions - -Proposals will eventually need to execute some action on behalf of the DAO, which needs to be encoded in a low-level format. - -The action encoders help encoding the most typical DAO operations. The way they work is that they can only get executed once a proposal passes. - -Hence, the flow is the following: -1. Encode the actions that you want to execute -2. Create a proposal with these actions in the `actions` field -3. Vote until the proposal has a majority: if the voting mode is `EARLY_EXECUTION` or until the `endDate` is achieved if the `votingMode` is `STANDARD` or `VOTE_REPLACEMENT` -4. If the propoosal passes the required approvals and participation, execute the proposal -5. Success - -## Decoding Actions - -To obtain the encoded back in readable format, you can decode -After a sucessful transaction, you can de -Decodes the actions of a transaction to understand them in a human-readable format. \ No newline at end of file diff --git a/versioned_docs/version-1.3.0/sdk/01-examples/index.md b/versioned_docs/version-1.3.0/sdk/01-examples/index.md deleted file mode 100644 index d6d94495..00000000 --- a/versioned_docs/version-1.3.0/sdk/01-examples/index.md +++ /dev/null @@ -1,99 +0,0 @@ ---- -title: Getting Started ---- - -## Getting Started With the Aragon SDK - -### Before You Begin - -The Aragon OSx SDK is Javascript agnostic, which means you can use it with any Javascript framework, including popular ones like React, Vite, or Vue. - -However, keep in mind that because server-side rendering is not supported yet for some crypto packages, you will not be able to use a framework like NextJS. Only frameworks that run entirely on client-side are supported. - -Also know that all documentation within this site is done with Typescript. You can read more about [Typescript here](https://www.typescriptlang.org/). - -### Installing the SDK - -First thing you want to do is install the Aragon OSx SDK package into your product. You can do this by using `npm` or `yarn`. - -```bash -npm install @aragon/sdk-client -``` -or -```bash -yarn add @aragon/sdk-client -``` - -### Setting up the Context - -Then, you'll want to set up the Aragon OSx SDK context within your application to have access to the SDK functions. You can do this at any point within your app. - -However, so you're not setting it up multiple times, we recommend you set it up as a [context hook](https://www.freecodecamp.org/news/react-context-for-beginners/) within Javascript application if you're using a framework like React, Vue, or other, or within the entry file of your app. - -```ts -import { Wallet } from "@ethersproject/wallet"; -import { Context, ContextParams } from "@aragon/sdk-client"; -import { SupportedNetwork } from "@aragon/sdk-client-common"; - -// Set up your IPFS API key. You can get one either by running a local node or by using a service like Infura or Alechmy. -// Make sure to always keep these private in a file that is not committed to your public repository. -export const IPFS_API_KEY: string = "ipfs-api-key"; - -// OPTION A: The simplest ContextParams you can have is this. This uses our default values and should work perfectly within your product. -const minimalContextParams: ContextParams = { - // Choose the network you want to use. You can use "goerli" (Ethereum) or "maticmum" (Polygon) for testing, or "mainnet" (Ethereum) and "polygon" (Polygon) for mainnet. - network: SupportedNetwork.MAINNET, - web3Providers: "https://eth.llamarpc.com", - // This is the signer account who will be signing transactions for your app. You can use also use a specific account where you have funds, through passing it `new Wallet("your-wallets-private-key")` or pass it in dynamically when someone connects their wallet to your dApp. - signer: Wallet.createRandom(), -}; - -// OPTION B: For a more advanced option, you can use the following ContextParams. This will allow you to use your own custom values if desired. -export const contextParams: ContextParams = { - // Choose the network you want to use. You can use "goerli" (Ethereum) or "maticmum" (Mumbai) for testing, or "mainnet" (Ethereum) and "polygon" (Polygon) for mainnet. - network: "goerli", - // This is the account that will be signing transactions for your app. You can use also use a specific account where you have funds, through passing it `new Wallet("your-wallets-private-key")` or pass it in dynamically when someone connects their wallet to your dApp. - signer: Wallet.createRandom(), - // Optional on "rinkeby", "arbitrum-rinkeby" or "mumbai" - // Pass the address of the `DaoFactory` contract you want to use. You can find it here based on your chain of choice: https://github.com/aragon/core/blob/develop/active_contracts.json - // Optional. Leave it empty to use Aragon's DAO Factory contract and claim a dao.eth subdomain - daoFactoryAddress: "0x1234381072385710239847120734123847123", - // Optional. Pass the address of the ensRegistry for networks other than Mainnet or Goerli. - // It will default to the registry deployed by Aragon. You can check them here: https://github.com/aragon/osx/blob/develop/active_contracts.json - ensRegistryAddress: "0x1234381072385710239847120734123847123", - // Choose your Web3 provider: Cloudfare, Infura, Alchemy, etc. - // Remember to change the list of providers if a different network is selected - web3Providers: ["https://rpc.ankr.com/eth_goerli"], - // Optional. By default, it will use Aragon's provided endpoints. - // They will switch depending on the network (production, development) - ipfsNodes: [ - { - url: "https://test.ipfs.aragon.network/api/v0", - headers: { "X-API-KEY": IPFS_API_KEY || "" }, - }, - ], - // Optional. By default it will use Aragon's provided endpoints. - // They will switch depending on the network (production, development) - graphqlNodes: [ - { - url: "https://subgraph.satsuma-prod.com/aragon/core-goerli/api", - }, - ], -}; - -// After defining the context parameters, you'll use them to instantiate the Aragon SDK context -export const context: Context = new Context(contextParams); // or minimalContextParams -// Instantiate the Aragon SDK context -export const minimalContext: Context = new Context(minimalContextParams); -``` - - -Update the context with new parameters if you wish to throughout your app. - -```ts -context.set({ network: 1 }); -context.set({ signer: new Wallet("private key") }); // if you're using wagmi library, you can also get the signer through their [`useSigner` method](https://wagmi.sh/react/hooks/useSigner) inside a `useEffect` hook. -context.set(contextParams); -``` - - diff --git a/versioned_docs/version-1.3.0/sdk/02-reference-guide/01-client.md b/versioned_docs/version-1.3.0/sdk/02-reference-guide/01-client.md deleted file mode 100644 index ad3837fa..00000000 --- a/versioned_docs/version-1.3.0/sdk/02-reference-guide/01-client.md +++ /dev/null @@ -1,757 +0,0 @@ -## 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](#clientdecoding) - * [.applyInstallationAction(Uint8Array)](#clientdecodingapplyinstallationactionuint8array--decodedapplyinstallationparams) ⇒ DecodedApplyInstallationParams - * [.applyUninstallationAction(Uint8Array)](#clientdecodingapplyuninstallationactionuint8array--decodedapplyinstallationparams) ⇒ DecodedApplyInstallationParams - * [.applyUpdateAction(data)](#clientdecodingapplyupdateactiondata--decodedapplyupdateparams) ⇒ DecodedApplyUpdateParams - * [.grantAction(data)](#clientdecodinggrantactiondata--grantpermissiondecodedparams) ⇒ GrantPermissionDecodedParams - * [.grantWithConditionAction(data)](#clientdecodinggrantwithconditionactiondata--grantpermissionwithconditionparams) ⇒ GrantPermissionWithConditionParams - * [.revokeAction(data)](#clientdecodingrevokeactiondata--revokepermissiondecodedparams) ⇒ RevokePermissionDecodedParams - * [.withdrawAction(data)](#clientdecodingwithdrawactiondata--withdrawparams) ⇒ WithdrawParams - * [.updateDaoMetadataRawAction(data)](#clientdecodingupdatedaometadatarawactiondata--string) ⇒ string - * [.updateDaoMetadataAction(data)](#clientdecodingupdatedaometadataactiondata--promisedaometadata) ⇒ Promise.<DaoMetadata> - * [.setDaoUriAction(data)](#clientdecodingsetdaouriactiondata--string) ⇒ string - * [.registerStandardCallbackAction(data)](#clientdecodingregisterstandardcallbackactiondata--registerstandardcallbackparams) ⇒ RegisterStandardCallbackParams - * [.setSignatureValidatorAction(data)](#clientdecodingsetsignaturevalidatoractiondata--string) ⇒ string - * [.upgradeToAndCallAction(data)](#clientdecodingupgradetoandcallactiondata--upgradetoandcallparams) ⇒ UpgradeToAndCallParams - * [.initializeFromAction(data)](#clientdecodinginitializefromactiondata--initializefromparams) ⇒ InitializeFromParams - * [.findInterface(data)](#clientdecodingfindinterfacedata--interfaceparams--null) ⇒ InterfaceParams \| null - * [.daoUpdateAction(data)](#clientdecodingdaoupdateactiondata--daoupdatedecodedparams) ⇒ DaoUpdateDecodedParams - - - -### clientDecoding.applyInstallationAction(Uint8Array) ⇒ DecodedApplyInstallationParams -**Kind**: instance method of [ClientDecoding](#clientdecoding) -**Returns**: DecodedApplyInstallationParams - -| Param | Type | -| --- | --- | -| Uint8Array | data | - - - -### clientDecoding.applyUninstallationAction(Uint8Array) ⇒ DecodedApplyInstallationParams -**Kind**: instance method of [ClientDecoding](#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](#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](#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](#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](#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](#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](#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](#clientdecoding) -**Returns**: Promise.<DaoMetadata> - -| Param | Type | -| --- | --- | -| data | Uint8Array | - - - -### clientDecoding.setDaoUriAction(data) ⇒ string -

Decodes the daoUri from a setDaoUriAction

- -**Kind**: instance method of [ClientDecoding](#clientdecoding) -**Returns**: string - -| Param | Type | -| --- | --- | -| data | Uint8Array | - - - -### clientDecoding.registerStandardCallbackAction(data) ⇒ RegisterStandardCallbackParams -

Decodes the RegisterStandardCallbackParams from a registerStandardCallbackAction

- -**Kind**: instance method of [ClientDecoding](#clientdecoding) -**Returns**: RegisterStandardCallbackParams - -| Param | Type | -| --- | --- | -| data | Uint8Array | - - - -### clientDecoding.setSignatureValidatorAction(data) ⇒ string -

Decodes the implementation address from an encoded upgradeToAction

- -**Kind**: instance method of [ClientDecoding](#clientdecoding) -**Returns**: string - -| Param | Type | -| --- | --- | -| data | Uint8Array | - - - -### clientDecoding.upgradeToAndCallAction(data) ⇒ UpgradeToAndCallParams -

Decodes upgradeToAndCallback params from an upgradeToAndCallAction

- -**Kind**: instance method of [ClientDecoding](#clientdecoding) -**Returns**: UpgradeToAndCallParams - -| Param | Type | -| --- | --- | -| data | Uint8Array | - - - -### clientDecoding.initializeFromAction(data) ⇒ InitializeFromParams -

Decodes the initializeFrom params from an initializeFromAction

- -**Kind**: instance method of [ClientDecoding](#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](#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](#clientdecoding) -**Returns**: DaoUpdateDecodedParams - -| Param | Type | -| --- | --- | -| data | Uint8Array | - - - -## ClientEncoding -

Encoding module the SDK Generic Client

- -**Kind**: global class - -* [ClientEncoding](#clientencoding) - * [.applyInstallationAction(daoAddress, params)](#clientencodingapplyinstallationactiondaoaddress-params--daoaction) ⇒ DaoAction - * [.applyUpdateAndPermissionsActionBlock(daoAddress, params)](#clientencodingapplyupdateandpermissionsactionblockdaoaddress-params--arraydaoaction) ⇒ Array.<DaoAction> - * [.grantAction(daoAddress, params)](#clientencodinggrantactiondaoaddress-params--daoaction) ⇒ DaoAction - * [.grantWithConditionAction(daoAddress, params)](#clientencodinggrantwithconditionactiondaoaddress-params--daoaction) ⇒ DaoAction - * [.revokeAction(daoAddress, params)](#clientencodingrevokeactiondaoaddress-params--daoaction) ⇒ DaoAction - * [.withdrawAction(recipientAddressOrEns, value)](#clientencodingwithdrawactionrecipientaddressorens-value--promisedaoaction) ⇒ Promise.<DaoAction> - * [.updateDaoMetadataAction(daoAddressOrEns, params)](#clientencodingupdatedaometadataactiondaoaddressorens-params--promisedaoaction) ⇒ Promise.<DaoAction> - * [.setDaoUriAction(daoAddressOrEns, daoUri)](#clientencodingsetdaouriactiondaoaddressorens-daouri--daoaction) ⇒ DaoAction - * [.registerStandardCallbackAction(daoAddressOrEns, daoUri)](#clientencodingregisterstandardcallbackactiondaoaddressorens-daouri--daoaction) ⇒ DaoAction - * [.setSignatureValidatorAction(daoAddressOrEns, signatureValidator)](#clientencodingsetsignaturevalidatoractiondaoaddressorens-signaturevalidator--daoaction) ⇒ DaoAction - * [.upgradeToAction(daoAddressOrEns, implementationAddress)](#clientencodingupgradetoactiondaoaddressorens-implementationaddress--daoaction) ⇒ DaoAction - * [.upgradeToAndCallAction(daoAddressOrEns, params)](#clientencodingupgradetoandcallactiondaoaddressorens-params--daoaction) ⇒ DaoAction - * [.initializeFromAction(daoAddressOrEns, params)](#clientencodinginitializefromactiondaoaddressorens-params--daoaction) ⇒ DaoAction - * [.daoUpdateAction(daoAddressOrEns, params)](#clientencodingdaoupdateactiondaoaddressorens-params--promisedaoaction) ⇒ Promise.<DaoAction> - - - -### clientEncoding.applyInstallationAction(daoAddress, params) ⇒ DaoAction -**Kind**: instance method of [ClientEncoding](#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](#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](#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](#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](#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](#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](#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](#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](#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](#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](#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](#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](#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](#clientencoding) -**Returns**: Promise.<DaoAction> - -| Param | Type | -| --- | --- | -| daoAddressOrEns | string | -| params | DaoUpdateParams | - - - -## ClientEstimation -

Estimation module the SDK Generic Client

- -**Kind**: global class - -* [ClientEstimation](#clientestimation) - * [.createDao(_params)](#clientestimationcreatedao_params--promisegasfeeestimation) ⇒ Promise.<GasFeeEstimation> - * [.deposit(params)](#clientestimationdepositparams--promisegasfeeestimation) ⇒ Promise.<GasFeeEstimation> - * [.setAllowance(_params)](#clientestimationsetallowance_params--promisegasfeeestimation) ⇒ Promise.<GasFeeEstimation> - * [.prepareUpdate(params)](#clientestimationprepareupdateparams--promisegasfeeestimation) ⇒ Promise.<GasFeeEstimation> - - - -### clientEstimation.createDao(_params) ⇒ Promise.<GasFeeEstimation> -

Estimates the gas fee of creating a DAO

- -**Kind**: instance method of [ClientEstimation](#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](#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](#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](#clientestimation) -**Returns**: Promise.<GasFeeEstimation> - -| Param | Type | -| --- | --- | -| params | PrepareUpdateParams | - - - -## ClientMethods -

Methods module the SDK Generic Client

- -**Kind**: global class - -* [ClientMethods](#clientmethods) - * [.createDao(params)](#clientmethodscreatedaoparams--asyncgeneratordaocreationstepvalue) ⇒ AsyncGenerator.<DaoCreationStepValue> - * [.pinMetadata(params)](#clientmethodspinmetadataparams--promisestring) ⇒ Promise.<string> - * [.deposit(params)](#clientmethodsdepositparams--asyncgeneratordaodepositstepvalue) ⇒ AsyncGenerator.<DaoDepositStepValue> - * [.setAllowance(params)](#clientmethodssetallowanceparams--asyncgeneratorsetallowancestepvalue) ⇒ AsyncGenerator.<SetAllowanceStepValue> - * [.prepareUninstallation(params)](#clientmethodsprepareuninstallationparams--asyncgeneratorprepareuninstallationstepvalue) ⇒ AsyncGenerator.<PrepareUninstallationStepValue> - * [.prepareUpdate(params)](#clientmethodsprepareupdateparams--asyncgeneratorprepareupdatestepvalue) ⇒ AsyncGenerator.<PrepareUpdateStepValue> - * [.hasPermission(params)](#clientmethodshaspermissionparams--promiseboolean) ⇒ Promise.<boolean> - * [.getDao(daoAddressOrEns)](#clientmethodsgetdaodaoaddressorens--promisedaodetailsnull) ⇒ Promise.<(DaoDetails\|null)> - * [.getDaos(params)](#clientmethodsgetdaosparams--promisearraydaolistitem) ⇒ Promise.<Array.<DaoListItem>> - * [.getDaoBalances(params)](#clientmethodsgetdaobalancesparams--promisearrayassetbalancenull) ⇒ Promise.<(Array.<AssetBalance>\|null)> - * [.getDaoTransfers(params)](#clientmethodsgetdaotransfersparams--promisearraytransfernull) ⇒ Promise.<(Array.<Transfer>\|null)> - * [.getPlugins(params)](#clientmethodsgetpluginsparams--promisearraypluginreponull) ⇒ Promise.<(Array.<PluginRepo>\|null)> - * [.getPlugin(pluginAddress)](#clientmethodsgetpluginpluginaddress--promisepluginrepo) ⇒ Promise.<PluginRepo> - * [.getProtocolVersion(contractAddress)](#clientmethodsgetprotocolversioncontractaddress--promisearraynumber) ⇒ Promise.<Array.<number>> - * [.isDaoUpdateProposal(proposalId)](#clientmethodsisdaoupdateproposalproposalid--promiseboolean) ⇒ Promise.<boolean> - * [.isPluginUpdateProposal(proposalId)](#clientmethodsispluginupdateproposalproposalid--promiseboolean) ⇒ Promise.<boolean> - * [.isPluginUpdateProposalValid(proposalId)](#clientmethodsispluginupdateproposalvalidproposalid--promisepluginupdateproposalvalidity) ⇒ Promise.<PluginUpdateProposalValidity> - * [.isDaoUpdateProposalValid(proposalId, [version])](#clientmethodsisdaoupdateproposalvalidproposalid-version--promisedaoupdateproposalvalidity) ⇒ Promise.<DaoUpdateProposalValidity> - * [.getDaoImplementation(daoFactoryAddress)](#clientmethodsgetdaoimplementationdaofactoryaddress--promisestring) ⇒ Promise.<string> - - - -### clientMethods.createDao(params) ⇒ AsyncGenerator.<DaoCreationStepValue> -

Creates a DAO with the given settings and plugins

- -**Kind**: instance method of [ClientMethods](#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](#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](#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](#clientmethods) -**Returns**: AsyncGenerator.<SetAllowanceStepValue> - -| Param | Type | -| --- | --- | -| params | SetAllowanceParams | - - - -### clientMethods.prepareUninstallation(params) ⇒ AsyncGenerator.<PrepareUninstallationStepValue> -

Prepare uninstallation of a plugin

- -**Kind**: instance method of [ClientMethods](#clientmethods) -**Returns**: AsyncGenerator.<PrepareUninstallationStepValue> - -| Param | Type | -| --- | --- | -| params | PrepareUninstallationParams | - - - -### clientMethods.prepareUpdate(params) ⇒ AsyncGenerator.<PrepareUpdateStepValue> -

Prepare update of a plugin

- -**Kind**: instance method of [ClientMethods](#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](#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](#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](#clientmethods) -**Returns**: Promise.<Array.<DaoListItem>> - -| Param | Type | Description | -| --- | --- | --- | -| params | DaoQueryParams |
  • 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](#clientmethods) -**Returns**: Promise.<(Array.<AssetBalance>\|null)> - -| Param | Type | Description | -| --- | --- | --- | -| params | DaoBalancesQueryParams |
  • 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](#clientmethods) -**Returns**: Promise.<(Array.<Transfer>\|null)> - -| Param | Type | Description | -| --- | --- | --- | -| params | TransferQueryParams |
  • 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](#clientmethods) -**Returns**: Promise.<(Array.<PluginRepo>\|null)> - -| Param | Type | Description | -| --- | --- | --- | -| params | PluginQueryParams |
  • 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](#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](#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](#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](#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](#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](#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](#clientmethods) -**Returns**: Promise.<string> - -| Param | Type | -| --- | --- | -| daoFactoryAddress | string | - diff --git a/versioned_docs/version-1.3.0/sdk/02-reference-guide/02-multisig.md b/versioned_docs/version-1.3.0/sdk/02-reference-guide/02-multisig.md deleted file mode 100644 index 4b337ced..00000000 --- a/versioned_docs/version-1.3.0/sdk/02-reference-guide/02-multisig.md +++ /dev/null @@ -1,404 +0,0 @@ -## Classes - -
-
MultisigClient
-

Provider a generic client with high level methods to manage and interact an Address List Voting plugin installed in a DAO

-
MultisigClientDecoding
-

Decoding module for the SDK AddressList Client

-
MultisigClientEncoding
-

Encoding module for the SDK Multisig Client

-
MultisigClientEstimation
-

Estimation module the SDK Address List Client

-
MultisigClientMethods
-

Methods module the SDK Address List Client

-
- - - -## MultisigClient -

Provider a generic client with high level methods to manage and interact an Address List Voting plugin installed in a DAO

- -**Kind**: global class - - -### MultisigClient.getPluginInstallItem(params, [network]) ⇒ PluginInstallItem -

Computes the parameters to be given when creating the DAO, -so that the plugin is configured

- -**Kind**: static method of [MultisigClient](#multisigclient) -**Returns**: PluginInstallItem - -| Param | Type | Default | -| --- | --- | --- | -| params | MultisigPluginInstallParams | | -| [network] | Networkish | "mainnet" | - - - -## MultisigClientDecoding -

Decoding module for the SDK AddressList Client

- -**Kind**: global class - -* [MultisigClientDecoding](#multisigclientdecoding) - * [.addAddressesAction(data)](#multisigclientdecodingaddaddressesactiondata--arraystring) ⇒ Array.<string> - * [.removeAddressesAction(data)](#multisigclientdecodingremoveaddressesactiondata--arraystring) ⇒ Array.<string> - * [.updateMultisigVotingSettings(data)](#multisigclientdecodingupdatemultisigvotingsettingsdata--multisigvotingsettings) ⇒ MultisigVotingSettings - * [.findInterface(data)](#multisigclientdecodingfindinterfacedata--interfaceparams--null) ⇒ InterfaceParams \| null - - - -### multisigClientDecoding.addAddressesAction(data) ⇒ Array.<string> -

Decodes a list of addresses from an encoded add members action

- -**Kind**: instance method of [MultisigClientDecoding](#multisigclientdecoding) -**Returns**: Array.<string> - -| Param | Type | -| --- | --- | -| data | Uint8Array | - - - -### multisigClientDecoding.removeAddressesAction(data) ⇒ Array.<string> -

Decodes a list of addresses from an encoded remove members action

- -**Kind**: instance method of [MultisigClientDecoding](#multisigclientdecoding) -**Returns**: Array.<string> - -| Param | Type | -| --- | --- | -| data | Uint8Array | - - - -### multisigClientDecoding.updateMultisigVotingSettings(data) ⇒ MultisigVotingSettings -

Decodes a list of min approvals from an encoded update min approval action

- -**Kind**: instance method of [MultisigClientDecoding](#multisigclientdecoding) -**Returns**: MultisigVotingSettings - -| Param | Type | -| --- | --- | -| data | Uint8Array | - - - -### multisigClientDecoding.findInterface(data) ⇒ InterfaceParams \| null -

Returns the decoded function info given the encoded data of an action

- -**Kind**: instance method of [MultisigClientDecoding](#multisigclientdecoding) -**Returns**: InterfaceParams \| null - -| Param | Type | -| --- | --- | -| data | Uint8Array | - - - -## MultisigClientEncoding -

Encoding module for the SDK Multisig Client

- -**Kind**: global class - -* [MultisigClientEncoding](#multisigclientencoding) - * _instance_ - * [.addAddressesAction(params)](#multisigclientencodingaddaddressesactionparams--arraydaoaction) ⇒ Array.<DaoAction> - * [.removeAddressesAction(params)](#multisigclientencodingremoveaddressesactionparams--arraydaoaction) ⇒ Array.<DaoAction> - * [.updateMultisigVotingSettings(params)](#multisigclientencodingupdatemultisigvotingsettingsparams--daoaction) ⇒ DaoAction - * _static_ - * [.getPluginInstallItem(params, network)](#multisigclientencodinggetplugininstallitemparams-network--plugininstallitem) ⇒ PluginInstallItem - - - -### multisigClientEncoding.addAddressesAction(params) ⇒ Array.<DaoAction> -

Computes the parameters to be given when creating a proposal that updates the governance configuration

- -**Kind**: instance method of [MultisigClientEncoding](#multisigclientencoding) -**Returns**: Array.<DaoAction> - -| Param | Type | -| --- | --- | -| params | AddAddressesParams | - - - -### multisigClientEncoding.removeAddressesAction(params) ⇒ Array.<DaoAction> -

Computes the parameters to be given when creating a proposal that adds addresses to address list

- -**Kind**: instance method of [MultisigClientEncoding](#multisigclientencoding) -**Returns**: Array.<DaoAction> - -| Param | Type | -| --- | --- | -| params | RemoveAddressesParams | - - - -### multisigClientEncoding.updateMultisigVotingSettings(params) ⇒ DaoAction -

Computes the parameters to be given when creating a proposal updates multisig settings

- -**Kind**: instance method of [MultisigClientEncoding](#multisigclientencoding) -**Returns**: DaoAction - -| Param | Type | -| --- | --- | -| params | UpdateMultisigVotingSettingsParams | - - - -### MultisigClientEncoding.getPluginInstallItem(params, network) ⇒ PluginInstallItem -

Computes the parameters to be given when creating the DAO, -so that the plugin is configured

- -**Kind**: static method of [MultisigClientEncoding](#multisigclientencoding) -**Returns**: PluginInstallItem - -| Param | Type | -| --- | --- | -| params | MultisigPluginInstallParams | -| network | Networkish | - - - -## MultisigClientEstimation -

Estimation module the SDK Address List Client

- -**Kind**: global class - -* [MultisigClientEstimation](#multisigclientestimation) - * [.createProposal(params)](#multisigclientestimationcreateproposalparams--promisegasfeeestimation) ⇒ Promise.<GasFeeEstimation> - * [.approveProposal(params)](#multisigclientestimationapproveproposalparams--promisegasfeeestimation) ⇒ Promise.<GasFeeEstimation> - * [.executeProposal(proposalId)](#multisigclientestimationexecuteproposalproposalid--promisegasfeeestimation) ⇒ Promise.<GasFeeEstimation> - * [.prepareUpdate(params)](#multisigclientestimationprepareupdateparams--promisegasfeeestimation) ⇒ Promise.<GasFeeEstimation> - - - -### multisigClientEstimation.createProposal(params) ⇒ Promise.<GasFeeEstimation> -

Estimates the gas fee of creating a proposal on the plugin

- -**Kind**: instance method of [MultisigClientEstimation](#multisigclientestimation) -**Returns**: Promise.<GasFeeEstimation> - -| Param | Type | -| --- | --- | -| params | CreateMultisigProposalParams | - - - -### multisigClientEstimation.approveProposal(params) ⇒ Promise.<GasFeeEstimation> -

Estimates the gas fee of approving a proposal

- -**Kind**: instance method of [MultisigClientEstimation](#multisigclientestimation) -**Returns**: Promise.<GasFeeEstimation> - -| Param | Type | -| --- | --- | -| params | ApproveMultisigProposalParams | - - - -### multisigClientEstimation.executeProposal(proposalId) ⇒ Promise.<GasFeeEstimation> -

Estimates the gas fee of executing a proposal

- -**Kind**: instance method of [MultisigClientEstimation](#multisigclientestimation) -**Returns**: Promise.<GasFeeEstimation> - -| Param | Type | -| --- | --- | -| proposalId | string | - - - -### multisigClientEstimation.prepareUpdate(params) ⇒ Promise.<GasFeeEstimation> -

Estimates the gas fee of preparing an update

- -**Kind**: instance method of [MultisigClientEstimation](#multisigclientestimation) -**Returns**: Promise.<GasFeeEstimation> - -| Param | Type | -| --- | --- | -| params | MultisigPluginPrepareUpdateParams | - - - -## MultisigClientMethods -

Methods module the SDK Address List Client

- -**Kind**: global class - -* [MultisigClientMethods](#multisigclientmethods) - * [.createProposal(params)](#multisigclientmethodscreateproposalparams--asyncgeneratorproposalcreationstepvalue) ⇒ AsyncGenerator.<ProposalCreationStepValue> - * [.pinMetadata(params)](#multisigclientmethodspinmetadataparams--promisestring) ⇒ Promise.<string> - * [.approveProposal(params)](#multisigclientmethodsapproveproposalparams--asyncgeneratorapproveproposalstepvalue) ⇒ AsyncGenerator.<ApproveProposalStepValue> - * [.executeProposal(proposalId)](#multisigclientmethodsexecuteproposalproposalid--asyncgeneratorexecutemultisigproposalstepvalue) ⇒ AsyncGenerator.<ExecuteMultisigProposalStepValue> - * [.prepareInstallation(params)](#multisigclientmethodsprepareinstallationparams--asyncgeneratorprepareinstallationstepvalue) ⇒ AsyncGenerator.<PrepareInstallationStepValue> - * [.prepareUpdate(params)](#multisigclientmethodsprepareupdateparams--asyncgeneratorprepareupdatestepvalue) ⇒ AsyncGenerator.<PrepareUpdateStepValue> - * [.canApprove(addressOrEns)](#multisigclientmethodscanapproveaddressorens--promiseboolean) ⇒ Promise.<boolean> - * [.canExecute(proposalId)](#multisigclientmethodscanexecuteproposalid--promiseboolean) ⇒ Promise.<boolean> - * [.getVotingSettings(addressOrEns, blockNumber)](#multisigclientmethodsgetvotingsettingsaddressorens-blocknumber--promisemultisigvotingsettings) ⇒ Promise.<MultisigVotingSettings> - * [.getMembers(params)](#multisigclientmethodsgetmembersparams--promisearraystring) ⇒ Promise.<Array.<string>> - * [.getProposal(proposalId)](#multisigclientmethodsgetproposalproposalid--promisemultisigproposalnull) ⇒ Promise.<(MultisigProposal\|null)> - * [.getProposals(params)](#multisigclientmethodsgetproposalsparams--promisearraymultisigproposallistitem) ⇒ Promise.<Array.<MultisigProposalListItem>> - * [.isMember(params)](#multisigclientmethodsismemberparams--boolean) ⇒ boolean - - - -### multisigClientMethods.createProposal(params) ⇒ AsyncGenerator.<ProposalCreationStepValue> -

Creates a new proposal on the given multisig plugin contract

- -**Kind**: instance method of [MultisigClientMethods](#multisigclientmethods) -**Returns**: AsyncGenerator.<ProposalCreationStepValue> - -| Param | Type | -| --- | --- | -| params | CreateMultisigProposalParams | - - - -### multisigClientMethods.pinMetadata(params) ⇒ Promise.<string> -

Pins a metadata object into IPFS and retruns the generated hash

- -**Kind**: instance method of [MultisigClientMethods](#multisigclientmethods) -**Returns**: Promise.<string> - -| Param | Type | -| --- | --- | -| params | ProposalMetadata | - - - -### multisigClientMethods.approveProposal(params) ⇒ AsyncGenerator.<ApproveProposalStepValue> -

Allow a wallet in the multisig give approval to a proposal

- -**Kind**: instance method of [MultisigClientMethods](#multisigclientmethods) -**Returns**: AsyncGenerator.<ApproveProposalStepValue> - -| Param | Type | -| --- | --- | -| params | ApproveMultisigProposalParams | - - - -### multisigClientMethods.executeProposal(proposalId) ⇒ AsyncGenerator.<ExecuteMultisigProposalStepValue> -

Allow a wallet in the multisig give approval to a proposal

- -**Kind**: instance method of [MultisigClientMethods](#multisigclientmethods) -**Returns**: AsyncGenerator.<ExecuteMultisigProposalStepValue> - -| Param | Type | -| --- | --- | -| proposalId | string | - - - -### multisigClientMethods.prepareInstallation(params) ⇒ AsyncGenerator.<PrepareInstallationStepValue> -

Prepares the installation of a multisig plugin in a given dao

- -**Kind**: instance method of [MultisigClientMethods](#multisigclientmethods) -**Returns**: AsyncGenerator.<PrepareInstallationStepValue> - -| Param | Type | -| --- | --- | -| params | MultisigPluginPrepareInstallationParams | - - - -### multisigClientMethods.prepareUpdate(params) ⇒ AsyncGenerator.<PrepareUpdateStepValue> -

Prepares the update of a multisig plugin in a given dao

- -**Kind**: instance method of [MultisigClientMethods](#multisigclientmethods) -**Returns**: AsyncGenerator.<PrepareUpdateStepValue> - -| Param | Type | -| --- | --- | -| params | MultisigPluginPrepareUpdateParams | - - - -### multisigClientMethods.canApprove(addressOrEns) ⇒ Promise.<boolean> -

Checks whether the current proposal can be approved by the given address

- -**Kind**: instance method of [MultisigClientMethods](#multisigclientmethods) -**Returns**: Promise.<boolean> - -| Param | Type | -| --- | --- | -| addressOrEns | string | - - - -### multisigClientMethods.canExecute(proposalId) ⇒ Promise.<boolean> -

Checks whether the current proposal can be executed

- -**Kind**: instance method of [MultisigClientMethods](#multisigclientmethods) -**Returns**: Promise.<boolean> - -| Param | Type | -| --- | --- | -| proposalId | string | - - - -### multisigClientMethods.getVotingSettings(addressOrEns, blockNumber) ⇒ Promise.<MultisigVotingSettings> -

Returns the voting settings

- -**Kind**: instance method of [MultisigClientMethods](#multisigclientmethods) -**Returns**: Promise.<MultisigVotingSettings> - -| Param | Type | -| --- | --- | -| addressOrEns | string | -| blockNumber | number | - - - -### multisigClientMethods.getMembers(params) ⇒ Promise.<Array.<string>> -

returns the members of the multisig

- -**Kind**: instance method of [MultisigClientMethods](#multisigclientmethods) -**Returns**: Promise.<Array.<string>> - -| Param | Type | Description | -| --- | --- | --- | -| params | MembersQueryParams |
  • pluginAddress
    • blockNumber
    • limit = 10
    • skip = 0
    • direction = SortDirection.ASC
    • sortBy = MembersSortBy.ADDRESS
| - - - -### multisigClientMethods.getProposal(proposalId) ⇒ Promise.<(MultisigProposal\|null)> -

Returns the details of the given proposal

- -**Kind**: instance method of [MultisigClientMethods](#multisigclientmethods) -**Returns**: Promise.<(MultisigProposal\|null)> - -| Param | Type | -| --- | --- | -| proposalId | string | - - - -### multisigClientMethods.getProposals(params) ⇒ Promise.<Array.<MultisigProposalListItem>> -

Returns a list of proposals on the Plugin, filtered by the given criteria

- -**Kind**: instance method of [MultisigClientMethods](#multisigclientmethods) -**Returns**: Promise.<Array.<MultisigProposalListItem>> - -| Param | Type | Description | -| --- | --- | --- | -| params | ProposalQueryParams |
  • daoAddressOrEns - limit = 10 - status - skip = 0 - direction = SortDirection.ASC - sortBy = ProposalSortBy.CREATED_AT
| - - - -### multisigClientMethods.isMember(params) ⇒ boolean -

Checks if a given address is a member of the tokenVoting contract.

- -**Kind**: instance method of [MultisigClientMethods](#multisigclientmethods) -**Returns**: boolean - A boolean indicating whether the address is a member or not. - -| Param | Description | -| --- | --- | -| params |

The parameters for the isMember method.

| -| params.pluginAddress |

The address of the plugin.

| -| params.address |

The address to check.

| -| params.blockNumber |

The block number for specifying a specific block.

| - diff --git a/versioned_docs/version-1.3.0/sdk/02-reference-guide/03-token-voting.md b/versioned_docs/version-1.3.0/sdk/02-reference-guide/03-token-voting.md deleted file mode 100644 index 5cc52f9e..00000000 --- a/versioned_docs/version-1.3.0/sdk/02-reference-guide/03-token-voting.md +++ /dev/null @@ -1,463 +0,0 @@ -## Classes - -
-
TokenVotingClient
-

Provider a generic client with high level methods to manage and interact a Token Voting plugin installed in a DAO

-
TokenVotingClientDecoding
-

Decoding module the SDK TokenVoting Client

-
TokenVotingClientEncoding
-

Encoding module the SDK TokenVoting Client

-
TokenVotingClientEstimation
-

Estimation module the SDK TokenVoting Client

-
TokenVotingClientMethods
-

Methods module the SDK TokenVoting Client

-
- - - -## TokenVotingClient -

Provider a generic client with high level methods to manage and interact a Token Voting plugin installed in a DAO

- -**Kind**: global class - -* [TokenVotingClient](#tokenvotingclient) - * [.getPluginInstallItem(params, [network])](#tokenvotingclientgetplugininstallitemparams-network--plugininstallitem) ⇒ PluginInstallItem - * [.TokenVotingClientMethods#createProposal(params)](#tokenvotingclienttokenvotingclientmethodscreateproposalparams--asyncgeneratorproposalcreationstepvalue) ⇒ AsyncGenerator.<ProposalCreationStepValue> - * [.TokenVotingClientMethods#voteProposal(params, vote)](#tokenvotingclienttokenvotingclientmethodsvoteproposalparams-vote--asyncgeneratorvoteproposalstepvalue) ⇒ AsyncGenerator.<VoteProposalStepValue> - * [.TokenVotingClientMethods#executeProposal(proposalId)](#tokenvotingclienttokenvotingclientmethodsexecuteproposalproposalid--asyncgeneratorexecuteproposalstepvalue) ⇒ AsyncGenerator.<ExecuteProposalStepValue> - * [.TokenVotingClientMethods#getProposal(proposalId)](#tokenvotingclienttokenvotingclientmethodsgetproposalproposalid--promisetokenvotingproposal) ⇒ Promise.<TokenVotingProposal> - * [.TokenVotingClientMethods#getProposals(params)](#tokenvotingclienttokenvotingclientmethodsgetproposalsparams--promisearraytokenvotingproposallistitem) ⇒ Promise.<Array.<TokenVotingProposalListItem>> - * [.TokenVotingClientMethods#getVotingSettings(pluginAddress, blockNumber)](#tokenvotingclienttokenvotingclientmethodsgetvotingsettingspluginaddress-blocknumber--promisevotingsettings) ⇒ Promise.<VotingSettings> - * [.TokenVotingClientMethods#getToken(pluginAddress)](#tokenvotingclienttokenvotingclientmethodsgettokenpluginaddress--promiseerc20tokendetailsnull) ⇒ Promise.<(Erc20TokenDetails\|null)> - - - -### TokenVotingClient.getPluginInstallItem(params, [network]) ⇒ PluginInstallItem -

Computes the parameters to be given when creating the DAO, -so that the plugin is configured

- -**Kind**: static method of [TokenVotingClient](#tokenvotingclient) -**Returns**: PluginInstallItem - -| Param | Type | Default | -| --- | --- | --- | -| params | TokenVotingPluginInstall | | -| [network] | Networkish | "mainnet" | - - - -### TokenVotingClient.TokenVotingClientMethods#createProposal(params) ⇒ AsyncGenerator.<ProposalCreationStepValue> -

Creates a new proposal on the given TokenVoting plugin contract

- -**Kind**: static method of [TokenVotingClient](#tokenvotingclient) -**Returns**: AsyncGenerator.<ProposalCreationStepValue> - -| Param | Type | -| --- | --- | -| params | CreateMajorityVotingProposalParams | - - - -### TokenVotingClient.TokenVotingClientMethods#voteProposal(params, vote) ⇒ AsyncGenerator.<VoteProposalStepValue> -

Cast a vote on the given proposal using the client's wallet. Depending on the proposal settings, an affirmative vote may execute the proposal's actions on the DAO.

- -**Kind**: static method of [TokenVotingClient](#tokenvotingclient) -**Returns**: AsyncGenerator.<VoteProposalStepValue> - -| Param | Type | -| --- | --- | -| params | VoteProposalParams | -| vote | VoteValues | - - - -### TokenVotingClient.TokenVotingClientMethods#executeProposal(proposalId) ⇒ AsyncGenerator.<ExecuteProposalStepValue> -

Executes the given proposal, provided that it has already passed

- -**Kind**: static method of [TokenVotingClient](#tokenvotingclient) -**Returns**: AsyncGenerator.<ExecuteProposalStepValue> - -| Param | Type | -| --- | --- | -| proposalId | string | - - - -### TokenVotingClient.TokenVotingClientMethods#getProposal(proposalId) ⇒ Promise.<TokenVotingProposal> -

Returns the details of the given proposal

- -**Kind**: static method of [TokenVotingClient](#tokenvotingclient) -**Returns**: Promise.<TokenVotingProposal> - -| Param | Type | -| --- | --- | -| proposalId | string | - - - -### TokenVotingClient.TokenVotingClientMethods#getProposals(params) ⇒ Promise.<Array.<TokenVotingProposalListItem>> -

Returns a list of proposals on the Plugin, filtered by the given criteria

- -**Kind**: static method of [TokenVotingClient](#tokenvotingclient) -**Returns**: Promise.<Array.<TokenVotingProposalListItem>> - -| Param | Type | -| --- | --- | -| params | ProposalQueryParams | - - - -### TokenVotingClient.TokenVotingClientMethods#getVotingSettings(pluginAddress, blockNumber) ⇒ Promise.<VotingSettings> -

Returns the settings of a plugin given the address of the plugin instance

- -**Kind**: static method of [TokenVotingClient](#tokenvotingclient) -**Returns**: Promise.<VotingSettings> - -| Param | Type | -| --- | --- | -| pluginAddress | string | -| blockNumber | number | - - - -### TokenVotingClient.TokenVotingClientMethods#getToken(pluginAddress) ⇒ Promise.<(Erc20TokenDetails\|null)> -

Returns the details of the token used in a specific plugin instance

- -**Kind**: static method of [TokenVotingClient](#tokenvotingclient) -**Returns**: Promise.<(Erc20TokenDetails\|null)> - -| Param | Type | -| --- | --- | -| pluginAddress | string | - - - -## TokenVotingClientDecoding -

Decoding module the SDK TokenVoting Client

- -**Kind**: global class - -* [TokenVotingClientDecoding](#tokenvotingclientdecoding) - * [.updatePluginSettingsAction(data)](#tokenvotingclientdecodingupdatepluginsettingsactiondata--votingsettings) ⇒ VotingSettings - * [.mintTokenAction(data)](#tokenvotingclientdecodingminttokenactiondata--minttokenparams) ⇒ MintTokenParams - * [.findInterface(data)](#tokenvotingclientdecodingfindinterfacedata--interfaceparams--null) ⇒ InterfaceParams \| null - - - -### tokenVotingClientDecoding.updatePluginSettingsAction(data) ⇒ VotingSettings -

Decodes a dao metadata from an encoded update metadata action

- -**Kind**: instance method of [TokenVotingClientDecoding](#tokenvotingclientdecoding) -**Returns**: VotingSettings - -| Param | Type | -| --- | --- | -| data | Uint8Array | - - - -### tokenVotingClientDecoding.mintTokenAction(data) ⇒ MintTokenParams -

Decodes the mint token params from an encoded mint token action

- -**Kind**: instance method of [TokenVotingClientDecoding](#tokenvotingclientdecoding) -**Returns**: MintTokenParams - -| Param | Type | -| --- | --- | -| data | Uint8Array | - - - -### tokenVotingClientDecoding.findInterface(data) ⇒ InterfaceParams \| null -

Returns the decoded function info given the encoded data of an action

- -**Kind**: instance method of [TokenVotingClientDecoding](#tokenvotingclientdecoding) -**Returns**: InterfaceParams \| null - -| Param | Type | -| --- | --- | -| data | Uint8Array | - - - -## TokenVotingClientEncoding -

Encoding module the SDK TokenVoting Client

- -**Kind**: global class - -* [TokenVotingClientEncoding](#tokenvotingclientencoding) - * _instance_ - * [.updatePluginSettingsAction(pluginAddress, params)](#tokenvotingclientencodingupdatepluginsettingsactionpluginaddress-params--daoaction) ⇒ DaoAction - * [.mintTokenAction(minterAddress, params)](#tokenvotingclientencodingminttokenactionminteraddress-params--daoaction) ⇒ DaoAction - * _static_ - * [.getPluginInstallItem(params, network)](#tokenvotingclientencodinggetplugininstallitemparams-network--plugininstallitem) ⇒ PluginInstallItem - - - -### tokenVotingClientEncoding.updatePluginSettingsAction(pluginAddress, params) ⇒ DaoAction -

Computes the parameters to be given when creating a proposal that updates the governance configuration

- -**Kind**: instance method of [TokenVotingClientEncoding](#tokenvotingclientencoding) -**Returns**: DaoAction - -| Param | Type | -| --- | --- | -| pluginAddress | string | -| params | VotingSettings | - - - -### tokenVotingClientEncoding.mintTokenAction(minterAddress, params) ⇒ DaoAction -

Computes the parameters to be given when creating a proposal that mints an amount of ERC-20 tokens to an address

- -**Kind**: instance method of [TokenVotingClientEncoding](#tokenvotingclientencoding) -**Returns**: DaoAction - -| Param | Type | -| --- | --- | -| minterAddress | string | -| params | MintTokenParams | - - - -### TokenVotingClientEncoding.getPluginInstallItem(params, network) ⇒ PluginInstallItem -

Computes the parameters to be given when creating the DAO, -so that the plugin is configured

- -**Kind**: static method of [TokenVotingClientEncoding](#tokenvotingclientencoding) -**Returns**: PluginInstallItem - -| Param | Type | -| --- | --- | -| params | TokenVotingPluginInstall | -| network | Networkish | - - - -## TokenVotingClientEstimation -

Estimation module the SDK TokenVoting Client

- -**Kind**: global class - -* [TokenVotingClientEstimation](#tokenvotingclientestimation) - * [.createProposal(params)](#tokenvotingclientestimationcreateproposalparams--promisegasfeeestimation) ⇒ Promise.<GasFeeEstimation> - * [.voteProposal(params)](#tokenvotingclientestimationvoteproposalparams--promisegasfeeestimation) ⇒ Promise.<GasFeeEstimation> - * [.executeProposal(proposalId)](#tokenvotingclientestimationexecuteproposalproposalid--promisegasfeeestimation) ⇒ Promise.<GasFeeEstimation> - * [.delegateTokens(params)](#tokenvotingclientestimationdelegatetokensparams--promisegasfeeestimation) ⇒ Promise.<GasFeeEstimation> - * [.undelegateTokens(tokenAddress)](#tokenvotingclientestimationundelegatetokenstokenaddress--promisegasfeeestimation) ⇒ Promise.<GasFeeEstimation> - * [.prepareUpdate(params)](#tokenvotingclientestimationprepareupdateparams--promisegasfeeestimation) ⇒ Promise.<GasFeeEstimation> - - - -### tokenVotingClientEstimation.createProposal(params) ⇒ Promise.<GasFeeEstimation> -

Estimates the gas fee of creating a proposal on the plugin

- -**Kind**: instance method of [TokenVotingClientEstimation](#tokenvotingclientestimation) -**Returns**: Promise.<GasFeeEstimation> - -| Param | Type | -| --- | --- | -| params | CreateMajorityVotingProposalParams | - - - -### tokenVotingClientEstimation.voteProposal(params) ⇒ Promise.<GasFeeEstimation> -

Estimates the gas fee of casting a vote on a proposal

- -**Kind**: instance method of [TokenVotingClientEstimation](#tokenvotingclientestimation) -**Returns**: Promise.<GasFeeEstimation> - -| Param | Type | -| --- | --- | -| params | VoteProposalParams | - - - -### tokenVotingClientEstimation.executeProposal(proposalId) ⇒ Promise.<GasFeeEstimation> -

Estimates the gas fee of executing a TokenVoting proposal

- -**Kind**: instance method of [TokenVotingClientEstimation](#tokenvotingclientestimation) -**Returns**: Promise.<GasFeeEstimation> - -| Param | Type | -| --- | --- | -| proposalId | string | - - - -### tokenVotingClientEstimation.delegateTokens(params) ⇒ Promise.<GasFeeEstimation> -

Estimates the gas fee of delegating voting power to a delegatee

- -**Kind**: instance method of [TokenVotingClientEstimation](#tokenvotingclientestimation) -**Returns**: Promise.<GasFeeEstimation> - -| Param | Type | -| --- | --- | -| params | DelegateTokensParams | - - - -### tokenVotingClientEstimation.undelegateTokens(tokenAddress) ⇒ Promise.<GasFeeEstimation> -

Estimates the gas fee of undelegating voting power

- -**Kind**: instance method of [TokenVotingClientEstimation](#tokenvotingclientestimation) -**Returns**: Promise.<GasFeeEstimation> - -| Param | Type | -| --- | --- | -| tokenAddress | string | - - - -### tokenVotingClientEstimation.prepareUpdate(params) ⇒ Promise.<GasFeeEstimation> -

Estimates the gas fee of preparing an update

- -**Kind**: instance method of [TokenVotingClientEstimation](#tokenvotingclientestimation) -**Returns**: Promise.<GasFeeEstimation> - -| Param | Type | -| --- | --- | -| params | TokenVotingPluginPrepareUpdateParams | - - - -## TokenVotingClientMethods -

Methods module the SDK TokenVoting Client

- -**Kind**: global class - -* [TokenVotingClientMethods](#tokenvotingclientmethods) - * [.prepareInstallation(params)](#tokenvotingclientmethodsprepareinstallationparams--asyncgeneratorprepareinstallationstepvalue) ⇒ AsyncGenerator.<PrepareInstallationStepValue> - * [.prepareUpdate(params)](#tokenvotingclientmethodsprepareupdateparams--asyncgeneratorprepareupdatestepvalue) ⇒ AsyncGenerator.<PrepareUpdateStepValue> - * [.delegateTokens(params)](#tokenvotingclientmethodsdelegatetokensparams--asyncgeneratordelegatetokensstepvalue) ⇒ AsyncGenerator.<DelegateTokensStepValue> - * [.undelegateTokens(tokenAddress)](#tokenvotingclientmethodsundelegatetokenstokenaddress--asyncgeneratorundelegatetokensstepvalue) ⇒ AsyncGenerator.<UndelegateTokensStepValue> - * [.getDelegatee(tokenAddress)](#tokenvotingclientmethodsgetdelegateetokenaddress--promisestringnull) ⇒ Promise.<(string\|null)> - * [.canVote(params)](#tokenvotingclientmethodscanvoteparams--promiseboolean) ⇒ Promise.<boolean> - * [.canExecute(proposalId)](#tokenvotingclientmethodscanexecuteproposalid--promiseboolean) ⇒ Promise.<boolean> - * [.getMembers(params)](#tokenvotingclientmethodsgetmembersparams--promisearraystring) ⇒ Promise.<Array.<string>> - * [.isTokenVotingCompatibleToken(tokenAddress)](#tokenvotingclientmethodsistokenvotingcompatibletokentokenaddress--promisetokenvotingtokencompatibility) ⇒ Promise.<TokenVotingTokenCompatibility> - * [.isMember(params)](#tokenvotingclientmethodsismemberparams--boolean) ⇒ boolean - - - -### tokenVotingClientMethods.prepareInstallation(params) ⇒ AsyncGenerator.<PrepareInstallationStepValue> -

Prepares the installation of a token voting plugin in a given dao

- -**Kind**: instance method of [TokenVotingClientMethods](#tokenvotingclientmethods) -**Returns**: AsyncGenerator.<PrepareInstallationStepValue> - -| Param | Type | -| --- | --- | -| params | TokenVotingPluginPrepareInstallationParams | - - - -### tokenVotingClientMethods.prepareUpdate(params) ⇒ AsyncGenerator.<PrepareUpdateStepValue> -

Prepares the update of a token voting plugin in a given dao

- -**Kind**: instance method of [TokenVotingClientMethods](#tokenvotingclientmethods) -**Returns**: AsyncGenerator.<PrepareUpdateStepValue> - -| Param | Type | -| --- | --- | -| params | TokenVotingPluginPrepareUpdateParams | - - - -### tokenVotingClientMethods.delegateTokens(params) ⇒ AsyncGenerator.<DelegateTokensStepValue> -

Delegates all the signer's voting power to a delegatee

- -**Kind**: instance method of [TokenVotingClientMethods](#tokenvotingclientmethods) -**Returns**: AsyncGenerator.<DelegateTokensStepValue> - -| Param | Type | -| --- | --- | -| params | DelegateTokensParams | - - - -### tokenVotingClientMethods.undelegateTokens(tokenAddress) ⇒ AsyncGenerator.<UndelegateTokensStepValue> -

Delegates all the signer's tokens back to itself

- -**Kind**: instance method of [TokenVotingClientMethods](#tokenvotingclientmethods) -**Returns**: AsyncGenerator.<UndelegateTokensStepValue> - -| Param | Type | -| --- | --- | -| tokenAddress | string | - - - -### tokenVotingClientMethods.getDelegatee(tokenAddress) ⇒ Promise.<(string\|null)> -

Retrieves the current signer's delegatee for the given token

- -**Kind**: instance method of [TokenVotingClientMethods](#tokenvotingclientmethods) -**Returns**: Promise.<(string\|null)> - -| Param | Type | -| --- | --- | -| tokenAddress | string | - - - -### tokenVotingClientMethods.canVote(params) ⇒ Promise.<boolean> -

Checks if an user can vote in a proposal

- -**Kind**: instance method of [TokenVotingClientMethods](#tokenvotingclientmethods) -**Returns**: Promise.<boolean> - -| Param | Type | -| --- | --- | -| params | CanVoteParams | - - - -### tokenVotingClientMethods.canExecute(proposalId) ⇒ Promise.<boolean> -

Checks whether the current proposal can be executed

- -**Kind**: instance method of [TokenVotingClientMethods](#tokenvotingclientmethods) -**Returns**: Promise.<boolean> - -| Param | Type | -| --- | --- | -| proposalId | string | - - - -### tokenVotingClientMethods.getMembers(params) ⇒ Promise.<Array.<string>> -

Returns the list of wallet addresses holding tokens from the underlying Token contract used by the plugin

- -**Kind**: instance method of [TokenVotingClientMethods](#tokenvotingclientmethods) -**Returns**: Promise.<Array.<string>> - -| Param | Type | Description | -| --- | --- | --- | -| params | MembersQueryParams |
  • pluginAddress
    • blockNumber
    • limit = 10
    • skip = 0
    • direction = SortDirection.ASC
    • sortBy = MembersSortBy.ADDRESS
| - - - -### tokenVotingClientMethods.isTokenVotingCompatibleToken(tokenAddress) ⇒ Promise.<TokenVotingTokenCompatibility> -

Checks if the given token is compatible with the TokenVoting plugin

- -**Kind**: instance method of [TokenVotingClientMethods](#tokenvotingclientmethods) -**Returns**: Promise.<TokenVotingTokenCompatibility> - -| Param | Type | -| --- | --- | -| tokenAddress | string | - - - -### tokenVotingClientMethods.isMember(params) ⇒ boolean -

Checks if a given address is a member of the tokenVoting contract.

- -**Kind**: instance method of [TokenVotingClientMethods](#tokenvotingclientmethods) -**Returns**: boolean - A boolean indicating whether the address is a member or not. - -| Param | Description | -| --- | --- | -| params |

The parameters for the isMember method.

| -| params.pluginAddress |

The address of the plugin.

| -| params.address |

The address to check.

| -| params.blockNumber |

The block number for specifying a specific block.

| - diff --git a/versioned_docs/version-1.3.0/sdk/02-reference-guide/04-addresslist-voting.md b/versioned_docs/version-1.3.0/sdk/02-reference-guide/04-addresslist-voting.md deleted file mode 100644 index d7b2d34f..00000000 --- a/versioned_docs/version-1.3.0/sdk/02-reference-guide/04-addresslist-voting.md +++ /dev/null @@ -1,381 +0,0 @@ -## Classes - -
-
AddresslistVotingClient
-

Provider a generic client with high level methods to manage and interact an Address List Voting plugin installed in a DAO

-
AddresslistVotingClientDecoding
-

Decoding module for the SDK AddressList Client

-
AddresslistVotingClientEncoding
-

Encoding module for the SDK AddressList Client

-
AddresslistVotingClientEstimation
-

Estimation module the SDK Address List Client

-
AddresslistVotingClientMethods
-

Methods module the SDK Address List Client

-
- - - -## AddresslistVotingClient -

Provider a generic client with high level methods to manage and interact an Address List Voting plugin installed in a DAO

- -**Kind**: global class - - -### AddresslistVotingClient.getPluginInstallItem(params, [network]) ⇒ PluginInstallItem -

Computes the parameters to be given when creating the DAO, -so that the plugin is configured

- -**Kind**: static method of [AddresslistVotingClient](#addresslistvotingclient) -**Returns**: PluginInstallItem - -| Param | Type | Default | -| --- | --- | --- | -| params | AddresslistVotingPluginInstall | | -| [network] | Networkish | "mainnet" | - - - -## AddresslistVotingClientDecoding -

Decoding module for the SDK AddressList Client

- -**Kind**: global class - -* [AddresslistVotingClientDecoding](#addresslistvotingclientdecoding) - * [.updatePluginSettingsAction(data)](#addresslistvotingclientdecodingupdatepluginsettingsactiondata--votingsettings) ⇒ VotingSettings - * [.addMembersAction(data)](#addresslistvotingclientdecodingaddmembersactiondata--arraystring) ⇒ Array.<string> - * [.removeMembersAction(data)](#addresslistvotingclientdecodingremovemembersactiondata--arraystring) ⇒ Array.<string> - * [.findInterface(data)](#addresslistvotingclientdecodingfindinterfacedata--interfaceparams--null) ⇒ InterfaceParams \| null - - - -### addresslistVotingClientDecoding.updatePluginSettingsAction(data) ⇒ VotingSettings -

Decodes a dao metadata from an encoded update metadata action

- -**Kind**: instance method of [AddresslistVotingClientDecoding](#addresslistvotingclientdecoding) -**Returns**: VotingSettings - -| Param | Type | -| --- | --- | -| data | Uint8Array | - - - -### addresslistVotingClientDecoding.addMembersAction(data) ⇒ Array.<string> -

Decodes a list of addresses from an encoded add members action

- -**Kind**: instance method of [AddresslistVotingClientDecoding](#addresslistvotingclientdecoding) -**Returns**: Array.<string> - -| Param | Type | -| --- | --- | -| data | Uint8Array | - - - -### addresslistVotingClientDecoding.removeMembersAction(data) ⇒ Array.<string> -

Decodes a list of addresses from an encoded remove members action

- -**Kind**: instance method of [AddresslistVotingClientDecoding](#addresslistvotingclientdecoding) -**Returns**: Array.<string> - -| Param | Type | -| --- | --- | -| data | Uint8Array | - - - -### addresslistVotingClientDecoding.findInterface(data) ⇒ InterfaceParams \| null -

Returns the decoded function info given the encoded data of an action

- -**Kind**: instance method of [AddresslistVotingClientDecoding](#addresslistvotingclientdecoding) -**Returns**: InterfaceParams \| null - -| Param | Type | -| --- | --- | -| data | Uint8Array | - - - -## AddresslistVotingClientEncoding -

Encoding module for the SDK AddressList Client

- -**Kind**: global class - -* [AddresslistVotingClientEncoding](#addresslistvotingclientencoding) - * _instance_ - * [.updatePluginSettingsAction(pluginAddress, params)](#addresslistvotingclientencodingupdatepluginsettingsactionpluginaddress-params--daoaction) ⇒ DaoAction - * [.addMembersAction(pluginAddress, members)](#addresslistvotingclientencodingaddmembersactionpluginaddress-members--daoaction) ⇒ DaoAction - * [.removeMembersAction(pluginAddress, members)](#addresslistvotingclientencodingremovemembersactionpluginaddress-members--daoaction) ⇒ DaoAction - * _static_ - * [.getPluginInstallItem(params, network)](#addresslistvotingclientencodinggetplugininstallitemparams-network--plugininstallitem) ⇒ PluginInstallItem - - - -### addresslistVotingClientEncoding.updatePluginSettingsAction(pluginAddress, params) ⇒ DaoAction -

Computes the parameters to be given when creating a proposal that updates the governance configuration

- -**Kind**: instance method of [AddresslistVotingClientEncoding](#addresslistvotingclientencoding) -**Returns**: DaoAction - -| Param | Type | -| --- | --- | -| pluginAddress | string | -| params | VotingSettings | - - - -### addresslistVotingClientEncoding.addMembersAction(pluginAddress, members) ⇒ DaoAction -

Computes the parameters to be given when creating a proposal that adds addresses to address list

- -**Kind**: instance method of [AddresslistVotingClientEncoding](#addresslistvotingclientencoding) -**Returns**: DaoAction - -| Param | Type | -| --- | --- | -| pluginAddress | string | -| members | Array.<string> | - - - -### addresslistVotingClientEncoding.removeMembersAction(pluginAddress, members) ⇒ DaoAction -

Computes the parameters to be given when creating a proposal that removes addresses from the address list

- -**Kind**: instance method of [AddresslistVotingClientEncoding](#addresslistvotingclientencoding) -**Returns**: DaoAction - -| Param | Type | -| --- | --- | -| pluginAddress | string | -| members | Array.<string> | - - - -### AddresslistVotingClientEncoding.getPluginInstallItem(params, network) ⇒ PluginInstallItem -

Computes the parameters to be given when creating the DAO, -so that the plugin is configured

- -**Kind**: static method of [AddresslistVotingClientEncoding](#addresslistvotingclientencoding) -**Returns**: PluginInstallItem - -| Param | Type | -| --- | --- | -| params | AddresslistVotingPluginInstall | -| network | Networkish | - - - -## AddresslistVotingClientEstimation -

Estimation module the SDK Address List Client

- -**Kind**: global class - -* [AddresslistVotingClientEstimation](#addresslistvotingclientestimation) - * [.createProposal(params)](#addresslistvotingclientestimationcreateproposalparams--promisegasfeeestimation) ⇒ Promise.<GasFeeEstimation> - * [.voteProposal(params)](#addresslistvotingclientestimationvoteproposalparams--promisegasfeeestimation) ⇒ Promise.<GasFeeEstimation> - * [.executeProposal(proposalId)](#addresslistvotingclientestimationexecuteproposalproposalid--promisegasfeeestimation) ⇒ Promise.<GasFeeEstimation> - * [.prepareUpdate(params)](#addresslistvotingclientestimationprepareupdateparams--promisegasfeeestimation) ⇒ Promise.<GasFeeEstimation> - - - -### addresslistVotingClientEstimation.createProposal(params) ⇒ Promise.<GasFeeEstimation> -

Estimates the gas fee of creating a proposal on the plugin

- -**Kind**: instance method of [AddresslistVotingClientEstimation](#addresslistvotingclientestimation) -**Returns**: Promise.<GasFeeEstimation> - -| Param | Type | -| --- | --- | -| params | CreateMajorityVotingProposalParams | - - - -### addresslistVotingClientEstimation.voteProposal(params) ⇒ Promise.<GasFeeEstimation> -

Estimates the gas fee of casting a vote on a proposal

- -**Kind**: instance method of [AddresslistVotingClientEstimation](#addresslistvotingclientestimation) -**Returns**: Promise.<GasFeeEstimation> - -| Param | Type | -| --- | --- | -| params | VoteProposalParams | - - - -### addresslistVotingClientEstimation.executeProposal(proposalId) ⇒ Promise.<GasFeeEstimation> -

Estimates the gas fee of executing an AddressList proposal

- -**Kind**: instance method of [AddresslistVotingClientEstimation](#addresslistvotingclientestimation) -**Returns**: Promise.<GasFeeEstimation> - -| Param | Type | -| --- | --- | -| proposalId | string | - - - -### addresslistVotingClientEstimation.prepareUpdate(params) ⇒ Promise.<GasFeeEstimation> -

Estimates the gas fee of preparing an update

- -**Kind**: instance method of [AddresslistVotingClientEstimation](#addresslistvotingclientestimation) -**Returns**: Promise.<GasFeeEstimation> - -| Param | Type | -| --- | --- | -| params | AddresslistVotingPluginPrepareUpdateParams | - - - -## AddresslistVotingClientMethods -

Methods module the SDK Address List Client

- -**Kind**: global class - -* [AddresslistVotingClientMethods](#addresslistvotingclientmethods) - * [.createProposal(params)](#addresslistvotingclientmethodscreateproposalparams--asyncgeneratorproposalcreationstepvalue) ⇒ AsyncGenerator.<ProposalCreationStepValue> - * [.voteProposal(params)](#addresslistvotingclientmethodsvoteproposalparams--asyncgeneratorvoteproposalstepvalue) ⇒ AsyncGenerator.<VoteProposalStepValue> - * [.executeProposal(proposalId)](#addresslistvotingclientmethodsexecuteproposalproposalid--asyncgeneratorexecuteproposalstepvalue) ⇒ AsyncGenerator.<ExecuteProposalStepValue> - * [.prepareUpdate(params)](#addresslistvotingclientmethodsprepareupdateparams--asyncgeneratorprepareupdatestepvalue) ⇒ AsyncGenerator.<PrepareUpdateStepValue> - * [.canVote(params)](#addresslistvotingclientmethodscanvoteparams--promiseboolean) ⇒ Promise.<boolean> - * [.canExecute(proposalId)](#addresslistvotingclientmethodscanexecuteproposalid--promiseboolean) ⇒ Promise.<boolean> - * [.getMembers(params)](#addresslistvotingclientmethodsgetmembersparams--promisearraystring) ⇒ Promise.<Array.<string>> - * [.getProposal(proposalId)](#addresslistvotingclientmethodsgetproposalproposalid--promiseaddresslistvotingproposalnull) ⇒ Promise.<(AddresslistVotingProposal\|null)> - * [.getProposals(params)](#addresslistvotingclientmethodsgetproposalsparams--promisearrayaddresslistvotingproposallistitem) ⇒ Promise.<Array.<AddresslistVotingProposalListItem>> - * [.getVotingSettings(pluginAddress, blockNumber)](#addresslistvotingclientmethodsgetvotingsettingspluginaddress-blocknumber--promisevotingsettingsnull) ⇒ Promise.<(VotingSettings\|null)> - * [.isMember(params)](#addresslistvotingclientmethodsismemberparams--boolean) ⇒ boolean - - - -### addresslistVotingClientMethods.createProposal(params) ⇒ AsyncGenerator.<ProposalCreationStepValue> -

Creates a new proposal on the given AddressList plugin contract

- -**Kind**: instance method of [AddresslistVotingClientMethods](#addresslistvotingclientmethods) -**Returns**: AsyncGenerator.<ProposalCreationStepValue> - -| Param | Type | -| --- | --- | -| params | CreateMajorityVotingProposalParams | - - - -### addresslistVotingClientMethods.voteProposal(params) ⇒ AsyncGenerator.<VoteProposalStepValue> -

Cast a vote on the given proposal using the client's wallet. Depending on the proposal settings, an affirmative vote may execute the proposal's actions on the DAO.

- -**Kind**: instance method of [AddresslistVotingClientMethods](#addresslistvotingclientmethods) -**Returns**: AsyncGenerator.<VoteProposalStepValue> - -| Param | Type | -| --- | --- | -| params | VoteProposalParams | - - - -### addresslistVotingClientMethods.executeProposal(proposalId) ⇒ AsyncGenerator.<ExecuteProposalStepValue> -

Executes the given proposal, provided that it has already passed

- -**Kind**: instance method of [AddresslistVotingClientMethods](#addresslistvotingclientmethods) -**Returns**: AsyncGenerator.<ExecuteProposalStepValue> - -| Param | Type | -| --- | --- | -| proposalId | string | - - - -### addresslistVotingClientMethods.prepareUpdate(params) ⇒ AsyncGenerator.<PrepareUpdateStepValue> -

Prepares the update of a token voting plugin in a given dao

- -**Kind**: instance method of [AddresslistVotingClientMethods](#addresslistvotingclientmethods) -**Returns**: AsyncGenerator.<PrepareUpdateStepValue> - -| Param | Type | -| --- | --- | -| params | AddresslistVotingPluginPrepareUpdateParams | - - - -### addresslistVotingClientMethods.canVote(params) ⇒ Promise.<boolean> -

Checks if an user can vote in a proposal

- -**Kind**: instance method of [AddresslistVotingClientMethods](#addresslistvotingclientmethods) -**Returns**: Promise.<boolean> - -| Param | Type | -| --- | --- | -| params | CanVoteParams | - - - -### addresslistVotingClientMethods.canExecute(proposalId) ⇒ Promise.<boolean> -

Checks whether the current proposal can be executed

- -**Kind**: instance method of [AddresslistVotingClientMethods](#addresslistvotingclientmethods) -**Returns**: Promise.<boolean> - -| Param | Type | -| --- | --- | -| proposalId | string | - - - -### addresslistVotingClientMethods.getMembers(params) ⇒ Promise.<Array.<string>> -

Returns the list of wallet addresses with signing capabilities on the plugin

- -**Kind**: instance method of [AddresslistVotingClientMethods](#addresslistvotingclientmethods) -**Returns**: Promise.<Array.<string>> - -| Param | Type | Description | -| --- | --- | --- | -| params | MembersQueryParams |
  • pluginAddress
    • blockNumber
    • limit = 10
    • skip = 0
    • direction = SortDirection.ASC
    • sortBy = MembersSortBy.ADDRESS
| - - - -### addresslistVotingClientMethods.getProposal(proposalId) ⇒ Promise.<(AddresslistVotingProposal\|null)> -

Returns the details of the given proposal

- -**Kind**: instance method of [AddresslistVotingClientMethods](#addresslistvotingclientmethods) -**Returns**: Promise.<(AddresslistVotingProposal\|null)> - -| Param | Type | -| --- | --- | -| proposalId | string | - - - -### addresslistVotingClientMethods.getProposals(params) ⇒ Promise.<Array.<AddresslistVotingProposalListItem>> -

Returns a list of proposals on the Plugin, filtered by the given criteria

- -**Kind**: instance method of [AddresslistVotingClientMethods](#addresslistvotingclientmethods) -**Returns**: Promise.<Array.<AddresslistVotingProposalListItem>> - -| Param | Type | Description | -| --- | --- | --- | -| params | ProposalQueryParams |
  • daoAddressOrEns - limit = 10 - status - skip = 0 - direction = SortDirection.ASC - sortBy = ProposalSortBy.CREATED_AT
| - - - -### addresslistVotingClientMethods.getVotingSettings(pluginAddress, blockNumber) ⇒ Promise.<(VotingSettings\|null)> -

Returns the settings of a plugin given the address of the plugin instance

- -**Kind**: instance method of [AddresslistVotingClientMethods](#addresslistvotingclientmethods) -**Returns**: Promise.<(VotingSettings\|null)> - -| Param | Type | -| --- | --- | -| pluginAddress | string | -| blockNumber | number | - - - -### addresslistVotingClientMethods.isMember(params) ⇒ boolean -

Checks if a given address is a member of the AddresslistVoting contract.

- -**Kind**: instance method of [AddresslistVotingClientMethods](#addresslistvotingclientmethods) -**Returns**: boolean - A boolean indicating whether the address is a member or not. - -| Param | Description | -| --- | --- | -| params |

The parameters for the isMember method.

| -| params.pluginAddress |

The address of the plugin.

| -| params.address |

The address to check.

| -| params.blockNumber |

The block number for specifying a specific block.

| - diff --git a/versioned_docs/version-1.3.0/sdk/02-reference-guide/index.md b/versioned_docs/version-1.3.0/sdk/02-reference-guide/index.md deleted file mode 100644 index 5e57cd92..00000000 --- a/versioned_docs/version-1.3.0/sdk/02-reference-guide/index.md +++ /dev/null @@ -1,12 +0,0 @@ ---- -title: Reference Guide ---- - -## Overview - -This section contains the auto-generated documentation of the individual clients that the `@aragon/sdk-client` is offering: - -- [Generic SDK Client](./01-client.md) -- [Multisig Client](./02-multisig.md) -- [Token Voting Client](./03-token-voting.md) -- [Addresslist Voting Client](./04-addresslist-voting.md) diff --git a/versioned_docs/version-1.3.0/sdk/03-update-security-check/index.md b/versioned_docs/version-1.3.0/sdk/03-update-security-check/index.md deleted file mode 100644 index 212b1bae..00000000 --- a/versioned_docs/version-1.3.0/sdk/03-update-security-check/index.md +++ /dev/null @@ -1,179 +0,0 @@ ---- -title: Update Security Check ---- - -## Context - -Aragon DAOs and the plugins installed can be updated via proposals. Upon execution, the proposal will call the DAO's [`execute` function][execute] and execute whatever action are specified inside its action list. -Accordingly, proposals must be checked thoroughly, especially when it comes to DAO or plugin updates. This happens automatically on the Aragon App frontend. - -All proposals scheduled in the DAO are checked via their proposal ID. A proposal is identified as an update proposals if it contains - -- one call to either - - [`upgradeTo(address newImplementation)`][oz-upgradeto] - OR - - [`upgradeToAndCall(address newImplementation, bytes memory data)`][oz-upgradetoandcall] -- one or more calls to [`applyUpdate(address _dao, ApplyUpdateParams _params)`][applyupdate] - -If a proposal is identified as an update proposal, we conduct general and specific checks on it. - -## General Proposal Checks - -After a proposal was identified as an update proposal, we check that only allowed actions are part of the action list and that none of them is allowed to fail. - -| Error | Explanation | -| ------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `"invalidActions"` | The proposal contains unexpected actions that are not allowed for update proposals. | -| `"nonZeroAllowFailureMapValue"` | The allow failure map is not zero (see [the Aragon OSX docs](https://devs.aragon.org/docs/osx/how-it-works/core/dao/actions#the-allowfailuremap-input-argument)). | -| `"proposalNotFound"` | The proposal could not be found. | - -## Action-Specific Checks - -After the general checks, we check every action in the `Action[]` array separately. An action has three fields [see][action]: - -```solidity title="@aragon/osx/core/dao/IDAO.sol" -/// @notice The action struct to be consumed by the DAO's `execute` function resulting in an external call. -/// @param to The address to call. -/// @param value The native token value to be sent with the call. -/// @param data The bytes-encoded function selector and calldata for the call. -struct Action { - address to; - uint256 value; - bytes data; -} - -``` - -In the following, we explain the action specific checks. - -### DAO Update - -For DAO updates, we expect single action at position 0 of the action array. This action, must call - -- `upgradeTo(address newImplementation)` - OR -- `upgradeToAndCall(address newImplementation, bytes memory data)` - -#### Checking the `upgradeTo` Calldata - -| Item | Error | Explanation | -| ------- | ----------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------- | -| `to` | `"invalidToAddress"` | The `to` address of the action must be the DAO contract. | -| | | | -| `value` | `"nonZeroCallValue"` | The `value` native token value send with the call must be zero. | -| | | | -| `data` | `"invalidActions"` | The first 4 bytes must match the [`upgradeTo` function][oz-upgradeto] selector (see [General Proposal Checks](#general-proposal-checks)). | -| | `"invalidUpgradeToImplementationAddress"` | The `newImplementation` address must match with a newer DAO implementation contract developed by Aragon. | - -#### Checking the Action `data` calling `upgradeToAndCall` - -| Item | Error | Explanation | -| ------- | ------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -| `to` | `"invalidToAddress"` | The `to` address of the action must be the DAO contract. | -| | | | -| `value` | `"nonZeroCallValue"` | The `value` native token value send with the call must be zero. | -| | | | -| `data` | `"invalidActions"` | The first 4 bytes must match the [`upgradeToAndCall` function][oz-upgradetoandcall] selector (see [General Proposal Checks](#general-proposal-checks)). | -| | `"invalidUpgradeToAndCallImplementationAddress"` | The `newImplementation` address must match with a newer DAO implementation contract developed by Aragon. | -| | `"invalidUpgradeToAndCallData"` | The `data` passed into `upgradeToAndCall` must call the [`initializeFrom(uint8[3] _previousProtocolVersion, bytes _initData)` function][initializefrom]. The first 96 bytes of `data` must be occupied by an `uint[3] _previousProtocolVersion` semantic version number. The sub `_initData` must be empty for the current Aragon updates. | -| | `"invalidUpgradeToAndCallVersion"` | `uint[3] _previousProtocolVersion` must match with the semantic version number of the DAO the upgrade is transitioning from. | - -### Plugin Update - -For each plugin update, we expect a block of associated actions. There can be multiple, independent plugin updates happening in one update proposal. -We expect two types of blocks: - -```solidity -[ - grant({_where: plugin, _who: pluginSetupProcessor, _permissionId: UPGRADE_PLUGIN_PERMISSION_ID}), - applyUpdate({_dao: dao, _params: applyUpdateParams}), - revoke({_where: plugin, _who: pluginSetupProcessor, _permissionId: UPGRADE_PLUGIN_PERMISSION_ID}) -] -``` - -or - -```solidity -[ - grant({_where: plugin, _who: pluginSetupProcessor, _permissionId: UPGRADE_PLUGIN_PERMISSION_ID}), - grant({_where: dao, _who: pluginSetupProcessor, _permissionId: ROOT_PERMISSION_ID}), - applyUpdate({_dao: dao, _params: applyUpdateParams}), - revoke({_where: dao, _who: pluginSetupProcessor, _permissionId: ROOT_PERMISSION_ID}), - revoke({_where: plugin, _who: pluginSetupProcessor, _permissionId: UPGRADE_PLUGIN_PERMISSION_ID}) -] -``` - -#### Mandatory `applyUpdate` Call - -Each block being related to a plugin update must contain an action calling the [`applyUpdate(address _dao, ApplyUpdateParams _params)` function][applyupdate] exactly once. -This action is composed as follows: - -This action calls the [`applyUpdate(address _dao, ApplyUpdateParams _params)` function][applyupdate] - -| `Action` field | Error | Explanation | -| -------------- | ------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------ | -| `to` | `"invalidToAddress"` | The `to` address of the action must be Aragon's `PluginSetupProcessor` contract. | -| | | | -| `value` | `"nonZeroApplyUpdateCallValue"` | The `value` send with the call must be zero. | -| | | | -| `data` | `"invalidActions"` | The first 4 bytes must match the [`applyUpdate` function][applyupdate] selector (see [General Proposal Checks](#general-proposal-checks)). | -| | `"invalidData"` | The bytes must be decodable as specified in the plugins `_metadata` [see our specs][build-metadata] (**currently we skip this**). | -| | `"invalidPluginRepoMetadata"` | The [`build-metadata`][build-metadata] could not be found or is incorrectly formatted. | -| | `"pluginNotInstalled"` | The plugin address referenced in the `_params` is not installed. | -| | `"missingPluginRepo"` | The plugin repo referenced in the `_params` is not existing. | -| | `"notAragonPluginRepo"` | The plugin repo referenced in the `_params` is not an Aragon plugin repo. | -| | `"missingPluginPreparation"` | The update was not prepared in Aragon's `PluginSetupProcessor` contract. | -| | `"updateToOlderOrSameBuild"` | The update wants to transition to the same or an older build. | -| | `"updateToIncompatibleRelease"` | The update wants to transition to a different, incompatible release. | - -#### Mandatory `grant`/`revoke` `UPGRADE_PLUGIN_PERMISSION` Calls - -The `applyUpdate` action must be wrapped by `grant` and `revoke` actions: - -| `Action` field | Error | Explanation | -| -------------- | ------------------------------------------------------ | ---------------------------------------------------------------------------------------------------------------------------------------------------- | -| `to` | `"invalidGrantUpgradePluginPermissionToAddress"` | The `to` address must be the DAO contract. | -| | | | -| `value` | `"nonZeroGrantUpgradePluginPermissionCallValue"` | The `value` send with the call must be zero. | -| | `"nonZeroRevokeUpgradePluginPermissionCallValue"` | " | -| | | | -| `data` | `"invalidActions"` | The first 4 bytes must match the [`grant` or][grant] [`revoke` function][revoke] selector (see [General Proposal Checks](#general-proposal-checks)). | -| | `"invalidGrantUpgradePluginPermissionWhereAddress"` | The `where` address must be the plugin proxy contract. | -| | `"invalidRevokeUpgradePluginPermissionWhereAddress"` | " | -| | `"invalidGrantUpgradePluginPermissionWhoAddress"` | The `who` address must be Aragon's `PluginSetupProcessor` contract. | -| | `"invalidRevokeUpgradePluginPermissionWhoAddress"` | " | -| | `"invalidGrantUpgradePluginPermissionPermissionId"` | `permissionId` must be `keccak256("UPGRADE_PLUGIN_PERMISSION")`. | -| | `"invalidRevokeUpgradePluginPermissionPermissionId"` | " | -| | `"invalidGrantUpgradePluginPermissionPermissionName"` | `permissionName` must be `UPGRADE_PLUGIN_PERMISSION`. | -| | `"invalidRevokeUpgradePluginPermissionPermissionName"` | " | - -#### Optional `grant`/`revoke` `ROOT_PERMISSION` Calls - -The `applyUpdate` action CAN be wrapped by `grant` and `revoke` actions: - -| `Action` field | Error | Explanation | -| -------------- | --------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------- | -| `to` | `"invalidGrantRootPermissionToAddress"` | The `to` address must be the DAO contract. | -| | | | -| `value` | `"nonZeroGrantRootPermissionCallValue"` | The `value` send with the call must be zero. | -| | `"nonZeroRevokeRootPermissionCallValue"` | The `value` send with the call must be zero. | -| | | | -| `data` | `"invalidActions"` | The first 4 bytes must match the [`grant` or][grant] [`revoke` function][revoke] selector (see [General Proposal Checks](#general-proposal-checks)). | -| | `"invalidGrantRootPermissionWhereAddress"` | The `where` address must be the DAO contract. | -| | `"invalidRevokeRootPermissionWhereAddress"` | " | -| | `"invalidGrantRootPermissionWhoAddress"` | The `who` address must be Aragon's `PluginSetupProcessor`. | -| | `"invalidRevokeRootPermissionWhoAddress"` | " | -| | `"invalidGrantRootPermissionPermissionId"` | The `permissionId` must be `keccak256("ROOT_PERMISSION")`. | -| | `"invalidRevokeRootPermissionPermissionId"` | " | -| | `"invalidGrantRootPermissionPermissionName"` | The `permissionName` must be `ROOT_PERMISSION`. | -| | `"invalidRevokeRootPermissionPermissionName"` | " | - -[execute]: ../../osx/01-how-it-works/01-core/01-dao/01-actions.md#a-deep-dive-into-actions-and-execution -[action]: ../../osx/01-how-it-works/01-core/01-dao/01-actions.md#actions -[allowfailuremap]: ../../osx/01-how-it-works/01-core/01-dao/01-actions.md#allowing-for-failure -[initializefrom]: ../../osx/03-reference-guide/core/dao/DAO.md#external-function-initializefrom -[oz-upgradeto]: https://github.com/OpenZeppelin/openzeppelin-contracts-upgradeable/blob/3d4c0d5741b131c231e558d7a6213392ab3672a5/contracts/proxy/utils/UUPSUpgradeable.sol#L74-L77 -[oz-upgradetoandcall]: https://github.com/OpenZeppelin/openzeppelin-contracts-upgradeable/blob/3d4c0d5741b131c231e558d7a6213392ab3672a5/contracts/proxy/utils/UUPSUpgradeable.sol#L89-L92 -[applyupdate]: ../../osx/03-reference-guide/framework/plugin/setup/PluginSetupProcessor.md#external-function-applyupdate -[grant]: ../../osx/03-reference-guide/core/permission/PermissionManager.md#external-function-grant -[revoke]: ../../osx/03-reference-guide/core/permission/PermissionManager.md#external-function-revoke \ No newline at end of file diff --git a/versioned_docs/version-1.3.0/sdk/index.md b/versioned_docs/version-1.3.0/sdk/index.md deleted file mode 100644 index 200aab32..00000000 --- a/versioned_docs/version-1.3.0/sdk/index.md +++ /dev/null @@ -1,84 +0,0 @@ ---- -title: Aragon SDK -sidebar_label: Intro -sidebar_position: 0 ---- - -## The JavaScript/TypeScript SDK for Aragon OSx - -`@aragon/sdk-client` provides easy access to the high level interactions to be -made with an Aragon DAO. It consists of three different components: - -- General-purpose DAO client -- Custom clients for specific DAO plugins -- Context for holding inheritable configuration - -Contributors: See [development](#development) below - -### Installation - -Use [npm](https://www.npmjs.com/) or [yarn](https://yarnpkg.com/) to install -@aragon/sdk-client. - -```bash -npm install @aragon/sdk-client -yarn add @aragon/sdk-client -``` - -### Usage - -The use of the different SDK features and methods is demonstrated in the [Examples (coming soon)](./01-examples/index.md) section. - -An extensive documentation of the different clients can be found in the auto-generated [Reference Guide](./02-reference-guide/index.md) section. - -#### React Native - -In order for the SDK to be used in restricted environments like react native install the following polyfills into your project: - -- [@ethersproject/shims](https://www.npmjs.com/package/@ethersproject/shims) -- [react-native-url-polyfill](https://www.npmjs.com/package/react-native-url-polyfill) - -Then import them like the following **before** you import the Aragon SDK package: - -```javascript -import '@ethersproject/shims'; -import 'react-native-url-polyfill/auto'; -import {Client} from '@aragon/sdk-client'; -``` - -### Development - -The building blocks are defined within the `src/internal` folder. The high level -client wrappers are implemented in `src/client*.ts` - -#### Low level networking - -See `ClientCore` (`/src/internal/core.ts`): - -- Abstract class implementing primitives for: - - Web3, contracts, signing - - IPFS - - GraphQL -- Inherited by classes like `Client` and all plugin classes like `TokenVotingClient`. - -#### Common interfaces, types, enums - -When updating a `ClientXXX` (plugin) class: - -- **Update first** all affected enums, types and interfaces in - `src/internal/interfaces/plugins.ts` - -When updating the `Client` class: - -- **Update first** all affected enums, types and interfaces in - `src/internal/interfaces/client.ts` - -When updating the `ClientCore` class: - -- **Update first** all affected enums, types and interfaces in - `src/internal/interfaces/core.ts` - -#### Developing a new Plugin client - -Create a new class that `extends` from `ClientCore`, receives a `Context` on the -`constructor` and follows the structure of `TokenVotingClient` (`./src/tokenVoting/client.ts`).