Compare commits
272
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
90571a0a5c | ||
|
|
f709f136a7 | ||
|
|
c2eba49112 | ||
|
|
0ebd2204a6 | ||
|
|
6c64102314 | ||
|
|
b583ebb7df | ||
|
|
fda0c1d01b | ||
|
|
5dd4ff1b38 | ||
|
|
97556c4d5d | ||
|
|
5be3c22df6 | ||
|
|
740a675a40 | ||
|
|
5f41412027 | ||
|
|
87cf5de8e8 | ||
|
|
4e19c2f1be | ||
|
|
0e479e2082 | ||
|
|
c38584825f | ||
|
|
b3d01402dd | ||
|
|
a2423cac70 | ||
|
|
e5e3347c3e | ||
|
|
4504a8d170 | ||
|
|
e9309bfc70 | ||
|
|
83ecf67c4b | ||
|
|
57b1f5839d | ||
|
|
97a31f57ce | ||
|
|
319435a331 | ||
|
|
69ee97981c | ||
|
|
44d96309d5 | ||
|
|
367576ca00 | ||
|
|
6fc9afa58f | ||
|
|
b4a71d5d5b | ||
|
|
127c476cff | ||
|
|
b3fca9509f | ||
|
|
2108af7cf3 | ||
|
|
e4d243ef34 | ||
|
|
421ffa024c | ||
|
|
286b9f1e0b | ||
|
|
46e880d9e2 | ||
|
|
7116ae0ce6 | ||
|
|
1042b5538a | ||
|
|
9d319f462c | ||
|
|
ed19f73fae | ||
|
|
8718354e69 | ||
|
|
945ea1d9ad | ||
|
|
02c8d51b84 | ||
|
|
47f7b4df39 | ||
|
|
891fde539d | ||
|
|
9666940fed | ||
|
|
b7b5ad2c11 | ||
|
|
5de549c5d2 | ||
|
|
1de78fb2f3 | ||
|
|
603ea56c54 | ||
|
|
7365634c0a | ||
|
|
b76d89dbb2 | ||
|
|
de7f7d701c | ||
|
|
32fa0c6aa8 | ||
|
|
c508751f38 | ||
|
|
fbf4556d48 | ||
|
|
c9f290a1d4 | ||
|
|
5fb92c0a98 | ||
|
|
9af8561284 | ||
|
|
2e12c769f9 | ||
|
|
d89f009f14 | ||
|
|
1c29556f14 | ||
|
|
15697ae741 | ||
|
|
d2ffb82071 | ||
|
|
e8063936c9 | ||
|
|
0394eb22bf | ||
|
+2 |
7234e6bc10 | ||
|
|
26a50b1e05 | ||
|
|
00be583b89 | ||
|
|
8c9def769c | ||
|
|
213f313034 | ||
|
|
3aaad1e9bf | ||
|
|
55848db4ea | ||
|
|
0c83897f62 | ||
|
|
b6a6eae3cc | ||
|
|
f7b45fa04e | ||
|
|
82e5f53bc4 | ||
|
|
13c3083ac4 | ||
|
|
755cffe590 | ||
|
|
dd1141f9af | ||
|
|
968fdc3ebe | ||
|
|
2ef20589b7 | ||
|
|
6d63920c0a | ||
|
|
3ef378659e | ||
|
|
eba8f1c198 | ||
|
|
52f827e8f2 | ||
|
|
6063f40f87 | ||
|
|
6bd1b82a58 | ||
|
|
052892b396 | ||
|
|
3b12c5c926 | ||
|
|
02d2377ca5 | ||
|
|
9545005908 | ||
|
|
d93286bc1f | ||
|
|
50e7dbaa9d | ||
|
|
04961f0e9a | ||
|
|
37f8433c7c | ||
|
|
c81bb882c5 | ||
|
|
701cd880df | ||
|
|
3f0a3124f3 | ||
|
|
949032ee09 | ||
|
|
3c58d17aba | ||
|
|
07954bb20b | ||
|
|
275af27a81 | ||
|
|
c63d9ea7ac | ||
|
|
8518ea18a7 | ||
|
|
18aaf5a1b8 | ||
|
|
9543a81d76 | ||
|
|
13f00cf476 | ||
|
|
9e28754bb1 | ||
|
|
095d227a13 | ||
|
|
889a1a08f5 | ||
|
|
6d7eedc213 | ||
|
|
bfdfb2ca38 | ||
|
|
17c772e839 | ||
|
|
73b5161a67 | ||
|
|
95eb75ac77 | ||
|
+2 |
01fd5237f5 | ||
|
|
6fd7497c15 | ||
|
|
25616ca794 | ||
|
|
2a345172a3 | ||
|
|
8cb002259a | ||
|
|
436d9baba2 | ||
|
|
e417f6ac64 | ||
|
|
65ea87425c | ||
|
|
0aea03e418 | ||
|
|
d8b488bbc9 | ||
|
|
cb0ef6a6a2 | ||
|
|
c377290b27 | ||
|
|
35bddd69c5 | ||
|
|
34be385a5c | ||
|
|
79c9e130fd | ||
|
|
9c884e2f55 | ||
|
|
2e21b52b97 | ||
|
|
e3f44905ca | ||
|
|
c47927708a | ||
|
|
4c511f0310 | ||
|
|
b2728ec6f2 | ||
|
|
663759975d | ||
|
|
f1971ffe36 | ||
|
|
8b134bbb55 | ||
|
|
8a20aa5825 | ||
|
|
112863ecce | ||
|
|
863049dc0c | ||
|
|
802ba8c5a9 | ||
|
|
e36ebe2243 | ||
|
|
c52e3beac1 | ||
|
|
f0250a77cd | ||
|
|
d4be6479db | ||
|
|
c67b287764 | ||
|
|
7ac4e6ba4e | ||
|
|
c494db87cb | ||
|
|
1932d601c1 | ||
|
|
846a3503fe | ||
|
|
3e7f9cb946 | ||
|
|
83526c519a | ||
|
|
2e01627c99 | ||
|
|
7b52c6bba0 | ||
|
|
e024d78ed0 | ||
|
|
a2002d1637 | ||
|
|
607ab7e860 | ||
|
|
f27989741a | ||
|
|
b2be63ada4 | ||
|
|
eee200f8d4 | ||
|
|
817ab2249f | ||
|
|
173777ade4 | ||
|
|
838233075a | ||
|
|
cabfc29119 | ||
|
|
f02570db88 | ||
|
|
c6b025e844 | ||
|
|
332a14552b | ||
|
|
c894270401 | ||
|
|
595815dc3e | ||
|
|
b959cafccc | ||
|
|
4cf0aede0e | ||
|
|
6cf298a29a | ||
|
|
62b2508a6c | ||
|
|
c3967b798e | ||
|
|
588897d1b0 | ||
|
|
862905e161 | ||
|
|
5f81e246f2 | ||
|
|
1b052d63e9 | ||
|
|
a3f6878649 | ||
|
|
74a92dcb7d | ||
|
|
38fc0b796a | ||
|
|
ef76a96c2d | ||
|
|
2667706d8d | ||
|
|
047fbe2918 | ||
|
|
af01c63b45 | ||
|
|
3796204372 | ||
|
|
9c7fbc1603 | ||
|
|
156950423b | ||
|
|
f80f6307a3 | ||
|
|
5f243bba0d | ||
|
|
7d8697ec3f | ||
|
|
ab44b8f0ae | ||
|
|
ad135b67b9 | ||
|
|
5a648f7e74 | ||
|
|
e87292ab60 | ||
|
|
d5d7d542ce | ||
|
|
bc694a1823 | ||
|
|
553f7fda47 | ||
|
|
bc198e215e | ||
|
|
73e34c083c | ||
|
|
cc22fa84e5 | ||
|
|
58b9dbc17d | ||
|
|
8d2811dd13 | ||
|
|
7d74d30b9f | ||
|
|
f3a0154b5a | ||
|
|
10b71dd7a0 | ||
|
|
1ac06b9286 | ||
|
|
cff6ef2c97 | ||
|
|
574f180dde | ||
|
|
bac0c9b4a1 | ||
|
|
a11f27be4e | ||
|
|
e7528af48f | ||
|
|
a50d3b04f6 | ||
|
|
fb5c185319 | ||
|
|
a00917cca4 | ||
|
|
7bbf3e235e | ||
|
|
abc0a53dc3 | ||
|
|
38ea61c649 | ||
|
|
652275834e | ||
|
|
64f05ad040 | ||
|
|
b5337bcfc3 | ||
|
|
2348417114 | ||
|
|
e6a2407ee5 | ||
|
|
b2a493f748 | ||
|
|
440f5f1b9e | ||
|
|
42d7510daf | ||
|
|
73a374aac2 | ||
|
|
4bb65cf8be | ||
|
|
7bcecc5628 | ||
|
|
e13b0d8cf3 | ||
|
|
db50b2fcc5 | ||
|
|
23820b2771 | ||
|
|
a4722053bd | ||
|
|
b33d13161c | ||
|
|
fa637c2e3c | ||
|
|
3137e45bb8 | ||
|
|
ed4ad8658e | ||
|
|
9e6b3e5764 | ||
|
|
94a699caae | ||
|
|
ecd82b4619 | ||
|
|
c44d6f2f9d | ||
|
|
ca70cd3882 | ||
|
|
0f9a7b2571 | ||
|
|
d33227ab2b | ||
|
|
53786fc306 | ||
|
|
f85806c067 | ||
|
|
0155adcea4 | ||
|
|
74d76ff580 | ||
|
|
537e5e063d | ||
|
|
a86478bf24 | ||
|
|
09de55f13c | ||
|
|
23d0e55308 | ||
|
|
185093c185 | ||
|
|
77400fcf21 | ||
|
|
6a41fe9829 | ||
|
|
0092e2a317 | ||
|
|
87b9e6d42d | ||
|
|
336dfd3b37 | ||
|
|
957c75a36e | ||
|
|
357886e31b | ||
|
|
330c270f3c | ||
|
|
9096bdc0f1 | ||
|
|
62ef83c9e0 | ||
|
|
1e7a7a5f3c | ||
|
|
433d49e3ab | ||
|
|
5a3f7fa123 | ||
|
|
3857cba8ab | ||
|
|
6a3cacb622 |
@@ -16,9 +16,6 @@
|
||||
"baseBranch": "main",
|
||||
"updateInternalDependencies": "patch",
|
||||
"ignore": [
|
||||
"e2e-cra-5",
|
||||
"e2e-next-13",
|
||||
"e2e-vite-3",
|
||||
"bundlers-esbuild",
|
||||
"bundlers-vite",
|
||||
"bundlers-webpack",
|
||||
|
||||
+2
-1
@@ -3,4 +3,5 @@
|
||||
|
||||
# used for unit tests that hit real IPFS gateway
|
||||
# get a secret key from https://thirdweb.com/create-api-key
|
||||
TW_SECRET_KEY=""
|
||||
# Learn more about API keys. https://portal.thirdweb.com/account/api-keys
|
||||
TW_SECRET_KEY=""
|
||||
|
||||
+39
-15
@@ -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
|
||||
|
||||
@@ -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"
|
||||
|
||||
|
||||
@@ -22,13 +22,13 @@ We use [Turborepo](https://turborepo.org/docs/getting-started) to manage the mon
|
||||
|
||||
You can see a quick outline of each of the projects within this repo below, each living within the [/packages](/packages) directory:
|
||||
|
||||
| Package | Description | Latest Version |
|
||||
| ------------------------------ | -------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| [/sdk](./packages/sdk) | Best in class web3 SDK for Browser, Node and Mobile apps | <a href="https://www.npmjs.com/package/@thirdweb-dev/sdk"><img src="https://img.shields.io/npm/v/@thirdweb-dev/sdk?color=red&label=npm&logo=npm" alt="npm version"/></a> |
|
||||
| [/react](./packages/react) | Ultimate collection of React hooks for your web3 apps | <a href="https://www.npmjs.com/package/@thirdweb-dev/react"><img src="https://img.shields.io/npm/v/@thirdweb-dev/react?color=red&label=npm&logo=npm" alt="npm version"/></a> |
|
||||
| [/auth](./packages/auth) | Best in class wallet authentication for Node backends | <a href="https://www.npmjs.com/package/@thirdweb-dev/auth"><img src="https://img.shields.io/npm/v/@thirdweb-dev/auth?color=red&label=npm&logo=npm" alt="npm version"/></a> |
|
||||
| [/storage](./packages/storage) | Best in class decentralized storage SDK for Browser and Node | <a href="https://www.npmjs.com/package/@thirdweb-dev/storage"><img src="https://img.shields.io/npm/v/@thirdweb-dev/storage?color=red&label=npm&logo=npm" alt="npm version"/></a> |
|
||||
| [/cli](./packages/cli) | Publish and deploy smart contracts without dealing with private keys | <a href="https://www.npmjs.com/package/thirdweb"><img src="https://img.shields.io/npm/v/thirdweb?color=red&label=npm&logo=npm" alt="npm version"/></a> |
|
||||
| Package | Description | Latest Version |
|
||||
| ------------------------------------- | -------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| [/sdk](./legacy_packages/sdk) | Best in class web3 SDK for Browser, Node and Mobile apps | <a href="https://www.npmjs.com/package/@thirdweb-dev/sdk"><img src="https://img.shields.io/npm/v/@thirdweb-dev/sdk?color=red&label=npm&logo=npm" alt="npm version"/></a> |
|
||||
| [/react](./legacy_packages/react) | Ultimate collection of React hooks for your web3 apps | <a href="https://www.npmjs.com/package/@thirdweb-dev/react"><img src="https://img.shields.io/npm/v/@thirdweb-dev/react?color=red&label=npm&logo=npm" alt="npm version"/></a> |
|
||||
| [/auth](./legacy_packages/auth) | Best in class wallet authentication for Node backends | <a href="https://www.npmjs.com/package/@thirdweb-dev/auth"><img src="https://img.shields.io/npm/v/@thirdweb-dev/auth?color=red&label=npm&logo=npm" alt="npm version"/></a> |
|
||||
| [/storage](./legacy_packages/storage) | Best in class decentralized storage SDK for Browser and Node | <a href="https://www.npmjs.com/package/@thirdweb-dev/storage"><img src="https://img.shields.io/npm/v/@thirdweb-dev/storage?color=red&label=npm&logo=npm" alt="npm version"/></a> |
|
||||
| [/cli](./legacy_packages/cli) | Publish and deploy smart contracts without dealing with private keys | <a href="https://www.npmjs.com/package/thirdweb"><img src="https://img.shields.io/npm/v/thirdweb?color=red&label=npm&logo=npm" alt="npm version"/></a> |
|
||||
|
||||
## How to contribute
|
||||
|
||||
|
||||
@@ -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"
|
||||
|
||||
@@ -11,3 +11,9 @@ Short description of the bug fixed or feature added
|
||||
|
||||
- [ ] Automated tests: link to unit test file
|
||||
- [ ] Manual tests: step by step instructions on how to test
|
||||
|
||||
## Contributor NFT
|
||||
|
||||
Paste in your wallet address below and we will airdrop you a special NFT when your pull request is merged.
|
||||
|
||||
```Address: ```
|
||||
|
||||
@@ -0,0 +1,130 @@
|
||||
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
|
||||
|
||||
- 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
|
||||
|
||||
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
|
||||
@@ -0,0 +1,97 @@
|
||||
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
|
||||
|
||||
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 }}
|
||||
@@ -1,157 +0,0 @@
|
||||
name: Build, Lint & Test
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: ["main"]
|
||||
pull_request:
|
||||
types: [opened, synchronize]
|
||||
# trigger on merge group as well (merge queue)
|
||||
merge_group:
|
||||
types: [checks_requested]
|
||||
|
||||
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 }}
|
||||
|
||||
- run: pnpm test
|
||||
|
||||
- name: Upload coverage reports to Codecov
|
||||
uses: codecov/codecov-action@v3
|
||||
with:
|
||||
files: ./packages/sdk/coverage/evm/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 }}
|
||||
@@ -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
|
||||
|
||||
@@ -10,21 +10,27 @@ on:
|
||||
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.ref }}
|
||||
# cancel any previous runs if they were started before this one
|
||||
cancel-in-progress: true
|
||||
|
||||
env:
|
||||
TURBO_TOKEN: ${{ secrets.TURBO_TOKEN }}
|
||||
TURBO_TEAM: ${{ secrets.TURBO_TEAM }}
|
||||
TW_SECRET_KEY: ${{ secrets.TW_SECRET_KEY }}
|
||||
|
||||
jobs:
|
||||
release-artifacts:
|
||||
timeout-minutes: 15
|
||||
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
|
||||
@@ -37,7 +43,7 @@ jobs:
|
||||
|
||||
- name: Generate Docs
|
||||
run: |
|
||||
cd packages/sdk
|
||||
cd legacy_packages/sdk
|
||||
pnpm generate-docs
|
||||
cd ../react-core
|
||||
pnpm generate-docs
|
||||
@@ -53,12 +59,13 @@ jobs:
|
||||
git config --local user.email "[email protected]"
|
||||
git config --local user.name "GitHub Action"
|
||||
git status
|
||||
git add packages/react/typedoc/documentation.json.gz
|
||||
git add packages/react-core/typedoc/documentation.json.gz
|
||||
git add packages/react-native/typedoc/documentation.json.gz
|
||||
git add packages/sdk/typedoc/documentation.json.gz
|
||||
git add packages/storage/typedoc/documentation.json.gz
|
||||
git add packages/wallets/typedoc/documentation.json.gz
|
||||
git add legacy_packages/react/typedoc/documentation.json.gz
|
||||
git add legacy_packages/react-core/typedoc/documentation.json.gz
|
||||
git add legacy_packages/react-native/typedoc/documentation.json.gz
|
||||
git add legacy_packages/sdk/typedoc/documentation.json.gz
|
||||
git add legacy_packages/storage/typedoc/documentation.json.gz
|
||||
git add legacy_packages/wallets/typedoc/documentation.json.gz
|
||||
git add packages/thirdweb/typedoc/documentation.json.gz
|
||||
git add snippets/feature_snippets_react.json
|
||||
git add snippets/feature_snippets_sdk.json
|
||||
git add snippets/snippets.json
|
||||
|
||||
@@ -1,47 +0,0 @@
|
||||
name: Release Next
|
||||
|
||||
on:
|
||||
push:
|
||||
paths:
|
||||
- ".changeset/**"
|
||||
- "packages/**"
|
||||
branches:
|
||||
- next
|
||||
|
||||
env:
|
||||
TURBO_TOKEN: ${{ secrets.TURBO_TOKEN }}
|
||||
TURBO_TEAM: ${{ secrets.TURBO_TEAM }}
|
||||
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.ref }}
|
||||
|
||||
jobs:
|
||||
release:
|
||||
name: Release
|
||||
timeout-minutes: 30
|
||||
runs-on: ubuntu-latest-16
|
||||
steps:
|
||||
- name: Checkout branch
|
||||
uses: actions/checkout@v3
|
||||
with:
|
||||
fetch-depth: 0
|
||||
|
||||
- name: Setup bun
|
||||
uses: oven-sh/setup-bun@v1
|
||||
with:
|
||||
bun-version: 1.0.21
|
||||
|
||||
- name: Install
|
||||
uses: ./.github/composite-actions/install
|
||||
|
||||
- name: Build
|
||||
run: pnpm build
|
||||
|
||||
- name: Create @next release
|
||||
run: |
|
||||
git checkout next
|
||||
pnpm version-packages:next
|
||||
pnpm release:next
|
||||
env:
|
||||
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
@@ -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.2.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
|
||||
|
||||
@@ -8,6 +8,7 @@ on:
|
||||
paths:
|
||||
- ".changeset/**"
|
||||
- "packages/**"
|
||||
- "legacy_packages/**"
|
||||
branches:
|
||||
- main
|
||||
|
||||
@@ -25,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
|
||||
@@ -34,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
|
||||
|
||||
@@ -10,16 +10,16 @@ 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
|
||||
working-directory: ./packages/chains
|
||||
working-directory: ./legacy_packages/chains
|
||||
|
||||
- name: Check for Changes
|
||||
id: git-check
|
||||
@@ -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"
|
||||
|
||||
+2
-2
@@ -10,7 +10,7 @@ dist-ssr
|
||||
.cache
|
||||
server/dist
|
||||
public/dist
|
||||
./packages/contracts-js/abis
|
||||
./legacy_packages/contracts-js/abis
|
||||
.idea/
|
||||
.yalc/
|
||||
yalc.lock
|
||||
@@ -20,4 +20,4 @@ playwright-report/
|
||||
.env/
|
||||
|
||||
# Artifacts
|
||||
packages/cli/artifacts/
|
||||
legacy_packages/cli/artifacts/
|
||||
@@ -1,53 +1,70 @@
|
||||
<p align="center">
|
||||
<br />
|
||||
<a href="https://thirdweb.com">
|
||||
<img src="https://github.com/thirdweb-dev/js/blob/main/packages/sdk/logo.svg?raw=true" width="200" alt=""/></a>
|
||||
<img src="https://github.com/thirdweb-dev/js/blob/main/legacy_packages/sdk/logo.svg?raw=true" width="200" alt=""/></a>
|
||||
<br />
|
||||
</p>
|
||||
|
||||
<h1 align="center"><a href='https://thirdweb.com/'>thirdweb</a> JavaScript/TypeScript monorepo</h1>
|
||||
<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"/>
|
||||
</a>
|
||||
</p>
|
||||
|
||||
<p align="center"><strong>Best in class web3 SDKs for Browser, Node and Mobile apps</strong></p>
|
||||
<p align="center"><strong>All-in-one web3 SDK for Browser, Node and Mobile apps</strong></p>
|
||||
|
||||
## Packages
|
||||
## Features
|
||||
|
||||
| Package | Description | Latest Version |
|
||||
| ---------------------------------------- | --------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
||||
| [/sdk](./packages/sdk) | Best in class web3 SDK for Browser, Node and Mobile apps | <a href="https://www.npmjs.com/package/@thirdweb-dev/sdk"><img src="https://img.shields.io/npm/v/@thirdweb-dev/sdk?color=red&label=npm&logo=npm" alt="npm version"/></a> |
|
||||
| [/wallets](./packages/wallets) | Unified web3 Wallet library to integrate any wallet into your applications. | <a href="https://www.npmjs.com/package/@thirdweb-dev/wallets"><img src="https://img.shields.io/npm/v/@thirdweb-dev/wallets?color=red&label=npm&logo=npm" alt="npm version"/></a> |
|
||||
| [/react](./packages/react) | Ultimate collection of React hooks for your web3 apps | <a href="https://www.npmjs.com/package/@thirdweb-dev/react"><img src="https://img.shields.io/npm/v/@thirdweb-dev/react?color=red&label=npm&logo=npm" alt="npm version"/></a> |
|
||||
| [/react-native](./packages/react-native) | Ultimate collection of React hooks for your native mobile web3 apps | <a href="https://www.npmjs.com/package/@thirdweb-dev/react-native"><img src="https://img.shields.io/npm/v/@thirdweb-dev/react-native?color=red&label=npm&logo=npm" alt="npm version"/></a> |
|
||||
| [/auth](./packages/auth) | Best in class wallet authentication for Node backends | <a href="https://www.npmjs.com/package/@thirdweb-dev/auth"><img src="https://img.shields.io/npm/v/@thirdweb-dev/auth?color=red&label=npm&logo=npm" alt="npm version"/></a> |
|
||||
| [/storage](./packages/storage) | Best in class decentralized storage SDK for Browser and Node | <a href="https://www.npmjs.com/package/@thirdweb-dev/storage"><img src="https://img.shields.io/npm/v/@thirdweb-dev/storage?color=red&label=npm&logo=npm" alt="npm version"/></a> |
|
||||
| [/cli](./packages/cli) | Publish and deploy smart contracts without dealing with private keys | <a href="https://www.npmjs.com/package/thirdweb"><img src="https://img.shields.io/npm/v/thirdweb?color=red&label=npm&logo=npm" alt="npm version"/></a> |
|
||||
| [/chains](./packages/chains) | All EVM chain information as JS objects for easy handling | <a href="https://www.npmjs.com/package/@thirdweb-dev/chains"><img src="https://img.shields.io/npm/v/@thirdweb-dev/chains?color=red&label=npm&logo=npm" alt="npm version"/></a> |
|
||||
- Support for React & React-Native
|
||||
- First party support for [Embedded Wallets](https://portal.thirdweb.com/connect/embedded-wallet/overview) (social/email login)
|
||||
- First party support for [Account Abstraction](https://portal.thirdweb.com/connect/account-abstraction)
|
||||
- Instant connection to any chain with RPC Edge integration
|
||||
- Integrated IPFS upload/download
|
||||
- UI Components for connection, transactions, nft rendering
|
||||
- High level contract extensions for interacting with common standards
|
||||
- Automatic ABI resolution
|
||||
|
||||
## Documentation
|
||||
## Library Comparison
|
||||
|
||||
Visit [https://portal.thirdweb.com/](https://portal.thirdweb.com/) to view the full documentation.
|
||||
|
||||
<br />
|
||||
| | thirdweb | Wagmi | Viem | Ethers@6 |
|
||||
| ----------------------------------------- | -------- | ------------------ | ------------------ | -------- |
|
||||
| Type safe contract API | ✅ | ✅ | ✅ | ✅ |
|
||||
| Type safe wallet API | ✅ | ✅ | ✅ | ✅ |
|
||||
| EVM utils | ✅ | ❌ | ✅ | ✅ |
|
||||
| RPC for any EVM | ✅ | ⚠️ public RPC only | ⚠️ public RPC only | ❌ |
|
||||
| Automatic ABI Resolution | ✅ | ❌ | ❌ | ❌ |
|
||||
| IPFS Upload/Download | ✅ | ❌ | ❌ | ❌ |
|
||||
| Embedded wallet (email/ social login) | ✅ | ⚠️ via 3rd party | ❌ | ❌ |
|
||||
| Account abstraction (ERC4337) support | ✅ | ⚠️ via 3rd party | ⚠️ via 3rd party | ❌ |
|
||||
| Web3 wallet connectors | ✅ | ✅ | ❌ | ❌ |
|
||||
| Local wallet creation | ✅ | ❌ | ✅ | ✅ |
|
||||
| Auth (SIWE) | ✅ | ⚠️ via 3rd party | ❌ | ❌ |
|
||||
| Extensions functions for common standards | ✅ | ❌ | ❌ | ❌ |
|
||||
| React Hooks | ✅ | ✅ | ❌ | ❌ |
|
||||
| React UI components | ✅ | ❌ | ❌ | ❌ |
|
||||
| React Native Hooks | ✅ | ❌ | ❌ | ❌ |
|
||||
| React Native UI Components | ✅ | ❌ | ❌ | ❌ |
|
||||
|
||||
## 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) where you'll learn how the repo works, how to test your changes, and how to submit a pull request.
|
||||
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.
|
||||
|
||||
<br />
|
||||
See our [open source page](https://thirdweb.com/open-source) for more information on our open-source bounties and program.
|
||||
|
||||
## Community
|
||||
## Additional Resources
|
||||
|
||||
The best place to discuss your ideas, ask questions, and troubleshoot issues is our [Discord server](https://discord.gg/thirdweb).
|
||||
- [Documentation](https://portal.thirdweb.com/typescript/v5)
|
||||
- [Templates](https://thirdweb.com/templates)
|
||||
- [YouTube](https://www.youtube.com/c/thirdweb)
|
||||
|
||||
<br/>
|
||||
## Support
|
||||
|
||||
For help or feedback, please [visit our support site](https://thirdweb.com/support)
|
||||
|
||||
## Security
|
||||
|
||||
|
||||
@@ -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.11",
|
||||
"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": "^3.2.8"
|
||||
"vite": "^5.2.7"
|
||||
}
|
||||
}
|
||||
@@ -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);
|
||||
-1
@@ -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);
|
||||
@@ -1,5 +1,193 @@
|
||||
# @thirdweb-dev/auth
|
||||
|
||||
## 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
|
||||
|
||||
- Updated dependencies [[`13f00cf`](https://github.com/thirdweb-dev/js/commit/13f00cf476b126683649a166e9e03b8e3f6599e4)]:
|
||||
- @thirdweb-dev/wallets@2.4.27
|
||||
|
||||
## 4.1.48
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies []:
|
||||
- @thirdweb-dev/wallets@2.4.26
|
||||
|
||||
## 4.1.47
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies []:
|
||||
- @thirdweb-dev/wallets@2.4.25
|
||||
|
||||
## 4.1.46
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [[`79c9e13`](https://github.com/thirdweb-dev/js/commit/79c9e130fdc6e1f7de1486894a5ac3e6d6776fa4)]:
|
||||
- @thirdweb-dev/wallets@2.4.24
|
||||
|
||||
## 4.1.45
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [[`802ba8c`](https://github.com/thirdweb-dev/js/commit/802ba8c5a980d3bddd308f9b3d14cc9cbb5453d5)]:
|
||||
- @thirdweb-dev/wallets@2.4.23
|
||||
|
||||
## 4.1.44
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies []:
|
||||
- @thirdweb-dev/wallets@2.4.22
|
||||
|
||||
## 4.1.43
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies []:
|
||||
- @thirdweb-dev/wallets@2.4.21
|
||||
|
||||
## 4.1.42
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies []:
|
||||
- @thirdweb-dev/wallets@2.4.20
|
||||
|
||||
## 4.1.41
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies []:
|
||||
- @thirdweb-dev/wallets@2.4.19
|
||||
|
||||
## 4.1.40
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [[`cabfc29`](https://github.com/thirdweb-dev/js/commit/cabfc29119f25a78010f59f766bdcb8c392afa2d)]:
|
||||
- @thirdweb-dev/wallets@2.4.18
|
||||
|
||||
## 4.1.39
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [[`c894270`](https://github.com/thirdweb-dev/js/commit/c894270401850575d1a4df73e16198177b46477a), [`332a145`](https://github.com/thirdweb-dev/js/commit/332a14552bf95e13e5220b1bd73414f000088568)]:
|
||||
- @thirdweb-dev/wallets@2.4.17
|
||||
|
||||
## 4.1.38
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- [#2417](https://github.com/thirdweb-dev/js/pull/2417) [`862905e`](https://github.com/thirdweb-dev/js/commit/862905e161a091c15eb9b054cfcca0e5d2879fd6) Thanks [@jnsdls](https://github.com/jnsdls)! - make verify login payload be self-sufficient
|
||||
|
||||
- Updated dependencies [[`862905e`](https://github.com/thirdweb-dev/js/commit/862905e161a091c15eb9b054cfcca0e5d2879fd6)]:
|
||||
- @thirdweb-dev/wallets@2.4.16
|
||||
|
||||
## 4.1.37
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [[`74a92dc`](https://github.com/thirdweb-dev/js/commit/74a92dcb7dc4be7d03bcb8b7211e87016f52a81f)]:
|
||||
- @thirdweb-dev/wallets@2.4.15
|
||||
|
||||
## 4.1.36
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [[`ab44b8f`](https://github.com/thirdweb-dev/js/commit/ab44b8f0ae760065f400f76d69703e26bcbcc022), [`f80f630`](https://github.com/thirdweb-dev/js/commit/f80f6307a3ebe1adaaf072dd2e02aecf83bfa43f)]:
|
||||
- @thirdweb-dev/wallets@2.4.14
|
||||
|
||||
## 4.1.35
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies []:
|
||||
- @thirdweb-dev/wallets@2.4.13
|
||||
|
||||
## 4.1.34
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [[`73e34c0`](https://github.com/thirdweb-dev/js/commit/73e34c083cd9c0d634e39657a4fad0f49f6fec89), [`e7528af`](https://github.com/thirdweb-dev/js/commit/e7528af48ff2dda622ed47074611499cfd66f819), [`10b71dd`](https://github.com/thirdweb-dev/js/commit/10b71dd7a0c6e91bb1ebe8250ca7fac7bac76635), [`bc198e2`](https://github.com/thirdweb-dev/js/commit/bc198e215e57094aac525b262fe91add4786df92)]:
|
||||
- @thirdweb-dev/wallets@2.4.12
|
||||
|
||||
## 4.1.33
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [[`23820b2`](https://github.com/thirdweb-dev/js/commit/23820b277118ae0845d4f0189ac58ef4e75896ba), [`73a374a`](https://github.com/thirdweb-dev/js/commit/73a374aac25c2396dd2a895629737c6e8d024f45)]:
|
||||
- @thirdweb-dev/wallets@2.4.11
|
||||
|
||||
## 4.1.32
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies []:
|
||||
- @thirdweb-dev/wallets@2.4.10
|
||||
|
||||
## 4.1.31
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- [#2278](https://github.com/thirdweb-dev/js/pull/2278) [`0092e2a3`](https://github.com/thirdweb-dev/js/commit/0092e2a3177364ad26af15ecafb4381591dc9be1) Thanks [@hsynlms](https://github.com/hsynlms)! - fix(auth): Next.js App Router handler return type
|
||||
|
||||
- Updated dependencies []:
|
||||
- @thirdweb-dev/wallets@2.4.9
|
||||
|
||||
## 4.1.30
|
||||
|
||||
### Patch Changes
|
||||
@@ -1,6 +1,6 @@
|
||||
<p align="center">
|
||||
<br />
|
||||
<a href="https://thirdweb.com"><img src="https://github.com/thirdweb-dev/js/blob/main/packages/sdk/logo.svg?raw=true" width="200" alt=""/></a>
|
||||
<a href="https://thirdweb.com"><img src="https://github.com/thirdweb-dev/js/blob/main/legacy_packages/sdk/logo.svg?raw=true" width="200" alt=""/></a>
|
||||
<br />
|
||||
</p>
|
||||
<h1 align="center">thirdweb Auth</h1>
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@thirdweb-dev/auth",
|
||||
"version": "4.1.30",
|
||||
"version": "4.1.56",
|
||||
"main": "dist/thirdweb-dev-auth.cjs.js",
|
||||
"module": "dist/thirdweb-dev-auth.esm.js",
|
||||
"browser": {
|
||||
@@ -51,17 +51,17 @@
|
||||
},
|
||||
"./package.json": "./package.json"
|
||||
},
|
||||
"repository": "https://github.com/thirdweb-dev/js/tree/main/packages/auth",
|
||||
"repository": "https://github.com/thirdweb-dev/js/tree/main/legacy_packages/auth",
|
||||
"author": "thirdweb eng <[email protected]>",
|
||||
"license": "Apache-2.0",
|
||||
"sideEffects": false,
|
||||
"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 30000 --parallel './test/**/*.test.ts'",
|
||||
"test": "vitest",
|
||||
"push": "yalc push"
|
||||
},
|
||||
"preconstruct": {
|
||||
@@ -80,48 +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.11",
|
||||
"@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",
|
||||
"@typescript-eslint/eslint-plugin": "^6.2.0",
|
||||
"@typescript-eslint/parser": "^6.19.1",
|
||||
"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-config-prettier": "^8.9.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.2.0",
|
||||
"next": "^13.4",
|
||||
"next-auth": "^4.22.3",
|
||||
"prettier": "^3.1.1",
|
||||
"typescript": "^5.3.3"
|
||||
"express": "^4.19.2",
|
||||
"fastify": "^4.26.2",
|
||||
"next": "^13.5.6",
|
||||
"next-auth": "^4.24.7",
|
||||
"typescript": "5.4.3"
|
||||
},
|
||||
"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": {
|
||||
@@ -145,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"
|
||||
@@ -23,14 +23,21 @@ import {
|
||||
AuthenticateOptionsWithOptionalDomain,
|
||||
AuthenticationPayload,
|
||||
} from "./schema/authenticate";
|
||||
import { ThirdwebAuthOptions } from "./types";
|
||||
|
||||
export class ThirdwebAuth {
|
||||
private domain: string;
|
||||
private wallet: GenericAuthWallet;
|
||||
private options: ThirdwebAuthOptions;
|
||||
|
||||
constructor(wallet: GenericAuthWallet, domain: string) {
|
||||
constructor(
|
||||
wallet: GenericAuthWallet,
|
||||
domain: string,
|
||||
options: ThirdwebAuthOptions = {},
|
||||
) {
|
||||
this.wallet = wallet;
|
||||
this.domain = domain;
|
||||
this.options = options;
|
||||
}
|
||||
|
||||
public updateWallet(wallet: GenericAuthWallet) {
|
||||
@@ -66,9 +73,9 @@ export class ThirdwebAuth {
|
||||
options?: VerifyOptionsWithOptionalDomain,
|
||||
): Promise<string> {
|
||||
return verifyLoginPayload({
|
||||
wallet: this.wallet,
|
||||
payload,
|
||||
options: this.formatOptions(options),
|
||||
clientOptions: this.options,
|
||||
});
|
||||
}
|
||||
|
||||
@@ -80,6 +87,7 @@ export class ThirdwebAuth {
|
||||
wallet: this.wallet,
|
||||
payload,
|
||||
options: this.formatOptions(options),
|
||||
clientOptions: this.options,
|
||||
});
|
||||
}
|
||||
|
||||
@@ -99,6 +107,7 @@ export class ThirdwebAuth {
|
||||
wallet: this.wallet,
|
||||
jwt,
|
||||
options: this.formatOptions(options),
|
||||
clientOptions: this.options,
|
||||
});
|
||||
}
|
||||
|
||||
+7
-2
@@ -14,6 +14,7 @@ import {
|
||||
import { GenerateOptionsSchema } from "../schema/generate";
|
||||
import { RefreshOptionsSchema } from "../schema/refresh";
|
||||
import { verifyLoginPayload } from "./login";
|
||||
import { verifySignature } from "./verify-signature";
|
||||
|
||||
function isBrowser() {
|
||||
return typeof window !== "undefined";
|
||||
@@ -71,15 +72,16 @@ export async function generateJWT({
|
||||
wallet,
|
||||
payload,
|
||||
options,
|
||||
clientOptions,
|
||||
}: GenerateJwtParams): Promise<string> {
|
||||
const parsedOptions = GenerateOptionsSchema.parse(options);
|
||||
const userAddress = await verifyLoginPayload({
|
||||
wallet,
|
||||
payload,
|
||||
options: {
|
||||
domain: parsedOptions.domain,
|
||||
...parsedOptions.verifyOptions,
|
||||
},
|
||||
clientOptions,
|
||||
});
|
||||
|
||||
let session: Json | undefined = undefined;
|
||||
@@ -156,6 +158,7 @@ export async function authenticateJWT<TSession extends Json = Json>({
|
||||
wallet,
|
||||
jwt,
|
||||
options,
|
||||
clientOptions,
|
||||
}: AuthenticateJwtParams): Promise<User<TSession>> {
|
||||
const parsedOptions = AuthenticateOptionsSchema.parse(options);
|
||||
const { payload, signature } = parseJWT(jwt);
|
||||
@@ -210,11 +213,13 @@ export async function authenticateJWT<TSession extends Json = Json>({
|
||||
}
|
||||
}
|
||||
|
||||
const verified = await wallet.verifySignature(
|
||||
const verified = await verifySignature(
|
||||
JSON.stringify(payload),
|
||||
signature,
|
||||
issuerAddress,
|
||||
chainId,
|
||||
clientOptions.clientId,
|
||||
clientOptions.secretKey,
|
||||
);
|
||||
if (!verified) {
|
||||
throw new Error(
|
||||
+10
-12
@@ -10,6 +10,7 @@ import {
|
||||
LoginPayloadDataSchema,
|
||||
} from "../schema/login";
|
||||
import { VerifyOptionsSchema } from "../schema/verify";
|
||||
import { verifySignature } from "./verify-signature";
|
||||
|
||||
/**
|
||||
* Create an EIP-4361 & CAIP-122 compliant message to sign based on the login payload
|
||||
@@ -113,18 +114,12 @@ export async function buildAndSignLoginPayload({
|
||||
}
|
||||
|
||||
export async function verifyLoginPayload({
|
||||
wallet,
|
||||
payload,
|
||||
options,
|
||||
clientOptions,
|
||||
}: VerifyLoginPayloadParams): Promise<string> {
|
||||
const parsedOptions = VerifyOptionsSchema.parse(options);
|
||||
|
||||
if (payload.payload.type !== wallet.type) {
|
||||
throw new Error(
|
||||
`Expected chain type '${wallet.type}' does not match chain type on payload '${payload.payload.type}'`,
|
||||
);
|
||||
}
|
||||
|
||||
// Check that the intended domain matches the domain of the payload
|
||||
if (payload.payload.domain !== parsedOptions.domain) {
|
||||
throw new Error(
|
||||
@@ -204,16 +199,19 @@ export async function verifyLoginPayload({
|
||||
|
||||
// Check that the signing address is the claimed wallet address
|
||||
const message = createLoginMessage(payload.payload);
|
||||
const chainId =
|
||||
wallet.type === "evm" && payload.payload.chain_id
|
||||
? parseInt(payload.payload.chain_id)
|
||||
: undefined;
|
||||
const verified = await wallet.verifySignature(
|
||||
const chainId = payload.payload.chain_id
|
||||
? parseInt(payload.payload.chain_id)
|
||||
: undefined;
|
||||
|
||||
const verified = await verifySignature(
|
||||
message,
|
||||
payload.signature,
|
||||
payload.payload.address,
|
||||
chainId,
|
||||
clientOptions?.clientId,
|
||||
clientOptions?.secretKey,
|
||||
);
|
||||
|
||||
if (!verified) {
|
||||
throw new Error(
|
||||
`Signer address does not match payload address '${payload.payload.address.toLowerCase()}'`,
|
||||
@@ -0,0 +1,35 @@
|
||||
import { checkContractWalletSignature } from "@thirdweb-dev/wallets";
|
||||
import { utils } from "ethers";
|
||||
|
||||
export async function verifySignature(
|
||||
message: string,
|
||||
signature: string,
|
||||
address: string,
|
||||
chainId?: number,
|
||||
clientId?: string,
|
||||
secretKey?: string,
|
||||
): Promise<boolean> {
|
||||
try {
|
||||
const messageHash = utils.hashMessage(message);
|
||||
const messageHashBytes = utils.arrayify(messageHash);
|
||||
const recoveredAddress = utils.recoverAddress(messageHashBytes, signature);
|
||||
|
||||
if (recoveredAddress === address) {
|
||||
return true;
|
||||
}
|
||||
} catch {
|
||||
// no-op
|
||||
}
|
||||
|
||||
if (!chainId) {
|
||||
return false;
|
||||
}
|
||||
return checkContractWalletSignature(
|
||||
message,
|
||||
signature,
|
||||
address,
|
||||
chainId,
|
||||
clientId,
|
||||
secretKey,
|
||||
);
|
||||
}
|
||||
+4
-1
@@ -7,6 +7,7 @@ import {
|
||||
} from "./authenticate";
|
||||
import { RefreshOptions } from "./refresh";
|
||||
import { GenerateOptions } from "./generate";
|
||||
import { ThirdwebAuthOptions } from "../types";
|
||||
|
||||
export type BuildLoginPayloadParams = {
|
||||
wallet: GenericAuthWallet;
|
||||
@@ -19,9 +20,9 @@ export type SignLoginPayloadParams = {
|
||||
};
|
||||
|
||||
export type VerifyLoginPayloadParams = {
|
||||
wallet: GenericAuthWallet;
|
||||
payload: LoginPayload;
|
||||
options: VerifyOptions;
|
||||
clientOptions: ThirdwebAuthOptions;
|
||||
};
|
||||
|
||||
export type BuildJwtParams = {
|
||||
@@ -33,6 +34,7 @@ export type GenerateJwtParams = {
|
||||
wallet: GenericAuthWallet;
|
||||
payload: LoginPayload;
|
||||
options: GenerateOptions;
|
||||
clientOptions: ThirdwebAuthOptions;
|
||||
};
|
||||
|
||||
export type RefreshJwtParams = {
|
||||
@@ -45,4 +47,5 @@ export type AuthenticateJwtParams = {
|
||||
wallet: GenericAuthWallet;
|
||||
jwt: string;
|
||||
options: AuthenticateOptions;
|
||||
clientOptions: ThirdwebAuthOptions;
|
||||
};
|
||||
@@ -0,0 +1,4 @@
|
||||
export type ThirdwebAuthOptions = {
|
||||
clientId?: string;
|
||||
secretKey?: string;
|
||||
};
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user