Skip to content

Commit

Permalink
feat(ethers): reexports structs and event from typechain (#528)
Browse files Browse the repository at this point in the history
* feat(ethers): exports structs and event from typechain

* chore(ethers): updates package version to be alpha

* style: run prettier

* fix: failing deployment tests

* chore: maintained changelog

* fix: type error

* ci: adapt workflows

* fix: remove struct now located in osx-commons-contracts

* feat: add missing exports

* feat: add ens contracts

* chore: maintained changelog

* build: use correct version number

---------

Co-authored-by: Michael Heuer <[email protected]>
  • Loading branch information
mathewmeconry and heueristik authored Feb 6, 2024
1 parent 929ab7a commit 35c066e
Show file tree
Hide file tree
Showing 14 changed files with 151 additions and 2 deletions.
2 changes: 2 additions & 0 deletions packages/contracts-ethers/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### Changed

- Added the `@ensdomains/ens-contracts`.
- Re-exported structs and events for the `DAO`, `DAORegistry`, `PluginRepo`, `PluginRepoRegistry`, and `PluginSetupProcessor`.
- Refactored import statements.

## v0.2.1-alpha
Expand Down
31 changes: 31 additions & 0 deletions packages/contracts-ethers/npm/events/DAO.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
export {
GrantedEvent,
RevokedEvent,
ExecutedEvent,
UpgradedEvent,
DepositedEvent,
InitializedEvent,
MetadataSetEvent,
AdminChangedEvent,
BeaconUpgradedEvent,
CallbackReceivedEvent,
TrustedForwarderSetEvent,
NativeTokenDepositedEvent,
StandardCallbackRegisteredEvent,
} from '../../types/core/dao/DAO';

export type EventName =
| 'Granted'
| 'Revoked'
| 'Executed'
| 'Upgraded'
| 'Deposited'
| 'Initialized'
| 'MetadataSet'
| 'AdminChanged'
| 'BeaconUpgraded'
| 'CallbackReceived'
| 'TrustedForwarderSet'
| 'NativeTokenDeposited'
| 'SignatureValidatorSet'
| 'StandardCallbackRegistered';
14 changes: 14 additions & 0 deletions packages/contracts-ethers/npm/events/DAORegistry.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
export {
UpgradedEvent,
AdminChangedEvent,
BeaconUpgradedEvent,
DAORegisteredEvent,
InitializedEvent,
} from '../../types/framework/dao/DAORegistry';

export type EventName =
| 'Upgraded'
| 'AdminChanged'
| 'BeaconUpgraded'
| 'DAORegistered'
| 'Initialized';
20 changes: 20 additions & 0 deletions packages/contracts-ethers/npm/events/PluginRepo.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
export {
GrantedEvent,
RevokedEvent,
UpgradedEvent,
InitializedEvent,
AdminChangedEvent,
BeaconUpgradedEvent,
VersionCreatedEvent,
ReleaseMetadataUpdatedEvent,
} from '../../types/framework/plugin/repo/PluginRepo';

export type EventName =
| 'Granted'
| 'Revoked'
| 'Upgraded'
| 'Initialized'
| 'AdminChanged'
| 'BeaconUpgraded'
| 'VersionCreated'
| 'ReleaseMetadataUpdated';
14 changes: 14 additions & 0 deletions packages/contracts-ethers/npm/events/PluginRepoRegistry.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
export {
UpgradedEvent,
InitializedEvent,
AdminChangedEvent,
BeaconUpgradedEvent,
PluginRepoRegisteredEvent,
} from '../../types/framework/plugin/repo/PluginRepoRegistry';

export type EventName =
| 'Upgraded'
| 'Initialized'
| 'AdminChanged'
| 'BeaconUpgraded'
| 'PluginRepoRegistered';
16 changes: 16 additions & 0 deletions packages/contracts-ethers/npm/events/PluginSetupProcessor.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
export {
UpdateAppliedEvent,
UpdatePreparedEvent,
InstallationAppliedEvent,
InstallationPreparedEvent,
UninstallationAppliedEvent,
UninstallationPreparedEvent,
} from '../../types/framework/plugin/setup/PluginSetupProcessor';

export type EventName =
| 'UpdateApplied'
| 'UpdatePrepared'
| 'InstallationApplied'
| 'InstallationPrepared'
| 'UninstallationApplied'
| 'UninstallationPrepared';
5 changes: 5 additions & 0 deletions packages/contracts-ethers/npm/events/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
export * as DAOEvents from './DAO';
export * as DAORegistryEvents from './DAORegistry';
export * as PluginRepoEvents from './PluginRepo';
export * as PluginRepoRegistryEvents from './PluginRepoRegistry';
export * as PluginSetupProcessorEvents from './PluginSetupProcessor';
2 changes: 2 additions & 0 deletions packages/contracts-ethers/npm/index.ts
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
export * from '../types/';
export * from './events/';
export * from './structs';
7 changes: 7 additions & 0 deletions packages/contracts-ethers/npm/structs/DAO.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import {IDAO, PermissionLib} from '../../types/core/dao/DAO';

export type ActionStruct = IDAO.ActionStruct;
export type MultiTargetPermissionStruct =
PermissionLib.MultiTargetPermissionStruct;
export type SingleTargetPermissionStruct =
PermissionLib.SingleTargetPermissionStruct;
4 changes: 4 additions & 0 deletions packages/contracts-ethers/npm/structs/DAOFactory.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
import {DAOFactory} from '../../types/framework/dao/DAOFactory';

export type DAOSettingsStruct = DAOFactory.DAOSettingsStruct;
export type PluginSettingsStruct = DAOFactory.PluginSettingsStruct;
4 changes: 4 additions & 0 deletions packages/contracts-ethers/npm/structs/PluginRepo.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
import {PluginRepo} from '../../types/framework/plugin/repo/PluginRepo';

export type TagStruct = PluginRepo.TagStruct;
export type VersionStruct = PluginRepo.VersionStruct;
26 changes: 26 additions & 0 deletions packages/contracts-ethers/npm/structs/PluginSetupProcessor.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
import {
PluginSetupProcessor,
PluginSetupRefStruct as PluginSetupRefStruct_,
PluginSetupRefStructOutput as PluginSetupRefStructOutput_,
} from '../../types/framework/plugin/setup/PluginSetupProcessor';

export type ApplyInstallationParamsStruct =
PluginSetupProcessor.ApplyInstallationParamsStruct;

export type ApplyUninstallationParamsStruct =
PluginSetupProcessor.ApplyUninstallationParamsStruct;

export type ApplyUpdateParamsStruct =
PluginSetupProcessor.ApplyUpdateParamsStruct;

export type PrepareInstallationParamsStruct =
PluginSetupProcessor.PrepareInstallationParamsStruct;
export type PrepareUninstallationParamsStruct =
PluginSetupProcessor.PrepareUninstallationParamsStruct;

export type PrepareUpdateParamsStructOutput =
PluginSetupProcessor.PrepareUpdateParamsStructOutput;

export type PluginSetupRefStruct = PluginSetupRefStruct_;

export type PluginSetupRefStructOutput = PluginSetupRefStructOutput_;
4 changes: 4 additions & 0 deletions packages/contracts-ethers/npm/structs/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
export * as DAOStructs from './DAO';
export * as DAOFactoryStructs from './DAOFactory';
export * as PluginRepoStructs from './PluginRepo';
export * as PluginSetupProcessorStructs from './PluginSetupProcessor';
4 changes: 2 additions & 2 deletions packages/contracts-ethers/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@aragon/osx-ethers",
"version": "1.4.0-rc0",
"version": "1.4.0-alpha.0",
"description": "The Aragon OSx contract definitions for ethers.js",
"main": "dist/bundle-cjs.js",
"module": "dist/bundle-esm.js",
Expand All @@ -10,7 +10,7 @@
},
"scripts": {
"build:contracts": "cd ../contracts && yarn build",
"build": "find ../contracts/artifacts/src/ -name '*.json' -type f | grep -v '.dbg.json' | xargs typechain --target=ethers-v5 --out-dir ./types",
"build": "find ../contracts/artifacts/src/ ../contracts/artifacts/@ensdomains/ens-contracts/contracts/ -name '*.json' -type f | grep -v '.dbg.json' | xargs typechain --target=ethers-v5 --out-dir ./types",
"build:npm": "rollup --config rollup.config.ts",
"prepublishOnly": "yarn build:contracts && yarn build && yarn build:npm"
},
Expand Down

0 comments on commit 35c066e

Please sign in to comment.