Skip to content

Commit 6022891

Browse files
Merge branch 'main' into winston/cnct-2523-remapping-of-siwe-wallet-type-in-typescript-sdk
2 parents 5ec9943 + 4f19f77 commit 6022891

File tree

13 files changed

+179
-115
lines changed

13 files changed

+179
-115
lines changed

.changeset/silver-weeks-rescue.md

Lines changed: 0 additions & 5 deletions
This file was deleted.

.changeset/stupid-buses-wink.md

Lines changed: 0 additions & 41 deletions
This file was deleted.

.changeset/wild-games-vanish.md

Lines changed: 0 additions & 5 deletions
This file was deleted.

apps/portal/src/app/react-native/v5/getting-started/page.mdx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ npx expo install thirdweb @thirdweb-dev/react-native-adapter
3636
Since react native requires installing native dependencies directly, you also have to install these required peer dependencies:
3737

3838
```shell
39-
npx expo install react-native-get-random-values @react-native-community/netinfo expo-application @react-native-async-storage/async-storage expo-web-browser expo-linking react-native-aes-gcm-crypto react-native-quick-crypto amazon-cognito-identity-js @coinbase/wallet-mobile-sdk react-native-mmkv react-native-svg
39+
npx expo install react-native-get-random-values @react-native-community/netinfo expo-application @react-native-async-storage/async-storage expo-web-browser expo-linking react-native-aes-gcm-crypto react-native-quick-crypto amazon-cognito-identity-js @coinbase/wallet-mobile-sdk react-native-mmkv react-native-svg @walletconnect/react-native-compat react-native-passkey
4040
```
4141

4242
Here's an explanation of each peer dependency and why its needed:
@@ -168,13 +168,13 @@ npx expo prebuild
168168
Run the development build on ios:
169169

170170
```shell
171-
npx expo:run ios
171+
npx expo run:ios
172172
```
173173

174174
Run the development build on android:
175175

176176
```shell
177-
npx expo:run android
177+
npx expo run:android
178178
```
179179

180180
</Step>

apps/portal/src/app/react-native/v5/troubleshooting/page.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,11 @@ npx expo prebuild
1313
You can then run the development build using the following command:
1414

1515
```shell
16-
npx expo:run ios
16+
npx expo run:ios
1717
```
1818

1919
```shell
20-
npx expo:run android
20+
npx expo run:android
2121
```
2222

2323
## OpenSSL iOS build error

packages/react-native-adapter/CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
# @thirdweb-dev/react-native-adapter
22

