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

feature(ui-ux): refetch hot wallet balance and transfer guard #763

Merged
merged 23 commits into from
Mar 23, 2023

Conversation

G9000
Copy link
Contributor

@G9000 G9000 commented Mar 17, 2023

What this PR does / why we need it:

To ensure balance value are up to date when verify transfer is clicked and prevent user to proceed if the balance is insufficient.

Added loading state to the button when fetching latest balance

Which issue(s) does this PR fixes?:

Fixes #758

Additional comments?:

Developer Checklist:

  • Read your code changes at least once
  • No console errors on web
  • Tested on Light mode and Dark mode*
  • Your UI implementation visually matched the rendered design*
  • Unit tests*
  • Added e2e tests*
  • Added translations*

@netlify
Copy link

netlify bot commented Mar 17, 2023

Deploy Preview for quantumbridge ready!

Name Link
🔨 Latest commit cc5bdbd
🔍 Latest deploy log https://app.netlify.com/sites/quantumbridge/deploys/641babe06be50b00088891b4
😎 Deploy Preview https://deploy-preview-763--quantumbridge.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

@github-actions github-actions bot added the kind/feature New feature request label Mar 17, 2023
@G9000 G9000 marked this pull request as ready for review March 17, 2023 03:15
@G9000 G9000 marked this pull request as draft March 17, 2023 03:34
@G9000 G9000 marked this pull request as ready for review March 17, 2023 04:07
@G9000 G9000 marked this pull request as draft March 17, 2023 05:00
@G9000 G9000 marked this pull request as ready for review March 17, 2023 06:59
apps/web/src/components/BridgeForm.tsx Outdated Show resolved Hide resolved
apps/web/src/components/BridgeForm.tsx Outdated Show resolved Hide resolved
apps/web/src/components/BridgeForm.tsx Outdated Show resolved Hide resolved
apps/web/src/components/BridgeForm.tsx Outdated Show resolved Hide resolved
apps/web/src/components/BridgeForm.tsx Outdated Show resolved Hide resolved
@JoshuaC817
Copy link
Contributor

LGTM!

