Skip to content

Commit 1285f83

Browse files
authored
chore: export additional types (#134)
* export additional types * update changelog
1 parent a8bd99a commit 1285f83

File tree

2 files changed

+24
-0
lines changed

2 files changed

+24
-0
lines changed

packages/smart-accounts-kit/CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
77

88
## [Unreleased]
99

10+
### Added
11+
12+
- Exports 2 new types: `PermissionRequestParameter` and `Erc7715Client` ([#134](https://github.com/MetaMask/smart-accounts-kit/pull/134))
13+
1014
## [0.4.0-beta.0]
1115

1216
### Added

packages/smart-accounts-kit/src/actions/index.ts

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ export {
5454
erc7715RequestExecutionPermissionsAction as requestExecutionPermissions,
5555
type MetaMaskExtensionClient,
5656
type MetaMaskExtensionSchema,
57+
type PermissionRequestParameter,
5758
type RequestExecutionPermissionsParameters,
5859
type RequestExecutionPermissionsReturnType,
5960
} from './erc7715RequestExecutionPermissionsAction';
@@ -91,6 +92,25 @@ export const erc7715ProviderActions = () => (client: Client) => ({
9192
},
9293
});
9394

95+
/**
96+
* Type for a viem Client extended with ERC-7715 provider actions.
97+
* Use this to type variables that will be assigned an extended client later.
98+
*
99+
* @example
100+
* ```typescript
101+
* let client: Erc7715Client | null = null;
102+
*
103+
* function setupClient() {
104+
* client = createWalletClient({
105+
* chain: sepolia,
106+
* transport: custom(window.ethereum),
107+
* }).extend(erc7715ProviderActions());
108+
* }
109+
* ```
110+
*/
111+
export type Erc7715Client = Client &
112+
ReturnType<ReturnType<typeof erc7715ProviderActions>>;
113+
94114
export const erc7710WalletActions = () => (client: WalletClient) => ({
95115
sendTransactionWithDelegation: async (
96116
args: SendTransactionWithDelegationParameters,

0 commit comments

Comments
 (0)