-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Feature: Add getPluginPreparations function (#294)
* add prepared plugins query * update commons * update changelog and example * Update modules/client/src/types.ts Co-authored-by: Michael Heuer <[email protected]> * fix formatting * fix tests --------- Co-authored-by: Michael Heuer <[email protected]>
- Loading branch information
1 parent
a9570ea
commit 76b4fc8
Showing
14 changed files
with
478 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
77 changes: 77 additions & 0 deletions
77
modules/client/examples/01-client/20-get-plugin-preparations.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,77 @@ | ||
/* MARKDOWN | ||
--- | ||
title: Get Plugin Preparations | ||
--- | ||
## Get Plugin Preparations | ||
Returns plugin preparations filtered by: | ||
- pluginAddress | ||
- daoAddressOrEns | ||
- pluginRepoAddress | ||
- type(Installation or Update) | ||
*/ | ||
|
||
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); | ||
|
||
/* MARKDOWN | ||
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() | ||
} | ||
] | ||
``` | ||
*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.