Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
109 commits
Select commit Hold shift + click to select a range
e01ff2c
feat(core): wip - implement etherscan abi loading mvp
pasevin Apr 11, 2025
57c9f7f
Merge branch 'better-chain-selector' into contract-loader
pasevin Apr 11, 2025
25c11a1
fix(export): include logger file and missing type exports in adapter …
pasevin Apr 11, 2025
d4e6abd
chore(core): merge branch 'contract-loader'
pasevin Apr 14, 2025
1443e3d
refactor(core): restructure StepContractDefinition for improved organ…
pasevin Apr 14, 2025
9872090
refactor(core): create centralized chain registry and update chain-sp…
pasevin Apr 14, 2025
87fd076
fix(export): update snapshots
pasevin Apr 14, 2025
baa8647
feat(core): wip contract state widget
pasevin Apr 15, 2025
cc3a556
feat(types): implement shared types package for core and form-renderer
pasevin Apr 16, 2025
b7c0f3b
docs(core): update documentation to reflect shared types package impl…
pasevin Apr 17, 2025
cae1b43
feat(ui): improve ContractStateWidget layout and create StepTitleWith…
pasevin Apr 18, 2025
b77ee59
refactor(core): move truncateMiddle utility function to general utils
pasevin Apr 18, 2025
b988ef2
fix(ui): reduce padding in ContractStateWidget card for better space …
pasevin Apr 18, 2025
3bd7175
feat(ui): auto-query simple view functions in ContractStateWidget
pasevin Apr 18, 2025
a70e83d
feat(ui): remove read-only functions display functionality
pasevin Apr 21, 2025
cf33cca
feat(core): remove layout customization functionality
pasevin Apr 21, 2025
70b834e
refactor(form): move execution method to customize form tab
pasevin Apr 21, 2025
9a10029
refactor(ui): remove parameterized query functionality from ContractS…
pasevin Apr 22, 2025
947a75d
refactor(ui): replace full-width refresh button with compact icon button
pasevin Apr 22, 2025
f5ce31f
refactor(ui): make Card component gap customizable
pasevin Apr 22, 2025
d63eb39
fix(ui): resolve ESLint warning by adding missing dependency to useEf…
pasevin Apr 22, 2025
0d5c6ed
fix(ui): improve button spacing and visual distinction in ContractSta…
pasevin Apr 22, 2025
0b8ffc5
feat(ui): make ContractStateWidget dynamically resize to available space
pasevin Apr 22, 2025
e14d338
feat(ui): enhance Preview Form button with icons for better UX
pasevin Apr 22, 2025
1a70a10
refactor(ui): shorten wizard tab names and increase font size
pasevin Apr 22, 2025
d6d22e0
feat(core): refactor export step to 'Complete', add loader, and use s…
pasevin Apr 22, 2025
b8fada4
chore(core): clean up
pasevin Apr 22, 2025
34546b6
refactor(core): rename CompleteStep to StepComplete and align directo…
pasevin Apr 22, 2025
3f2833b
chore(core): clean up
pasevin Apr 22, 2025
dfcc192
refactor(core): split monolithic hook into focused step-specific hooks
pasevin Apr 22, 2025
76c2a5f
refactor(core): reorganize FormBuilder components for consistency
pasevin Apr 22, 2025
6eb6b4a
feat(core): remove Field Width option from customization
pasevin Apr 22, 2025
ea6e64c
Merge branch 'plat-6405-transaction-form-builder-mock-schema-poc-v2' …
pasevin Apr 23, 2025
b05b149
fix(core): make placeholder input full width in field customization
pasevin Apr 23, 2025
e44d4d4
fix(core): set default EOA execution method on customization step load
pasevin Apr 23, 2025
69a7bba
feat(core): change execution method UI to use left rail navigation
pasevin Apr 23, 2025
ab185ec
feat(ui): hide next button on the last page
pasevin Apr 23, 2025
b50839e
feat(ui): make the export button more prominent
pasevin Apr 23, 2025
3e0a41a
feat(core): enhance wizard header and footer styling for better visua…
pasevin Apr 23, 2025
0cc2f0f
feat(core): select first field in field customization tab
pasevin Apr 23, 2025
c254039
chore(core): clean up
pasevin Apr 23, 2025
a413db9
feat(core): font size consistency
pasevin Apr 23, 2025
5fe2f81
feat(form): wip add wallet connection and transaction execution ui sk…
pasevin Apr 24, 2025
de8de2c
feat(ui): enhance form preview with visual indicators
pasevin Apr 24, 2025
6d49915
chore(deps): update lucide-react dependency
pasevin Apr 24, 2025
3768883
feat(form): show loading indicator in wallet button
pasevin Apr 24, 2025
739e577
feat(form): show loading indicator in transction execute button
pasevin Apr 24, 2025
bb42afa
feat(core): improve wizard validation with step-based requirements
pasevin Apr 24, 2025
1c031b1
fix(core): persist contract data when navigating back in wizard
pasevin Apr 24, 2025
59c1fdd
fix(form): prefil default values to avoid controled components error
pasevin Apr 24, 2025
bea38cf
refactor(core): move contract state widget to form-renderer
pasevin Apr 24, 2025
886bcca
fix(form): lint issues
pasevin Apr 24, 2025
13c435c
refactor(core): use card from form-renderer
pasevin Apr 24, 2025
9f86289
feat(form): include the contract state widget in the exported form
pasevin Apr 25, 2025
de5071f
fix(export): exported package issues
pasevin Apr 25, 2025
182330e
fix(core): update snapshot
pasevin Apr 25, 2025
42f0fc1
refactor(export): centralize logger and general utils in form-renderer
pasevin Apr 25, 2025
a160a3a
chore(docs): update READMEs for utility centralization
pasevin Apr 25, 2025
9e267ce
feat(core): wallet connect in the core app
pasevin Apr 27, 2025
dfe4000
refactor(core): separate blockchain adapters into individual packages
pasevin Apr 28, 2025
0028372
fix(export): regression issue with adapter configs not being included…
pasevin Apr 29, 2025
8d78d8b
fix(config): lint adapters
pasevin Apr 30, 2025
3764217
fix(export): wallet provider state issues and improved templates
pasevin Apr 30, 2025
5bb3c47
fix(export): tests
pasevin Apr 30, 2025
f3b4e93
chore(export): clean up outdated docs and files
pasevin Apr 30, 2025
aad7248
feat(form): transaction execution
pasevin May 2, 2025
7865454
feat(form): add transaction confirmation waiting step
pasevin May 2, 2025
57e114f
feat(form): add reset button
pasevin May 2, 2025
a8fdead
feat(config): add adapter into commit scope
pasevin May 2, 2025
e5424f6
fix(adapter): eslint rules path
pasevin May 2, 2025
c072339
feat(adapter): implement robust serialization for inputs/outputs for evm
pasevin May 2, 2025
f51ceb5
refactor(adapter): establish domain-driven module structure for evm
pasevin May 3, 2025
3381634
refactor(adapter): apply domain-driven module structure for solana
pasevin May 3, 2025
7d64d4e
refactor(adapter): apply domain-driven module structure for stellar
pasevin May 3, 2025
59504c3
refactor(adapter): apply domain-driven module structure for midnight
pasevin May 3, 2025
982586e
feat(ui): move contract state widget to the left
pasevin May 5, 2025
2fb011a
feat(form): improve transaction status display
pasevin May 5, 2025
fb617fb
feat(core): wip ecosystem model
pasevin May 5, 2025
4b37a83
feat(adapter): implement new network configurations
pasevin May 5, 2025
9b3a088
refactor(core): remove nested imports from types package
pasevin May 6, 2025
c2671eb
feat(core): pass network config accross adapter and core app
pasevin May 6, 2025
c41599d
refactor(core): make adapter loading async and network-aware, consoli…
pasevin May 6, 2025
4998eab
feat(export): inject the network config to exported app and handle it
pasevin May 8, 2025
f8c811f
feat(core): hide contract state widget on the first step
pasevin May 8, 2025
b2fdef6
feat(ui): adjust badge size
pasevin May 8, 2025
60cf2d3
feat(ui): remove unecessary element
pasevin May 8, 2025
d230eb1
feat(core): remove contract mocks and moking UI
pasevin May 8, 2025
a62013e
feat(ui): remove load contract button
pasevin May 8, 2025
bb24a7c
feat(ui): improve action bar and contract state UI components
pasevin May 8, 2025
d9b1fb8
feat(ui): improve action bar with export button and refined styling
pasevin May 8, 2025
5cfb706
fix(form): wallet disconnect state issues
pasevin May 8, 2025
20a57fb
refactor(core): singleton adapter provider pattern
pasevin May 8, 2025
a830d5a
fix(export): update onSubmit and omit contractSchema
pasevin May 8, 2025
653c18a
refactor(export): clean up template
pasevin May 8, 2025
d00a1c8
fix(adapter): ensure transformer includes only standard properties
pasevin May 8, 2025
add7abc
feat(adapter): implement proactive network switching on connect and p…
pasevin May 8, 2025
6c2f331
test(adapter): evm abi transformer
pasevin May 8, 2025
48f5253
fix(core): contract loader infinite loop if wrong network
pasevin May 8, 2025
c6553b5
test(types): no need for tests here
pasevin May 9, 2025
8de68de
ci(core): sequence
pasevin May 9, 2025
497002f
fix(core): build issues
pasevin May 9, 2025
94c9e09
fix(config): add optimizeDeps to shared vitest config
pasevin May 9, 2025
50f090b
fix(config): add ssr.noExternal to shared vitest config
pasevin May 9, 2025
5558df5
fix(core): add optimizeDeps and ssr.noExternal to vitest config
pasevin May 9, 2025
1c35a73
fix(core): add resolve.dedupe to vitest config
pasevin May 9, 2025
97b5266
fix(config): ensure build runs before coverage tests
pasevin May 9, 2025
baee487
fix(config): add build step to export-testing workflow
pasevin May 9, 2025
b99e14d
fix(ui): prevent overflow in contract preview JSON display
pasevin May 9, 2025
e44884a
fix(ui): remove error message for contracts with no view functions
pasevin May 9, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
13 changes: 12 additions & 1 deletion .eslint/rules/no-extra-adapter-methods.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ module.exports = {
// Known interface methods from ContractAdapter
const interfaceMethods = [
'loadContract',
'loadMockContract',
'getWritableFunctions',
'mapParameterTypeToFieldType',
'getCompatibleFieldTypes',
Expand All @@ -46,6 +45,18 @@ module.exports = {
'isValidAddress',
'getSupportedExecutionMethods',
'validateExecutionConfig',
'isViewFunction',
'queryViewFunction',
'formatFunctionResult',
'supportsWalletConnection',
'getAvailableConnectors',
'connectWallet',
'disconnectWallet',
'getWalletConnectionStatus',
'onWalletConnectionChange',
'getExplorerUrl',
'getExplorerTxUrl',
'waitForTransactionConfirmation',
];

// Common standard methods and properties that are allowed
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,9 @@ jobs:
- name: Install dependencies
run: pnpm install

- name: Build all packages
run: pnpm -r build

- name: Type check
run: pnpm tsc --noEmit

Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/coverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@ jobs:
- name: Install dependencies
run: pnpm install

- name: Build all packages
run: pnpm -r build

- name: Run tests with coverage
run: pnpm test:coverage

Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/export-testing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,10 @@ jobs:
- name: Install dependencies
run: pnpm install

# Add this build step to ensure all workspace packages are built before testing
- name: Build all packages
run: pnpm -r build

# Run only export-related tests
- name: Run export tests
run: pnpm --filter @openzeppelin/transaction-form-builder-core test src/export/__tests__/
Expand Down
17 changes: 17 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,23 @@ Thank you for considering contributing to Transaction Form Builder! This documen
6. Push to your branch: `git push origin feature/amazing-feature`
7. Open a Pull Request

### Adding New Adapters

If you are contributing support for a new blockchain ecosystem, please follow the detailed instructions in the main **[README.md under the "Adding New Adapters" section](./README.md#adding-new-adapters)**.

Key steps include:

1. **Familiarize Yourself:** Read the **[Adapter Architecture Guide](./docs/ADAPTER_ARCHITECTURE.md)** to understand the modular structure and responsibilities.
2. **Package Setup**: Create a new `packages/adapter-<chain-name>` package with appropriate `package.json` (depending on `@openzeppelin/transaction-form-types`) and `tsconfig.json`.
3. **Network Configurations**: Define `YourEcosystemNetworkConfig` objects in `src/networks/`, ensuring they provide all necessary details (RPC URLs, chain IDs, etc.). Export a combined list (e.g., `export const suiNetworks = [...]`) and individual configurations from `src/networks/index.ts`.
4. **Adapter Implementation**: Implement the `ContractAdapter` interface from `@openzeppelin/transaction-form-types` in `src/adapter.ts`. The constructor must accept its specific `NetworkConfig` (e.g., `constructor(networkConfig: SuiNetworkConfig)`) and use `this.networkConfig` internally.
5. **Exports**: Export your adapter class and the main networks array (and ideally individual network configs) from your adapter package's `src/index.ts`.
6. **Ecosystem Registration**: Register your new ecosystem in `packages/core/src/core/ecosystemManager.ts` by:
- Adding an entry to `ecosystemRegistry` with the `AdapterClass` constructor and the `networksExportName` (the name of your exported network list).
- Updating the `switch` statement in `loadAdapterPackageModule` to enable dynamic import of your adapter package.
7. **Testing**: Add comprehensive unit and integration tests for your adapter's logic and network configurations.
8. **Documentation**: Update any relevant documentation.

## Pull Request Process

1. Ensure your code follows the style guidelines of the project
Expand Down
116 changes: 92 additions & 24 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,14 @@ This project is currently in development.

This project is organized as a monorepo with the following packages:

- **packages/core**: The main application with the form builder UI
- **packages/form-renderer**: The shared form rendering library (published to npm)
- **packages/styles**: Centralized styling system with shared CSS variables and configurations
- **packages/core**: The main application with the form builder UI and core logic.
- **packages/form-renderer**: The shared form rendering library (published to npm).
- **packages/types**: Shared TypeScript type definitions for all packages (published to npm).
- **packages/styles**: Centralized styling system with shared CSS variables and configurations.
- **packages/adapter-evm**: Adapter implementation for EVM-compatible chains.
- **packages/adapter-solana**: Adapter implementation for the Solana blockchain.
- **packages/adapter-stellar**: Adapter implementation for the Stellar network.
- **packages/adapter-midnight**: Adapter implementation for the Midnight blockchain.

## Packages

Expand All @@ -57,6 +62,19 @@ Features:

For more details, see the [Form-Renderer README](./packages/form-renderer/README.md).

### Types Package

The `types` package contains shared TypeScript type definitions for all packages in the ecosystem. It serves as the single source of truth for types used across the Transaction Form Builder.

Features:

- Centralized type definitions
- Organized namespaces for contracts, adapters, and forms
- Clear separation of concerns
- TypeScript project references for proper type checking

For more details, see the [Types README](./packages/types/README.md).

### Styles Package

The `styles` package contains the centralized styling system used across all packages. It provides consistent theming, spacing, and component styles throughout the application.
Expand All @@ -76,6 +94,7 @@ For more details, see the [Styles README](./packages/styles/README.md).
- Adapter pattern for easily adding support for new blockchains
- Modern React components for building transaction forms
- Customizable UI with Tailwind CSS and shadcn/ui
- Handles wallet connection state consistently in both core app and exported forms
- Configure transaction execution methods (EOA, Relayer, Multisig) via adapters
- Type-safe with TypeScript
- Fast development with Vite
Expand Down Expand Up @@ -169,15 +188,11 @@ transaction-form-builder/
│ │ │ │ ├── Common/ # Shared components across features
│ │ │ │ └── FormBuilder/ # Form builder components
│ │ │ ├── core/ # Chain-agnostic core functionality
│ │ │ │ ├── types/ # Type definitions
│ │ │ │ ├── types/ # Core-specific Type definitions (distinct from packages/types)
│ │ │ │ ├── utils/ # Utility functions
│ │ │ │ ├── hooks/ # Shared hooks
│ │ │ │ └── factories/ # Schema factories
│ │ │ ├── adapters/ # Chain-specific implementations
│ │ │ │ ├── evm/ # Ethereum Virtual Machine adapter
│ │ │ │ ├── midnight/ # Midnight blockchain adapter
│ │ │ │ ├── solana/ # Solana blockchain adapter
│ │ │ │ └── stellar/ # Stellar blockchain adapter
│ │ │ │ ├── factories/ # Schema factories
│ │ │ │ └── ecosystemManager.ts # Central management of ecosystems, adapters, and network configs
│ │ │ ├── export/ # Export system
│ │ │ │ ├── generators/ # Form code generators
│ │ │ │ ├── codeTemplates/ # Individual file templates for generation
Expand All @@ -192,8 +207,6 @@ transaction-form-builder/
│ │ │ │ ├── form-builder/# Stories for form builder components
│ │ │ │ └── ui/ # Stories for UI components
│ │ │ ├── test/ # Package-specific tests
│ │ │ ├── mocks/ # Mock data for development and testing
│ │ │ ├── types/ # Shared types for core package
│ │ │ ├── App.tsx # Main application component
│ │ │ ├── main.tsx # Application entry point
│ │ │ └── index.css # Main CSS entry point (imports from @styles)
Expand All @@ -217,11 +230,27 @@ transaction-form-builder/
│ │ ├── scripts/ # Build scripts
│ │ ├── tsconfig.json # TypeScript configuration
│ │ └── package.json # Package configuration
│ └── styles/ # Centralized styling system
│ ├── global.css # Global CSS variables and base styles
│ ├── src/ # Source directory for styles
│ ├── utils/ # Styling utilities
│ └── README.md # Styling documentation
│ ├── types/ # Shared TypeScript type definitions
│ │ ├── src/
│ │ │ ├── adapters/ # Contract adapter interfaces
│ │ │ ├── contracts/ # Contract and blockchain types
│ │ │ ├── forms/ # Form field and layout definitions
│ │ │ └── index.ts # Main entry point
│ │ ├── tsconfig.json # TypeScript configuration
│ │ └── package.json # Package configuration
│ ├── styles/ # Centralized styling system
│ │ ├── global.css # Global CSS variables and base styles
│ │ ├── src/ # Source directory for styles
│ │ ├── utils/ # Styling utilities
│ │ └── README.md # Styling documentation
│ ├── adapter-evm/ # NEW: EVM Adapter Package
│ │ └── src/ # Contains EvmAdapter implementation
│ ├── adapter-solana/ # NEW: Solana Adapter Package
│ │ └── src/ # Contains SolanaAdapter implementation
│ ├── adapter-stellar/ # NEW: Stellar Adapter Package
│ │ └── src/ # Contains StellarAdapter implementation
│ └── adapter-midnight/ # NEW: Midnight Adapter Package
│ └── src/ # Contains MidnightAdapter implementation
├── tailwind.config.cjs # Central Tailwind CSS configuration
├── postcss.config.cjs # Central PostCSS configuration
├── components.json # Central shadcn/ui configuration
Expand All @@ -238,14 +267,17 @@ transaction-form-builder/

## Architecture

The application uses an adapter pattern to support multiple blockchain ecosystems:
The application uses a modular, domain-driven adapter pattern to support multiple blockchain ecosystems. For a detailed explanation of the adapter architecture and module responsibilities, please see the **[Adapter Architecture Guide](./docs/ADAPTER_ARCHITECTURE.md)**.

- **Core**: Chain-agnostic components, types, and utilities
- **Adapters**: Chain-specific implementations that conform to a common interface (including methods for field mapping, transaction formatting, address validation, and discovering/validating execution methods)
- **UI Components**: React components that use adapters to interact with different blockchains
- **Styling System**: Centralized CSS variables and styling approach used across all packages
**Key Components:**

This architecture allows for easy extension to support additional blockchain ecosystems without modifying the core application logic. It utilizes **custom Vite plugins** to create **virtual modules**, enabling reliable loading of shared assets (like configuration files and CSS) across package boundaries, ensuring consistency between development, testing, and exported builds.
- **Core**: Chain-agnostic application logic, UI components, export system, and the central `ecosystemManager.ts` for managing ecosystem details, network configurations, and adapter instantiation.
- **Adapters (`packages/adapter-*`)**: Individual packages containing chain-specific implementations (e.g., `EvmAdapter`, `SolanaAdapter`). Each adapter conforms to the common `ContractAdapter` interface defined in `packages/types`. Adapters are now instantiated with a specific `NetworkConfig`, making them network-aware. The core package dynamically discovers network configurations and instantiates adapters via `ecosystemManager.ts`.
- **Form Renderer**: Shared library containing form rendering components and common utilities (like logging).
- **Types**: Shared TypeScript type definitions across all packages, including the crucial `ContractAdapter` interface.
- **Styling System**: Centralized CSS variables and styling approach used across all packages.

This architecture allows for easy extension to support additional blockchain ecosystems without modifying the core application logic. The core package dynamically loads and uses adapters via the `ecosystemManager.ts`, and the export system includes the specific adapter package needed for the target chain in exported forms. It utilizes **custom Vite plugins** to create **virtual modules**, enabling reliable loading of shared assets (like configuration files between packages) across package boundaries, ensuring consistency between development, testing, and exported builds.

### Adapter Pattern Enforcement

Expand All @@ -258,7 +290,7 @@ To maintain the integrity of the adapter pattern, this project includes:

These enforcement mechanisms ensure that the adapter interface remains the single source of truth for adapter implementations, preventing interface drift and maintaining architectural consistency.

For more detailed documentation about the adapter pattern, implementation guidelines, and validation rules, see the [Adapter System documentation](./packages/core/src/adapters/README.md).
For more detailed documentation about the adapter pattern, implementation guidelines, and validation rules, see the documentation within the [`packages/types/src/adapters/base.ts`](./packages/types/src/adapters/base.ts) file where the `ContractAdapter` interface is defined.

## Component Architecture

Expand Down Expand Up @@ -384,6 +416,42 @@ The project is configured with:

1. **Update Dependencies workflow**: Runs weekly to check for and apply updates

## Adding New Adapters

To add support for a new blockchain ecosystem:

1. **Create Package**: Create a new directory `packages/adapter-<chain-name>` (e.g., `packages/adapter-sui`).
2. **Define `package.json`**:
- Set the package name (e.g., `@openzeppelin/transaction-form-adapter-sui`).
- Add a dependency on `@openzeppelin/transaction-form-types` (`workspace:*`).
- Add any chain-specific SDKs or libraries required by the adapter.
- Include standard build scripts (refer to existing adapter packages).
- **Important**: Ensure your package exports a named array of its `NetworkConfig[]` objects (e.g., `export const suiNetworks = [...]`) and its main `Adapter` class from its entry point (`src/index.ts`).
3. **Define `tsconfig.json`**: Create a `tsconfig.json` extending the root `tsconfig.base.json`.
4. **Implement Adapter**:
- Create `src/adapter.ts`.
- Import `ContractAdapter`, the specific `YourEcosystemNetworkConfig` (e.g., `SuiNetworkConfig`), and related types from `@openzeppelin/transaction-form-types`.
- Implement the `ContractAdapter` interface. The constructor **must** accept its specific `NetworkConfig` (e.g., `constructor(networkConfig: SuiNetworkConfig)`).
- Implement methods to use `this.networkConfig` internally for network-specific operations (e.g., initializing HTTP clients with RPC URLs from the config).
5. **Define Network Configurations**:\
- Create `src/networks/mainnet.ts`, `testnet.ts`, etc., defining `YourEcosystemNetworkConfig` objects for each supported network.
- Each network config must provide all necessary details for the adapter to function, such as RPC endpoints (`rpcUrl` or `rpcEndpoint`), chain identifiers (`chainId` for EVM), explorer URLs, native currency details, etc., as defined by its `YourEcosystemNetworkConfig` interface.
- Create `src/networks/index.ts` to export the combined list of networks (e.g., `export const suiNetworks = [...mainnetSuiNetworks, ...testnetSuiNetworks];`) and also export each network configuration individually by its constant name (e.g., `export { suiMainnet, suiTestnet } from './mainnet';`).
6. **Export Adapter & Networks**: Create `src/index.ts` in your adapter package and export the adapter class (e.g., `export { SuiAdapter } from './adapter';`) and the main networks array (e.g., `export { suiNetworks } from './networks';`). It's also good practice to re-export individual network configurations from the adapter's main entry point if they might be directly imported by consumers.
7. **Register Ecosystem in Core**:
- Open `packages/core/src/core/ecosystemManager.ts`.
- Import the new adapter class (e.g., `import { SuiAdapter } from '@openzeppelin/transaction-form-adapter-sui';`).
- Add a new entry to the `ecosystemRegistry` object. This entry defines:
- `networksExportName`: The string name of the exported network list (e.g., 'suiNetworks'). This is used by the `EcosystemManager` to dynamically load all network configurations for an ecosystem.
- `AdapterClass`: The constructor of your adapter (e.g., `SuiAdapter as AnyAdapterConstructor`).
- Add a case for your new ecosystem in the `switch` statement within `loadAdapterPackageModule` to enable dynamic import of your adapter package module (which should export the `AdapterClass` and the `networksExportName` list).
- Note: If the adapter requires specific package dependencies for _exported projects_ (beyond its own runtime dependencies), these are typically managed by the `PackageManager` configuration within the adapter package itself (e.g., an `adapter.config.ts` file exporting dependency details).
8. **Workspace**: Ensure the new package is included in the `pnpm-workspace.yaml` (if not covered by `packages/*`).
9. **Build & Test**:
- Build the new adapter package (`pnpm --filter @openzeppelin/transaction-form-adapter-<chain-name> build`).
- Add relevant unit/integration tests.
- Ensure the core application (`pnpm --filter @openzeppelin/transaction-form-builder-core build`) and the export system still function correctly.

## Commit Convention

This project follows [Conventional Commits](https://www.conventionalcommits.org/en/v1.0.0/). See [COMMIT_CONVENTION.md](./COMMIT_CONVENTION.md) for
Expand Down
4 changes: 3 additions & 1 deletion SECURITY.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@

| Version | Supported |
| ------- | ------------------ |
| 0.1.x | :white_check_mark: |
| 1.1.x | :white_check_mark: |
| 1.0.x | :white_check_mark: |
| < 1.0 | :x: |

## Reporting a Vulnerability

Expand Down
3 changes: 3 additions & 0 deletions commitlint.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,11 +41,14 @@ export default {
'deps',
'config',
'form',
'types',
'transaction',
'utils',
'docs',
'tests',
'release',
'adapter',
'types',
],
],
'scope-empty': [2, 'never'],
Expand Down
Loading
Loading