Commit Graph

240 Commits

Author SHA1 Message Date
Ben Kremer
bd34004248
chore(deps): upgrade dapp to beta.102 (#37) 2022-07-12 15:03:48 +07:00
Ben Kremer
248d60e516 fix: update known active pairings after session connects 2022-07-04 16:41:06 +07:00
Ben Kremer
55249754f5 fix: filter out inactive pairings using client.pairing.getAll 2022-06-21 11:34:05 +02:00
Ben Kremer
4ab000ed05
chore(deps): upgrades primary dapp/wallet examples to beta.101 (#33) 2022-06-16 16:22:34 +02:00
Ben Kremer
1c4c4de242 chore: adds backlink to readme to version display 2022-06-14 18:35:57 +02:00
Ben Kremer
55cdfbf6a6 docs: adds SDK compatibility notices in provider example readmes 2022-05-31 10:48:33 +02:00
Ben Kremer
b01fff837d chore: removes stale with-solana-web3js PoC 2022-05-31 10:48:07 +02:00
Pedro Gomes
954831538d
Beta 100 (#27)
* update deps

* revert react dep updates

* chore: update deps to beta.50

* fix: get dapp running again up to Client.connect()

* save progress

* feat(debug): sets up a debug peerClient as responder

* refactor: remove more hardcoded example connect params

* fix: gets `checkPersistedState` working again

* fix: gets client.disconnect + effects working again

* feat: integrates `session_update` handling with namespaces

* fix: remove hardcoded `chains`

* stash progress

* Establish session

* save progress - established session with example dapp

* refactor: rewrite namespace helpers to handle `requiredNamespaces` (#23)

* fix: re-enables restoring persisted session

* refactor: remove debug peerClient code

* fix: re-enables restoring persisted pairings

* Save progress

* fix: re-enables pairing modal, connecting from existing pairing

* Update modals to handle new payloads

* fix(types): fix Metadata typing

* chore(deps): upgrade to beta.53

* refactor: adjusts event handler args for beta.53 `session_update`

* stash

* fix: adds missing keys for `DEFAULT_EIP155_EVENTS` enum

* stash

* chore: update comment for client.request typing FIXME

* feat: integrate beta.54

* feat: integrate beta.55, removes FIXME comments for client.request types

* chore: clean up unused import

* fix: log session_ping event

* fix: log incoming `session_event`

* chore: upgrade client@2.0.0-beta.55 -> sign-client@2.0.0-beta.56

* chore: integrate beta.57

* New beta changes (#24)

* smal lchange

* fix types

* Add package info

* format empty methods / events

* Update deps

* adjust styles

* attempt ios layout fix

* Revert "attempt ios layout fix"

This reverts commit f0176f2ef52f338980ee54e75a767b3d452733f2.

* beta.54

* fix build

* Update to beta 55

* Add todos

* update wallet to beta 56

* Update mumbai rpc add logger

* update to beta 57

* chore: adds note on beta.100 compatibility

* plock

* beta.58

* beta.100;

Co-authored-by: Ilja <idaderko@gmail.com>
Co-authored-by: Ben Kremer <ben@walletconnect.com>
Co-authored-by: Ilja <IljaDaderko@users.noreply.github.com>
2022-05-30 11:46:15 +02:00
Ben Kremer
3a2ac70f1f fix(dapps): normalize addresses to lowercase when validating signatures
fix(dapp-v2): normalize addresses to lowercase when validating signatures

chore: updates yarn.lock

fix(with-ethers): normalize addresses to lowercase for sig validation

fix(with-web3js): normalize addresses to lowercase for sig validation

Fixes #18
2022-04-08 17:09:37 +02:00
Ben Kremer
f06ba323ac feat(dapp-v2): adds cosmos signature verification (#6) 2022-04-04 16:04:11 +02:00
Ben Kremer
32afbb373c fix(cosmos-provider): handle possibly undefined address 2022-04-04 15:51:15 +02:00
Ben Kremer
b8515abe6e chore(deps): update to cosmos-wallet@1.2.0 in v2-cosmos-provider 2022-04-04 13:52:12 +02:00
Ben Kremer
cda29b7ffd Revert "Revert "Cosmos signature verification (#6)""
This reverts commit dad29d7611.
2022-04-04 13:49:32 +02:00
Chad Jackson
50881924fa
update broken link (#15) 2022-03-29 15:37:09 +02:00
Ben Kremer
5d8245b8f1 fix(with-web3js): resolves EthereumProvider type error fixed by 2.0.0-beta.26 2022-03-29 12:12:05 +02:00
Ben Kremer
a82034fefd chore(deps): upgrade dapp examples to 2.0.0-beta.26 2022-03-29 11:51:10 +02:00
Ben Kremer
80e97e5163 feat: adds sig verification for eth_signTransaction 2022-03-21 13:20:53 +01:00
Ben Kremer
5097f42b7f chore: adds link to discussion on omitting EIP712Domain validation 2022-03-21 11:50:43 +01:00
Ben Kremer
1f3af8763c refactor(dapp-v2): use ethers.utils.verifyMessage 2022-03-21 11:47:30 +01:00
Ben Kremer
f1e69504a0 fix(dapp-v2): ensures thrown errors bubble to RPC result modal
Fixes #10
2022-03-18 11:54:26 +01:00
Ben Kremer
59b9eb5867 refactor(dapp-v2): separates chainData into own context/hook 2022-03-17 16:56:54 +01:00
Ben Kremer
6b14e13eaf refactor(dapp-v2): use enums for default chain methods 2022-03-17 16:21:47 +01:00
Ben Kremer
c4759249b6 refactor(dapp-v2): rename resetApp -> reset 2022-03-17 15:02:23 +01:00
Ben Kremer
863e0f8bf8 feat(dapp-v2): integrates solana + RPC methods 2022-03-17 11:08:47 +01:00
Ben Kremer
86ef897b4c chore(config): adds solana network data and metadata 2022-03-16 16:26:00 +01:00
Ben Kremer
a54db6ceb2 chore(deps): adds @solana/web3.js 2022-03-16 15:34:07 +01:00
Ben Kremer
9e77f51464 refactor(with-solana): use solanaWallet.verifyMessageSignature 2022-03-16 15:17:59 +01:00
Ben Kremer
b382036c83 feat(with-solana): adds tx sig and message sig verification 2022-03-15 17:19:53 +01:00
Ben Kremer
e78bacd165 chore(with-solana): adds tweetnacl as direct dep 2022-03-15 15:50:52 +01:00
Ben Kremer
8c5e817760 fix(with-solana): use spec-compliant solana_ method prefix 2022-03-15 15:03:27 +01:00
Ben Kremer
c419b83ee5 feat(with-solana): adds sol_signMessage request example 2022-03-15 14:29:39 +01:00
Ben Kremer
42623d493a fix(with-solana): render result.signature for result in modal 2022-03-15 13:45:27 +01:00
Ben Kremer
6f4a52a8d9 fix(with-solana): disable transaction.addSignature temporarily 2022-03-15 13:16:10 +01:00
Ben Kremer
202aa73ab5 fix(with-solana): ensure address is returned for sol_signTransaction 2022-03-15 11:17:55 +01:00
Ben Kremer
7550d4e90a fix(with-solana): adds missing transaction.recentBlockhash param 2022-03-15 10:39:34 +01:00
Ben Kremer
f70dec62ef docs(with-solana): adds preview URL and PoC note 2022-03-14 17:54:43 +01:00
Ben Kremer
9b59d1a94e refactor(with-solana): handle multiple pubKeys via mapping 2022-03-14 17:48:46 +01:00
Ben Kremer
081ae11986 fix(cosmos-provider): ensures proper multi-account request handling 2022-03-14 16:24:29 +01:00
Ben Kremer
cb648ace48 chore(cosmos-provider): updates yarn.lock 2022-03-14 16:22:46 +01:00
Ben Kremer
dbc2aa5fa5 fix(with-solana): adds missing useCallback dep 2022-03-14 15:56:18 +01:00
Ben Kremer
9bc970e8bc fix(with-solana): adds missing session_update handler 2022-03-14 15:30:34 +01:00
Ben Kremer
a6ef7d64bd Merge branch 'feat/dapp-with-solana-web3js' into main 2022-03-14 12:14:44 +01:00
Ben Kremer
5338c930fe fix: adds toggling between solana devnet and mainnet 2022-03-14 12:10:15 +01:00
Ben Kremer
2b695af9f0 fix: allows rejected eth_sendTransaction call to bubble to handler
Fixes: https://github.com/WalletConnect/walletconnect-monorepo/issues/854

There was a superfluous try/catch here which caused the rejection to be
logged and then continue instead of throwing and allowing the
JsonRpcHandler wrapper to handle the promise rejection.
2022-03-14 11:11:16 +01:00
Ben Kremer
ae2a3d2d60 feat(dapp-with-solana): sets up client and sol_signTransaction test 2022-03-11 18:15:56 +01:00
Ben Kremer
c418007c24 chore(deps): adds bs58 2022-03-11 16:12:39 +01:00
Ben Kremer
2568b0d3bb fix: manually adds basic solana chain metadata until available via API 2022-03-11 15:17:04 +01:00
Ben Kremer
4932223b76 chore: adds solana mainnet and testnet chainIds 2022-03-11 15:16:35 +01:00
Ben Kremer
f5b6c7c8a8 chore(deps): adjusts required deps for solana 2022-03-11 15:15:32 +01:00
Ben Kremer
7b8b3e5c85 chore: set up react-dapp-v2-with-solana-web3js subdirectory 2022-03-11 14:03:18 +01:00
Ben Kremer
dad29d7611 Revert "Cosmos signature verification (#6)"
This reverts commit 3c47a595b8.
2022-03-10 15:38:53 +01:00
Alex
3c47a595b8
Cosmos signature verification (#6) 2022-03-10 15:30:12 +01:00
Ben Kremer
512d9f1ccc fix: sets rpc result to null on rejection for EthereumProvider examples 2022-03-10 12:16:05 +01:00
Ben Kremer
929779f213 fix(dapps): aligns EIP712 example with the one used in spec
Reference: https://eips.ethereum.org/EIPS/eip-712
2022-03-10 12:04:09 +01:00
Ben Kremer
2c314afee9 docs(dapp): use walletconnect subdomains for demo links 2022-03-10 10:36:38 +01:00
Ben Kremer
e437e802dd fix: handle session_updated event in EthereumProvider examples 2022-03-04 12:03:24 +00:00
Ben Kremer
1998be6295 refactor(dapp-v2): use existing onSessionConnected handler for session_updated 2022-03-04 10:30:08 +00:00
Ben Kremer
57e991f56a fix(v2-dapp): handle CLIENT_EVENTS.session.updated event 2022-03-04 10:21:15 +00:00
Ben Kremer
44b2cac9f3 fix(v2-cosmos-provider): set RPC result on caught error 2022-03-01 14:13:14 +00:00
Ben Kremer
2e0ead7011 fix(v2-cosmos-provider): fixes expected RPC result shape 2022-03-01 14:05:39 +00:00
Ben Kremer
d91d05d559 fix(react-dapp-v2): fixes accessing of result.signature on cosmos RPC 2022-03-01 13:56:47 +00:00
Ben Kremer
072d4593ca chore: rename react-dapp-v2-cosmos -> react-dapp-v2-cosmos-provider 2022-03-01 12:02:15 +00:00
Ben Kremer
d309291b9e docs(v2-cosmos): updates readme 2022-02-24 10:54:10 +01:00
Ben Kremer
cc39f1c52b refactor(cosmos): handle RPC requests via cosmosProvider 2022-02-24 10:42:31 +01:00
Ben Kremer
a9be9fc4e9 feat: sets up v2-cosmos example 2022-02-23 15:02:40 +01:00
Ben Kremer
09334bd198 docs(with-web3js): updates example and top-level readmes 2022-02-23 11:07:21 +01:00
Ben Kremer
331a6e2e66 refactor(with-web3js): handles multi-account balance representation 2022-02-22 11:58:53 +01:00
Ben Kremer
68655234b4 feat: gets eth_signTypedData working with web3js 2022-02-22 11:55:16 +01:00
Ben Kremer
240d874562 feat: sets up react-dapp-v2-with-web3js 2022-02-22 11:55:16 +01:00
Ben Kremer
97bdc4aa59 refactor(with-ethers): handles multi-account balance representation 2022-02-22 11:54:07 +01:00
Ben Kremer
e7e8638229 chore: cleans up unused JsonRpcContext in with-ethers example 2022-02-22 11:14:05 +01:00
Ben Kremer
7e76cb79d1 fix(api): use /account-balance endpoint instead of /account-assets
There seems to be a weird race condition on the `/account-assets`
endpoint when handling two different requests for the same chainId.

Reproduction:
https://codesandbox.io/s/ethereum-api-race-condition-repro-f24x4t?file=/src/index.js
2022-02-21 17:53:11 +01:00
Ben Kremer
c4b93e771a docs: adds overview for react-dapp-v2-with-ethers 2022-02-21 13:47:16 +01:00
Ben Kremer
288f19a12a docs: adds overview for react-dapp-v2 2022-02-21 12:11:48 +01:00
Ben Kremer
3c2684f851 refactor(dapp): support signing from different addresses on same network 2022-02-21 11:45:15 +01:00
Ben Kremer
d4c670bdf3 chore: updates .env.local.example to use non-dev relay 2022-02-18 14:24:57 +01:00
Ben Kremer
558efc8d27 refactor: simplify eth_sendTransaction for ethers example 2022-02-18 10:59:25 +01:00
Ben Kremer
154e05afa7 refactor: use web3Provider.listAccounts() 2022-02-18 10:51:35 +01:00
Ben Kremer
75354cf87d chore(deps): upgrade deps to beta.23 2022-02-17 14:21:57 +01:00
Ben Kremer
5a4835281f refactor: re-enables session ping 2022-02-17 13:58:09 +01:00
Ben Kremer
7c03646e39 feat: adds web3Provider.send("eth_signTransaction,...") 2022-02-17 12:17:12 +01:00
Ben Kremer
4058649b14 feat: adds web3Provider.send("eth_sign",...) 2022-02-17 11:33:12 +01:00
Ben Kremer
f3c9a9bdcf chore: cleanup 2022-02-17 11:29:38 +01:00
Ben Kremer
61148c8c04 chore(deps): upgrade to beta.23 2022-02-17 10:39:24 +01:00
Ben Kremer
2dfb5a0bc6 fix: use ethers.utils.verifyTypedData to verify signature 2022-02-17 10:33:19 +01:00
Ben Kremer
4b0d8c50fd chore(deps): replaces legacy-modal dep with standard qrcode-modal 2022-02-17 10:33:19 +01:00
Ben Kremer
0e7b02da4b fix: adds missing useCallback dependency 2022-02-17 10:33:19 +01:00
Ben Kremer
b225f4e215 feat: adds provider handler for eth_signTypedData 2022-02-17 10:33:19 +01:00
Ben Kremer
35868ea7af feat: sets up passing of custom RPCs to EthereumProvider 2022-02-17 10:33:19 +01:00
Ben Kremer
3e53d08874 fix: simplifies session deleted handling 2022-02-17 10:33:19 +01:00
Ben Kremer
bf553a2c2d refactor: simplify by using higher-level provider.disconnect 2022-02-17 10:33:19 +01:00
Ben Kremer
9172b368b9 refactor: abstract into DEFAULT_INFURA_ID 2022-02-17 10:33:19 +01:00
Ben Kremer
ca5b9674d7 feat: gets persistence check working with provider 2022-02-17 10:33:19 +01:00
Ben Kremer
4d1caa7997 fix: dereference session from client directly 2022-02-17 10:33:19 +01:00
Ben Kremer
623c44e4c2 chore: cleanup 2022-02-17 10:33:19 +01:00
Ben Kremer
6a23ad8a0a fix: removes reliance on session for Header 2022-02-17 10:33:19 +01:00
Ben Kremer
68a5335b02 wip 2022-02-17 10:33:19 +01:00
Ben Kremer
43c67d0c81 chore: set up app, get basics working with EthereumProvider 2022-02-17 10:33:19 +01:00
Ben Kremer
033cf6a585 fix: simplifies handling deleted session 2022-02-16 14:28:24 +01:00
Ben Kremer
5ea671281f refactor: updates eth_signTypedData example 2022-02-16 14:12:02 +01:00
Ben Kremer
f5814d4d1a feat: adds eth_sign and eth_signTransaction examples 2022-02-16 14:05:12 +01:00
Ben Kremer
f5a0598ef1 chore: removes unused param 2022-02-10 17:31:36 +01:00
Ben Kremer
fa72dd6577 refactor: rename fetching -> isFetchingBalances 2022-02-10 17:16:08 +01:00
Ben Kremer
2b25de2f30 refactor: renames loading -> isInitializing 2022-02-10 17:12:38 +01:00
Ben Kremer
3bc76a24c0 refactor(client): creates separate namespace/methods getters 2022-02-10 17:08:46 +01:00
Ben Kremer
02e3b8861e docs: method annotations 2022-02-10 17:08:22 +01:00
Ben Kremer
bb744c48c5 refactor: rename testnet localStorage helpers 2022-02-10 16:53:46 +01:00
Ben Kremer
c058d500d0 fix: adds missed underscore 2022-02-10 15:20:14 +01:00
Ben Kremer
40f7cab8fc chore: clean up ordering in ClientContext 2022-02-10 14:37:00 +01:00
Ben Kremer
1a2e5098c3 refactor: creates getAddressByChainId helper fn 2022-02-10 14:34:32 +01:00
Ben Kremer
601f16b171 chore: remove old class-based App component 2022-02-10 11:45:19 +01:00
Ben Kremer
22c0a7c456 fix: adds missing setLoading toggle 2022-02-09 13:53:56 +01:00
Ben Kremer
1ca7a5cfd1 feat: adds back resetApp 2022-02-09 13:45:30 +01:00
Ben Kremer
d33bf9dcd1 refactor: standardises cosmos RPC methods alongside EIP155 ones 2022-02-09 13:45:30 +01:00
Ben Kremer
95751d6efb refactor: clean up client init 2022-02-09 13:45:30 +01:00
Ben Kremer
067aca31b8 refactor: simplifies onSessionConnected 2022-02-09 13:45:30 +01:00
Ben Kremer
d675606194 fix: reference client version via package.json 2022-02-09 13:45:30 +01:00
Ben Kremer
7eeefd4f65 refactor: creates standalone JsonRpcContext 2022-02-09 13:45:30 +01:00
Ben Kremer
34e175f24c feat: memoize ClientContext value 2022-02-09 13:45:30 +01:00
Ben Kremer
dc120c89d2 refactor: moves more client specific methods into ClientContext 2022-02-09 13:45:30 +01:00
Ben Kremer
0732b09991 refactor: sets up ClientContext 2022-02-09 13:45:30 +01:00
Ben Kremer
f819161934 chore: removes unused uri state 2022-02-09 13:45:30 +01:00
Ben Kremer
575f21e814 refactor: abstracts common rpc handling into createJsonRpcRequestHandler 2022-02-09 13:45:30 +01:00
Ben Kremer
55fff706cf fix: pass accounts to getAccountBalances 2022-02-09 13:45:30 +01:00
Ben Kremer
6976e7bbd6 fix(deps): pin react-error-overlay versions
See:
https://github.com/facebook/create-react-app/issues/11773
2022-02-09 13:45:30 +01:00
Ben Kremer
273ef2f9dc refactor: separates App styled-components into own file 2022-02-09 13:45:30 +01:00
Ben Kremer
940d59fc00 fix(react-dapp): ensures pending state is set before RPC modal opens 2022-02-09 13:45:30 +01:00
Ben Kremer
04ecb7a155 chore: update lockfile 2022-02-09 13:45:30 +01:00
Ben Kremer
dc58ed1266 fix: ensure session can be referenced when creating event handlers 2022-02-04 12:28:12 +01:00
Ben Kremer
004717fce1 refactor: moves getAllChainNamespaces into util helpers 2022-02-04 12:28:04 +01:00
Ben Kremer
0d3d25d521 fix: clean up unwanted imports + check initial state for testnet 2022-02-04 11:18:53 +01:00
Ben Kremer
6b040dbfe1 refactor(App): gets core functionality running via react hooks 2022-02-03 18:15:01 +01:00
Ben Kremer
b9f59295c8 refactor(react-dapp-v2): refactor Modal to React hooks 2022-02-02 17:12:31 +01:00
Ben Kremer
2201fed80b style: format all with prettier 2022-02-02 17:11:22 +01:00
Ben Kremer
6626de3b10 chore(deps): adds missing prettier devDep 2022-02-02 17:10:56 +01:00
Ben Kremer
09078d5016 chore(deps): separates out and updates devDeps 2022-02-02 16:35:06 +01:00
Ben Kremer
d0840daa1a chore: removes react/ sub directory 2022-02-02 14:28:59 +01:00
Ben Kremer
5b07e63f5d chore: update projectId for example 2022-02-02 14:27:15 +01:00
Ben Kremer
9dba142aeb docs: add .env.local instructions to readme
The dapp won't boot up without setting
`process.env.REACT_APP_PROJECT_ID`
2022-02-02 14:02:37 +01:00
Ben Kremer
a00fa094f7 chore(dapps): sets up existing v2 react-app with yarn.lock 2022-02-02 14:00:33 +01:00