This repository was archived by the owner on Mar 5, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 5.1k
fix: export Web3Account, Wallet and signature related types #7374
Merged
Merged
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 |
---|---|---|
|
@@ -15,38 +15,16 @@ You should have received a copy of the GNU Lesser General Public License | |
along with web3.js. If not, see <http://www.gnu.org/licenses/>. | ||
*/ | ||
|
||
import { Web3BaseWalletAccount, HexString } from 'web3-types'; | ||
import { FeeMarketEIP1559TxData, AccessListEIP2930TxData, TxData } from './tx/types.js'; | ||
import { | ||
HexString, | ||
SignatureObject, | ||
SignResult, | ||
SignTransactionResult, | ||
Web3BaseWalletAccount, | ||
} from 'web3-types'; | ||
import { AccessListEIP2930Transaction, FeeMarketEIP1559Transaction, Transaction } from './tx'; | ||
|
||
export type SignatureObject = { | ||
messageHash: string; | ||
r: string; | ||
s: string; | ||
v: string; | ||
}; | ||
|
||
export type SignTransactionResult = SignatureObject & { | ||
rawTransaction: string; | ||
transactionHash: string; | ||
}; | ||
|
||
export type SignTransactionFunction = ( | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. this is not used anywhere |
||
transaction: | ||
| TxData | ||
| AccessListEIP2930TxData | ||
| FeeMarketEIP1559TxData | ||
| Record<string, unknown>, | ||
) => SignTransactionResult; | ||
|
||
export type SignResult = SignatureObject & { | ||
message?: string; | ||
signature: string; | ||
}; | ||
|
||
export type SignFunction = (data: string, privateKey: string) => SignResult; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. this is not used anywhere |
||
|
||
// https://github.com/ethereum/wiki/wiki/Web3-Secret-Storage-Definition | ||
export { SignatureObject, SignResult, SignTransactionResult }; | ||
|
||
export interface Web3Account extends Web3BaseWalletAccount { | ||
address: HexString; | ||
|
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll suggest to move only shared types that are used in 1+ packages in web3-types package, and for moved types re-export those from web3-eth-accounts package for backward compatibility.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the problem is that
SignatureObject
is used in web3-eth-accounts but is also part of theWeb3BaseWalletAccount
type inweb3-types
.See the type details below:
Also, none of the
web3-eth-accounts
types are exported from the umbrellaweb3
package, but I will reexport these forweb3-eth-accounts
backwards compatibility.