-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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: add public wallet #561
Conversation
Coverage report
Show new covered files 🐣
Show files with reduced coverage 🔻
Test suite run success541 tests passing in 49 suites. Report generated by 🧪jest coverage report action from 852874c |
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 think it looks good, but want to discuss names more.
I feel like the primary name should be Wallet and then we'd name the signed version with private key using a different name.
Like:
WalletPublic => Wallet
Wallet => WalletSigned or PrivateWallet
One suggestion from @digorithm is to follow the terminology rust has that is WalletUnlocked and WalletLocked https://github.com/FuelLabs/fuels-rs/blob/14ac1b9feaa09fe64513aefec9115166b971148e/docs/src/wallets/access.md |
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.
Good stuff!
LGTM.
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.
This PR split the Wallet functions into two different levels;
The main difference is that WalletUnlocked has access to the PrivateKey, and WalletPublic works only with the Address.
Also, I add a new
arrayify
function. The idea of the newarrayify
is to enable correctly parsing an object without a length. This is needed in order to stringify a transaction and be able to recreate a new TransactionRequest object from the parse of the string.I add a new test on contract.test.ts to test the stringify and a test for emulating a custom provider using a WalletPublic.
These changes are enabling fuels-ts integration with custom provider objects, like Wallet Extension now and Hardware Wallets in the future.