Commit Graph

102 Commits

Author SHA1 Message Date
IshaVenikar
cd03fb6e84 Add custom form validation messages (#106)
* Fix empty fields and url error msg

* Use constants for error msgs
2024-04-25 17:08:27 +05:30
IshaVenikar
455703f91c Display pop-up when chains are not supported (#103)
* Check for unsupported namespace

* Add check for common walletchains and networks chains

* Format code

* Display unsupported chains

* Display Dapp info in modal

* Refactor code

* Reject request if chains are not supported

* Reject sessions

* Remove isVisible state
2024-04-25 17:08:27 +05:30
shreerang6921
b9d3eef707 Send only network id and name to paired dApp (#104) 2024-04-25 17:08:27 +05:30
shreerang6921
e98dac7a5b Fix spinner not showing up on starting wallet (#102)
* Fix spinner not showing up on starting wallet

* Remove unnecessary dependancies
2024-04-25 17:08:27 +05:30
IshaVenikar
670d6f4a54 Add form validation for add network form (#101)
* Use zod for validation

* Return to index 0 after deleting network

* Make url optional

* Use form schema according to the selected nw

* Fix type for networks data

* Accept numeric value for coin type

* Fix form type issue
2024-04-25 17:08:27 +05:30
shreerang6921
b947dd1151 Use configured coin type for creating accounts (#100)
* Use configured coin type for creating accounts

* Resolve eslint warnings
2024-04-25 17:08:27 +05:30
IshaVenikar
2adfffba55 Reset Add Network form after switching the network (#97)
* Reset form upon switching nws

* Modify gitignore

* Fix undefined field error

* Add env steps in readme

* Remove .env file

* Fix indentation in readme

* Disable buttons while loading (#99)

* Disable buttons while loading

* Disable pairing modal button

* Format code
2024-04-25 17:08:27 +05:30
shreerang6921
15da99a827 Send back namespaces object based on chains requested by dApp (#94)
* Refactor pairing modal code

* Refactor update session code

* Reset state after session proposal is approved

* Refactor approve and update session

* Remove unused helper methods

* Remove completed todos
2024-04-25 17:08:27 +05:30
IshaVenikar
888302a0dd Auto-populate eth chain data from chain id (#96)
* Auto-populate eth data from json file

* Modify variable names

* Clear fields if chainId is not found

* Format code

* Fix indentation

* Use reset to clear values

* Exclude chain id while resetting

* Make review changes

* Fix format
2024-04-25 17:08:27 +05:30
IshaVenikar
33147bee0d Auto-populate cosmos chain details from chain id (#95)
* Autplopulate cosmos chain details from chain id

* Display rpc url

* Remove assert

* Make review changes

* Use watch to trigger function

* Use usewatch
2024-04-25 17:08:27 +05:30
IshaVenikar
e879fe8e46 Implement remove network functionality for added networks (#93)
* Set current network to ethereum after removing network

* Display confirm dialog after deleting network

---------

Co-authored-by: Shreerang Kale <shreerangkale@gmail.com>
2024-04-25 17:08:27 +05:30
IshaVenikar
0707cd6fa4 Set coin type by default after selecting network (#90) 2024-04-25 17:08:27 +05:30
IshaVenikar
da4bed9c4b Send networks data to dapp (#87)
* Send networks data to dapp

* Reflect switching tabs in dapp dropdown

* Fix current network name not showing in Dapp

* Modify variable names

* Modify method and variable names

* Modify networks type

* Use selectedNetwork state and networkId

* Fix networks context states

* Add separate file for network methods
2024-04-25 17:08:27 +05:30
IshaVenikar
984cad8e48 Fix intents path to use namespace and chainId (#92) 2024-04-25 17:08:27 +05:30
shreerang6921
3809ce88b1 Update keystore data structure (#88)
* Update keystore data structure (#83)

* Update create wallet and retrieve accounts functionality for updated data structure

* Refactor accounts state

* Use constant variable for cosmos

* Update add accounts incrementally and with custom HD path for updated data structure (#85)

* Change data structure

* Reset wallet change

* Fix signEthMessage

* Fix sign request

* Fix pairing with laconic pay dApp and sending tokens

* Add accounts to configured networks

* Update add account from hd path flow

* Handle review changes

---------

Co-authored-by: Shreerang Kale <shreerangkale@gmail.com>

* Remove network type state

* Refactor create wallet code (#89)

* Refactor create wallet code

* Create cosmos accounts with correct address prefix

* Use networks data from state while creating wallet

* Refactor code and add network id in types (#91)

* Refactor add new networks component

* Add selected network state in context

* Remove returning account from create wallet

---------

Co-authored-by: IshaVenikar <145848618+IshaVenikar@users.noreply.github.com>
2024-04-25 17:08:27 +05:30
IshaVenikar
94bd8b6480 Persist network data (#84)
* Store new network data

* Store default networks in keystore (#86)

* Add default nws in keystore

* Fix duplicate networks

* Display correct currency symbols for eth and cosmos tx

* Fix currency display

* Use wei for eth
2024-04-25 17:08:27 +05:30
IshaVenikar
23fa5415ae Update namespace after adding network (#81)
* Update namespace

* Add eth accounts

* Add isSubmitted

* Send namespace to dApp based on selected network while pairing

* Send transactions on configured chain

* Fix modal UI

* Use namespace by default for chainId

* Use ethereum mainnet as default chain

* Use method names from constants file

* Combine required and optional namespaces

* Fix chainId

* Fix networksData

* Remove cosmos denom

* Remove todo

* Use lowercase denom

---------

Co-authored-by: Shreerang Kale <shreerangkale@gmail.com>
2024-04-25 17:08:27 +05:30
shreerang6921
e4fe88939c Add support to configure networks (#76)
* Add support to configure cosmos networks

* Fix intents functionality for configured networks

* Add address prefix while initializing stargate client

* Remove unnecessary functions

* Update style for add network page

* Handle review changes

* Fix eth accounts not showing up on configured eth chain
2024-04-25 17:08:27 +05:30
shreerang6921
bdd1b58140 Fix sending transactions on default networks (#78)
* Add default values to networksData state

* Handle review changes

* Get default chains data from constants file
2024-04-25 17:08:27 +05:30
Adwait Gharpure
2e18397a95 Navigate to homescreen on approving sign request (#75)
* Navigate to homescreen on approving sign request

* Add spinner to button on approve

---------

Co-authored-by: Adw8 <adwait@deepstacksoft.com>
2024-04-25 17:08:27 +05:30
shreerang6921
703ea72c1f Add functionality to configure EVM networks (#74)
* Configure EVM networks

* Display added EVM networks in network drop down

* Add network for configured networks
2024-04-25 17:08:27 +05:30
IshaVenikar
0dea0082b4
Display buttons above scroll in laconic-wallet approve screens (#72)
* Buttons outside scroll

* Fix ui for signRequest page

* Remove todo
2024-04-01 18:00:40 +05:30
Adwait Gharpure
d50cfbfe84
Add support for displaying svg images (#71)
* Add support for SVG images

* Fix imports

---------

Co-authored-by: Adw8 <adwait@deepstacksoft.com>
2024-04-01 17:21:01 +05:30
IshaVenikar
ac18a43fab
Disable button for approve tx (#70) 2024-03-28 16:51:58 +05:30
neerajvijay1997
290ea0097c
UI Improvements (#65)
* Rebase ui branch

* Fix scrollview (#69)

* Add loading prop to button

* Change function reference

* Remove fragment

---------

Co-authored-by: Adw8 <adwait@deepstacksoft.com>
Co-authored-by: IshaVenikar <145848618+IshaVenikar@users.noreply.github.com>
2024-03-28 16:23:12 +05:30
shreerang6921
b134c957f6
Fix add accounts method (#68) 2024-03-28 14:21:49 +05:30
IshaVenikar
cc3d7f708f
Add spinner for tx after being approved (#67)
* Add spinner for tx

* Change text color
2024-03-28 13:36:14 +05:30
Adwait Gharpure
4eecdb7e4c
Support SIWE using selected account (#61)
* Sign in using selected address

* Use optional namespace

* Merge namespaces and use combined namespace

* Add todo for lodash merge

* Use walletConnect util buildApprovedNamespaces while approving sessions

* Lint fixes

---------

Co-authored-by: Adw8 <adwait@deepstacksoft.com>
Co-authored-by: Nabarun <nabarun@deepstacksoft.com>
2024-03-28 11:10:55 +05:30
shreerang6921
3a2087b389
Add method to send cosmos tokens (#66)
* Add support to send cosmos tokens

* Fix approve transaction page ui

* Take gas amount from dApp

* Handle review changes

* Add check while creating stargate client

* Remove unnecessary checks

* Remove unnecessary states

* Fix balance showing undefined while loading
2024-03-27 18:09:01 +05:30
Adwait Gharpure
b275f376c4
Refactor account utils (#64)
* Refactor method in account utils

* Make container height auto

---------

Co-authored-by: Adw8 <adwait@deepstacksoft.com>
2024-03-22 15:40:43 +05:30
IshaVenikar
0fa793bead
Add new page for approving eth transactions (#63)
* Display funds on signRequest page

* Format balance value

* Display upto 18 digits

* Use useMemo for provider

* Display balance in wei

* Make UI changes

* Make review changes

* Add page to approve eth transactions

* Update approve transaction page ui

* Update balance unit display

---------

Co-authored-by: Shreerang Kale <shreerangkale@gmail.com>
2024-03-21 16:09:25 +05:30
shreerang6921
3cd4c51515
Add support for eth send transaction method (#62)
* Add support for eth send transaction method

* Add reference to eip155 data file
2024-03-19 11:33:29 +05:30
Adwait Gharpure
fbfd6b9709
Add scroll to pairing modal (#60)
* Add scrolling to pairing modal

* Set wallet connect state empty before populating

---------

Co-authored-by: Adw8 <adwait@deepstacksoft.com>
2024-03-18 15:08:30 +05:30
Adwait Gharpure
8ed4c33beb
Refactor code for WalletConnect Integration (#59)
* Disconnect pairing request when app is reset

* Move files to respective folders

* Add comments to describe flow

* Add new line

* remove request session context

* Fix imports

* Move hook to folder

* Add undefined type

* Move types to src

* Move util functions to correct files

* Remove typeroots from tsconfig

---------

Co-authored-by: Adw8 <adwait@deepstacksoft.com>
2024-03-18 10:57:20 +05:30
shreerang6921
63faa74e2c
Remove any type (#57)
* Remove any type for requestEvent parameter

* Handle review changes
2024-03-15 13:50:57 +05:30
Adwait Gharpure
8bd3b4b567
Handle all dapps getting updated on adding accounts (#55)
* Replace QR icon with WC logo

* Change screen title

* Change title

* Display session topic in list item

* Move useEffect to WalletConnectContext

* Disconnect sessions on resetting wallet

* Update dapp session on adding account

* Update sessions inside useEffect

* Clean up code

* Remove question mark

* Handle all dapps getting updated

* Remove index from map

* Move hook to different folder

---------

Co-authored-by: Adw8 <adwait@deepstacksoft.com>
2024-03-14 13:53:04 +05:30
shreerang6921
e1d75dc4c6
Reject signature request if user goes back from page (#54) 2024-03-13 19:12:50 +05:30
Adwait Gharpure
1f0e8aecd4
Update sessions on adding accounts (#53)
* Replace QR icon with WC logo

* Change screen title

* Change title

* Display session topic in list item

* Move useEffect to WalletConnectContext

* Disconnect sessions on resetting wallet

* Update dapp session on adding account

* Update sessions inside useEffect

* Remove button from toast

* Clean up code

* Remove question mark

* Remove label from snackbar

---------

Co-authored-by: Adw8 <adwait@deepstacksoft.com>
2024-03-13 19:04:12 +05:30
shreerang6921
2a92e71594
Display decoded message received while using signDirect method (#52)
* Display decoded message received while using signDirect method

* Fix permission dialog not exiting after clicking outside

* Handle review changes

* Remove optional chaining in while checking for signDirect method
2024-03-13 12:02:08 +05:30
Adwait Gharpure
cf197f386f
Display active sessions on walletconnect page (#50)
* Replace QR icon with WC logo

* Change screen title

* Display active sessions

* Change title

* Display sessions on WalletConnect page

* Display session topic in list item

* Fix types

* Add line

* Change message

* Move useEffect to WalletConnectContext

* Disconnect sessions on resetting wallet

* Review changes

---------

Co-authored-by: Adw8 <adwait@deepstacksoft.com>
2024-03-12 18:23:16 +05:30
shreerang6921
7219162185
Sign message using signDirect method with cosmos accounts (#51)
* Sign message using signDirect method with cosmos accounts

* Add explaination for signDirect method

* Use existing utility function to convert hex string to uint8array

* Handle review changes
2024-03-12 16:47:05 +05:30
shreerang6921
5b6f4e9f61
Sign message with cosmos accounts using signAmino method (#49)
* Add functionality to use cosmos accounts while pairing

* Sign message using cosmos accounts using signAmino method

* Add todo to debug signDirect

* Use cosmos wallet amino method directly

* Add back displaying wallet connect data while pairing

* Reset state for wallet connect data on closing pairing modal
2024-03-12 13:40:34 +05:30
Adwait Gharpure
7f1b2e38ef
Use separate page for walletconnect (#48)
* Add function to disconnect session

* Replace QR icon with WC logo

* Use separate page for walletconnect

* Change screen title

* Make review changes

* Make walletconnect page empty

---------

Co-authored-by: Adw8 <adwait@deepstacksoft.com>
2024-03-11 16:14:08 +05:30
c6128f222c Load config values from env (#1)
Part of https://www.notion.so/WalletConnect-integration-84b2f7377d514d7ead698bebd84f1e31

- Use `react-native-config` library

Co-authored-by: Shreerang Kale <shreerangkale@gmail.com>
Reviewed-on: cerc-io/laconic-wallet#1
2024-03-08 06:54:16 +00:00
59be46c5f0 Update intent URL (#2)
Part of https://www.notion.so/WalletConnect-integration-84b2f7377d514d7ead698bebd84f1e31

- Update intent URL to https://wallet.laconic.com/
- Move navigation to index.js

Co-authored-by: Adw8 <adwait@deepstacksoft.com>
Reviewed-on: cerc-io/laconic-wallet#2
2024-03-08 06:14:44 +00:00
Adwait Gharpure
4b0ed0ba9f
Add toast on session approval (#46)
* Add toast on session_approval

* Handle case where request icon is null

* Change camera permission message

* Fix comments

* Fix import order

---------

Co-authored-by: Adw8 <adwait@deepstacksoft.com>
2024-03-07 19:28:30 +05:30
Adwait Gharpure
d7ebdd6063
Remove QRScanner.tsx (#45)
* Remove QRScanner component

* Remove unused variables

---------

Co-authored-by: Adw8 <adwait@deepstacksoft.com>
2024-03-07 19:12:22 +05:30
shreerang6921
9ab8c2ce4f
Display details coming from dapp in sign request page (#44)
* Add qr-code scanner button in homescreen header

* Display dapp details on sign request page

* Center details coming from dapp

* Remove request event state from request context
2024-03-07 16:02:35 +05:30
Adwait Gharpure
d44d8a3092
UI changes for wallet-connect integration (#43)
* Change button position

* Add check for counterId

* Display complete uri

* Update readme

---------

Co-authored-by: Adw8 <adwait@deepstacksoft.com>
2024-03-07 15:28:12 +05:30
Adwait Gharpure
05be6008de
Use page for handling sign requests (#42)
* Use sign request page instead of modal

* Fix context

* Remove multiple if statements

* Change metadata

* Remove sign modal

* Make review changes

* Remove state

---------

Co-authored-by: Adw8 <adwait@deepstacksoft.com>
2024-03-07 12:44:05 +05:30