Skip to content
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 fireblocks to aa-signers #301

Merged
merged 8 commits into from
Dec 11, 2023

Conversation

avasisht23
Copy link
Contributor

@avasisht23 avasisht23 commented Dec 4, 2023

Pull Request Checklist


PR-Codex overview

Focus of this PR:

This PR focuses on adding the FireblocksSigner to the project and providing methods for authentication, getting addresses, signing messages, and signing typed data.

Detailed summary:

  • Added mock-private-key.txt in the packages/signers/src/fireblocks/__tests__/ directory.
  • Added export { FireblocksSigner } and export type * to packages/signers/src/fireblocks/index.ts.
  • Added import type { Address } and interfaces FireblocksAuthenticationParams and FireblocksUserInfo to packages/signers/src/fireblocks/types.ts.
  • Added FireblocksSigner and type FireblocksAuthenticationParams to packages/signers/src/index.ts.
  • Added "@fireblocks/fireblocks-web3-provider": "^1.2.6" to packages/signers/package.json.
  • Modified the site/.vitepress/config.ts file.
  • Added getAddress.md, signMessage.md, getAuthDetails.md, authenticate.md, and signTypedData.md files to site/packages/aa-signers/fireblocks/.
  • Added code snippets to fireblocks.ts in the site/snippets/ directory.
  • Added import { FireblocksSigner } and import { ChainId } to site/snippets/fireblocks.ts.
  • Added createFireblocksSigner function to site/snippets/fireblocks.ts.
  • Added the FireblocksSigner class to packages/signers/src/fireblocks/signer.ts.

The following files were skipped due to too many changes: packages/signers/src/fireblocks/signer.ts, site/smart-accounts/signers/guides/fireblocks.md, site/packages/aa-signers/fireblocks/introduction.md, packages/signers/src/fireblocks/__tests__/signer.test.ts, site/packages/aa-signers/fireblocks/constructor.md, yarn.lock

✨ Ask PR-Codex anything about this PR by commenting with /codex {your question}

@avasisht23
Copy link
Contributor Author

avasisht23 commented Dec 4, 2023

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is this necessary? can't we just hardcode this value?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

instantiating a FireblocksWeb3Provider requires the privateKey which actually does check for a file. if i just put a value for the private key itself, I get:
image

to avoid mocking instantiation, making a file was the easiest solution.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ah gotcha


You can either pass in a constructed `FireblocksWeb3Provider` object, or directly pass into the `FireblocksSigner` the `FireblocksProviderConfig` used to construct a `FireblocksWeb3Provider` object. These parameters are listed on the [Fireblocks repo](https://github.com/fireblocks/fireblocks-web3-provider/blob/main/src/types.ts#L48) as well.

`FireblocksProviderConfig` takes in the following parameters:
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oh oof... this is gonna be a pain to have to do and maintain for each signer provider in the future. I can see the devex benefit of having this here, but once it goes out of sync it causes more harm than good. can we link out to their types or docs instead?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah where possible. some SDKs don't expose this, so I have to copy-paste onto the types.ts file for the Signer (so we'll still be out of sink).

but yeah, will just link to code where possible. (saves me time too 🙏 )

@avasisht23 avasisht23 force-pushed the 12-03-docs_reorganize_the_sidebar branch from 556b416 to 2a567a4 Compare December 4, 2023 19:42
@avasisht23 avasisht23 force-pushed the 12-03-feat_add_fireblocks_to_aa-signers branch from 8ee5ca3 to dee199a Compare December 4, 2023 19:42
@avasisht23 avasisht23 mentioned this pull request Dec 4, 2023
7 tasks
@avasisht23 avasisht23 force-pushed the 12-03-feat_add_fireblocks_to_aa-signers branch from dee199a to ccdca68 Compare December 4, 2023 19:44
Base automatically changed from 12-03-docs_reorganize_the_sidebar to main December 4, 2023 21:08
@avasisht23 avasisht23 force-pushed the 12-03-feat_add_fireblocks_to_aa-signers branch from ccdca68 to e55a747 Compare December 4, 2023 21:57
@avasisht23 avasisht23 mentioned this pull request Dec 5, 2023
7 tasks
moldy530
moldy530 previously approved these changes Dec 5, 2023
@moldy530
Copy link
Collaborator

might need to rebase again and then I can approve

@avasisht23 avasisht23 force-pushed the 12-03-feat_add_fireblocks_to_aa-signers branch from f369f33 to 6f369aa Compare December 11, 2023 18:31
@avasisht23 avasisht23 merged commit 40289e6 into main Dec 11, 2023
4 checks passed
@avasisht23 avasisht23 deleted the 12-03-feat_add_fireblocks_to_aa-signers branch December 11, 2023 20:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants