Compare commits

..
Author SHA1 Message Date
Jonas DanielsGitHubgithub-actions[bot] <github-actions[bot]@users.noreply.github.com>GitHub Action
031eccbab1 Version Packages (#2713)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: GitHub Action <[email protected]>
2024-04-09 02:23:28 -07:00
github-actions[bot]GitHubgithub-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
9e8cca2da5 chore(chains): update chains (#2739)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2024-04-09 02:03:38 -07:00
FirekeeperandGitHub 8d81b686f2 Unity 4.10.1 (#2733) 2024-04-09 08:57:23 +00:00
Jonas DanielsandGitHub d9cd6f5c2a implement additional extensions (#2735) 2024-04-09 08:51:13 +00:00
github-actions[bot]GitHubgithub-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2a5c7d0ebc chore(chains): update chains (#2734)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2024-04-09 01:03:26 -07:00
gregandGitHub 3847617f8e [SDK] fromGwei helper function (#2736) 2024-04-08 23:18:07 -07:00
Jonas DanielsandGitHub 1d4fdd6753 feat: Add chain Metadata type (#2731) 2024-04-08 16:42:03 -07:00
github-actions[bot]GitHubgithub-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
c98112445c chore(chains): update chains (#2732)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2024-04-08 16:32:15 -07:00
f6a30c0371 feat: add phone login for embedded wallet (#2366)
Co-authored-by: Jonas Daniels <[email protected]>
Co-authored-by: Manan Tank <[email protected]>
2024-04-08 23:08:43 +00:00
dependabot[bot]GitHubdependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
b1013fc302 build(deps-dev): bump knip from 5.8.0 to 5.9.1 (#2720)
Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-04-08 15:30:24 -07:00
github-actions[bot]GitHubgithub-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
f2b5d4ba56 chore(chains): update chains (#2730)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2024-04-08 15:30:03 -07:00
Joaquim VergesandGitHub 6961e09a4c [SDK] simulate inner transactions before bundling user ops (#2714) 2024-04-08 21:48:44 +00:00
github-actions[bot]GitHubgithub-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
49354c6cc3 chore(chains): update chains (#2727)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2024-04-08 14:07:17 -07:00
Jonas DanielsandGitHub 51502596d9 chore: remove unused dependency (#2726) 2024-04-08 20:54:19 +00:00
dependabot[bot]GitHubdependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>Jonas Daniels
df5eba9aff build(deps): bump octokit/request-action from 2.2.0 to 2.3.0 (#2715)
Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Jonas Daniels <[email protected]>
2024-04-08 13:25:53 -07:00
Jonas DanielsandGitHub 64c03ab378 chore: Update .gitignore and add VSCode configuration files (#2716) 2024-04-08 13:18:12 -07:00
github-actions[bot]GitHubgithub-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
53e56f4bf8 chore(chains): update chains (#2708)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2024-04-08 13:05:45 -07:00
Jonas DanielsandGitHub 02583f857e fix(rpc): Fix issue with block number polling (#2712) 2024-04-08 19:45:47 +00:00
14cecc9c75 feat: expose useSendBatchTransaction for smart accounts (#2711)
Signed-off-by: Jonas Daniels <[email protected]>
Co-authored-by: Jonas Daniels <[email protected]>
2024-04-08 18:54:55 +00:00
Joaquim VergesandGitHub 30e6385dea chore: remove log (#2710) 2024-04-08 17:15:40 +02:00
Jonas DanielsGitHubgithub-actions[bot] <github-actions[bot]@users.noreply.github.com>GitHub Action
37c3224a78 Version Packages (#2705)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: GitHub Action <[email protected]>
2024-04-07 16:30:37 -07:00
github-actions[bot]GitHubgithub-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
ebdfb571c9 chore(chains): update chains (#2707)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2024-04-07 13:58:06 -07:00
github-actions[bot]GitHubgithub-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>Jonas Daniels
48c1d60382 chore(chains): update chains (#2702)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Jonas Daniels <[email protected]>
2024-04-07 19:26:20 +00:00
Jonas DanielsandGitHub 584d68e6f6 fix: update test command in package.json files (#2706) 2024-04-07 12:10:06 -07:00
Jonas DanielsandGitHub 703cb6ae3c chore: update dependencies (#2701) 2024-04-07 10:09:20 -07:00
7a9a086cdc Export ERC721 event: TokensLazyMintedEvent (#2704)
Signed-off-by: Jonas Daniels <[email protected]>
Co-authored-by: Kien Ngo <[email protected]>
Co-authored-by: Jonas Daniels <[email protected]>
2024-04-07 16:05:16 +00:00
Jonas DanielsGitHubgithub-actions[bot] <github-actions[bot]@users.noreply.github.com>GitHub Action
90571a0a5c Version Packages (#2680)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: GitHub Action <[email protected]>
2024-04-06 08:50:49 -07:00
Jonas DanielsandGitHub f709f136a7 feat(extensions/ens): add support for more ens features (#2700) 2024-04-06 02:33:42 +00:00
c2eba49112 refactor: rename embeddedWallet to inAppWallet (#2697)
Co-authored-by: Jonas Daniels <[email protected]>
2024-04-06 02:13:57 +00:00
github-actions[bot]GitHubgithub-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
0ebd2204a6 chore(chains): update chains (#2699)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2024-04-05 15:30:26 -07:00
6c64102314 chore(chains): update chains (#2696)
Co-authored-by: GitHub Action <[email protected]>
Co-authored-by: Jonas Daniels <[email protected]>
2024-04-05 11:11:33 -07:00
Jonas DanielsandGitHub b583ebb7df chore(chains): sync from db (#2698) 2024-04-05 11:02:00 -07:00
fda0c1d01b chore(chains): update chains (#2694)
Co-authored-by: GitHub Action <[email protected]>
2024-04-05 04:13:13 -07:00
Jonas DanielsandGitHub 5dd4ff1b38 feat: Update dependencies and size limitThe commit updates dependenci… (#2695) 2024-04-05 04:12:53 -07:00
97556c4d5d chore(chains): update chains (#2692)
Co-authored-by: GitHub Action <[email protected]>
Co-authored-by: Jonas Daniels <[email protected]>
2024-04-05 03:18:14 -07:00
Jonas DanielsandGitHub 5be3c22df6 Update README.md (#2693)
Signed-off-by: Jonas Daniels <[email protected]>
2024-04-05 03:15:48 -07:00
Jonas DanielsandGitHub 740a675a40 feat(extensions): add initial marketplace extensions (#2689) 2024-04-05 03:09:37 -07:00
5f41412027 chore(chains): update chains (#2690)
Co-authored-by: GitHub Action <[email protected]>
2024-04-05 02:30:29 -07:00
87cf5de8e8 chore(chains): update chains (#2688)
Co-authored-by: GitHub Action <[email protected]>
2024-04-04 18:16:37 -07:00
FirekeeperandGitHub 4e19c2f1be Unity 4.10.0 - Phone EWS, Native Only (#2687) 2024-04-05 00:41:56 +00:00
0e479e2082 fix: Added 50k overhead to userOps estimation (#2677)
Co-authored-by: Joaquim Verges <[email protected]>
2024-04-05 00:20:53 +00:00
c38584825f chore(chains): update chains (#2685)
Co-authored-by: GitHub Action <[email protected]>
2024-04-04 13:03:16 -07:00
Manan TankandGitHub b3d01402dd [v4 wallets] Start new session for walletConnect on connect method call (#2683) 2024-04-04 19:18:42 +00:00
Manan TankandGitHub a2423cac70 feat: Add modalSize prop on ConnectEmbed (#2686) 2024-04-04 18:53:45 +00:00
e5e3347c3e chore(chains): update chains (#2682)
Co-authored-by: GitHub Action <[email protected]>
2024-04-04 09:30:46 -07:00
Manan TankandGitHub 4504a8d170 [test] Fix sourcemap warnings in CRA (#2684) 2024-04-04 16:18:26 +00:00
github-actions[bot]andGitHub e9309bfc70 chore(chains): update chains (#2681) 2024-04-03 22:01:14 -07:00
github-actions[bot]andGitHub 83ecf67c4b chore(chains): update chains (#2676) 2024-04-03 21:34:54 -07:00
Jonas DanielsGitHubgithub-actions[bot] <github-actions[bot]@users.noreply.github.com>GitHub Action
57b1f5839d Version Packages (#2669)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: GitHub Action <[email protected]>
2024-04-04 00:48:19 +02:00
Joaquim VergesandGitHub 97a31f57ce feat: add useSendAndConfirmTransaction hook (#2674) 2024-04-03 19:17:14 +00:00
github-actions[bot]andGitHub 319435a331 chore(chains): update chains (#2673) 2024-04-03 12:19:41 -07:00
69ee97981c chore: add more adapter tests (#2672)
Co-authored-by: Jonas Daniels <[email protected]>
2024-04-03 18:35:36 +00:00
44d96309d5 feat: Add provider and signTypedData to ethers5 signer adapter (#2667)
Co-authored-by: Jonas Daniels <[email protected]>
2024-04-03 18:09:54 +00:00
367576ca00 feat: always use new session when calling connect method for WC (#2637)
Co-authored-by: Jonas Daniels <[email protected]>
2024-04-03 17:51:31 +00:00
Jonas DanielsandGitHub 6fc9afa58f test: Update contract deployment tests (#2671) 2024-04-03 17:40:47 +00:00
b4a71d5d5b chore(chains): update chains (#2670)
Co-authored-by: GitHub Action <[email protected]>
2024-04-03 10:03:33 -07:00
127c476cff Fix getAddresses call for accounts converted to viem (#2666)
Co-authored-by: Jonas Daniels <[email protected]>
2024-04-03 09:14:00 -07:00
b3fca9509f chore(chains): update chains (#2668)
Co-authored-by: GitHub Action <[email protected]>
2024-04-03 09:02:15 -07:00
Jonas DanielsandGitHub 2108af7cf3 Version Packages (#2633) 2024-04-02 22:58:28 -07:00
Jonas DanielsandGitHub e4d243ef34 fix(adapters): sendTransaction within viemAdapter.walletClient.toViem() (#2662) 2024-04-02 19:41:42 -07:00
Jonas DanielsandGitHub 421ffa024c chore: Add job name for build step (#2665) 2024-04-02 19:38:04 -07:00
Jonas DanielsandGitHub 286b9f1e0b build: Add build:packages and build:legacy_packages scripts (#2664) 2024-04-02 19:32:57 -07:00
dependabot[bot]GitHubdependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
46e880d9e2 build(deps): bump expo-file-system from 15.9.0 to 16.0.8 (#2658)
Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-04-03 02:28:04 +00:00
dependabot[bot]GitHubdependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
7116ae0ce6 build(deps): bump @google-cloud/kms from 3.0.1 to 4.2.0 (#2653)
Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-04-03 02:27:56 +00:00
dependabot[bot]GitHubdependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
1042b5538a build(deps-dev): bump @tanstack/eslint-plugin-query from 5.28.6 to 5.28.11 (#2654)
Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-04-03 02:13:09 +00:00
Jonas DanielsandGitHub 9d319f462c chore: Update lint script in package.json (#2663) 2024-04-02 18:48:06 -07:00
dependabot[bot]GitHubdependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
ed19f73fae build(deps): bump @typescript-eslint/eslint-plugin from 7.4.0 to 7.5.0 (#2650)
Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-04-02 18:42:50 -07:00
8718354e69 chore(chains): update chains (#2640)
Co-authored-by: GitHub Action <[email protected]>
Co-authored-by: Jonas Daniels <[email protected]>
2024-04-03 00:23:19 +00:00
Jonas DanielsandGitHub 945ea1d9ad chore(CI/tests): update workflows (#2660) 2024-04-02 17:12:27 -07:00
Jonas DanielsandGitHub 02c8d51b84 chore(CI): Update CI configuration for packages and legacy packages (#2659) 2024-04-02 16:36:41 -07:00
Jonas DanielsandGitHub 47f7b4df39 test: run "Account Permissions" only if TW_SECRET_KEY is defined (#2657) 2024-04-02 16:32:22 -07:00
Jonas DanielsandGitHub 891fde539d chore: Update linting script (#2656) 2024-04-02 16:21:47 -07:00
dependabot[bot]GitHubdependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
9666940fed build(deps): bump peter-evans/create-pull-request from 3 to 6 (#2648)
Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-04-02 16:18:16 -07:00
dependabot[bot]GitHubdependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
b7b5ad2c11 build(deps): bump octokit/request-action from 2.1.0 to 2.2.0 (#2647)
Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-04-02 16:14:53 -07:00
dependabot[bot]GitHubdependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
5de549c5d2 build(deps): bump actions/checkout from 2 to 4 (#2646)
Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-04-02 16:14:32 -07:00
Jonas DanielsandGitHub 1de78fb2f3 chore(ci): Add concurrency control to CI workflow (#2644) 2024-04-02 16:13:32 -07:00
Jonas DanielsandGitHub 603ea56c54 chore: Remove legacy e2e tests workflow (#2643) 2024-04-02 15:35:57 -07:00
Jonas DanielsandGitHub 7365634c0a chore: Update CI configuration (#2642) 2024-04-02 15:33:42 -07:00
Jonas DanielsandGitHub b76d89dbb2 chore(workflows): cleanup workflows (#2641) 2024-04-02 15:16:37 -07:00
Jonas DanielsandGitHub de7f7d701c update workflows (#2639) 2024-04-02 14:58:54 -07:00
32fa0c6aa8 chore(chains): update chains (#2638)
Co-authored-by: GitHub Action <[email protected]>
2024-04-02 14:10:32 -07:00
Joaquim VergesandGitHub c508751f38 refactor: optimize encode with async params (#2636) 2024-04-02 20:52:49 +00:00
fbf4556d48 chore(chains): update chains (#2635)
Co-authored-by: GitHub Action <[email protected]>
2024-04-02 13:53:06 -07:00
FirekeeperandGitHub c9f290a1d4 Unity 4.9.1 (#2634) 2024-04-02 17:54:19 +00:00
5fb92c0a98 chore(chains): update chains (#2630)
Co-authored-by: GitHub Action <[email protected]>
2024-04-02 09:56:18 -07:00
9af8561284 [SDK] ZkSync deterministic deployments (#2592)
Signed-off-by: Yash <[email protected]>
Co-authored-by: Jonas Daniels <[email protected]>
2024-04-02 16:45:05 +00:00
Jonas DanielsGitHubgithub-actions[bot] <github-actions[bot]@users.noreply.github.com>GitHub Action
2e12c769f9 Version Packages (#2600)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: GitHub Action <[email protected]>
2024-04-02 18:18:07 +02:00
Manan TankandGitHub d89f009f14 feat: Wallet connection improvements (#2632) 2024-04-02 16:04:34 +00:00
Joaquim VergesandGitHub 1c29556f14 refactor: get userOp gas prices from bundler (#2631) 2024-04-02 15:15:01 +00:00
15697ae741 chore(chains): update chains (#2629)
Co-authored-by: GitHub Action <[email protected]>
2024-04-02 02:01:58 -07:00
Jonas DanielsandGitHub d2ffb82071 refactor: Update import statement for AutoConnect in ConnectWallet.tsx (#2628) 2024-04-02 00:58:10 -07:00
Jonas DanielsandGitHub e8063936c9 fix(WalletConnectConnection): fix wallet connect uri parsing (#2626) 2024-04-01 22:38:20 -07:00
0394eb22bf feat: add ERC4337 account / factory extensions (#2606)
Co-authored-by: Jonas Daniels <[email protected]>
2024-04-02 01:38:38 +00:00
+2 7234e6bc10 [SDK] Native privateKeyAccount implementation (#2525)
Signed-off-by: Joaquim Verges <[email protected]>
Signed-off-by: jxom  <[email protected]>
Signed-off-by: greg <[email protected]>
Signed-off-by: Jonas Daniels <[email protected]>
Co-authored-by: Jonas Daniels <[email protected]>
Co-authored-by: GitHub Action <[email protected]>
Co-authored-by: Joaquim Verges <[email protected]>
Co-authored-by: Manan Tank <[email protected]>
Co-authored-by: jxom <[email protected]>
Co-authored-by: Nacho Iacovino <[email protected]>
Co-authored-by: Winston Yeo <[email protected]>
Co-authored-by: iketw <[email protected]>
Co-authored-by: Winston Yeo <[email protected]>
Co-authored-by: Isaac Dubuque <[email protected]>
2024-04-01 18:27:35 -07:00
Jonas DanielsandGitHub 26a50b1e05 chore: update depdendencies (#2623) 2024-04-01 15:41:52 -07:00
Joaquim VergesandGitHub 00be583b89 chore(v4): get gas price from bundler for userOps (#2622) 2024-04-01 22:19:38 +00:00
Jonas DanielsandGitHub 8c9def769c feat: add turbo build and update-version commands to release script (#2621) 2024-04-01 13:47:06 -07:00
dependabot[bot]GitHubdependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>Jonas Daniels
213f313034 build(deps): bump viem from 2.9.5 to 2.9.6 (#2610)
Signed-off-by: dependabot[bot] <[email protected]>
Signed-off-by: Jonas Daniels <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Jonas Daniels <[email protected]>
2024-04-01 13:22:41 -07:00
3aaad1e9bf [SDK] generateWallet utility function (#2602)
Co-authored-by: Jonas Daniels <[email protected]>
2024-04-01 09:59:01 -07:00
55848db4ea chore(chains): update chains (#2605)
Co-authored-by: GitHub Action <[email protected]>
2024-04-01 09:58:37 -07:00
Jonas DanielsandGitHub 0c83897f62 test: add erc20 approve test (#2596) 2024-03-30 18:12:12 -07:00
Jonas DanielsandGitHub b6a6eae3cc chore(tests): skip tests that will fail without secret key set (#2604) 2024-03-30 16:58:28 -07:00
f7b45fa04e chore(chains): update chains (#2601)
Co-authored-by: GitHub Action <[email protected]>
2024-03-30 16:57:35 -07:00
82e5f53bc4 chore(chains): update chains (#2597)
Co-authored-by: GitHub Action <[email protected]>
2024-03-30 06:34:10 -07:00
Joaquim VergesandGitHub 13c3083ac4 Update README.md (#2599)
Signed-off-by: Joaquim Verges <[email protected]>
2024-03-29 21:12:36 -07:00
Jonas DanielsGitHubgithub-actions[bot] <github-actions[bot]@users.noreply.github.com>GitHub Action
755cffe590 Version Packages (#2589)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: GitHub Action <[email protected]>
2024-03-29 16:17:16 -07:00
Manan TankandGitHub dd1141f9af fix: Do not open wallet uri when connected using official WC modal (#2595) 2024-03-29 23:00:55 +00:00
Joaquim VergesandGitHub 968fdc3ebe chore: add smart wallet exports for user op types (#2594) 2024-03-29 22:29:21 +00:00
2ef20589b7 chore(chains): update chains (#2593)
Co-authored-by: GitHub Action <[email protected]>
2024-03-29 15:07:03 -07:00
Manan TankandGitHub 6d63920c0a feat: add walletConnect, Fix WC connection issues (#2591) 2024-03-29 21:58:03 +00:00
3ef378659e chore(chains): update chains (#2590)
Co-authored-by: GitHub Action <[email protected]>
2024-03-29 14:24:29 -07:00
Joaquim VergesandGitHub eba8f1c198 fix: 721/1155 claimTo with custom currency (#2588) 2024-03-29 19:45:02 +00:00
Jonas DanielsGitHubgithub-actions[bot] <github-actions[bot]@users.noreply.github.com>GitHub Action
52f827e8f2 Version Packages (#2586)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: GitHub Action <[email protected]>
2024-03-29 11:37:16 -07:00
Jonas DanielsandGitHub 6063f40f87 fix(cli): fix execution on windows and when prettier is not installed (#2587) 2024-03-29 18:16:38 +00:00
YashandGitHub 6bd1b82a58 [CLI] Publish and deploy updates for ZKSync (#2584) 2024-03-29 17:12:50 +00:00
Manan TankandGitHub 052892b396 [v5] Fix WC session request (#2585) 2024-03-29 17:09:06 +00:00
Jonas DanielsGitHubgithub-actions[bot] <github-actions[bot]@users.noreply.github.com>GitHub Action
3b12c5c926 Version Packages (#2574)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: GitHub Action <[email protected]>
2024-03-29 03:59:31 -07:00
Jonas DanielsandGitHub 02d2377ca5 build: Update dependencies in package.json (#2582) 2024-03-29 03:44:43 -07:00
9545005908 chore(chains): update chains (#2581)
Co-authored-by: GitHub Action <[email protected]>
2024-03-29 03:43:37 -07:00
Jonas DanielsandGitHub d93286bc1f chore: Update devDependencies versions (#2577) 2024-03-29 10:29:33 +00:00
50e7dbaa9d chore(chains): update chains (#2580)
Co-authored-by: GitHub Action <[email protected]>
2024-03-28 21:05:46 -07:00
Joaquim VergesandGitHub 04961f0e9a feat: change getWalletBalance prop from account to address (#2576) 2024-03-28 23:45:15 +00:00
Jonas DanielsandGitHub 37f8433c7c chore: Skip benchmark step for merge groups (#2575) 2024-03-28 22:29:33 +00:00
Jonas DanielsandGitHub c81bb882c5 fix(evm): fix CWE-1333 (#2573) 2024-03-28 22:22:51 +00:00
Jonas DanielsandGitHub 701cd880df chore: point CLI backwards compatibility @latest instead of @beta (#2572) 2024-03-28 22:10:17 +00:00
1267 changed files with 29005 additions and 21254 deletions
+39 -15
View File
@@ -2,28 +2,52 @@
# Platform team owns everything by default
* @thirdweb-dev/platform
- @jnsdls @joaquim-verges @MananTank
# Devrel owns all markdown files (README etc.)
# legacy packages
*.md @thirdweb-dev/devrel
.changeset/
legacy_packages/auth/ @jnsdls
legacy_packages/chains/ @jnsdls
legacy_packages/cli/ @jnsdls
legacy_packages/contracts-js/ @jnsdls
legacy_packages/crypto/ @jnsdls
legacy_packages/generated-abis/ @jnsdls
legacy_packages/merkletree/ @jnsdls
legacy_packages/pay/ @jnsdls
legacy_packages/payments/ @jnsdls
legacy_packages/react/ @MananTank @jnsdls
legacy_packages/react-core/ @MananTank @jnsdls
legacy_packages/react-native/ @jnsdls
legacy_packages/react-native-compat/ @jnsdls
legacy_packages/sdk/ @joaquim-verges @jnsdls
legacy_packages/storage/ @jnsdls
legacy_packages/wallets/ @MananTank @jnsdls
# Shared ownership of the react and react-core packages
# legacy e2e
packages/react/ @thirdweb-dev/product @thirdweb-dev/platform
packages/react-core/ @thirdweb-dev/product @thirdweb-dev/platform
legacy_e2e/ @jnsdls
# Shared ownership of the CLI
# packages
packages/cli/ @thirdweb-dev/product @thirdweb-dev/platform
## specific thirdweb pieces
# Chains is owned specifically by jonas for now
packages/thirdweb/src/react/ @MananTank
packages/thirdweb/src/reactive/ @MananTank
packages/thirdweb/src/gas/ @joaquim-verges
packages/thirdweb/src/pay/ @MananTank @IDubuque
packages/chains/ @jnsdls
packages/typedoc-gen/ @MananTank
# .github folder + .changeset + turbo config is owned by joaquim and jonas for now
# owned by phil for now
.github/ @jnsdls @joaquim-verges
.changeset/config.json @jnsdls @joaquim-verges
turbo.json @joaquim-verges @jnsdls
packages/service-utils/ @arcoraven
packages/eslint-config-thirdweb/ @jnsdls
packages/tw-tsconfig/ @jnsdls
packages/unity-js-bridge/ @joaquim-verges @0xFirekeeper
# .github folder + .changeset + turbo config is owned by jonas for now
scripts/ @jnsdls
.github/ @jnsdls
.changeset/config.json @jnsdls
turbo.json @jnsdls
+9 -2
View File
@@ -4,13 +4,20 @@ description: "Sets up Node.js and runs install"
runs:
using: composite
steps:
- uses: pnpm/action-setup@v2
# we use bun for some test suites
- name: Setup bun
uses: oven-sh/setup-bun@v1
with:
bun-version: 1.0.35
# pnpm for our dependencies
- uses: pnpm/action-setup@v3
with:
version: 8
- name: Setup Node.js
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version: 20
check-latest: true
registry-url: "https://registry.npmjs.org"
cache: "pnpm"
+5
View File
@@ -9,3 +9,8 @@ updates:
directory: "/" # Location of package manifests
schedule:
interval: "weekly"
- package-ecosystem: "github-actions"
directory: "/"
schedule:
# Check for updates to GitHub Actions every week
interval: "weekly"
+136
View File
@@ -0,0 +1,136 @@
name: CI
on:
push:
branches: ["main"]
paths:
- "packages/**"
- "package.json"
pull_request:
types: [opened, synchronize]
paths:
- "packages/**"
- "package.json"
# trigger on merge group as well (merge queue)
merge_group:
types: [checks_requested]
branches: ["main"]
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
# To use Remote Caching, uncomment the next lines and follow the steps below.
env:
TURBO_TOKEN: ${{ secrets.TURBO_TOKEN }}
TURBO_TEAM: ${{ secrets.TURBO_TEAM }}
TW_SECRET_KEY: ${{ secrets.TW_SECRET_KEY }}
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
jobs:
build:
runs-on: ubuntu-latest-16
name: Build Packages
steps:
- name: Check out the code
uses: actions/checkout@v4
- name: Setup & Install
uses: ./.github/composite-actions/install
- name: Build Packages
run: pnpm build:packages
lint:
timeout-minutes: 15
name: Lint Packages
runs-on: ubuntu-latest
steps:
- name: Check out the code
uses: actions/checkout@v4
- name: Setup & Install
uses: ./.github/composite-actions/install
- name: Setup Biome
uses: biomejs/setup-biome@v2
with:
version: latest
- run: pnpm lint
test:
timeout-minutes: 15
name: Unit Tests
runs-on: ubuntu-latest-16
steps:
- name: Check out the code
uses: actions/checkout@v4
- name: Setup & Install
uses: ./.github/composite-actions/install
- name: Set up foundry
uses: foundry-rs/foundry-toolchain@v1
- run: pnpm test
- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v4
with:
directory: packages/
flags: packages
verbose: true
e2e:
timeout-minutes: 15
name: E2E Tests
runs-on: ubuntu-latest
steps:
- name: Check out the code
uses: actions/checkout@v4
- name: Setup & Install
uses: ./.github/composite-actions/install
# TODO actually run e2e tests
benchmark:
# cannot run benchmarks on merge group
if: github.event_name != 'merge_group'
timeout-minutes: 15
name: "Benchmarks"
runs-on: ubuntu-latest-16
steps:
- name: Check out the code
uses: actions/checkout@v4
- name: Setup & Install
uses: ./.github/composite-actions/install
- name: Run benchmarks
uses: CodSpeedHQ/action@v2
with:
token: ${{ secrets.CODSPEED_TOKEN }}
run: "pnpm bench"
size:
# only run on pull requests
if: github.event_name == 'pull_request'
timeout-minutes: 15
name: "Size"
runs-on: ubuntu-latest-16
steps:
- name: Check out the code
uses: actions/checkout@v4
- name: Setup & Install
uses: ./.github/composite-actions/install
- name: Report bundle size
uses: andresz1/size-limit-action@master
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
package_manager: pnpm
directory: packages/thirdweb
+98
View File
@@ -0,0 +1,98 @@
name: CI (Legacy Packages)
on:
push:
branches: ["main"]
paths:
- "legacy_packages/**"
- "legacy_e2e/**"
- "package.json"
pull_request:
types: [opened, synchronize]
paths:
- "legacy_packages/**"
- "legacy_e2e/**"
- "package.json"
# trigger on merge group as well (merge queue)
merge_group:
types: [checks_requested]
branches: ["main"]
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
# To use Remote Caching, uncomment the next lines and follow the steps below.
env:
TURBO_TOKEN: ${{ secrets.TURBO_TOKEN }}
TURBO_TEAM: ${{ secrets.TURBO_TEAM }}
TW_SECRET_KEY: ${{ secrets.TW_SECRET_KEY }}
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
jobs:
build:
runs-on: ubuntu-latest-16
name: Build Packages
steps:
- name: Check out the code
uses: actions/checkout@v4
- name: Setup & Install
uses: ./.github/composite-actions/install
- name: Build Packages
run: pnpm build:legacy_packages
lint:
timeout-minutes: 15
name: Lint Packages
runs-on: ubuntu-latest
steps:
- name: Check out the code
uses: actions/checkout@v4
- name: Setup & Install
uses: ./.github/composite-actions/install
- run: pnpm lint:legacy
test:
timeout-minutes: 15
name: Unit Tests
runs-on: ubuntu-latest-16
steps:
- name: Check out the code
uses: actions/checkout@v4
- name: Setup & Install
uses: ./.github/composite-actions/install
- run: pnpm test:legacy
- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v4
with:
directory: legacy_packages/
flags: legacy_packages
verbose: true
e2e:
timeout-minutes: 15
name: E2E Tests
runs-on: ubuntu-latest-16
steps:
- name: Check out the code
uses: actions/checkout@v4
- name: Setup & Install
uses: ./.github/composite-actions/install
- name: Install Playwright
run: npx playwright install --with-deps
- name: Run e2e tests
run: pnpm e2e:legacy
env:
NODE_OPTIONS: "--max_old_space_size=4096"
CLI_E2E_API_KEY: ${{ secrets.CLI_E2E_API_KEY }}
-193
View File
@@ -1,193 +0,0 @@
name: Build, Lint & Test & Benchmark
on:
push:
branches: ["main"]
pull_request:
types: [opened, synchronize]
# trigger on merge group as well (merge queue)
merge_group:
types: [checks_requested]
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
# To use Remote Caching, uncomment the next lines and follow the steps below.
env:
TURBO_TOKEN: ${{ secrets.TURBO_TOKEN }}
TURBO_TEAM: ${{ secrets.TURBO_TEAM }}
TW_SECRET_KEY: ${{ secrets.TW_SECRET_KEY }}
jobs:
build:
timeout-minutes: 15
name: Build
runs-on: ubuntu-latest-16
steps:
- name: Check out code
uses: actions/checkout@v3
with:
fetch-depth: 25
- name: Setup bun
uses: oven-sh/setup-bun@v1
with:
bun-version: 1.0.21
- name: Install
uses: ./.github/composite-actions/install
- run: pnpm build
# We use week in the turbo cache key to keep the cache from infinitely growing
- id: get-week
run: echo "WEEK=$(date +%U)" >> $GITHUB_OUTPUT
- uses: actions/cache@v3
timeout-minutes: 5
id: cache-build
with:
path: ./*
key: ${{ github.sha }}-${{ github.run_number }}
lint:
timeout-minutes: 15
name: Lint Packages
runs-on: ubuntu-latest
needs: build
steps:
- name: Setup node
uses: actions/setup-node@v3
with:
node-version: 20
check-latest: true
- name: Setup bun
uses: oven-sh/setup-bun@v1
with:
bun-version: 1.0.21
- uses: pnpm/action-setup@v2
with:
version: 8
- uses: actions/cache@v3
timeout-minutes: 5
id: restore-build
with:
path: ./*
key: ${{ github.sha }}-${{ github.run_number }}
- run: pnpm lint
test:
timeout-minutes: 15
name: Unit Tests
runs-on: ubuntu-latest-16
needs: build
steps:
- name: Setup node
uses: actions/setup-node@v3
with:
node-version: 20
check-latest: true
# we use bun for some test suites
- name: Setup bun
uses: oven-sh/setup-bun@v1
with:
bun-version: 1.0.21
- uses: pnpm/action-setup@v2
with:
version: 8
- uses: actions/cache@v3
timeout-minutes: 5
id: restore-build
with:
path: ./*
key: ${{ github.sha }}-${{ github.run_number }}
- name: Set up foundry
uses: foundry-rs/foundry-toolchain@v1
- run: pnpm test
- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v3
with:
files: ./legacy_packages/sdk/coverage/evm/lcov.info,./packages/thirdweb/coverage/lcov.info
e2e:
timeout-minutes: 15
name: E2E Tests
runs-on: ubuntu-latest-16
needs: build
steps:
- name: Setup node
uses: actions/setup-node@v3
with:
node-version: 20
check-latest: true
# we use bun for some test suites
- name: Setup bun
uses: oven-sh/setup-bun@v1
with:
bun-version: 1.0.21
- uses: pnpm/action-setup@v2
with:
version: 8
- uses: actions/cache@v3
timeout-minutes: 5
id: restore-build
with:
path: ./*
key: ${{ github.sha }}-${{ github.run_number }}
- name: Install Playwright
run: npx playwright install --with-deps
- name: Run e2e tests
run: pnpm e2e
env:
NODE_OPTIONS: "--max_old_space_size=4096"
CLI_E2E_API_KEY: ${{ secrets.CLI_E2E_API_KEY }}
benchmark:
timeout-minutes: 15
name: "Benchmark"
runs-on: ubuntu-latest-16
needs: build
steps:
- name: Setup node
uses: actions/setup-node@v3
with:
node-version: 20
check-latest: true
- uses: pnpm/action-setup@v2
with:
version: 8
- uses: actions/cache@v3
timeout-minutes: 5
id: restore-build
with:
path: ./*
key: ${{ github.sha }}-${{ github.run_number }}
- name: Set up foundry
uses: foundry-rs/foundry-toolchain@v1
- name: Run benchmarks
uses: CodSpeedHQ/action@v2
with:
token: ${{ secrets.CODSPEED_TOKEN }}
run: "pnpm bench"
+34 -31
View File
@@ -13,12 +13,16 @@ name: "CodeQL"
on:
push:
branches: [ "main" ]
branches: ["main"]
pull_request:
# The branches below must be a subset of the branches above
branches: [ "main" ]
branches: ["main"]
schedule:
- cron: '37 9 * * 3'
- cron: "37 9 * * 3"
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
analyze:
@@ -32,41 +36,40 @@ jobs:
strategy:
fail-fast: false
matrix:
language: [ 'javascript' ]
language: ["javascript"]
# CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python', 'ruby' ]
# Learn more about CodeQL language support at https://aka.ms/codeql-docs/language-support
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Checkout repository
uses: actions/checkout@v4
# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v2
with:
languages: ${{ matrix.language }}
# If you wish to specify custom queries, you can do so here or in a config file.
# By default, queries listed here will override any specified in a config file.
# Prefix the list here with "+" to use these queries and those in the config file.
# Details on CodeQL's query packs refer to : https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs
# queries: security-extended,security-and-quality
# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v3
with:
languages: ${{ matrix.language }}
# If you wish to specify custom queries, you can do so here or in a config file.
# By default, queries listed here will override any specified in a config file.
# Prefix the list here with "+" to use these queries and those in the config file.
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
# If this step fails, then you should remove it and run the build manually (see below)
- name: Autobuild
uses: github/codeql-action/autobuild@v2
# Details on CodeQL's query packs refer to : https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs
# queries: security-extended,security-and-quality
# ℹ️ Command-line programs to run using the OS shell.
# 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
# If this step fails, then you should remove it and run the build manually (see below)
- name: Autobuild
uses: github/codeql-action/autobuild@v3
# If the Autobuild fails above, remove it and uncomment the following three lines.
# modify them (or add more) to build your code if your project, please refer to the EXAMPLE below for guidance.
# ℹ️ Command-line programs to run using the OS shell.
# 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun
# - run: |
# echo "Run, Build Application using script"
# ./location_of_script_within_repo/buildscript.sh
# If the Autobuild fails above, remove it and uncomment the following three lines.
# modify them (or add more) to build your code if your project, please refer to the EXAMPLE below for guidance.
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v2
# - run: |
# echo "Run, Build Application using script"
# ./location_of_script_within_repo/buildscript.sh
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v3
+2 -2
View File
@@ -24,13 +24,13 @@ jobs:
runs-on: ubuntu-latest-16
steps:
- name: Checkout branch
uses: actions/checkout@v3
uses: actions/checkout@v4
# bun setup is required, because pnpm typdoc will run pnpm build and some packages uses bun for build
- name: Setup bun
uses: oven-sh/setup-bun@v1
with:
bun-version: 1.0.21
bun-version: 1.0.35
- name: Install
uses: ./.github/composite-actions/install
+3 -3
View File
@@ -51,7 +51,7 @@ jobs:
steps:
- name: get pull request ref
id: get_pull_request_ref
uses: octokit/request-action@v2.1.0
uses: octokit/request-action@v2.3.0
with:
route: GET /repos/{owner}/{repository}/pulls/{issue_id}
owner: ${{ github.repository_owner }}
@@ -61,7 +61,7 @@ jobs:
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
- name: pull the repo.
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
persist-credentials: true
repository: ${{ fromJson(steps.get_pull_request_ref.outputs.data).head.repo.full_name }}
@@ -70,7 +70,7 @@ jobs:
- name: Setup bun
uses: oven-sh/setup-bun@v1
with:
bun-version: 1.0.21
bun-version: 1.0.35
- name: Install
uses: ./.github/composite-actions/install
+2 -2
View File
@@ -26,7 +26,7 @@ jobs:
runs-on: ubuntu-latest-16
steps:
- name: Checkout branch
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
fetch-depth: 0
# Do not use the GITHUB_TOKEN by default
@@ -35,7 +35,7 @@ jobs:
- name: Setup bun
uses: oven-sh/setup-bun@v1
with:
bun-version: 1.0.21
bun-version: 1.0.35
- name: Install
uses: ./.github/composite-actions/install
+5 -5
View File
@@ -10,12 +10,12 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v2
uses: actions/checkout@v4
- name: Install bun
uses: oven-sh/setup-bun@v1
with:
bun-version: 1.0.21
bun-version: 1.0.35
- name: Run chains sync
run: bun run db:sync
@@ -42,14 +42,14 @@ jobs:
- name: Commit Changes
if: env.CHANGES_FOUND == 'true'
run: |
git config --local user.email "action@github.com"
git config --local user.name "GitHub Action"
git config --local user.email "41898282+github-actions[bot]@users.noreply.github.com"
git config --local user.name "github-actions[bot]"
git add -A
git commit -m "chore(chains): sync from db"
- name: Create or Update Pull Request
if: env.CHANGES_FOUND == 'true'
uses: peter-evans/create-pull-request@v3
uses: peter-evans/create-pull-request@v6
with:
title: "chore(chains): update chains"
branch: "sync-chains"
+4 -2
View File
@@ -16,8 +16,10 @@ public/dist
yalc.lock
build/
playwright-report/
.vscode/
.env/
# Artifacts
legacy_packages/cli/artifacts/
legacy_packages/cli/artifacts/
# codecov binary
codecov
+7
View File
@@ -0,0 +1,7 @@
{
"recommendations": ["biomejs.biome"],
"unwantedRecommendations": [
"dbaeumer.vscode-eslint",
"esbenp.prettier-vscode"
]
}
+9
View File
@@ -0,0 +1,9 @@
{
"editor.formatOnSave": true,
"editor.defaultFormatter": "biomejs.biome",
"editor.codeActionsOnSave": {
"quickfix.biome": "explicit",
"source.organizeImports.biome": "explicit"
},
"typescript.preferences.importModuleSpecifier": "relative"
}
+4 -20
View File
@@ -8,8 +8,8 @@
<h1 align="center"><a href='https://thirdweb.com/'>thirdweb</a> TypeScript SDK</h1>
<p align="center">
<a href="https://github.com/thirdweb-dev/js/actions/workflows/build-test-lint.yml">
<img alt="Build Status" src="https://github.com/thirdweb-dev/js/actions/workflows/build-test-lint.yml/badge.svg"/>
<a href="https://github.com/thirdweb-dev/js/actions/workflows/CI.yml">
<img alt="Build Status" src="https://github.com/thirdweb-dev/js/actions/workflows/CI.yml/badge.svg"/>
</a>
<a href="https://discord.gg/thirdweb">
<img alt="Join our Discord!" src="https://img.shields.io/discord/834227967404146718.svg?color=7289da&label=discord&logo=discord&style=flat"/>
@@ -18,9 +18,6 @@
<p align="center"><strong>All-in-one web3 SDK for Browser, Node and Mobile apps</strong></p>
> [!IMPORTANT]
> We rewrote the thirdweb SDK from scratch for performance! Head over to the [v5 SDK](https://github.com/thirdweb-dev/js/tree/main/packages/thirdweb).
## Features
- Support for React & React-Native
@@ -53,19 +50,6 @@
| React Native Hooks | ✅ | ❌ | ❌ | ❌ |
| React Native UI Components | ✅ | ❌ | ❌ | ❌ |
## Packages
| Package | Description |
| ----------------------------------------------- | --------------------------------------------------------------------------- |
| [/sdk](./legacy_packages/sdk) | Best in class web3 SDK for Browser, Node and Mobile apps |
| [/wallets](./legacy_packages/wallets) | Unified web3 Wallet library to integrate any wallet into your applications. |
| [/react](./legacy_packages/react) | Ultimate collection of React hooks for your web3 apps |
| [/react-native](./legacy_packages/react-native) | Ultimate collection of React hooks for your native mobile web3 apps |
| [/auth](./legacy_packages/auth) | Best in class wallet authentication for Node backends |
| [/storage](./legacy_packages/storage) | Best in class decentralized storage SDK for Browser and Node |
| [/cli](./legacy_packages/cli) | Publish and deploy smart contracts without dealing with private keys |
| [/chains](./legacy_packages/chains) | All EVM chain information as JS objects for easy handling |
## Contributing
We welcome contributions from all developers regardless of experience level. If you are interested in contributing, please read our [Contributing Guide](.github/contributing.md) to learn how the repo works, how to test your changes, and how to submit a pull request.
@@ -74,9 +58,9 @@ See our [open source page](https://thirdweb.com/open-source) for more informatio
## Additional Resources
- [SDK Documentation](https://portal.thirdweb.com/typescript/v5)
- [Documentation](https://portal.thirdweb.com/typescript/v5)
- [Templates](https://thirdweb.com/templates)
- [YouTube](https://www.youtube.com/c/thirdweb_)
- [YouTube](https://www.youtube.com/c/thirdweb)
## Support
+25
View File
@@ -0,0 +1,25 @@
{
"$schema": "https://biomejs.dev/schemas/1.6.4/schema.json",
"organizeImports": {
"enabled": true
},
"linter": {
"enabled": true,
"rules": {
"recommended": true
}
},
"formatter": {
"enabled": true,
"indentStyle": "space"
},
"files": {
"ignore": [
"legacy_packages/**",
"packages/thirdweb/src/crypto/aes/lib/md5.ts",
"packages/thirdweb/src/utils/promise/p-limit.ts",
"packages/thirdweb/src/utils/bytecode/cbor-decode.ts",
"packages/thirdweb/src/**/__generated__/**"
]
}
}
+30
View File
@@ -0,0 +1,30 @@
coverage:
status:
project:
default:
target: auto
patch:
packages:
target: auto
flags:
- packages
legacy_packages:
target: auto
flags:
- legacy_packages
github_checks:
annotations: true
flag_management:
default_rules:
carryforward: true
comment:
layout: "newheader, diff, flags, files"
require_changes: false # if true: only post the comment if coverage changes
require_base: false # [yes :: must have a base report to post]
require_head: true # [yes :: must have a head report to post]
show_carryforward_flags: true
hide_comment_details: true #collapse all the "detailed info" for the PR comment
@@ -14,8 +14,7 @@
"e2e": "bun run.ts"
},
"devDependencies": {
"esbuild": "0.15.17",
"execa": "^8.0.1",
"esbuild": "0.20.2",
"ora": "^6.3.1"
}
}
@@ -1,4 +1,4 @@
import { execa } from "execa";
import { $ } from "bun";
import fs from "node:fs/promises";
import ora from "ora";
@@ -9,7 +9,7 @@ const spinner = ora("Running fixtures: ").start();
for (const fixture of fixtures) {
spinner.suffixText = fixture;
try {
await execa("bunx", ["swc", "fixtures/" + fixture]);
await $`esbuild fixtures/${fixture} --bundle`.text();
} catch (error) {
if (error.exitCode !== 0) {
console.error(error);
@@ -14,9 +14,8 @@
"e2e": "bun run.ts"
},
"devDependencies": {
"@swc/cli": "^0.1.63",
"@swc/core": "^1.3.71",
"execa": "^8.0.1",
"@swc/cli": "0.3.10",
"@swc/core": "^1.4.12",
"ora": "^6.3.1"
}
}
@@ -1,4 +1,4 @@
import { execa } from "execa";
import { $ } from "bun";
import fs from "node:fs/promises";
import ora from "ora";
@@ -9,7 +9,7 @@ const spinner = ora("Running fixtures: ").start();
for (const fixture of fixtures) {
spinner.suffixText = fixture;
try {
await execa("esbuild", ["fixtures/" + fixture, "--bundle"]);
await $`bunx swc fixtures/${fixture}`.text();
} catch (error) {
if (error.exitCode !== 0) {
console.error(error);
@@ -14,8 +14,7 @@
"e2e": "bun run.ts"
},
"devDependencies": {
"execa": "^8.0.1",
"ora": "^6.3.1",
"vite": "^5.1.4"
"vite": "^5.2.8"
}
}
@@ -1,4 +1,4 @@
import { execa } from "execa";
import { $ } from "bun";
import fs from "node:fs/promises";
import ora from "ora";
@@ -20,7 +20,7 @@ for (const fixture of fixtures) {
`,
);
await execa("vite", ["build", "fixtures/"]);
await $`vite build fixtures/`.text();
} catch (error) {
if (error.exitCode !== 0) {
console.error(error);
@@ -14,9 +14,8 @@
"e2e": "bun run.ts"
},
"devDependencies": {
"execa": "^8.0.1",
"ora": "^6.3.1",
"webpack": "^5.89.0",
"webpack": "^5.91.0",
"webpack-cli": "^5.1.4"
}
}
@@ -1,4 +1,4 @@
import { execa } from "execa";
import { $ } from "bun";
import fs from "node:fs/promises";
import ora from "ora";
@@ -9,7 +9,7 @@ const spinner = ora("Running fixtures: ").start();
for (const fixture of fixtures) {
spinner.suffixText = fixture;
try {
await execa("webpack", ["build", "./fixtures/" + fixture]);
await $`webpack build ./fixtures/${fixture} --mode=production`.text();
} catch (error) {
if (error.exitCode !== 0) {
console.error(error);
@@ -15,7 +15,6 @@
"e2e": "bun run.ts"
},
"devDependencies": {
"execa": "^8.0.1",
"ora": "^6.3.1"
}
}
@@ -1,4 +1,4 @@
import { execa } from "execa";
import { $ } from "bun";
import fs from "node:fs/promises";
import ora from "ora";
@@ -9,7 +9,7 @@ const spinner = ora("Running fixtures: ").start();
for (const fixture of fixtures) {
spinner.suffixText = fixture;
try {
await execa("node", ["fixtures/" + fixture]);
await $`node fixtures/${fixture}`.text();
} catch (error) {
if (error.exitCode !== 0) {
console.error(error);
@@ -15,7 +15,6 @@
"e2e": "bun run.ts"
},
"devDependencies": {
"execa": "^8.0.1",
"ora": "^6.3.1"
}
}
@@ -1,4 +1,4 @@
import { execa } from "execa";
import { $ } from "bun";
import fs from "node:fs/promises";
import ora from "ora";
@@ -9,7 +9,7 @@ const spinner = ora("Running fixtures: ").start();
for (const fixture of fixtures) {
spinner.suffixText = fixture;
try {
await execa("node", ["fixtures/" + fixture]);
await $`node fixtures/${fixture}`.text();
} catch (error) {
if (error.exitCode !== 0) {
console.error(error);
+67
View File
@@ -1,5 +1,72 @@
# @thirdweb-dev/auth
## 4.1.58
### Patch Changes
- Updated dependencies [[`6961e09`](https://github.com/thirdweb-dev/js/commit/6961e09a4cec4c276b233285e721dc0505792be5), [`f6a30c0`](https://github.com/thirdweb-dev/js/commit/f6a30c037197391ef0a514570931775b18927f17), [`5150259`](https://github.com/thirdweb-dev/js/commit/51502596d9f165a5316ce08da8a04b3e5c5e4eba)]:
- @thirdweb-dev/wallets@2.5.0
## 4.1.57
### Patch Changes
- [#2701](https://github.com/thirdweb-dev/js/pull/2701) [`703cb6a`](https://github.com/thirdweb-dev/js/commit/703cb6ae3cc51fa4b0ba7c87f09f8e84dab8ed3f) Thanks [@jnsdls](https://github.com/jnsdls)! - updated dependencies
- Updated dependencies [[`703cb6a`](https://github.com/thirdweb-dev/js/commit/703cb6ae3cc51fa4b0ba7c87f09f8e84dab8ed3f)]:
- @thirdweb-dev/wallets@2.4.35
## 4.1.56
### Patch Changes
- Updated dependencies [[`0e479e2`](https://github.com/thirdweb-dev/js/commit/0e479e2082fd685c9b8cae7d1cad53cade65de18), [`b3d0140`](https://github.com/thirdweb-dev/js/commit/b3d01402dd93c24f6b16aaa55674c2c10eb33be5)]:
- @thirdweb-dev/wallets@2.4.34
## 4.1.55
### Patch Changes
- Updated dependencies []:
- @thirdweb-dev/wallets@2.4.33
## 4.1.54
### Patch Changes
- Updated dependencies []:
- @thirdweb-dev/wallets@2.4.32
## 4.1.53
### Patch Changes
- Updated dependencies [[`00be583`](https://github.com/thirdweb-dev/js/commit/00be583b8902a1a0e5382ffdaafa6b9e31316075)]:
- @thirdweb-dev/wallets@2.4.31
## 4.1.52
### Patch Changes
- Updated dependencies []:
- @thirdweb-dev/wallets@2.4.30
## 4.1.51
### Patch Changes
- Updated dependencies []:
- @thirdweb-dev/wallets@2.4.29
## 4.1.50
### Patch Changes
- [#2577](https://github.com/thirdweb-dev/js/pull/2577) [`d93286b`](https://github.com/thirdweb-dev/js/commit/d93286bc1f8224d055b50ce3ffa4f302869cb2b1) Thanks [@jnsdls](https://github.com/jnsdls)! - update dependencies
- Updated dependencies [[`d93286b`](https://github.com/thirdweb-dev/js/commit/d93286bc1f8224d055b50ce3ffa4f302869cb2b1)]:
- @thirdweb-dev/wallets@2.4.28
## 4.1.49
### Patch Changes
+26 -33
View File
@@ -1,6 +1,6 @@
{
"name": "@thirdweb-dev/auth",
"version": "4.1.49",
"version": "4.1.58",
"main": "dist/thirdweb-dev-auth.cjs.js",
"module": "dist/thirdweb-dev-auth.esm.js",
"browser": {
@@ -58,10 +58,10 @@
"scripts": {
"build": "preconstruct build",
"format": "prettier --write 'src/**/*'",
"lint": "eslint src/ && bunx publint --strict --level warning",
"lint": "eslint src/",
"fix": "eslint src/ --fix",
"clean": "rm -rf dist/ && rm -rf node_modules/",
"test": "mocha --config './test/.mocharc.json' --timeout 240000 --parallel './test/**/*.test.ts'",
"test": "vitest run",
"push": "yalc push"
},
"preconstruct": {
@@ -80,44 +80,37 @@
}
},
"devDependencies": {
"@babel/core": "^7.23.7",
"@babel/preset-env": "^7.23.8",
"@babel/preset-typescript": "^7.23.3",
"@microsoft/api-documenter": "^7.22.30",
"@microsoft/api-extractor": "^7.36.3",
"@microsoft/tsdoc": "^0.14.1",
"@microsoft/api-documenter": "^7.24.1",
"@microsoft/api-extractor": "^7.43.0",
"@microsoft/tsdoc": "^0.14.2",
"@preconstruct/cli": "2.7.0",
"@swc-node/register": "^1.6.8",
"@swc/core": "^1.3.71",
"@swc-node/register": "^1.9.0",
"@swc/core": "^1.4.12",
"@thirdweb-dev/tsconfig": "workspace:*",
"@types/chai": "^4.3.5",
"@types/cookie": "^0.5.1",
"@types/cookie-parser": "^1.4.3",
"@types/express": "^4.17.13",
"@types/mocha": "^10.0.0",
"@types/uuid": "^9.0.5",
"chai": "^4.3.6",
"@types/cookie": "^0.6.0",
"@types/cookie-parser": "^1.4.7",
"@types/express": "^4.17.21",
"@types/uuid": "^9.0.8",
"cookie-parser": "^1.4.6",
"eslint": "^8.56.0",
"eslint": "8.57.0",
"eslint-config-thirdweb": "workspace:*",
"eslint-plugin-import": "^2.26.0",
"eslint-plugin-inclusive-language": "^2.2.0",
"eslint-plugin-prettier": "^5.0.0",
"eslint-plugin-tsdoc": "^0.2.16",
"eslint-plugin-import": "^2.29.1",
"eslint-plugin-inclusive-language": "^2.2.1",
"eslint-plugin-prettier": "^5.1.3",
"eslint-plugin-tsdoc": "^0.2.17",
"ethers": "^5.7.2",
"express": "^4.18.1",
"fastify": "^4.25.2",
"mocha": "10.4.0",
"next": "^13.4",
"next-auth": "^4.22.3",
"typescript": "^5.3.3"
"express": "^4.19.2",
"fastify": "^4.26.2",
"next": "^13.5.6",
"next-auth": "^4.24.7",
"typescript": "5.4.4"
},
"peerDependencies": {
"cookie-parser": "^1.4.6",
"ethers": "^5",
"express": "^4",
"fastify": "^4.25.2",
"next": "^12 || ^13 || ^14",
"next": "^13.4 || ^14",
"next-auth": "^4"
},
"peerDependenciesMeta": {
@@ -141,12 +134,12 @@
}
},
"dependencies": {
"@fastify/cookie": "^9.1.0",
"@fastify/cookie": "^9.3.1",
"@thirdweb-dev/wallets": "workspace:*",
"cookie": "^0.5.0",
"cookie": "^0.6.0",
"fastify-type-provider-zod": "^1.1.9",
"uuid": "^9.0.1",
"zod": "^3.22.3"
"zod": "^3.22.4"
},
"engines": {
"node": ">=18"
-8
View File
@@ -1,8 +0,0 @@
{
"extension": [
"ts"
],
"require": [
"@swc-node/register"
]
}
+334 -327
View File
@@ -1,377 +1,384 @@
import { ThirdwebAuth } from "../src/core";
import { EthersWallet } from "@thirdweb-dev/wallets/evm/wallets/ethers";
import { expect } from "chai";
import { Wallet } from "ethers";
import { describe, it, beforeAll, beforeEach, expect } from "vitest";
// eslint-disable-next-line @typescript-eslint/no-var-requires
require("dotenv-mono").load();
describe("Wallet Authentication - EVM", async () => {
let adminWallet: any, signerWallet: any, attackerWallet: any;
let auth: ThirdwebAuth;
describe.runIf(process.env.TW_SECRET_KEY)(
"Wallet Authentication - EVM",
{
timeout: 60000,
},
async () => {
let adminWallet: any, signerWallet: any, attackerWallet: any;
let auth: ThirdwebAuth;
before(async () => {
const [adminSigner, signerSigner, attackerSigner] = [
Wallet.createRandom(),
Wallet.createRandom(),
Wallet.createRandom(),
];
beforeAll(async () => {
const [adminSigner, signerSigner, attackerSigner] = [
Wallet.createRandom(),
Wallet.createRandom(),
Wallet.createRandom(),
];
adminWallet = new EthersWallet(adminSigner);
signerWallet = new EthersWallet(signerSigner);
attackerWallet = new EthersWallet(attackerSigner);
adminWallet = new EthersWallet(adminSigner);
signerWallet = new EthersWallet(signerSigner);
attackerWallet = new EthersWallet(attackerSigner);
auth = new ThirdwebAuth(signerWallet, "thirdweb.com", {
secretKey: process.env.TW_SECRET_KEY,
});
});
beforeEach(async () => {
auth.updateWallet(signerWallet);
});
it("Should verify logged in wallet", async () => {
const payload = await auth.login();
auth.updateWallet(adminWallet);
const address = await auth.verify(payload);
expect(address).to.equal(await signerWallet.getAddress());
});
it("Should verify logged in wallet with chain ID and expiration", async () => {
const payload = await auth.login({
expirationTime: new Date(Date.now() + 1000 * 60 * 5),
chainId: "137",
});
auth.updateWallet(adminWallet);
const address = await auth.verify(payload, {
chainId: "137",
});
expect(address).to.equal(await signerWallet.getAddress());
});
it("Should verify payload with resources", async () => {
const payload = await auth.login({
resources: ["https://example.com", "https://test.com"],
});
auth.updateWallet(adminWallet);
const address = await auth.verify(payload, {
resources: ["https://example.com", "https://test.com"],
});
expect(address).to.equal(await signerWallet.getAddress());
});
it("Should reject payload without necessary resources", async () => {
const payload = await auth.login({
resources: ["https://example.com"],
});
auth.updateWallet(adminWallet);
try {
await auth.verify(payload, {
resources: ["https://example.com", "https://test.com"],
auth = new ThirdwebAuth(signerWallet, "thirdweb.com", {
secretKey: process.env.TW_SECRET_KEY,
});
expect.fail();
} catch (err: any) {
expect(err.message).to.equal(
"Login request is missing required resources: https://test.com",
);
}
});
it("Should verify payload with customized statement", async () => {
const payload = await auth.login({
statement: "Please sign!",
});
auth.updateWallet(adminWallet);
const address = await auth.verify(payload, {
statement: "Please sign!",
beforeEach(async () => {
auth.updateWallet(signerWallet);
});
expect(address).to.equal(await signerWallet.getAddress());
});
it("Should verify logged in wallet", async () => {
const payload = await auth.login();
it("Should reject payload with incorrect statement", async () => {
const payload = await auth.login({
statement: "Please sign!",
auth.updateWallet(adminWallet);
const address = await auth.verify(payload);
expect(address).to.equal(await signerWallet.getAddress());
});
auth.updateWallet(adminWallet);
try {
await auth.verify(payload, {
statement: "Please sign again!",
});
expect.fail();
} catch (err: any) {
expect(err.message).to.include(
"Expected statement 'Please sign again!' does not match statement on payload",
);
}
});
it("Should reject invalid nonce", async () => {
const payload = await auth.login();
auth.updateWallet(adminWallet);
try {
await auth.verify(payload, {
validateNonce: (nonce: string) => {
if (nonce === payload.payload.nonce) {
throw new Error();
}
},
});
expect.fail();
} catch (err: any) {
expect(err.message).to.equal("Login request nonce is invalid");
}
});
it("Should accept valid nonce", async () => {
const payload = await auth.login();
auth.updateWallet(adminWallet);
const address = await auth.verify(payload, {
validateNonce: (nonce: string) => {
if (nonce !== payload.payload.nonce) {
throw new Error();
}
},
});
expect(address).to.equal(await signerWallet.getAddress());
});
it("Should reject payload with incorrect domain", async () => {
const payload = await auth.login();
auth.updateWallet(adminWallet);
try {
await auth.verify(payload, { domain: "test.thirdweb.com" });
expect.fail();
} catch (err: any) {
expect(err.message).to.equal(
"Expected domain 'test.thirdweb.com' does not match domain on payload 'thirdweb.com'",
);
}
});
it("Should reject expired login payload", async () => {
const payload = await auth.login({
expirationTime: new Date(Date.now() - 1000 * 60 * 5),
});
auth.updateWallet(adminWallet);
try {
await auth.verify(payload);
expect.fail();
} catch (err: any) {
expect(err.message).to.equal("Login request has expired");
}
});
it("Should reject payload with incorrect chain ID", async () => {
const payload = await auth.login({
chainId: "1",
});
auth.updateWallet(adminWallet);
try {
await auth.verify(payload, {
it("Should verify logged in wallet with chain ID and expiration", async () => {
const payload = await auth.login({
expirationTime: new Date(Date.now() + 1000 * 60 * 5),
chainId: "137",
});
expect.fail();
} catch (err: any) {
expect(err.message).to.equal(
"Expected chain ID '137' does not match chain ID on payload '1'",
);
}
});
it("Should reject payload with incorrect signer", async () => {
const payload = await auth.login();
payload.payload.address = await attackerWallet.getAddress();
auth.updateWallet(adminWallet);
const address = await auth.verify(payload, {
chainId: "137",
});
auth.updateWallet(adminWallet);
try {
await auth.verify(payload);
expect.fail();
} catch (err: any) {
expect(err.message).to.contain("does not match payload address");
}
});
it("Should generate valid authentication token", async () => {
const payload = await auth.login();
auth.updateWallet(adminWallet);
const token = await auth.generate(payload);
const user = await auth.authenticate(token);
expect(user.address).to.equal(await signerWallet.getAddress());
});
it("Should reject token with incorrect domain", async () => {
const payload = await auth.login();
auth.updateWallet(adminWallet);
const token = await auth.generate(payload);
try {
await auth.authenticate(token, { domain: "test.thirdweb.com" });
expect.fail();
} catch (err: any) {
expect(err.message).to.contain(
"Expected token to be for the domain 'test.thirdweb.com', but found token with domain 'thirdweb.com'",
);
}
});
it("Should reject token before invalid before", async () => {
const payload = await auth.login();
auth.updateWallet(adminWallet);
const token = await auth.generate(payload, {
invalidBefore: new Date(Date.now() + 1000 * 60 * 5),
expect(address).to.equal(await signerWallet.getAddress());
});
try {
await auth.authenticate(token);
expect.fail();
} catch (err: any) {
expect(err.message).to.contain("This token is invalid before");
}
});
it("Should verify payload with resources", async () => {
const payload = await auth.login({
resources: ["https://example.com", "https://test.com"],
});
it("Should reject expired authentication token", async () => {
const payload = await auth.login();
auth.updateWallet(adminWallet);
const address = await auth.verify(payload, {
resources: ["https://example.com", "https://test.com"],
});
auth.updateWallet(adminWallet);
const token = await auth.generate(payload, {
expirationTime: new Date(Date.now() - 1000 * 60 * 5),
expect(address).to.equal(await signerWallet.getAddress());
});
try {
await auth.authenticate(token);
expect.fail();
} catch (err: any) {
expect(err.message).to.contain("This token expired");
}
});
it("Should reject payload without necessary resources", async () => {
const payload = await auth.login({
resources: ["https://example.com"],
});
it("Should reject if admin address is not connected wallet address", async () => {
const payload = await auth.login();
auth.updateWallet(adminWallet);
const token = await auth.generate(payload);
auth.updateWallet(signerWallet);
try {
await auth.authenticate(token);
expect.fail();
} catch (err: any) {
expect(err.message).to.contain(
`The expected issuer address '${await signerWallet.getAddress()}' did not match the token issuer address '${await adminWallet.getAddress()}'`,
);
}
});
it("Should accept token with valid token ID", async () => {
const payload = await auth.login();
auth.updateWallet(adminWallet);
const token = await auth.generate(payload, {
tokenId: "test",
auth.updateWallet(adminWallet);
try {
await auth.verify(payload, {
resources: ["https://example.com", "https://test.com"],
});
expect.fail();
} catch (err: any) {
expect(err.message).to.equal(
"Login request is missing required resources: https://test.com",
);
}
});
const user = await auth.authenticate(token, {
validateTokenId: (tokenId: string) => {
if (tokenId !== "test") {
throw new Error();
}
},
it("Should verify payload with customized statement", async () => {
const payload = await auth.login({
statement: "Please sign!",
});
auth.updateWallet(adminWallet);
const address = await auth.verify(payload, {
statement: "Please sign!",
});
expect(address).to.equal(await signerWallet.getAddress());
});
expect(user.address).to.equal(await signerWallet.getAddress());
});
it("Should reject payload with incorrect statement", async () => {
const payload = await auth.login({
statement: "Please sign!",
});
it("Should reject token with invalid token ID", async () => {
const payload = await auth.login();
auth.updateWallet(adminWallet);
const token = await auth.generate(payload, {
tokenId: "test",
auth.updateWallet(adminWallet);
try {
await auth.verify(payload, {
statement: "Please sign again!",
});
expect.fail();
} catch (err: any) {
expect(err.message).to.include(
"Expected statement 'Please sign again!' does not match statement on payload",
);
}
});
try {
await auth.authenticate(token, {
validateTokenId: (tokenId: string) => {
if (tokenId !== "invalid") {
it("Should reject invalid nonce", async () => {
const payload = await auth.login();
auth.updateWallet(adminWallet);
try {
await auth.verify(payload, {
validateNonce: (nonce: string) => {
if (nonce === payload.payload.nonce) {
throw new Error();
}
},
});
expect.fail();
} catch (err: any) {
expect(err.message).to.equal("Login request nonce is invalid");
}
});
it("Should accept valid nonce", async () => {
const payload = await auth.login();
auth.updateWallet(adminWallet);
const address = await auth.verify(payload, {
validateNonce: (nonce: string) => {
if (nonce !== payload.payload.nonce) {
throw new Error();
}
},
});
expect.fail();
} catch (err: any) {
expect(err.message).to.contain("Token ID is invalid");
}
});
it("Should propagate session on token", async () => {
const payload = await auth.login();
auth.updateWallet(adminWallet);
const token = await auth.generate(payload, {
session: { role: "admin" },
expect(address).to.equal(await signerWallet.getAddress());
});
const user = await auth.authenticate(token);
it("Should reject payload with incorrect domain", async () => {
const payload = await auth.login();
expect(user.address).to.equal(await signerWallet.getAddress());
expect(user.session).to.deep.equal({ role: "admin" });
});
it("Should call session callback function", async () => {
const payload = await auth.login();
auth.updateWallet(adminWallet);
const token = await auth.generate(payload, {
session: (address: string) => {
return { address, role: "admin" };
},
auth.updateWallet(adminWallet);
try {
await auth.verify(payload, { domain: "test.thirdweb.com" });
expect.fail();
} catch (err: any) {
expect(err.message).to.equal(
"Expected domain 'test.thirdweb.com' does not match domain on payload 'thirdweb.com'",
);
}
});
const user = await auth.authenticate(token);
it("Should reject expired login payload", async () => {
const payload = await auth.login({
expirationTime: new Date(Date.now() - 1000 * 60 * 5),
});
expect(user.address).to.equal(await signerWallet.getAddress());
expect(user.session).to.deep.equal({
address: await signerWallet.getAddress(),
role: "admin",
auth.updateWallet(adminWallet);
try {
await auth.verify(payload);
expect.fail();
} catch (err: any) {
expect(err.message).to.equal("Login request has expired");
}
});
});
it("Should authenticate with issuer address", async () => {
const payload = await auth.login();
it("Should reject payload with incorrect chain ID", async () => {
const payload = await auth.login({
chainId: "1",
});
auth.updateWallet(adminWallet);
const token = await auth.generate(payload);
auth.updateWallet(attackerWallet);
try {
await auth.authenticate(token);
expect.fail();
} catch (err: any) {
expect(err.message).to.contain("The expected issuer address");
}
const user = await auth.authenticate(token, {
issuerAddress: await adminWallet.getAddress(),
auth.updateWallet(adminWallet);
try {
await auth.verify(payload, {
chainId: "137",
});
expect.fail();
} catch (err: any) {
expect(err.message).to.equal(
"Expected chain ID '137' does not match chain ID on payload '1'",
);
}
});
expect(user.address).to.equal(await signerWallet.getAddress());
});
});
it("Should reject payload with incorrect signer", async () => {
const payload = await auth.login();
payload.payload.address = await attackerWallet.getAddress();
auth.updateWallet(adminWallet);
try {
await auth.verify(payload);
expect.fail();
} catch (err: any) {
expect(err.message).to.contain("does not match payload address");
}
});
it("Should generate valid authentication token", async () => {
const payload = await auth.login();
auth.updateWallet(adminWallet);
const token = await auth.generate(payload);
const user = await auth.authenticate(token);
expect(user.address).to.equal(await signerWallet.getAddress());
});
it("Should reject token with incorrect domain", async () => {
const payload = await auth.login();
auth.updateWallet(adminWallet);
const token = await auth.generate(payload);
try {
await auth.authenticate(token, { domain: "test.thirdweb.com" });
expect.fail();
} catch (err: any) {
expect(err.message).to.contain(
"Expected token to be for the domain 'test.thirdweb.com', but found token with domain 'thirdweb.com'",
);
}
});
it("Should reject token before invalid before", async () => {
const payload = await auth.login();
auth.updateWallet(adminWallet);
const token = await auth.generate(payload, {
invalidBefore: new Date(Date.now() + 1000 * 60 * 5),
});
try {
await auth.authenticate(token);
expect.fail();
} catch (err: any) {
expect(err.message).to.contain("This token is invalid before");
}
});
it("Should reject expired authentication token", async () => {
const payload = await auth.login();
auth.updateWallet(adminWallet);
const token = await auth.generate(payload, {
expirationTime: new Date(Date.now() - 1000 * 60 * 5),
});
try {
await auth.authenticate(token);
expect.fail();
} catch (err: any) {
expect(err.message).to.contain("This token expired");
}
});
it("Should reject if admin address is not connected wallet address", async () => {
const payload = await auth.login();
auth.updateWallet(adminWallet);
const token = await auth.generate(payload);
auth.updateWallet(signerWallet);
try {
await auth.authenticate(token);
expect.fail();
} catch (err: any) {
expect(err.message).to.contain(
`The expected issuer address '${await signerWallet.getAddress()}' did not match the token issuer address '${await adminWallet.getAddress()}'`,
);
}
});
it("Should accept token with valid token ID", async () => {
const payload = await auth.login();
auth.updateWallet(adminWallet);
const token = await auth.generate(payload, {
tokenId: "test",
});
const user = await auth.authenticate(token, {
validateTokenId: (tokenId: string) => {
if (tokenId !== "test") {
throw new Error();
}
},
});
expect(user.address).to.equal(await signerWallet.getAddress());
});
it("Should reject token with invalid token ID", async () => {
const payload = await auth.login();
auth.updateWallet(adminWallet);
const token = await auth.generate(payload, {
tokenId: "test",
});
try {
await auth.authenticate(token, {
validateTokenId: (tokenId: string) => {
if (tokenId !== "invalid") {
throw new Error();
}
},
});
expect.fail();
} catch (err: any) {
expect(err.message).to.contain("Token ID is invalid");
}
});
it("Should propagate session on token", async () => {
const payload = await auth.login();
auth.updateWallet(adminWallet);
const token = await auth.generate(payload, {
session: { role: "admin" },
});
const user = await auth.authenticate(token);
expect(user.address).to.equal(await signerWallet.getAddress());
expect(user.session).to.deep.equal({ role: "admin" });
});
it("Should call session callback function", async () => {
const payload = await auth.login();
auth.updateWallet(adminWallet);
const token = await auth.generate(payload, {
session: (address: string) => {
return { address, role: "admin" };
},
});
const user = await auth.authenticate(token);
expect(user.address).to.equal(await signerWallet.getAddress());
expect(user.session).to.deep.equal({
address: await signerWallet.getAddress(),
role: "admin",
});
});
it("Should authenticate with issuer address", async () => {
const payload = await auth.login();
auth.updateWallet(adminWallet);
const token = await auth.generate(payload);
auth.updateWallet(attackerWallet);
try {
await auth.authenticate(token);
expect.fail();
} catch (err: any) {
expect(err.message).to.contain("The expected issuer address");
}
const user = await auth.authenticate(token, {
issuerAddress: await adminWallet.getAddress(),
});
expect(user.address).to.equal(await signerWallet.getAddress());
});
},
);
+320 -313
View File
@@ -1,384 +1,391 @@
import { LocalWallet, SmartWallet } from "@thirdweb-dev/wallets";
import { ThirdwebAuth } from "../src/core";
import { EthersWallet } from "@thirdweb-dev/wallets/evm/wallets/ethers";
import { expect } from "chai";
import { Wallet } from "ethers";
import { describe, it, beforeEach, beforeAll, expect } from "vitest";
// eslint-disable-next-line @typescript-eslint/no-var-requires
require("dotenv-mono").load();
describe("Wallet Authentication - EVM - Smart Wallet", async () => {
let adminWallet: any, signerWallet: any, attackerWallet: any;
let auth: ThirdwebAuth;
describe.runIf(process.env.TW_SECRET_KEY)(
"Wallet Authentication - EVM - Smart Wallet",
{
timeout: 60000,
},
async () => {
let adminWallet: any, signerWallet: any, attackerWallet: any;
let auth: ThirdwebAuth;
before(async () => {
const factoryAddress = "0xbf1C9aA4B1A085f7DA890a44E82B0A1289A40052";
const chain = 421614;
const localWallet = new LocalWallet();
await localWallet.generate();
const smartWallet = new SmartWallet({
chain: chain,
factoryAddress: factoryAddress,
gasless: true,
secretKey: process.env.TW_SECRET_KEY,
});
await smartWallet.connect({ personalWallet: localWallet });
beforeAll(async () => {
const factoryAddress = "0xbf1C9aA4B1A085f7DA890a44E82B0A1289A40052";
const chain = 421614;
const localWallet = new LocalWallet();
await localWallet.generate();
const smartWallet = new SmartWallet({
chain: chain,
factoryAddress: factoryAddress,
gasless: true,
secretKey: process.env.TW_SECRET_KEY,
});
await smartWallet.connect({ personalWallet: localWallet });
adminWallet = new EthersWallet(Wallet.createRandom());
signerWallet = smartWallet;
attackerWallet = new EthersWallet(Wallet.createRandom());
adminWallet = new EthersWallet(Wallet.createRandom());
signerWallet = smartWallet;
attackerWallet = new EthersWallet(Wallet.createRandom());
auth = new ThirdwebAuth(signerWallet, "thirdweb.com", {
secretKey: process.env.TW_SECRET_KEY,
});
});
beforeEach(async () => {
auth.updateWallet(signerWallet);
});
it("Should verify logged in wallet", async () => {
const payload = await auth.login();
auth.updateWallet(adminWallet);
const address = await auth.verify(payload);
expect(address).to.equal(await signerWallet.getAddress());
});
it("Should verify logged in wallet with chain ID and expiration", async () => {
const payload = await auth.login({
expirationTime: new Date(Date.now() + 1000 * 60 * 5),
chainId: "421614",
auth = new ThirdwebAuth(signerWallet, "thirdweb.com", {
secretKey: process.env.TW_SECRET_KEY,
});
});
auth.updateWallet(adminWallet);
const address = await auth.verify(payload, {
chainId: "421614",
beforeEach(async () => {
auth.updateWallet(signerWallet);
});
expect(address).to.equal(await signerWallet.getAddress());
});
it("Should verify logged in wallet", async () => {
const payload = await auth.login();
it("Should verify payload with resources", async () => {
const payload = await auth.login({
resources: ["https://example.com", "https://test.com"],
auth.updateWallet(adminWallet);
const address = await auth.verify(payload);
expect(address).to.equal(await signerWallet.getAddress());
});
auth.updateWallet(adminWallet);
const address = await auth.verify(payload, {
resources: ["https://example.com", "https://test.com"],
it("Should verify logged in wallet with chain ID and expiration", async () => {
const payload = await auth.login({
expirationTime: new Date(Date.now() + 1000 * 60 * 5),
chainId: "421614",
});
auth.updateWallet(adminWallet);
const address = await auth.verify(payload, {
chainId: "421614",
});
expect(address).to.equal(await signerWallet.getAddress());
});
expect(address).to.equal(await signerWallet.getAddress());
});
it("Should reject payload without necessary resources", async () => {
const payload = await auth.login({
resources: ["https://example.com"],
});
auth.updateWallet(adminWallet);
try {
await auth.verify(payload, {
it("Should verify payload with resources", async () => {
const payload = await auth.login({
resources: ["https://example.com", "https://test.com"],
});
expect.fail();
} catch (err: any) {
expect(err.message).to.equal(
"Login request is missing required resources: https://test.com",
);
}
});
it("Should verify payload with customized statement", async () => {
const payload = await auth.login({
statement: "Please sign!",
});
auth.updateWallet(adminWallet);
const address = await auth.verify(payload, {
statement: "Please sign!",
});
expect(address).to.equal(await signerWallet.getAddress());
});
it("Should reject payload with incorrect statement", async () => {
const payload = await auth.login({
statement: "Please sign!",
});
auth.updateWallet(adminWallet);
try {
await auth.verify(payload, {
statement: "Please sign again!",
auth.updateWallet(adminWallet);
const address = await auth.verify(payload, {
resources: ["https://example.com", "https://test.com"],
});
expect.fail();
} catch (err: any) {
expect(err.message).to.include(
"Expected statement 'Please sign again!' does not match statement on payload",
);
}
});
it("Should reject invalid nonce", async () => {
const payload = await auth.login();
expect(address).to.equal(await signerWallet.getAddress());
});
auth.updateWallet(adminWallet);
try {
await auth.verify(payload, {
it("Should reject payload without necessary resources", async () => {
const payload = await auth.login({
resources: ["https://example.com"],
});
auth.updateWallet(adminWallet);
try {
await auth.verify(payload, {
resources: ["https://example.com", "https://test.com"],
});
expect.fail();
} catch (err: any) {
expect(err.message).to.equal(
"Login request is missing required resources: https://test.com",
);
}
});
it("Should verify payload with customized statement", async () => {
const payload = await auth.login({
statement: "Please sign!",
});
auth.updateWallet(adminWallet);
const address = await auth.verify(payload, {
statement: "Please sign!",
});
expect(address).to.equal(await signerWallet.getAddress());
});
it("Should reject payload with incorrect statement", async () => {
const payload = await auth.login({
statement: "Please sign!",
});
auth.updateWallet(adminWallet);
try {
await auth.verify(payload, {
statement: "Please sign again!",
});
expect.fail();
} catch (err: any) {
expect(err.message).to.include(
"Expected statement 'Please sign again!' does not match statement on payload",
);
}
});
it("Should reject invalid nonce", async () => {
const payload = await auth.login();
auth.updateWallet(adminWallet);
try {
await auth.verify(payload, {
validateNonce: (nonce: string) => {
if (nonce === payload.payload.nonce) {
throw new Error();
}
},
});
expect.fail();
} catch (err: any) {
expect(err.message).to.equal("Login request nonce is invalid");
}
});
it("Should accept valid nonce", async () => {
const payload = await auth.login();
auth.updateWallet(adminWallet);
const address = await auth.verify(payload, {
validateNonce: (nonce: string) => {
if (nonce === payload.payload.nonce) {
if (nonce !== payload.payload.nonce) {
throw new Error();
}
},
});
expect.fail();
} catch (err: any) {
expect(err.message).to.equal("Login request nonce is invalid");
}
});
it("Should accept valid nonce", async () => {
const payload = await auth.login();
auth.updateWallet(adminWallet);
const address = await auth.verify(payload, {
validateNonce: (nonce: string) => {
if (nonce !== payload.payload.nonce) {
throw new Error();
}
},
expect(address).to.equal(await signerWallet.getAddress());
});
expect(address).to.equal(await signerWallet.getAddress());
});
it("Should reject payload with incorrect domain", async () => {
const payload = await auth.login();
it("Should reject payload with incorrect domain", async () => {
const payload = await auth.login();
auth.updateWallet(adminWallet);
try {
await auth.verify(payload, { domain: "test.thirdweb.com" });
expect.fail();
} catch (err: any) {
expect(err.message).to.equal(
"Expected domain 'test.thirdweb.com' does not match domain on payload 'thirdweb.com'",
);
}
});
it("Should reject expired login payload", async () => {
const payload = await auth.login({
expirationTime: new Date(Date.now() - 1000 * 60 * 5),
auth.updateWallet(adminWallet);
try {
await auth.verify(payload, { domain: "test.thirdweb.com" });
expect.fail();
} catch (err: any) {
expect(err.message).to.equal(
"Expected domain 'test.thirdweb.com' does not match domain on payload 'thirdweb.com'",
);
}
});
auth.updateWallet(adminWallet);
try {
await auth.verify(payload);
expect.fail();
} catch (err: any) {
expect(err.message).to.equal("Login request has expired");
}
});
it("Should reject payload with incorrect chain ID", async () => {
const payload = await auth.login({
chainId: "1",
});
auth.updateWallet(adminWallet);
try {
await auth.verify(payload, {
chainId: "137",
it("Should reject expired login payload", async () => {
const payload = await auth.login({
expirationTime: new Date(Date.now() - 1000 * 60 * 5),
});
expect.fail();
} catch (err: any) {
expect(err.message).to.equal(
"Expected chain ID '137' does not match chain ID on payload '1'",
);
}
});
it("Should reject payload with incorrect signer", async () => {
const payload = await auth.login();
payload.payload.address = await attackerWallet.getAddress();
auth.updateWallet(adminWallet);
try {
await auth.verify(payload);
expect.fail();
} catch (err: any) {
expect(err.message).to.contain("does not match payload address");
}
});
it("Should generate valid authentication token", async () => {
const payload = await auth.login();
auth.updateWallet(adminWallet);
const token = await auth.generate(payload);
const user = await auth.authenticate(token);
expect(user.address).to.equal(await signerWallet.getAddress());
});
it("Should reject token with incorrect domain", async () => {
const payload = await auth.login();
auth.updateWallet(adminWallet);
const token = await auth.generate(payload);
try {
await auth.authenticate(token, { domain: "test.thirdweb.com" });
expect.fail();
} catch (err: any) {
expect(err.message).to.contain(
"Expected token to be for the domain 'test.thirdweb.com', but found token with domain 'thirdweb.com'",
);
}
});
it("Should reject token before invalid before", async () => {
const payload = await auth.login();
auth.updateWallet(adminWallet);
const token = await auth.generate(payload, {
invalidBefore: new Date(Date.now() + 1000 * 60 * 5),
auth.updateWallet(adminWallet);
try {
await auth.verify(payload);
expect.fail();
} catch (err: any) {
expect(err.message).to.equal("Login request has expired");
}
});
try {
await auth.authenticate(token);
expect.fail();
} catch (err: any) {
expect(err.message).to.contain("This token is invalid before");
}
});
it("Should reject payload with incorrect chain ID", async () => {
const payload = await auth.login({
chainId: "1",
});
it("Should reject expired authentication token", async () => {
const payload = await auth.login();
auth.updateWallet(adminWallet);
const token = await auth.generate(payload, {
expirationTime: new Date(Date.now() - 1000 * 60 * 5),
auth.updateWallet(adminWallet);
try {
await auth.verify(payload, {
chainId: "137",
});
expect.fail();
} catch (err: any) {
expect(err.message).to.equal(
"Expected chain ID '137' does not match chain ID on payload '1'",
);
}
});
try {
await auth.authenticate(token);
expect.fail();
} catch (err: any) {
expect(err.message).to.contain("This token expired");
}
});
it("Should reject payload with incorrect signer", async () => {
const payload = await auth.login();
payload.payload.address = await attackerWallet.getAddress();
it("Should reject if admin address is not connected wallet address", async () => {
const payload = await auth.login();
auth.updateWallet(adminWallet);
const token = await auth.generate(payload);
auth.updateWallet(signerWallet);
try {
await auth.authenticate(token);
expect.fail();
} catch (err: any) {
expect(err.message).to.contain(
`The expected issuer address '${await signerWallet.getAddress()}' did not match the token issuer address '${await adminWallet.getAddress()}'`,
);
}
});
it("Should accept token with valid token ID", async () => {
const payload = await auth.login();
auth.updateWallet(adminWallet);
const token = await auth.generate(payload, {
tokenId: "test",
auth.updateWallet(adminWallet);
try {
await auth.verify(payload);
expect.fail();
} catch (err: any) {
expect(err.message).to.contain("does not match payload address");
}
});
const user = await auth.authenticate(token, {
validateTokenId: (tokenId: string) => {
if (tokenId !== "test") {
throw new Error();
}
},
it("Should generate valid authentication token", async () => {
const payload = await auth.login();
auth.updateWallet(adminWallet);
const token = await auth.generate(payload);
const user = await auth.authenticate(token);
expect(user.address).to.equal(await signerWallet.getAddress());
});
expect(user.address).to.equal(await signerWallet.getAddress());
});
it("Should reject token with incorrect domain", async () => {
const payload = await auth.login();
it("Should reject token with invalid token ID", async () => {
const payload = await auth.login();
auth.updateWallet(adminWallet);
const token = await auth.generate(payload);
auth.updateWallet(adminWallet);
const token = await auth.generate(payload, {
tokenId: "test",
try {
await auth.authenticate(token, { domain: "test.thirdweb.com" });
expect.fail();
} catch (err: any) {
expect(err.message).to.contain(
"Expected token to be for the domain 'test.thirdweb.com', but found token with domain 'thirdweb.com'",
);
}
});
try {
await auth.authenticate(token, {
it("Should reject token before invalid before", async () => {
const payload = await auth.login();
auth.updateWallet(adminWallet);
const token = await auth.generate(payload, {
invalidBefore: new Date(Date.now() + 1000 * 60 * 5),
});
try {
await auth.authenticate(token);
expect.fail();
} catch (err: any) {
expect(err.message).to.contain("This token is invalid before");
}
});
it("Should reject expired authentication token", async () => {
const payload = await auth.login();
auth.updateWallet(adminWallet);
const token = await auth.generate(payload, {
expirationTime: new Date(Date.now() - 1000 * 60 * 5),
});
try {
await auth.authenticate(token);
expect.fail();
} catch (err: any) {
expect(err.message).to.contain("This token expired");
}
});
it("Should reject if admin address is not connected wallet address", async () => {
const payload = await auth.login();
auth.updateWallet(adminWallet);
const token = await auth.generate(payload);
auth.updateWallet(signerWallet);
try {
await auth.authenticate(token);
expect.fail();
} catch (err: any) {
expect(err.message).to.contain(
`The expected issuer address '${await signerWallet.getAddress()}' did not match the token issuer address '${await adminWallet.getAddress()}'`,
);
}
});
it("Should accept token with valid token ID", async () => {
const payload = await auth.login();
auth.updateWallet(adminWallet);
const token = await auth.generate(payload, {
tokenId: "test",
});
const user = await auth.authenticate(token, {
validateTokenId: (tokenId: string) => {
if (tokenId !== "invalid") {
if (tokenId !== "test") {
throw new Error();
}
},
});
expect.fail();
} catch (err: any) {
expect(err.message).to.contain("Token ID is invalid");
}
});
it("Should propagate session on token", async () => {
const payload = await auth.login();
auth.updateWallet(adminWallet);
const token = await auth.generate(payload, {
session: { role: "admin" },
expect(user.address).to.equal(await signerWallet.getAddress());
});
const user = await auth.authenticate(token);
it("Should reject token with invalid token ID", async () => {
const payload = await auth.login();
expect(user.address).to.equal(await signerWallet.getAddress());
expect(user.session).to.deep.equal({ role: "admin" });
});
auth.updateWallet(adminWallet);
const token = await auth.generate(payload, {
tokenId: "test",
});
it("Should call session callback function", async () => {
const payload = await auth.login();
auth.updateWallet(adminWallet);
const token = await auth.generate(payload, {
session: (address: string) => {
return { address, role: "admin" };
},
try {
await auth.authenticate(token, {
validateTokenId: (tokenId: string) => {
if (tokenId !== "invalid") {
throw new Error();
}
},
});
expect.fail();
} catch (err: any) {
expect(err.message).to.contain("Token ID is invalid");
}
});
const user = await auth.authenticate(token);
it("Should propagate session on token", async () => {
const payload = await auth.login();
expect(user.address).to.equal(await signerWallet.getAddress());
expect(user.session).to.deep.equal({
address: await signerWallet.getAddress(),
role: "admin",
auth.updateWallet(adminWallet);
const token = await auth.generate(payload, {
session: { role: "admin" },
});
const user = await auth.authenticate(token);
expect(user.address).to.equal(await signerWallet.getAddress());
expect(user.session).to.deep.equal({ role: "admin" });
});
});
it("Should authenticate with issuer address", async () => {
const payload = await auth.login();
it("Should call session callback function", async () => {
const payload = await auth.login();
auth.updateWallet(adminWallet);
const token = await auth.generate(payload);
auth.updateWallet(adminWallet);
const token = await auth.generate(payload, {
session: (address: string) => {
return { address, role: "admin" };
},
});
auth.updateWallet(attackerWallet);
try {
await auth.authenticate(token);
expect.fail();
} catch (err: any) {
expect(err.message).to.contain("The expected issuer address");
}
const user = await auth.authenticate(token);
const user = await auth.authenticate(token, {
issuerAddress: await adminWallet.getAddress(),
expect(user.address).to.equal(await signerWallet.getAddress());
expect(user.session).to.deep.equal({
address: await signerWallet.getAddress(),
role: "admin",
});
});
expect(user.address).to.equal(await signerWallet.getAddress());
});
});
it("Should authenticate with issuer address", async () => {
const payload = await auth.login();
auth.updateWallet(adminWallet);
const token = await auth.generate(payload);
auth.updateWallet(attackerWallet);
try {
await auth.authenticate(token);
expect.fail();
} catch (err: any) {
expect(err.message).to.contain("The expected issuer address");
}
const user = await auth.authenticate(token, {
issuerAddress: await adminWallet.getAddress(),
});
expect(user.address).to.equal(await signerWallet.getAddress());
});
},
);
+52
View File
@@ -1,5 +1,57 @@
# @thirdweb-dev/chains
## 0.1.91
### Patch Changes
- [#2708](https://github.com/thirdweb-dev/js/pull/2708) [`53e56f4`](https://github.com/thirdweb-dev/js/commit/53e56f4bf8d3fbe7e2d5252b561bcef5927762e6) Thanks [@github-actions](https://github.com/apps/github-actions)! - Synced Chains Package
## 0.1.90
### Patch Changes
- [#2701](https://github.com/thirdweb-dev/js/pull/2701) [`703cb6a`](https://github.com/thirdweb-dev/js/commit/703cb6ae3cc51fa4b0ba7c87f09f8e84dab8ed3f) Thanks [@jnsdls](https://github.com/jnsdls)! - updated dependencies
- [#2702](https://github.com/thirdweb-dev/js/pull/2702) [`48c1d60`](https://github.com/thirdweb-dev/js/commit/48c1d6038272284f8942e1fb3635283b48945a68) Thanks [@github-actions](https://github.com/apps/github-actions)! - Synced Chains Package
## 0.1.89
### Patch Changes
- [#2676](https://github.com/thirdweb-dev/js/pull/2676) [`83ecf67`](https://github.com/thirdweb-dev/js/commit/83ecf67c4b973b17fbc57eeaa03d7a8176ff5d39) Thanks [@github-actions](https://github.com/apps/github-actions)! - Synced Chains Package
## 0.1.88
### Patch Changes
- [#2668](https://github.com/thirdweb-dev/js/pull/2668) [`b3fca95`](https://github.com/thirdweb-dev/js/commit/b3fca9509feb0ac6e0ded816f08570b2954f6521) Thanks [@github-actions](https://github.com/apps/github-actions)! - Synced Chains Package
## 0.1.87
### Patch Changes
- [#2635](https://github.com/thirdweb-dev/js/pull/2635) [`fbf4556`](https://github.com/thirdweb-dev/js/commit/fbf4556d489b3be7c0c0ff85736e803573f55228) Thanks [@github-actions](https://github.com/apps/github-actions)! - Synced Chains Package
## 0.1.86
### Patch Changes
- [#2597](https://github.com/thirdweb-dev/js/pull/2597) [`82e5f53`](https://github.com/thirdweb-dev/js/commit/82e5f53bc49208cbc43ef3eb64e3a4b6ef6c7cf6) Thanks [@github-actions](https://github.com/apps/github-actions)! - Synced Chains Package
## 0.1.85
### Patch Changes
- [#2590](https://github.com/thirdweb-dev/js/pull/2590) [`3ef3786`](https://github.com/thirdweb-dev/js/commit/3ef378659e83341663dfaded417e33b5af29bbbc) Thanks [@github-actions](https://github.com/apps/github-actions)! - Synced Chains Package
## 0.1.84
### Patch Changes
- [#2577](https://github.com/thirdweb-dev/js/pull/2577) [`d93286b`](https://github.com/thirdweb-dev/js/commit/d93286bc1f8224d055b50ce3ffa4f302869cb2b1) Thanks [@jnsdls](https://github.com/jnsdls)! - update dependencies
- [#2580](https://github.com/thirdweb-dev/js/pull/2580) [`50e7dba`](https://github.com/thirdweb-dev/js/commit/50e7dbaa9dae77cb8cd865405c322495e2498c65) Thanks [@github-actions](https://github.com/apps/github-actions)! - Synced Chains Package
## 0.1.83
### Patch Changes
+4
View File
@@ -70,7 +70,11 @@ export default {
"https://mainnet.gateway.tenderly.co",
"wss://mainnet.gateway.tenderly.co",
"https://rpc.blocknative.com/boost",
"https://rpc.flashbots.net",
"https://rpc.flashbots.net/fast",
"https://rpc.mevblocker.io",
"https://rpc.mevblocker.io/fast",
"https://rpc.mevblocker.io/noreverts",
"https://rpc.mevblocker.io/fullprivacy",
"https://eth.drpc.org",
"wss://eth.drpc.org"
+10 -6
View File
@@ -4,8 +4,13 @@ export default {
"chainId": 1001,
"explorers": [
{
"name": "klaytnscope",
"url": "https://scope.klaytn.com",
"name": "Klaytnscope",
"url": "https://baobab.klaytnscope.com",
"standard": "EIP3091"
},
{
"name": "Klaytnfinder",
"url": "https://baobab.klaytnfinder.io",
"standard": "EIP3091"
}
],
@@ -13,7 +18,7 @@ export default {
"https://baobab.wallet.klaytn.com/access?next=faucet"
],
"features": [],
"infoURL": "https://www.klaytn.com/",
"infoURL": "https://klaytn.foundation",
"name": "Klaytn Testnet Baobab",
"nativeCurrency": {
"name": "KLAY",
@@ -24,9 +29,8 @@ export default {
"redFlags": [],
"rpc": [
"https://1001.rpc.thirdweb.com/${THIRDWEB_API_KEY}",
"https://api.baobab.klaytn.net:8651",
"https://klaytn-baobab.drpc.org",
"wss://klaytn-baobab.drpc.org"
"https://public-en-baobab.klaytn.net",
"https://api.baobab.klaytn.net:8651"
],
"shortName": "Baobab",
"slip44": 1,
+34
View File
@@ -0,0 +1,34 @@
import type { Chain } from "../src/types";
export default {
"chain": "Jumbo",
"chainId": 1009,
"explorers": [
{
"name": "Jumboscan",
"url": "https://jumboscan.jumbochain.org",
"standard": "EIP3091"
}
],
"faucets": [],
"features": [
{
"name": "EIP155"
}
],
"infoURL": "https://jumbochain.org",
"name": "Jumbochain Mainnet",
"nativeCurrency": {
"name": "JNFTC",
"symbol": "JNFTC",
"decimals": 18
},
"networkId": 1009,
"rpc": [
"https://1009.rpc.thirdweb.com/${THIRDWEB_API_KEY}",
"https://rpcpriv.jumbochain.org"
],
"shortName": "Jumboscan",
"slip44": 1,
"slug": "jumbochain",
"testnet": false
} as const satisfies Chain;
+2 -1
View File
@@ -46,7 +46,8 @@ export default {
"https://evm.humans.stakepool.dev.br",
"https://mainnet-humans-evm.konsortech.xyz",
"https://evm-rpc.mainnet.humans.zone",
"https://json-rpc.humans.bh.rocks"
"https://json-rpc.humans.bh.rocks",
"https://evm-rpc.humans.huginn.tech"
],
"shortName": "humans",
"slug": "humans-ai",
+41
View File
@@ -0,0 +1,41 @@
import type { Chain } from "../src/types";
export default {
"chain": "NetMind",
"chainId": 1100789,
"explorers": [
{
"name": "NetMind Testnet Explorer",
"url": "https://testbrower.protago-dev.com",
"standard": "EIP3091",
"icon": {
"url": "ipfs://QmQNipd6uen7sm7HZXGbqhcSVkUXxu3Tp6c3BoeFpvmywp",
"width": 500,
"height": 500,
"format": "png"
}
}
],
"faucets": [],
"icon": {
"url": "ipfs://QmQNipd6uen7sm7HZXGbqhcSVkUXxu3Tp6c3BoeFpvmywp",
"width": 500,
"height": 500,
"format": "png"
},
"infoURL": "https://netmind.ai",
"name": "Netmind Chain Testnet",
"nativeCurrency": {
"name": "NMT",
"symbol": "NMT",
"decimals": 18
},
"networkId": 1100789,
"rpc": [
"https://1100789.rpc.thirdweb.com/${THIRDWEB_API_KEY}",
"https://testblock.protago-dev.com"
],
"shortName": "nmtTest",
"slug": "netmind-chain-testnet",
"testnet": true,
"title": "NetMind Chain Testnet"
} as const satisfies Chain;
-1
View File
@@ -50,7 +50,6 @@ export default {
"shortName": "re-al",
"slip44": 60,
"slug": "re-al",
"status": "incubating",
"testnet": false,
"title": "re.al Real-World Assets network"
} as const satisfies Chain;
+40
View File
@@ -0,0 +1,40 @@
import type { Chain } from "../src/types";
export default {
"chain": "BSQ",
"chainId": 1113,
"explorers": [
{
"name": "B2 Hub Habitat Testnet Explorer",
"url": "https://habitat-hub-explorer.bsquared.network",
"standard": "EIP3091",
"icon": {
"url": "ipfs://QmPV6ASrQDEkEW3g3ni7p2rJMPeciRLpEpvrAc1QfzVkx9",
"width": 640,
"height": 640,
"format": "png"
}
}
],
"faucets": [],
"icon": {
"url": "ipfs://QmPV6ASrQDEkEW3g3ni7p2rJMPeciRLpEpvrAc1QfzVkx9",
"width": 640,
"height": 640,
"format": "png"
},
"infoURL": "https://www.bsquared.network",
"name": "B2 Hub Habitat Testnet",
"nativeCurrency": {
"name": "BSquared Token",
"symbol": "BSQ",
"decimals": 18
},
"networkId": 1113,
"rpc": [
"https://1113.rpc.thirdweb.com/${THIRDWEB_API_KEY}",
"https://habitat-hub-rpc.bsquared.network"
],
"shortName": "B2Hub-testnet",
"slug": "b2-hub-habitat-testnet",
"testnet": true
} as const satisfies Chain;
+40
View File
@@ -0,0 +1,40 @@
import type { Chain } from "../src/types";
export default {
"chain": "SC20",
"chainId": 11221,
"explorers": [
{
"name": "shinescan",
"url": "https://shinescan.io",
"standard": "none",
"icon": {
"url": "ipfs://QmUBkpY3prCTZHpx1fjrYLAJ6dPaGvNVTj97iy6p3NPUi1",
"width": 161,
"height": 161,
"format": "png"
}
}
],
"faucets": [],
"icon": {
"url": "ipfs://QmUBkpY3prCTZHpx1fjrYLAJ6dPaGvNVTj97iy6p3NPUi1",
"width": 161,
"height": 161,
"format": "png"
},
"infoURL": "https://shinechain.tech",
"name": "Shine Chain",
"nativeCurrency": {
"name": "Shine",
"symbol": "SC20",
"decimals": 18
},
"networkId": 11221,
"rpc": [
"https://11221.rpc.thirdweb.com/${THIRDWEB_API_KEY}",
"https://rpc.shinescan.io"
],
"shortName": "SC20",
"slug": "shine-chain",
"testnet": false
} as const satisfies Chain;
+30
View File
@@ -0,0 +1,30 @@
import type { Chain } from "../src/types";
export default {
"chain": "Avalanche",
"chainId": 11227,
"explorers": [],
"faucets": [],
"features": [],
"icon": {
"url": "https://images.ctfassets.net/9bazykntljf6/62CceHSYsRS4D9fgDSkLRB/877cb8f26954e1743ff535fd7fdaf78f/avacloud-placeholder.svg",
"width": 256,
"height": 256,
"format": "svg"
},
"infoURL": "https://avacloud.io",
"name": "Jiritsu Testnet",
"nativeCurrency": {
"name": "Jiritsu Testnet Token",
"symbol": "TZW",
"decimals": 18
},
"networkId": 11227,
"redFlags": [],
"rpc": [
"https://11227.rpc.thirdweb.com/${THIRDWEB_API_KEY}",
"https://subnets.avax.network/jiritsutes/testnet/rpc"
],
"shortName": "Jiritsu Testnet",
"slug": "jiritsu-testnet",
"testnet": true
} as const satisfies Chain;
+47
View File
@@ -0,0 +1,47 @@
import type { Chain } from "../src/types";
export default {
"chain": "Habitat",
"chainId": 1123,
"explorers": [
{
"name": "blockscout",
"url": "https://habitat-explorer.bsquared.network",
"standard": "EIP3091",
"icon": {
"url": "ipfs://QmPV6ASrQDEkEW3g3ni7p2rJMPeciRLpEpvrAc1QfzVkx9",
"width": 640,
"height": 640,
"format": "png"
}
}
],
"faucets": [],
"icon": {
"url": "ipfs://QmPV6ASrQDEkEW3g3ni7p2rJMPeciRLpEpvrAc1QfzVkx9",
"width": 640,
"height": 640,
"format": "png"
},
"infoURL": "https://www.bsquared.network",
"name": "B2 Habitat Testnet",
"nativeCurrency": {
"name": "Bitcoin",
"symbol": "BTC",
"decimals": 18
},
"networkId": 1123,
"parent": {
"type": "L2",
"chain": "eip155-1113"
},
"rpc": [
"https://1123.rpc.thirdweb.com/${THIRDWEB_API_KEY}",
"https://b2habitat-testnet.alt.technology",
"https://habitat-rpc.bsquared.network",
"https://habitat-rpc-public.bsquared.network"
],
"shortName": "B2-testnet",
"slug": "b2-habitat-testnet",
"testnet": true,
"title": "B2 Habitat Testnet"
} as const satisfies Chain;
+34 -7
View File
@@ -2,7 +2,19 @@ import type { Chain } from "../src/types";
export default {
"chain": "ETH",
"chainId": 123420111,
"explorers": [],
"explorers": [
{
"name": "blockscout",
"url": "https://opcelestia-raspberry.gelatoscout.com",
"standard": "EIP3091",
"icon": {
"url": "ipfs://QmYtUimyqHkkFxYdbXXRbUqNg2VLPUg6Uu2C2nmFWowiZM",
"width": 551,
"height": 540,
"format": "png"
}
}
],
"faucets": [],
"features": [],
"icon": {
@@ -11,18 +23,33 @@ export default {
"height": 300,
"format": "png"
},
"infoURL": "https://raas.gelato.network/rollups/details/public/op-celestia-testnet",
"name": "Gelato OP Celestia",
"infoURL": "https://raas.gelato.network/rollups/details/public/opcelestia-raspberry",
"name": "OP Celestia Rasberry",
"nativeCurrency": {
"name": "Ether",
"symbol": "ETH",
"decimals": 18
},
"networkId": 123420111,
"parent": {
"type": "L2",
"chain": "eip155-11155111",
"bridges": [
{
"url": "https://bridge.gelato.network/bridge/opcelestia-raspberry"
}
]
},
"redFlags": [],
"rpc": [],
"shortName": "opcelestia",
"slug": "gelato-op-celestia",
"rpc": [
"https://123420111.rpc.thirdweb.com/${THIRDWEB_API_KEY}",
"https://rpc.opcelestia-raspberry.gelato.digital",
"wss://ws.opcelestia-raspberry.gelato.digital"
],
"shortName": "opcelestia-rasberry",
"slip44": 60,
"slug": "op-celestia-rasberry",
"status": "active",
"testnet": true,
"title": "Gelato OP Celestia Testnet"
"title": "OP Celestia Rasberry"
} as const satisfies Chain;
+43
View File
@@ -0,0 +1,43 @@
import type { Chain } from "../src/types";
export default {
"chain": "RSS3",
"chainId": 12553,
"explorers": [
{
"name": "RSS3 VSL Scan",
"url": "https://scan.rss3.io",
"standard": "EIP3091"
}
],
"faucets": [],
"icon": {
"url": "ipfs://QmZFWYnufi6G2Z54oJ25sx2yf2Skx5tseJHJJa6Hc1G34t",
"width": 200,
"height": 200,
"format": "svg"
},
"infoURL": "https://rss3.io",
"name": "RSS3 VSL Mainnet",
"nativeCurrency": {
"name": "RSS3",
"symbol": "RSS3",
"decimals": 18
},
"networkId": 12553,
"parent": {
"type": "L2",
"chain": "eip155-1",
"bridges": [
{
"url": "https://explorer.rss3.io/bridge"
}
]
},
"rpc": [
"https://12553.rpc.thirdweb.com/${THIRDWEB_API_KEY}",
"https://rpc.rss3.io"
],
"shortName": "rss3",
"slug": "rss3-vsl",
"testnet": false
} as const satisfies Chain;
+30
View File
@@ -0,0 +1,30 @@
import type { Chain } from "../src/types";
export default {
"chain": "Avalanche",
"chainId": 12781,
"explorers": [],
"faucets": [],
"features": [],
"icon": {
"url": "https://images.ctfassets.net/9bazykntljf6/62CceHSYsRS4D9fgDSkLRB/877cb8f26954e1743ff535fd7fdaf78f/avacloud-placeholder.svg",
"width": 256,
"height": 256,
"format": "svg"
},
"infoURL": "https://avacloud.io",
"name": "playdapp Testnet",
"nativeCurrency": {
"name": "playdapp Testnet Token",
"symbol": "PDA",
"decimals": 18
},
"networkId": 12781,
"redFlags": [],
"rpc": [
"https://12781.rpc.thirdweb.com/${THIRDWEB_API_KEY}",
"https://subnets.avax.network/playdappte/testnet/rpc"
],
"shortName": "playdapp Testnet",
"slug": "playdapp-testnet",
"testnet": true
} as const satisfies Chain;
+12 -2
View File
@@ -2,9 +2,19 @@ import type { Chain } from "../src/types";
export default {
"chain": "Avalanche",
"chainId": 13396,
"explorers": [],
"explorers": [
{
"name": "Masa Explorer",
"url": "https://subnets.avax.network/masa",
"standard": "EIP3091"
}
],
"faucets": [],
"features": [],
"features": [
{
"name": "EIP1559"
}
],
"icon": {
"url": "https://images.ctfassets.net/9bazykntljf6/62CceHSYsRS4D9fgDSkLRB/877cb8f26954e1743ff535fd7fdaf78f/avacloud-placeholder.svg",
"width": 256,
+36
View File
@@ -0,0 +1,36 @@
import type { Chain } from "../src/types";
export default {
"chain": "EVO",
"chainId": 14324,
"explorers": [
{
"name": "Evolve Testnet Explorer",
"url": "https://testnet.evolveblockchain.io",
"standard": "EIP3091"
}
],
"faucets": [
"https://faucet.evolveblockchain.io"
],
"icon": {
"url": "ipfs://QmVxtpYYzc5214CB7BgsMC4mRNRHCD8fpbNMzZguBWyRwa",
"width": 600,
"height": 600,
"format": "png"
},
"infoURL": "https://evolveblockchain.io",
"name": "EVOLVE Testnet",
"nativeCurrency": {
"name": "Evolve",
"symbol": "EVO",
"decimals": 18
},
"networkId": 14324,
"rpc": [
"https://14324.rpc.thirdweb.com/${THIRDWEB_API_KEY}",
"https://testnet-rpc.evolveblockchain.io"
],
"shortName": "evo",
"slug": "evolve-testnet",
"testnet": true
} as const satisfies Chain;
+42
View File
@@ -0,0 +1,42 @@
import type { Chain } from "../src/types";
export default {
"chain": "RBA",
"chainId": 158,
"explorers": [
{
"name": "Rbascan Explorer",
"url": "https://rbascan.com",
"standard": "EIP3091"
}
],
"faucets": [],
"features": [
{
"name": "EIP155"
},
{
"name": "EIP1559"
}
],
"icon": {
"url": "ipfs://QmTk1uhB9nvnvXifvwEPGFcdgsXRt4EXNjovUGyUmfFRcB",
"width": 4000,
"height": 4000,
"format": "png"
},
"infoURL": "https://www.roburna.com/",
"name": "Roburna Mainnet",
"nativeCurrency": {
"name": "Roburna",
"symbol": "RBA",
"decimals": 18
},
"networkId": 158,
"rpc": [
"https://158.rpc.thirdweb.com/${THIRDWEB_API_KEY}",
"https://dataseed.roburna.com"
],
"shortName": "rba",
"slug": "roburna",
"testnet": false
} as const satisfies Chain;
+4 -14
View File
@@ -2,16 +2,8 @@ import type { Chain } from "../src/types";
export default {
"chain": "gETH",
"chainId": 1582,
"explorers": [
{
"name": "Bubs Testnet Explorer",
"url": "https://explorer.bubstestnet.com",
"standard": "EIP3091"
}
],
"faucets": [
"https://bubstestnet.com"
],
"explorers": [],
"faucets": [],
"features": [],
"icon": {
"url": "ipfs://bafybeibfpls2ealp4e5fdeoxessfjjkldgjnrcx2erph7524pg7alskk6a/1f9cb.svg",
@@ -28,11 +20,9 @@ export default {
},
"networkId": 1582,
"redFlags": [],
"rpc": [
"https://1582.rpc.thirdweb.com/${THIRDWEB_API_KEY}",
"https://bubs.calderachain.xyz/http"
],
"rpc": [],
"shortName": "Bubs",
"slug": "bubs-testnet",
"status": "deprecated",
"testnet": true
} as const satisfies Chain;
+42
View File
@@ -0,0 +1,42 @@
import type { Chain } from "../src/types";
export default {
"chain": "RBAT",
"chainId": 159,
"explorers": [
{
"name": "Rbascan Testnet Explorer",
"url": "https://testnet.rbascan.com",
"standard": "EIP3091"
}
],
"faucets": [],
"features": [
{
"name": "EIP155"
},
{
"name": "EIP1559"
}
],
"icon": {
"url": "ipfs://QmTk1uhB9nvnvXifvwEPGFcdgsXRt4EXNjovUGyUmfFRcB",
"width": 4000,
"height": 4000,
"format": "png"
},
"infoURL": "https://www.roburna.com/",
"name": "Roburna Testnet",
"nativeCurrency": {
"name": "Roburna",
"symbol": "RBAT",
"decimals": 18
},
"networkId": 159,
"rpc": [
"https://159.rpc.thirdweb.com/${THIRDWEB_API_KEY}",
"https://preseed-testnet-1.roburna.com"
],
"shortName": "rbat",
"slug": "roburna-testnet",
"testnet": true
} as const satisfies Chain;
+4 -3
View File
@@ -5,7 +5,7 @@ export default {
"explorers": [
{
"name": "Blockscout",
"url": "https://plume-testnet.explorer.caldera.xyz",
"url": "https://testnet-explorer.plumenetwork.xyz",
"standard": "EIP3091",
"icon": {
"url": "ipfs://QmYtUimyqHkkFxYdbXXRbUqNg2VLPUg6Uu2C2nmFWowiZM",
@@ -35,13 +35,14 @@ export default {
"chain": "eip155-11155111",
"bridges": [
{
"url": "https://plume-testnet.calderabridge.xyz"
"url": "https://testnet-bridge.plumenetwork.xyz"
}
]
},
"rpc": [
"https://161221135.rpc.thirdweb.com/${THIRDWEB_API_KEY}",
"https://plume-testnet.rpc.caldera.xyz/http"
"https://testnet-rpc.plumenetwork.xyz/http",
"wss://testnet-rpc.plumenetwork.xyz/ws"
],
"shortName": "plume-testnet",
"slip44": 1,
+26
View File
@@ -0,0 +1,26 @@
import type { Chain } from "../src/types";
export default {
"chain": "Omni",
"chainId": 166,
"explorers": [],
"faucets": [],
"features": [
{
"name": "EIP155"
}
],
"infoURL": "https://docs.omni.network/",
"name": "Omni",
"nativeCurrency": {
"name": "Omni",
"symbol": "OMNI",
"decimals": 18
},
"networkId": 166,
"rpc": [],
"shortName": "omni",
"slip44": 1,
"slug": "omni",
"status": "incubating",
"testnet": false
} as const satisfies Chain;
+36
View File
@@ -0,0 +1,36 @@
import type { Chain } from "../src/types";
export default {
"chain": "ETH",
"chainId": 167009,
"explorers": [
{
"name": "blockscout",
"url": "https://blockscoutapi.hekla.taiko.xyz",
"standard": "EIP3091"
}
],
"faucets": [],
"icon": {
"url": "ipfs://QmcHdmVr5VRUJq13jnM6tgah5Ge7hn3Dm14eY6vwivJ5ui",
"width": 288,
"height": 258,
"format": "png"
},
"infoURL": "https://taiko.xyz",
"name": "Taiko Hekla L2",
"nativeCurrency": {
"name": "Ether",
"symbol": "ETH",
"decimals": 18
},
"networkId": 167009,
"rpc": [
"https://167009.rpc.thirdweb.com/${THIRDWEB_API_KEY}",
"https://rpc.hekla.taiko.xyz",
"wss://ws.hekla.taiko.xyz"
],
"shortName": "tko-hekla",
"slug": "taiko-hekla-l2",
"status": "active",
"testnet": false
} as const satisfies Chain;
+49
View File
@@ -0,0 +1,49 @@
import type { Chain } from "../src/types";
export default {
"chain": "ETH",
"chainId": 1687,
"explorers": [
{
"name": "blockscout",
"url": "https://sepolia-testnet-explorer.mintchain.io",
"standard": "EIP3091",
"icon": {
"url": "ipfs://QmQsYisbKkCTKoKG2YSVs94UGuWWMiBspirH4Af4FyZeZz",
"width": 80,
"height": 80,
"format": "png"
}
}
],
"faucets": [],
"icon": {
"url": "ipfs://QmQsYisbKkCTKoKG2YSVs94UGuWWMiBspirH4Af4FyZeZz",
"width": 80,
"height": 80,
"format": "png"
},
"infoURL": "https://www.mintchain.io",
"name": "Mint Sepolia Testnet",
"nativeCurrency": {
"name": "Sepolia Ether",
"symbol": "ETH",
"decimals": 18
},
"networkId": 1687,
"parent": {
"type": "L2",
"chain": "eip155-1",
"bridges": [
{
"url": "https://sepolia-testnet-bridge.mintchain.io"
}
]
},
"rpc": [
"https://1687.rpc.thirdweb.com/${THIRDWEB_API_KEY}",
"https://sepolia-testnet-rpc.mintchain.io"
],
"shortName": "mintsepoliatest",
"slug": "mint-sepolia-testnet",
"testnet": true
} as const satisfies Chain;
+30
View File
@@ -0,0 +1,30 @@
import type { Chain } from "../src/types";
export default {
"chain": "Avalanche",
"chainId": 18109,
"explorers": [],
"faucets": [],
"features": [],
"icon": {
"url": "https://images.ctfassets.net/9bazykntljf6/62CceHSYsRS4D9fgDSkLRB/877cb8f26954e1743ff535fd7fdaf78f/avacloud-placeholder.svg",
"width": 256,
"height": 256,
"format": "svg"
},
"infoURL": "https://avacloud.io",
"name": "QaUser7737 Testnet",
"nativeCurrency": {
"name": "QaUser7737 Testnet Token",
"symbol": "XSP",
"decimals": 18
},
"networkId": 18109,
"redFlags": [],
"rpc": [
"https://18109.rpc.thirdweb.com/${THIRDWEB_API_KEY}",
"https://subnets.avax.network/defi-kingdoms/dfk-chain/rpc"
],
"shortName": "QaUser7737 Testnet",
"slug": "qauser7737-testnet",
"testnet": true
} as const satisfies Chain;

Some files were not shown because too many files have changed in this diff Show More