-
-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: AccountApi #3
base: WY_gg_extension
Are you sure you want to change the base?
Conversation
feat: add smart contract base structure
feat(browser-extension): add signing utils test(browser-extension): add signing utils tests
Added working signing with dynamically checked address type test(browser-extension): added simple error throwing test for accountApi
export const getDomainSeparator = (chainId: number): string => { | ||
return ethers.utils.keccak256( | ||
ethers.utils.defaultAbiCoder.encode( | ||
["bytes32", "bytes32", "uint256"] as string[], |
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.
remove type cast
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.
done
export const getTxnHash = (transaction: Transaction): string => { | ||
return ethers.utils.keccak256( | ||
ethers.utils.defaultAbiCoder.encode( | ||
["uint256", "uint256", "address", "bool", "uint256", "bytes"] as string[], |
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.
here and everywhere else too
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.
done
}; | ||
|
||
// Get the hash of the given transaction | ||
export const getTxnHash = (transaction: Transaction): string => { |
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.
maybe getKeccakHashForTransactionObject
}; | ||
|
||
// Get the hash of the signed message for the given transaction and chain ID | ||
export function getTransactionHash( |
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.
maybe getEip712HashForTransactionObject
const message = ethers.utils.solidityPack( | ||
["bytes2", "bytes32", "bytes32"] as string[], | ||
[ | ||
ethers.utils.toUtf8Bytes("\x19\x01"), |
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.
where is this coming from
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.
put the magic var into a constant
ethers.utils.toUtf8Bytes("\x19\x01"), | ||
domainSeparator, | ||
getTxnHash(transaction), | ||
] as string[], |
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.
remove
chore(pullRequest): refactored tests so they work.
PR to add AccountApi object for signing utils.