Skip to content

Enhance contract functionalities and streamline client configuration#74

Merged
mahabubAlahi merged 16 commits intofeat/contract-sdkfrom
update/contract-sdk/feedbacks
Mar 9, 2026
Merged

Enhance contract functionalities and streamline client configuration#74
mahabubAlahi merged 16 commits intofeat/contract-sdkfrom
update/contract-sdk/feedbacks

Conversation

@mahabubAlahi
Copy link

  • Add missing function implementations to contract entities

    • Introduced cancelled and cancelTreasury functions in AllOrNothing and KeepWhatsRaised contracts.
    • Added cancelCampaign function in CampaignInfo contract.
    • Updated corresponding types in client.ts to reflect the new functionalities.
  • Update account handling in wallet client creation

    • Refactored the account assignment in the createWallet function to utilize privateKeyToAccount for improved clarity and correctness.
    • Removed redundant account extraction from the wallet client, streamlining the wallet creation process.
  • Standardize function name casing in PaymentTreasuryEntity

    • Updated function names from getplatformHash and getplatformFeePercent to getPlatformHash and getPlatformFeePercent for consistency and adherence to naming conventions in both the contract and type definitions.
  • Remove ResolvedOakContractsClientConfig interface

    • Eliminated the ResolvedOakContractsClientConfig interface from client.ts to streamline the type definitions and improve clarity in client configuration handling.
  • Enhance client configuration with timeout options

    • Updated the buildClients function to accept a new options parameter, allowing for customizable request timeouts in HTTP transport calls and transaction receipt waits.
    • Adjusted the default timeout value in OakContractsClientOptions from 3000ms to 30000ms for improved reliability in client operations.
  • Add error module to contract package

    • Introduced a new module for error handling in the contracts package by adding errors to the package.json and tsup.config.ts files.
    • Updated the build configuration to include the new errors/index.ts entry point for better organization and accessibility of error-related functionalities.
  • Remove keccak256 export from contracts index

    • Eliminated the keccak256 export from the index.ts file in the contracts package to streamline the module exports and improve clarity.
  • Improve type definitions in wallet client functions

    • Updated the createBrowserProvider and getSigner functions to use EIP1193Provider instead of any for the ethereum parameter, enhancing type safety and clarity in the wallet client implementation.
    • Adjusted the transport handling in createWallet to utilize the custom transport method for better compatibility with various providers.
  • keep Jest config loadable after switching package to ESM

  • Update chain ID naming and usage in client configuration

    • Changed the chain ID from CHAIN_IDS.CELO_SEPOLIA to CHAIN_IDS.CELO_TESTNET_SEPOLIA in the client example for clarity.
    • Updated the chain ID constants to follow a new naming convention, distinguishing between mainnet and testnet.
    • Added Celo Mainnet definition to the chain registry for improved clarity and organization.
  • Update chain ID references in README for clarity

    • Changed all instances of CHAIN_IDS.CELO_SEPOLIA to CHAIN_IDS.CELO_TESTNET_SEPOLIA in the README to reflect the correct testnet configuration.
    • Updated chain ID constants to better differentiate between mainnet and testnet environments, enhancing documentation accuracy.
  • Remove deprecated `entities' files

    • It's unreferenced dead code, and its functionality is already covered by contracts/.

- Introduced `cancelled` and `cancelTreasury` functions in `AllOrNothing` and `KeepWhatsRaised` contracts.
- Added `cancelCampaign` function in `CampaignInfo` contract.
- Updated corresponding types in `client.ts` to reflect the new functionalities.
- Refactored the account assignment in the `createWallet` function to utilize `privateKeyToAccount` for improved clarity and correctness.
- Removed redundant account extraction from the wallet client, streamlining the wallet creation process.
- Updated function names from `getplatformHash` and `getplatformFeePercent` to `getPlatformHash` and `getPlatformFeePercent` for consistency and adherence to naming conventions in both the contract and type definitions.
- Eliminated the `ResolvedOakContractsClientConfig` interface from `client.ts` to streamline the type definitions and improve clarity in client configuration handling.
- Updated the `buildClients` function to accept a new `options` parameter, allowing for customizable request timeouts in HTTP transport calls and transaction receipt waits.
- Adjusted the default timeout value in `OakContractsClientOptions` from 3000ms to 30000ms for improved reliability in client operations.
- Introduced a new module for error handling in the contracts package by adding `errors` to the package.json and tsup.config.ts files.
- Updated the build configuration to include the new `errors/index.ts` entry point for better organization and accessibility of error-related functionalities.
- Eliminated the `keccak256` export from the `index.ts` file in the contracts package to streamline the module exports and improve clarity.
- Updated the `createBrowserProvider` and `getSigner` functions to use `EIP1193Provider` instead of `any` for the `ethereum` parameter, enhancing type safety and clarity in the wallet client implementation.
- Adjusted the transport handling in `createWallet` to utilize the `custom` transport method for better compatibility with various providers.
- Changed the chain ID from `CHAIN_IDS.CELO_SEPOLIA` to `CHAIN_IDS.CELO_TESTNET_SEPOLIA` in the client example for clarity.
- Updated the chain ID constants to follow a new naming convention, distinguishing between mainnet and testnet.
- Added `Celo Mainnet` definition to the chain registry for improved clarity and organization.
- Changed all instances of `CHAIN_IDS.CELO_SEPOLIA` to `CHAIN_IDS.CELO_TESTNET_SEPOLIA` in the README to reflect the correct testnet configuration.
- Updated chain ID constants to better differentiate between mainnet and testnet environments, enhancing documentation accuracy.
- It's unreferenced dead
  code and its functionality is already covered by `contracts/`
@mahabubAlahi mahabubAlahi self-assigned this Mar 9, 2026
@mahabubAlahi mahabubAlahi added the enhancement New feature or request label Mar 9, 2026
Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 00a0e9fdba

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

@mahabubAlahi
Copy link
Author

@codex review

Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 46f5ec5927

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

- Improved type checks for the `chainId`, `rpcUrl`, and `privateKey` properties in the `isSimpleConfig` function to ensure they meet specific criteria, enhancing type safety and configuration reliability.
- Deleted the `CELO_TESTNET_ALFAJORES` constant from the `CHAIN_IDS` to eliminate outdated references and encourage the use of `CELO_TESTNET_SEPOLIA` for new development.
@mahabubAlahi
Copy link
Author

@codex review

Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: f079d3ce21

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

@mahabubAlahi mahabubAlahi merged commit f2b6abd into feat/contract-sdk Mar 9, 2026
1 check passed
@mahabubAlahi mahabubAlahi requested a review from adnanhq March 9, 2026 09:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant