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: export account json rpc #234

Merged
merged 5 commits into from
Jun 18, 2024
Merged

feat: export account json rpc #234

merged 5 commits into from
Jun 18, 2024

Conversation

irubido
Copy link
Contributor

@irubido irubido commented Jun 17, 2024

contains changes from #233

new rpc returns stringified json of keyring pair
example implements file saver and json passphrase encoding field

mpetrunic
mpetrunic previously approved these changes Jun 17, 2024
@irubido irubido changed the title feat: export account json rpc feat: export account json rpc, export seed fix Jun 18, 2024
@@ -70,6 +70,16 @@ export async function exportSeed(this: MetamaskPolkadotSnap): Promise<string> {
return (await sendSnapMethod({ method: 'exportSeed' }, this.snapId)) as string;
}

export async function exportAccount(
this: MetamaskPolkadotSnap,
jsonPassphrase?: string
Copy link
Contributor

Choose a reason for hiding this comment

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

Remove jsonPassphrase there is no usage of it in snap

Copy link
Contributor Author

@irubido irubido Jun 18, 2024

Choose a reason for hiding this comment

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

Left it optional because polkadot js extension must have a passphrase to successfully import account.
Leaving it as empty field does not allow restoring.
Screenshot from 2024-06-18 13-20-33

Copy link
Contributor

Choose a reason for hiding this comment

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

but like reviewing exportAccount.test.ts seems like there is no point of using it

If the extension uses a password field that is not used anywhere (bad U, itX) should not affect our API

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Why we wouldn't allow this option, we lose nothing extending the already existing
KeyringPair.toJson(passphrase?: string) method.

@irubido irubido requested a review from BeroBurny June 18, 2024 11:21
mpetrunic
mpetrunic previously approved these changes Jun 18, 2024
@irubido irubido dismissed mpetrunic’s stale review June 18, 2024 13:32

The merge-base changed after approval.

@irubido irubido changed the title feat: export account json rpc, export seed fix feat: export account json rpc Jun 18, 2024
@irubido irubido merged commit 0212428 into master Jun 18, 2024
5 checks passed
@irubido irubido deleted the irubido/exportAccountJsonRpc branch June 18, 2024 13:39
@github-actions github-actions bot mentioned this pull request Jun 18, 2024
irubido pushed a commit that referenced this pull request Jun 19, 2024
🤖 I have created a release *beep* *boop*
---


<details><summary>metamask-polkadot-adapter: 0.7.0</summary>

##
[0.7.0](metamask-polkadot-adapter-v0.6.0...metamask-polkadot-adapter-v0.7.0)
(2024-06-18)


### Features

* export account json rpc
([#234](#234))
([0212428](0212428))
</details>

<details><summary>metamask-polkadot-types: 0.8.0</summary>

##
[0.8.0](metamask-polkadot-types-v0.7.0...metamask-polkadot-types-v0.8.0)
(2024-06-18)


### Features

* export account json rpc
([#234](#234))
([0212428](0212428))
</details>

<details><summary>polkadot-snap: 0.10.0</summary>

##
[0.10.0](polkadot-snap-v0.9.0...polkadot-snap-v0.10.0)
(2024-06-18)


### Features

* export account json rpc
([#234](#234))
([0212428](0212428))


### Bug Fixes

* exportSeed coin type fix
([#233](#233))
([7bef7c2](7bef7c2))
</details>

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
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.

3 participants