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

Dapp request account selection #151

Merged
merged 3 commits into from
Dec 20, 2022
Merged

Conversation

m-aboelenein
Copy link
Member

@m-aboelenein m-aboelenein commented Dec 15, 2022

PR Type

What kind of change does this PR introduce?
closes #149 #122

  • added auto-switching based on Dapp logged in account for (tx-request, signature-request)

  • handling tx-requests from apps with different logged in wallets

  • view Error messages correctly for Contract-call and contract-deploy

  • solved hiro-api rate limiting issue in tx-requests

  • added setup wallet accounts on create wallet instead of the home screen

  • Bugfix

  • Enhancement

@m-aboelenein m-aboelenein added the enhancement New feature or request label Dec 15, 2022
@m-aboelenein m-aboelenein added this to the Sprint 23 - Dec 30 milestone Dec 15, 2022
@m-aboelenein m-aboelenein self-assigned this Dec 15, 2022
@DuskaT021
Copy link
Contributor

@yknl Cause I don't have specific testing instructions, I'll do complete regression testing. 👍

@DuskaT021
Copy link
Contributor

DuskaT021 commented Dec 18, 2022

@yknl Can't create a wallet when I choose to back-up the wallet later on this branch.
On the prod this bug doesn't exist. Not for merge.
image

@m-aboelenein
Copy link
Member Author

@yknl Can't create a wallet when I choose to back-up the wallet later on this branch. On the prod this bug doesn't exist. Not for merge. image

@DuskaT021 i wasn't able to reproduce can. you add some reproductions steps please

@DuskaT021
Copy link
Contributor

@m-aboelenein
Choose to create a wallet and skip the backup wallet, you'll not be able to proceed.
I was able to reproduce it every time on this branch.

@m-aboelenein
Copy link
Member Author

@yknl Cause I don't have specific testing instructions, I'll do complete regression testing. 👍

so the cases we are addressing here is:

  • requesting a transaction or a signature from the extension where the extension have a different account than the one authenticated in the app we addressed this by auto-switching the selected account on the extension to match the one on the authenticated app to test
    • login(authenticate) to a dapp with an account
    • open the extension and select a different account
    • try triggering a tx request or a signature request from the dapp
    • you should see the selected account in the popup has changed to the one authenticated in the app
    • confirm the tx or signature it should behave normally
  • requesting a transaction or a signature from the extension where the extension have a completely different wallet than the one logged in the app this should show an error message
    • login(authenticate) a dapp with a wallet
    • open the extension and reset the wallet
    • create/restore a different wallet on the extension
    • try triggering a tx on the dapp authenticated with the old wallet it should show an error screen

@m-aboelenein
Copy link
Member Author

@m-aboelenein Choose to create a wallet and skip the backup wallet, you'll not be able to proceed. I was able to reproduce it every time on this branch.

i did the same and it worked so it might be something off on the local build try to re-build the extension and add it again to the browser also make sure you a are using the build command npm run build instead of the dev command

@DuskaT021
Copy link
Contributor

@m-aboelenein Choose to create a wallet and skip the backup wallet, you'll not be able to proceed. I was able to reproduce it every time on this branch.

i did the same and it worked so it might be something off on the local build try to re-build the extension and add it again to the browser also make sure you a are using the build command npm run build instead of the dev command

Thank you, after running with npm run build, the error/issue mentioned is not showing 🙏

@DuskaT021
Copy link
Contributor

@yknl ready for merge

@yknl yknl merged commit 09d88fb into develop Dec 20, 2022
@m-aboelenein m-aboelenein deleted the dapp-request-account-selection branch December 20, 2022 07:35
teebszet pushed a commit that referenced this pull request Mar 28, 2024
teebszet added a commit that referenced this pull request Mar 28, 2024
* release: v0.31.0

