This repository has been archived by the owner on Oct 7, 2024. It is now read-only.
generated from MetaMask/metamask-module-template
-
-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
51 additions
and
1 deletion.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
import type { Json, Keyring } from '@metamask/utils'; | ||
|
||
import type { | ||
EthBaseTransaction, | ||
EthBaseUserOperation, | ||
EthUserOperation, | ||
EthUserOperationPatch, | ||
} from '../../eth'; | ||
|
||
export type EthKeyring<State extends Json> = Keyring<State> & { | ||
/** | ||
* Convert a base transaction to a base UserOperation. | ||
* | ||
* @param address - Address of the sender. | ||
* @param transactions - Base transactions to include in the UserOperation. | ||
* @returns A pseudo-UserOperation that can be used to construct a real. | ||
*/ | ||
prepareUserOperation( | ||
address: string, | ||
transactions: EthBaseTransaction[], | ||
): Promise<EthBaseUserOperation>; | ||
|
||
/** | ||
* Patches properties of a UserOperation. Currently, only the | ||
* `paymasterAndData` can be patched. | ||
* | ||
* @param address - Address of the sender. | ||
* @param userOp - UserOperation to patch. | ||
* @returns A patch to apply to the UserOperation. | ||
*/ | ||
patchUserOperation( | ||
address: string, | ||
userOp: EthUserOperation, | ||
): Promise<EthUserOperationPatch>; | ||
|
||
/** | ||
* Signs an UserOperation. | ||
* | ||
* @param address - Address of the sender. | ||
* @param userOp - UserOperation to sign. | ||
* @returns The signature of the UserOperation. | ||
*/ | ||
signUserOperation(address: string, userOp: EthUserOperation): Promise<string>; | ||
}; |
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 @@ | ||
export * from './EthKeyring'; |
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 |
---|---|---|
@@ -1,4 +1,5 @@ | ||
export * from './api'; | ||
export * from './eth'; | ||
export * from './events'; | ||
export * from './rpc'; | ||
export * from './types'; |