3+
## 1.5.2
4+
5+
### Patch Changes
6+
7+
- [#5594](https://github.com/thirdweb-dev/js/pull/5594) [`b7c8854`](https://github.com/thirdweb-dev/js/commit/b7c885432726eeaf3401217573f2cff0f5247ff7) Thanks [@joaquim-verges](https://github.com/joaquim-verges)! - Support for Expo 52 and React Native 0.76
8+
39
## 1.5.1
410

511
### Patch Changes

packages/react-native-adapter/package.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@thirdweb-dev/react-native-adapter",
3-
"version": "1.5.1",
3+
"version": "1.5.2",
44
"repository": {
55
"type": "git",
66
"url": "git+https://github.com/thirdweb-dev/js.git#main"
@@ -31,8 +31,7 @@
3131
"@aws-sdk/client-kms": "3.699.0",
3232
"@aws-sdk/client-lambda": "3.699.0",
3333
"@aws-sdk/credential-providers": "3.699.0",
34-
"@mobile-wallet-protocol/client": "0.1.2",
35-
"@walletconnect/react-native-compat": "2.17.2"
34+
"@mobile-wallet-protocol/client": "0.1.2"
3635
},
3736
"devDependencies": {
3837
"rimraf": "6.0.1"
@@ -41,9 +40,10 @@
4140
"@coinbase/wallet-mobile-sdk": "^1",
4241
"@react-native-async-storage/async-storage": "^1 || ^2",
4342
"@react-native-community/netinfo": "^11",
44-
"expo-application": "^5",
43+
"@walletconnect/react-native-compat": "^2",
44+
"expo-application": "^5 || ^6",
4545
"expo-linking": "^6",
46-
"expo-web-browser": "^13",
46+
"expo-web-browser": "^13 || ^14",
4747
"react-native": ">=0.70",
4848
"react-native-aes-gcm-crypto": "^0.2",
4949
"react-native-get-random-values": "^1",

packages/thirdweb/CHANGELOG.md

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,60 @@
11
# thirdweb
22

3+
## 5.73.0
4+
5+
### Minor Changes
6+
7+
- [#5457](https://github.com/thirdweb-dev/js/pull/5457) [`57fa96b`](https://github.com/thirdweb-dev/js/commit/57fa96b268671f19c7f57fa2208fb83e2b0e75b5) Thanks [@kien-ngo](https://github.com/kien-ngo)! - Add 2 new Pay functions: convertFiatToCrypto and convertCryptoToFiat
8+
9+
Examples:
10+
11+
### Convert fiat (USD) to crypto
12+
13+
```ts
14+
import { convertFiatToCrypto } from "thirdweb/pay";
15+
import { ethereum } from "thirdweb/chains";
16+
17+
// Convert 2 cents to ETH
18+
const result = await convertFiatToCrypto({
19+
from: "USD",
20+
// the token address. For native token, use NATIVE_TOKEN_ADDRESS
21+
to: "0x...",
22+
// the chain (of the chain where the token belong to)
23+
chain: ethereum,
24+
// 2 cents
25+
fromAmount: 0.02,
26+
});
27+
// Result: 0.0000057 (a number)
28+
```
29+
30+
### Convert crypto to fiat (USD)
31+
32+
```ts
33+
import { convertCryptoToFiat } from "thirdweb/pay";
34+
35+
// Get Ethereum price
36+
const result = convertCryptoToFiat({
37+
fromTokenAddress: NATIVE_TOKEN_ADDRESS,
38+
to: "USD",
39+
chain: ethereum,
40+
fromAmount: 1,
41+
});
42+
43+
// Result: 3404.11 (number)
44+
```
45+
46+
### Patch Changes
47+
48+
- [#5594](https://github.com/thirdweb-dev/js/pull/5594) [`b7c8854`](https://github.com/thirdweb-dev/js/commit/b7c885432726eeaf3401217573f2cff0f5247ff7) Thanks [@joaquim-verges](https://github.com/joaquim-verges)! - Support for Expo 52 and React Native 0.76
49+
50+
- [#5595](https://github.com/thirdweb-dev/js/pull/5595) [`9b45aae`](https://github.com/thirdweb-dev/js/commit/9b45aae699c6f927816a415cabd61bb30bef72b1) Thanks [@ElasticBottle](https://github.com/ElasticBottle)! - Display error message when failing to fetch account status from endpoint outside of unauthorized requests
51+
52+
- [#5592](https://github.com/thirdweb-dev/js/pull/5592) [`c3d7b66`](https://github.com/thirdweb-dev/js/commit/c3d7b662c402f96696141070ea42b2e10d94e1f8) Thanks [@gregfromstl](https://github.com/gregfromstl)! - Properly updates active smart wallet when switching signer account on EOA wallet
53+
54+
- [#5577](https://github.com/thirdweb-dev/js/pull/5577) [`b117cb1`](https://github.com/thirdweb-dev/js/commit/b117cb19279a7807fc956e77ae144788112eec7f) Thanks [@joaquim-verges](https://github.com/joaquim-verges)! - Show warning when sponsorship policy rejects a transaction
55+
56+
- [#5531](https://github.com/thirdweb-dev/js/pull/5531) [`1e9a6c7`](https://github.com/thirdweb-dev/js/commit/1e9a6c7d8ae28012956b688f6e0af6f94c075181) Thanks [@joaquim-verges](https://github.com/joaquim-verges)! - Handle 0 value for maxPriorityFeePerGas in 712 transactions
57+
358
## 5.72.0
459

560
### Minor Changes

packages/thirdweb/package.json

Lines changed: 58 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "thirdweb",
3-
"version": "5.72.0",
3+
"version": "5.73.0",
44
"repository": {
55
"type": "git",
66
"url": "git+https://github.com/thirdweb-dev/js.git#main"
@@ -127,24 +127,60 @@
127127
},
128128
"typesVersions": {
129129
"*": {
130-
"adapters/*": ["./dist/types/exports/adapters/*.d.ts"],
131-
"auth": ["./dist/types/exports/auth.d.ts"],
132-
"chains": ["./dist/types/exports/chains.d.ts"],
133-
"contract": ["./dist/types/exports/contract.d.ts"],
134-
"deploys": ["./dist/types/exports/deploys.d.ts"],
135-
"event": ["./dist/types/exports/event.d.ts"],
136-
"extensions/*": ["./dist/types/exports/extensions/*.d.ts"],
137-
"pay": ["./dist/types/exports/pay.d.ts"],
138-
"react": ["./dist/types/exports/react.d.ts"],
139-
"react-native": ["./dist/types/exports/react-native.d.ts"],
140-
"rpc": ["./dist/types/exports/rpc.d.ts"],
141-
"storage": ["./dist/types/exports/storage.d.ts"],
142-
"transaction": ["./dist/types/exports/transaction.d.ts"],
143-
"utils": ["./dist/types/exports/utils.d.ts"],
144-
"wallets": ["./dist/types/exports/wallets.d.ts"],
145-
"wallets/*": ["./dist/types/exports/wallets/*.d.ts"],
146-
"modules": ["./dist/types/exports/modules.d.ts"],
147-
"social": ["./dist/types/exports/social.d.ts"]
130+
"adapters/*": [
131+
"./dist/types/exports/adapters/*.d.ts"
132+
],
133+
"auth": [
134+
"./dist/types/exports/auth.d.ts"
135+
],
136+
"chains": [
137+
"./dist/types/exports/chains.d.ts"
138+
],
139+
"contract": [
140+
"./dist/types/exports/contract.d.ts"
141+
],
142+
"deploys": [
143+
"./dist/types/exports/deploys.d.ts"
144+
],
145+
"event": [
146+
"./dist/types/exports/event.d.ts"
147+
],
148+
"extensions/*": [
149+
"./dist/types/exports/extensions/*.d.ts"
150+
],
151+
"pay": [
152+
"./dist/types/exports/pay.d.ts"
153+
],
154+
"react": [
155+
"./dist/types/exports/react.d.ts"
156+
],
157+
"react-native": [
158+
"./dist/types/exports/react-native.d.ts"
159+
],
160+
"rpc": [
161+
"./dist/types/exports/rpc.d.ts"
162+
],
163+
"storage": [
164+
"./dist/types/exports/storage.d.ts"
165+
],
166+
"transaction": [
167+
"./dist/types/exports/transaction.d.ts"
168+
],
169+
"utils": [
170+
"./dist/types/exports/utils.d.ts"
171+
],
172+
"wallets": [
173+
"./dist/types/exports/wallets.d.ts"
174+
],
175+
"wallets/*": [
176+
"./dist/types/exports/wallets/*.d.ts"
177+
],
178+
"modules": [
179+
"./dist/types/exports/modules.d.ts"
180+
],
181+
"social": [
182+
"./dist/types/exports/social.d.ts"
183+
]
148184
}
149185
},
150186
"browser": {
@@ -193,10 +229,11 @@
193229
"@react-native-async-storage/async-storage": "^1 || ^2",
194230
"ethers": "^5 || ^6",
195231
"expo-linking": "^6",
196-
"expo-web-browser": "^13",
232+
"expo-web-browser": "^13 || ^14",
197233
"react": ">=18",
198234
"react-native": "*",
199235
"react-native-aes-gcm-crypto": "^0.2",
236+
"react-native-passkey": "^3",
200237
"react-native-quick-crypto": ">=0.7.0-rc.6 || >=0.7",
201238
"react-native-svg": "^15",
202239
"typescript": ">=5.0.4"
@@ -314,7 +351,7 @@
314351
"ethers5": "npm:ethers@5",
315352
"ethers6": "npm:ethers@6",
316353
"expo-linking": "7.0.3",
317-
"expo-web-browser": "13.0.3",
354+
"expo-web-browser": "14.0.1",
318355
"happy-dom": "15.11.7",
319356
"knip": "5.39.0",
320357
"msw": "2.6.6",

packages/thirdweb/src/react/core/hooks/wallets/useConnect.ts

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,14 @@ import { useSetActiveWalletConnectionStatus } from "./useSetActiveWalletConnecti
1111
* @returns A function that lets you connect a wallet.
1212
* @example
1313
* ```jsx
14+
* import { createThirdwebClient } from "thirdweb";
1415
* import { useConnect } from "thirdweb/react";
1516
* import { createWallet } from "thirdweb/wallets";
1617
*
18+
* const client = createThirdwebClient({
19+
* clientId: "YOUR_CLIENT_ID",
20+
* });
21+
*
1722
* function Example() {
1823
* const { connect, isConnecting, error } = useConnect();
1924
* return (
@@ -23,7 +28,9 @@ import { useSetActiveWalletConnectionStatus } from "./useSetActiveWalletConnecti
2328
* // instantiate wallet
2429
* const wallet = createWallet("io.metamask");
2530
* // connect wallet
26-
* await wallet.connect();
31+
* await wallet.connect({
32+
* client,
33+
* });
2734
* // return the wallet
2835
* return wallet;
2936
* })

0 commit comments

Comments
 (0)