* RPC Wallet Api & BTC handlers (#85)

* WIP: Inject Xverse Webbtc_provider and add request method

* refactor dom event names

* fix send back wallet response

* Start adding stacks request types

* Add placeholders for stx rpc calls

* Sort methods alphabetically

* Reword key RPC methods and types

* Revert "Start adding stacks request types"

This reverts commit 6afcacd.

* update sats-connect version and init rpc handlers

* rebase fixes

* fix duplicate type

* Move helper function out of legacy code

* BTC RPC handlers (#92)

* handle getAddresses request

* WIP Add Support for BTC RPC Methods

* added error request component and refactor psbt request

* separate stx and btc signMessage screens

* update hooks file structure

* return errors as resolved promises instead of rejecting

* update btcAddressRequest hook

* update request handling hooks

* add ledger ui for btc signMessage screen

* chore: bump core to 11.2.0

* chore: remove unnecessary type default

* fix: type errors

---------

Co-authored-by: Eduard Bardají Puig <[email protected]>
Co-authored-by: Tim Man <[email protected]>

* [ENG-3844][ENG-3845][ENG-3850][ENG-3851] stx_callContract, stx_transferStx, stx_getAccounts, stx_getAddresses (#112)

* Add placeholders for stx rpc handlers

* Move helpers to own file

* Remove unused

* Add various changes related to request handling

* Add rpc method param for transaction request type differentiation

* Add response message

* Add rpc method to request params

* Provide rpc response based on rpc call method

* Handle missing function args

* Move error messages to constants

* Add missing rpc method

* Remove unnecessary type

* Refine variable name

* Prevent unknown errors from blocking navigation

* Add rpc props

* Remove unnecessary conditional

* Send rpc response after broadcast

* Start updating ContractCall to RPC request

* Handle contract deploy request

* Update rpc response type

* Add rpc props

* Remove sign message work from this branch

* Simplify request handling

* Rename file

* Add handler and helpers for contractCall

* Rename handler file

* Update hook to handle callContract

* Perform minor tweaks for callContract

* fix: updated sats connect version and stacks methods names

* feat: handle stx_transferStx method

* Use Zod union

* Fix minor issues

* Add stx_getAccounts and stx_getAddresses method handlers

* Update the handleGetStxAccounts method

* Update types

* Remove unimplemented methods

* Refactor send message helpers

* Update params type

* Remove unused prop

* Move messages to translation file

* Add useMemo and useCallback to accounts and address fetching hooks

* Refactor the getAppIconFromWebManifest fetching

* Refactor the getAppIconFromWebManifest fetching useEffect

* Use existing payload format

* Move hook close to component using it

* Replace the ternary return with if statement

---------

Co-authored-by: Abdul Haseeb <[email protected]>
Co-authored-by: Denys Hriaznov <[email protected]>

* fix amount conversion

* close sendTransfer popup after tx_broadcasted

* [ENG-3860] chore: remove name palindrome support (#104)

* chore: use beta core version for testing

* chore: be more strict with typing as in mobile repo

* chore: bump to xverse-core 11.2.0

* Stacks RPC method: `stx_signTransaction` (#100)

* Handle stx token transfer sign tx reqs

* Hande tx signing for deploy contract

* Use payload type checker

* Update params stx_getAccounts (#121)

* Update params stx_getAccounts

* Add user cancellation handling

* Update params stx_getAddresses (#122)

* Eng 3846 stx signmessage (#119)

* WIP: Update Stacks Message signing and refactor signature screen

* added rpc response handling

* disable structured message signing for rpc

* update signature hook dependency params

* Update to sats-connect v2 (#123)

* Chore/return supported methods (#120)

* return supported methods for getInfo

* Add keys transformer to prod loaders

---------

Co-authored-by: Eduard Bardají Puig <[email protected]>

* Support stx_deployContract

* Update sats-connect version

* [ENG-3847] Update stx_signStructuredMessage handling (#131)

* Update stx_signStructuredMessage handling

* Rename file

* Update renamed file path

* added support for get accounts request

* ui improvements

* remove methods automatic generation

* Squashed commit of the following:

commit 66fafe6
Author: Den <[email protected]>
Date:   Mon Mar 25 06:52:07 2024 +0100

    [ENG-3340] feat: Add UI warning about the Non default sighash Ledger alert (#97)

    * [ENG-3340] feat: Add UI warning about the Non default sighash Ledger alert

    * Fix tooltip hiding

    * Update the info message copy

    * Create a separate LedgerStepView component

    * Remove the unused imports

    * Remove the Steps enum duplicate

commit 59ae427
Author: Victor Kirov <[email protected]>
Date:   Mon Mar 25 06:56:11 2024 +0200

    Add sighash none warning (#152)

    * Add sighash none warning

    * Fix spacing

    ---------

    Co-authored-by: Den <[email protected]>

commit 5759028
Author: Den <[email protected]>
Date:   Mon Mar 25 05:36:10 2024 +0100

    [ENG-3972] fix: Issue with balance sip-10 tokens fiat value does not add up to the total balance (#151)

commit a62315f
Author: fede erbes <[email protected]>
Date:   Mon Mar 25 05:02:46 2024 +0100

    fix: qr config, avoid hiding dots covered by image (#154)

commit 3980cae
Author: fede erbes <[email protected]>
Date:   Mon Mar 25 04:50:16 2024 +0100

    fix: remove satributes component from receive section in payment address (#133)

    * fix: remove satributes component from receive section in payment address

    * chore: fix logic

    * chore: fix logic for all cases

commit 6c08ff9
Author: Den <[email protected]>
Date:   Mon Mar 25 04:49:04 2024 +0100

    [ENG-3937] Replace the old STX logo leftovers on the web-extension (#143)

    * [ENG-3937] Replace the old STX logo leftovers on the web-extension

    * Update the styled components names

commit 10653d1
Author: Den <[email protected]>
Date:   Thu Mar 21 11:10:40 2024 +0100

    [ENG-3477] feat: Open the onboarding screen right after user installs the extension (#86)

    * [ENG-3477] feat: Open the onboarding screen right after user installs the extension

    * Use the ui-library/button component instead of the ActionButton

    * Remove the tabs permission from the manifest config

    * Remove the custom old button styles

    * Fix the onboarding animation container

    * Improve the account restore/creation flow accessibility

commit 45cf27e
Merge: 5454e94 4054f22
Author: Tim Man <[email protected]>
Date:   Tue Mar 19 16:07:15 2024 +0800

    Merge pull request #148 from secretkeylabs/release/v0.32.3

    release: v0.32.3 to develop

commit 4054f22
Merge: edd60ed 2db9d91
Author: fede erbes <[email protected]>
Date:   Mon Mar 18 18:21:31 2024 +0100

    Merge branch 'main' into release/v0.32.3

commit edd60ed
Author: GitHub Actions Bot <>
Date:   Mon Mar 18 17:20:22 2024 +0000

    release: v0.32.3

commit 5454e94
Author: fede erbes <[email protected]>
Date:   Mon Mar 18 18:19:35 2024 +0100

    chore: restore max button in send btc flow (#146)

    * chore: restore max button in send btc flow

    * chore: use release core v13.0.0

commit e07287f
Merge: 895c89a dfe4fd2
Author: fede erbes <[email protected]>
Date:   Mon Mar 18 11:51:59 2024 +0100

    Merge pull request #144 from secretkeylabs/release/v0.32.2-mirror

    Hotfix: v0.32.2

commit dfe4fd2
Merge: 9371643 895c89a
Author: Tim Man <[email protected]>
Date:   Mon Mar 18 12:16:08 2024 +0800

    Merge branch 'develop' into release/v0.32.2-mirror

commit 2db9d91
Merge: da0c803 9371643
Author: Tim Man <[email protected]>
Date:   Mon Mar 18 12:15:40 2024 +0800

    Merge pull request #145 from secretkeylabs/release/v0.32.2-mirror

    Hotfix: v0.32.2

commit 895c89a
Merge: 0782b5c ea9a07f
Author: Tim Man <[email protected]>
Date:   Mon Mar 18 12:12:53 2024 +0800

    Merge pull request #140 from secretkeylabs/release/v0.32.1

    release: v0.32.1 to develop

commit da0c803
Merge: 166ada9 ea9a07f
Author: Tim Man <[email protected]>
Date:   Mon Mar 18 12:12:38 2024 +0800

    Merge pull request #139 from secretkeylabs/release/v0.32.1

    release: v0.32.1 to main

commit 9371643
Author: fede erbes <[email protected]>
Date:   Fri Mar 15 18:47:23 2024 -0300

    chore: disable max button and bump version

commit ea9a07f
Merge: 723aec8 166ada9
Author: Tim Man <[email protected]>
Date:   Fri Mar 15 12:09:27 2024 +0800

    Merge branch 'main' into release/v0.32.1

commit 723aec8
Author: GitHub Actions Bot <>
Date:   Fri Mar 15 04:08:50 2024 +0000

    release: v0.32.1

commit 166ada9
Merge: 6a8671f d7c9170
Author: Tim Man <[email protected]>
Date:   Thu Mar 14 23:56:42 2024 +0800

    Merge pull request #125 from secretkeylabs/release/v0.32.0

    release: v0.32.0 to main

* Revert "Squashed commit of the following:"

This reverts commit 6da6efe.

* use wallet methods for btc_providers entry

* hardcode supported methods

* display a dapp provided message for getAccounts request

* update getAccounts to require a purpose passed

* update sats-connect version

* chore: bump to [email protected]

---------

Co-authored-by: GitHub Actions Bot <>
Co-authored-by: Tim Man <[email protected]>
Co-authored-by: Eduard Bardají Puig <[email protected]>
Co-authored-by: Abdul Haseeb <[email protected]>
Co-authored-by: Denys Hriaznov <[email protected]>
teebszet pushed a commit that referenced this pull request May 31, 2024
commit 66fafe6
Author: Den <[email protected]>
Date:   Mon Mar 25 06:52:07 2024 +0100

    [ENG-3340] feat: Add UI warning about the Non default sighash Ledger alert (#97)

    * [ENG-3340] feat: Add UI warning about the Non default sighash Ledger alert

    * Fix tooltip hiding

    * Update the info message copy

    * Create a separate LedgerStepView component

    * Remove the unused imports

    * Remove the Steps enum duplicate

commit 59ae427
Author: Victor Kirov <[email protected]>
Date:   Mon Mar 25 06:56:11 2024 +0200

    Add sighash none warning (#152)

    * Add sighash none warning

    * Fix spacing

    ---------

    Co-authored-by: Den <[email protected]>

commit 5759028
Author: Den <[email protected]>
Date:   Mon Mar 25 05:36:10 2024 +0100

    [ENG-3972] fix: Issue with balance sip-10 tokens fiat value does not add up to the total balance (#151)

commit a62315f
Author: fede erbes <[email protected]>
Date:   Mon Mar 25 05:02:46 2024 +0100

    fix: qr config, avoid hiding dots covered by image (#154)

commit 3980cae
Author: fede erbes <[email protected]>
Date:   Mon Mar 25 04:50:16 2024 +0100

    fix: remove satributes component from receive section in payment address (#133)

    * fix: remove satributes component from receive section in payment address

    * chore: fix logic

    * chore: fix logic for all cases

commit 6c08ff9
Author: Den <[email protected]>
Date:   Mon Mar 25 04:49:04 2024 +0100

    [ENG-3937] Replace the old STX logo leftovers on the web-extension (#143)

    * [ENG-3937] Replace the old STX logo leftovers on the web-extension

    * Update the styled components names

commit 10653d1
Author: Den <[email protected]>
Date:   Thu Mar 21 11:10:40 2024 +0100

    [ENG-3477] feat: Open the onboarding screen right after user installs the extension (#86)

    * [ENG-3477] feat: Open the onboarding screen right after user installs the extension

    * Use the ui-library/button component instead of the ActionButton

    * Remove the tabs permission from the manifest config

    * Remove the custom old button styles

    * Fix the onboarding animation container

    * Improve the account restore/creation flow accessibility

commit 45cf27e
Merge: 5454e94 4054f22
Author: Tim Man <[email protected]>
Date:   Tue Mar 19 16:07:15 2024 +0800

    Merge pull request #148 from secretkeylabs/release/v0.32.3

    release: v0.32.3 to develop

commit 4054f22
Merge: edd60ed 2db9d91
Author: fede erbes <[email protected]>
Date:   Mon Mar 18 18:21:31 2024 +0100

    Merge branch 'main' into release/v0.32.3

commit edd60ed
Author: GitHub Actions Bot <>
Date:   Mon Mar 18 17:20:22 2024 +0000

    release: v0.32.3

commit 5454e94
Author: fede erbes <[email protected]>
Date:   Mon Mar 18 18:19:35 2024 +0100

    chore: restore max button in send btc flow (#146)

    * chore: restore max button in send btc flow

    * chore: use release core v13.0.0

commit e07287f
Merge: 895c89a dfe4fd2
Author: fede erbes <[email protected]>
Date:   Mon Mar 18 11:51:59 2024 +0100

    Merge pull request #144 from secretkeylabs/release/v0.32.2-mirror

    Hotfix: v0.32.2

commit dfe4fd2
Merge: 9371643 895c89a
Author: Tim Man <[email protected]>
Date:   Mon Mar 18 12:16:08 2024 +0800

    Merge branch 'develop' into release/v0.32.2-mirror

commit 2db9d91
Merge: da0c803 9371643
Author: Tim Man <[email protected]>
Date:   Mon Mar 18 12:15:40 2024 +0800

    Merge pull request #145 from secretkeylabs/release/v0.32.2-mirror

    Hotfix: v0.32.2

commit 895c89a
Merge: 0782b5c ea9a07f
Author: Tim Man <[email protected]>
Date:   Mon Mar 18 12:12:53 2024 +0800

    Merge pull request #140 from secretkeylabs/release/v0.32.1

    release: v0.32.1 to develop

commit da0c803
Merge: 166ada9 ea9a07f
Author: Tim Man <[email protected]>
Date:   Mon Mar 18 12:12:38 2024 +0800

    Merge pull request #139 from secretkeylabs/release/v0.32.1

    release: v0.32.1 to main

commit 9371643
Author: fede erbes <[email protected]>
Date:   Fri Mar 15 18:47:23 2024 -0300

    chore: disable max button and bump version

commit ea9a07f
Merge: 723aec8 166ada9
Author: Tim Man <[email protected]>
Date:   Fri Mar 15 12:09:27 2024 +0800

    Merge branch 'main' into release/v0.32.1

commit 723aec8
Author: GitHub Actions Bot <>
Date:   Fri Mar 15 04:08:50 2024 +0000

    release: v0.32.1

commit 166ada9
Merge: 6a8671f d7c9170
Author: Tim Man <[email protected]>
Date:   Thu Mar 14 23:56:42 2024 +0800

    Merge pull request #125 from secretkeylabs/release/v0.32.0

    release: v0.32.0 to main
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Contract call infinite loading Dapp request different seed phrase/ different account
3 participants