@thedoublejay thedoublejay requested a review from pierregee March 22, 2023 23:34
@pierregee pierregee changed the base branch from main to 1.9.0 March 23, 2023 01:34
@pierregee pierregee merged commit b48a0cb into 1.9.0 Mar 23, 2023
@pierregee pierregee deleted the julio/refetch-hot-wallet branch March 23, 2023 01:39
thedoublejay added a commit that referenced this pull request Mar 23, 2023
* feature(ui-ux): refetch hot wallet balance and transfer guard (#763)

* init

* refactor on transfer token flow

* code cleanup

* code cleanup

* code cleanup -S

* code cleanup

* code cleanup

* resolve pr comment -S

* resolve pr comment

* fix getBalanceFn response type

* code cleanup

---------

Co-authored-by: JJ Adonis <[email protected]>
Co-authored-by: Pierre Gee <[email protected]>

* chore(ops): enable DFI on client (#804)

chore: enable DFI on client

* add dfc confirmation

* add confirmation

* add confirmation

* revert

* remove log

* clean up code

* update e2e

* fix duplicate import

---------

Co-authored-by: Julio Caesar <[email protected]>
Co-authored-by: JJ Adonis <[email protected]>
Co-authored-by: Keng Ye <[email protected]>
thedoublejay added a commit that referenced this pull request Mar 23, 2023
…pi (#798)

* feat(server): ethereum - add total bridged amount

* feat(stats): move ethereum stats into separate controller and service

* feat(stats): move try-catch inside service

* feat(stats): add type to raw query's result for total amount

* feat(stats): update type

* feature(ui-ux): refetch hot wallet balance and transfer guard (#763)

* init

* refactor on transfer token flow

* code cleanup

* code cleanup

* code cleanup -S

* code cleanup

* code cleanup

* resolve pr comment -S

* resolve pr comment

* fix getBalanceFn response type

* code cleanup

---------

Co-authored-by: JJ Adonis <[email protected]>
Co-authored-by: Pierre Gee <[email protected]>

* feat(stats): add util to initialize enum, update tests

* feat(stats): update defichain interface

* chore(ops): enable DFI on client (#804)

chore: enable DFI on client

* chore(ops): update

---------

Co-authored-by: JJ Adonis <[email protected]>
Co-authored-by: Julio Caesar <[email protected]>
Co-authored-by: Pierre Gee <[email protected]>
Co-authored-by: Keng Ye <[email protected]>
thedoublejay added a commit that referenced this pull request Mar 29, 2023
* feature(ui-ux): refetch hot wallet balance and transfer guard (#763)

* init

* refactor on transfer token flow

* code cleanup

* code cleanup

* code cleanup -S

* code cleanup

* code cleanup

* resolve pr comment -S

* resolve pr comment

* fix getBalanceFn response type

* code cleanup

---------

Co-authored-by: JJ Adonis <[email protected]>
Co-authored-by: Pierre Gee <[email protected]>

* chore(ops): enable DFI on client (#804)

chore: enable DFI on client

* feature(ui-ux): added liquidity overview screen (#794)

* feature(ui-ux): added liquidity overview screen

* added Link component

* added Disclosure for mobile view

* removed env variables

* removed unused api endpoint

* lint fix

* fixed width in small screen

* renamed router

* added tool tip and added fetch balances on network change

* minor ui updates

* hide navigation when bridge is down

* desc update

* minor fix

* minor updates

* updated hotWalletAddress to HotWalletAddress

* chore: update dfi label on ethereum

Refactor TokenInfo prop and rename component

---------

Co-authored-by: Keng Ye <[email protected]>
Co-authored-by: Keng Ye <[email protected]>

* chore: re-add dfi into client

* feature(ui-ux): added on click event on entire token header bar while closing (#821)

* feature(ui-ux): added test ids for better cypress testing on liquidity screen (#837)

feature(ui-ux): added testids for better cypress testing on liquidity screen

* chore(ui-ux): update warning message when balance is insufficient (#841)

* feat: add reserved utxo on client form

* feat: support all token for liquidity check

* chore: add liquidity as dependency

* revert: all previous changes

Only update warning message when insufficient balance

* chore(ui-ux): claim - prevent txn hook from running on load (#731)

* chore(refactor): claim - prevent txn hook from running on load

* fix(ui-ux): fix lint error

* bump(deps): update dependency react-secure-storage to ^1.2.0 (#839)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* bump(deps): update @waveshq/walletkit to ^0.43.0 (#842)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* bump(deps): update dependency @netlify/plugin-nextjs to ^4.33.0 (#845)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* feat(server): check for hot wallet DFI balance when crafting send tx (#843)

feat: check for hot wallet DFI balance when crafting send tx

* bump(deps): update dependency @fastify/compress to ^6.2.1 (#844)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* feat(server): Add another sanity check for decodeTxnData (#811)

* add another sanity check

* Update apps/server/src/ethereum/services/EVMTransactionConfirmerService.ts

Co-authored-by: Lee Wei Yuan <[email protected]>

---------

Co-authored-by: JJ Adonis <[email protected]>
Co-authored-by: Lee Wei Yuan <[email protected]>

* chore(core): add sanity checks in evm to dfc endpoints (#816)

* add another sanity check

* chore(core): add sec checks in evm to dfc endpoints

* use clearer variable names

* remove comment

* check txn validity before accessing db

* pass 0 confirmations and revert name

* rename comments

* rename comments

* revert reodering condition

* fix typo

* update e2e

---------

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

* fix(ui-ux): fix disabled claim btn (#852)

* fix(ui-ux): trial fix, claim btn is disabled on some machines

* fix(ui-ux): fix disabled claim btn

* fix(ui-ux): fix disabled claim button for eth (#853)

---------

Co-authored-by: Julio Caesar <[email protected]>
Co-authored-by: Pierre Gee <[email protected]>
Co-authored-by: Keng Ye <[email protected]>
Co-authored-by: Harsh R <[email protected]>
Co-authored-by: Keng Ye <[email protected]>
Co-authored-by: Lyka Labrada <[email protected]>
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: cuongquangnam <[email protected]>
Co-authored-by: Lee Wei Yuan <[email protected]>
Co-authored-by: Pierre Gee <[email protected]>
Co-authored-by: cuongquangnam <[email protected]>
thedoublejay added a commit that referenced this pull request Mar 30, 2023
* feature(ui-ux): refetch hot wallet balance and transfer guard (#763)

* init

* refactor on transfer token flow

* code cleanup

* code cleanup

* code cleanup -S

* code cleanup

* code cleanup

* resolve pr comment -S

* resolve pr comment

* fix getBalanceFn response type

* code cleanup

---------

Co-authored-by: JJ Adonis <[email protected]>
Co-authored-by: Pierre Gee <[email protected]>

* chore(ops): enable DFI on client (#804)

chore: enable DFI on client

* feature(ui-ux): added liquidity overview screen (#794)

* feature(ui-ux): added liquidity overview screen

* added Link component

* added Disclosure for mobile view

* removed env variables

* removed unused api endpoint

* lint fix

* fixed width in small screen

* renamed router

* added tool tip and added fetch balances on network change

* minor ui updates

* hide navigation when bridge is down

* desc update

* minor fix

* minor updates

* updated hotWalletAddress to HotWalletAddress

* chore: update dfi label on ethereum

Refactor TokenInfo prop and rename component

---------

Co-authored-by: Keng Ye <[email protected]>
Co-authored-by: Keng Ye <[email protected]>

* chore: re-add dfi into client

* feature(ui-ux): added on click event on entire token header bar while closing (#821)

* feature(ui-ux): added test ids for better cypress testing on liquidity screen (#837)

feature(ui-ux): added testids for better cypress testing on liquidity screen

* chore(ui-ux): update warning message when balance is insufficient (#841)

* feat: add reserved utxo on client form

* feat: support all token for liquidity check

* chore: add liquidity as dependency

* revert: all previous changes

Only update warning message when insufficient balance

* fix(ui-ux): set default network to mainnet

* pr comment fix

---------

Co-authored-by: Julio Caesar <[email protected]>
Co-authored-by: JJ Adonis <[email protected]>
Co-authored-by: Pierre Gee <[email protected]>
Co-authored-by: Keng Ye <[email protected]>
Co-authored-by: Keng Ye <[email protected]>
thedoublejay added a commit that referenced this pull request Apr 3, 2023
* feature(ui-ux): added liquidity overview screen

* added Link component

* added Disclosure for mobile view

* removed env variables

* removed unused api endpoint

* lint fix

* fixed width in small screen

* renamed router

* added tool tip and added fetch balances on network change

* feature(ui-ux): refetch hot wallet balance and transfer guard (#763)

* init

* refactor on transfer token flow

* code cleanup

* code cleanup

* code cleanup -S

* code cleanup

* code cleanup

* resolve pr comment -S

* resolve pr comment

* fix getBalanceFn response type

* code cleanup

---------

Co-authored-by: JJ Adonis <[email protected]>
Co-authored-by: Pierre Gee <[email protected]>

* chore(ops): enable DFI on client (#804)

chore: enable DFI on client

* minor ui updates

* hide navigation when bridge is down

* desc update

* minor fix

* minor updates

* updated hotWalletAddress to HotWalletAddress

* added navigation check, PoB link, liquidity validation, addresses checks, basic responsiveness check for mobile elements;

* update port number;

* feature(ui-ux): added liquidity overview screen (#794)

* feature(ui-ux): added liquidity overview screen

* added Link component

* added Disclosure for mobile view

* removed env variables

* removed unused api endpoint

* lint fix

* fixed width in small screen

* renamed router

* added tool tip and added fetch balances on network change

* minor ui updates

* hide navigation when bridge is down

* desc update

* minor fix

* minor updates

* updated hotWalletAddress to HotWalletAddress

* chore: update dfi label on ethereum

Refactor TokenInfo prop and rename component

---------

Co-authored-by: Keng Ye <[email protected]>
Co-authored-by: Keng Ye <[email protected]>

* prettifier;

* Navigation test update;

* chore: re-add dfi into client

* moved navigation check to mobile; add ipad viewport;

* feature(ui-ux): added on click event on entire token header bar while closing (#821)

* prettify;

* feature(ui-ux): added test ids for better cypress testing on liquidity screen (#837)

feature(ui-ux): added testids for better cypress testing on liquidity screen

* chore(ui-ux): update warning message when balance is insufficient (#841)

* feat: add reserved utxo on client form

* feat: support all token for liquidity check

* chore: add liquidity as dependency

* revert: all previous changes

Only update warning message when insufficient balance

* chore(ui-ux): claim - prevent txn hook from running on load (#731)

* chore(refactor): claim - prevent txn hook from running on load

* fix(ui-ux): fix lint error

* bump(deps): update dependency react-secure-storage to ^1.2.0 (#839)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* bump(deps): update @waveshq/walletkit to ^0.43.0 (#842)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* bump(deps): update dependency @netlify/plugin-nextjs to ^4.33.0 (#845)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* feat(server): check for hot wallet DFI balance when crafting send tx (#843)

feat: check for hot wallet DFI balance when crafting send tx

* bump(deps): update dependency @fastify/compress to ^6.2.1 (#844)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* feat(server): Add another sanity check for decodeTxnData (#811)

* add another sanity check

* Update apps/server/src/ethereum/services/EVMTransactionConfirmerService.ts

Co-authored-by: Lee Wei Yuan <[email protected]>

---------

Co-authored-by: JJ Adonis <[email protected]>
Co-authored-by: Lee Wei Yuan <[email protected]>

* chore(core): add sanity checks in evm to dfc endpoints (#816)

* add another sanity check

* chore(core): add sec checks in evm to dfc endpoints

* use clearer variable names

* remove comment

* check txn validity before accessing db

* pass 0 confirmations and revert name

* rename comments

* rename comments

* revert reodering condition

* fix typo

* update e2e

---------

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

* fix(ui-ux): fix disabled claim btn (#852)

* fix(ui-ux): trial fix, claim btn is disabled on some machines

* fix(ui-ux): fix disabled claim btn

* fix(ui-ux): fix disabled claim button for eth (#853)

* add TN/MN liquidity checks; add test ids;

* added testid for navigation check;

* added testid for mobile responsiveness check;

* prettify;

* prettify;

* refactored; add network configs;

* prettify;

* fix lint; rename test ids;gi

* rename testid;

---------

Co-authored-by: Harsh <[email protected]>
Co-authored-by: Keng Ye <[email protected]>
Co-authored-by: Julio Caesar <[email protected]>
Co-authored-by: JJ Adonis <[email protected]>
Co-authored-by: Pierre Gee <[email protected]>
Co-authored-by: Harsh R <[email protected]>
Co-authored-by: Keng Ye <[email protected]>
Co-authored-by: Lyka Labrada <[email protected]>
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: cuongquangnam <[email protected]>
Co-authored-by: Lee Wei Yuan <[email protected]>
Co-authored-by: Pierre Gee <[email protected]>
Co-authored-by: cuongquangnam <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/feature New feature request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

UI - Refectch the hot wallet balance on button click
4 participants