Skip to content

Commit

Permalink
upgrade wc to Reown
Browse files Browse the repository at this point in the history
  • Loading branch information
ruijialin-avalabs committed Dec 6, 2024
1 parent 0a044e4 commit 7ecdd1c
Show file tree
Hide file tree
Showing 8 changed files with 258 additions and 261 deletions.
2 changes: 0 additions & 2 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,8 @@ updates:
- dependency-name: "@react-native/babel-preset"
- dependency-name: "react-native-reanimated"
- dependency-name: "react-native-mmkv" # we're currently on 2.12.2 which is the latest version compatible with react-native 0.73.7
- dependency-name: "@walletconnect/react-native-compat"
- dependency-name: "@walletconnect/types"
- dependency-name: "@walletconnect/utils"
- dependency-name: "@walletconnect/web3wallet"
- dependency-name: "@avalabs/*"
- dependency-name: "ethers" # we should be using ethers 6.8.1 (please refer to dependencies_resolutions.md)
- dependency-name: "web3" # we should be using web3 1.7.5 (please refer to dependencies_resolutions.md)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { Core } from '@walletconnect/core'
import { EngineTypes, SessionTypes } from '@walletconnect/types'
import { IWeb3Wallet, Web3Wallet } from '@walletconnect/web3wallet'
import { IWalletKit, WalletKit } from '@reown/walletkit'

import { getSdkError } from '@walletconnect/utils'
import Config from 'react-native-config'
import { RpcError } from '@avalabs/vm-module-types'
Expand Down Expand Up @@ -39,14 +40,14 @@ if (!Config.WALLET_CONNECT_PROJECT_ID) {
class WalletConnectService implements WalletConnectServiceInterface {
constructor(private walletConnectProjectId: string) {}

#client: IWeb3Wallet | undefined
#client: IWalletKit | undefined

private get client(): IWeb3Wallet {
private get client(): IWalletKit {
assertNotUndefined(this.#client)
return this.#client
}

private set client(client: IWeb3Wallet) {
private set client(client: IWalletKit) {
this.#client = client
}

Expand All @@ -61,7 +62,7 @@ class WalletConnectService implements WalletConnectServiceInterface {
projectId: this.walletConnectProjectId
})

this.client = await Web3Wallet.init({
this.client = await WalletKit.init({
core,
metadata: CLIENT_METADATA
})
Expand Down
156 changes: 78 additions & 78 deletions packages/core-mobile/ios/AvaxWallet.xcodeproj/project.pbxproj

Large diffs are not rendered by default.

8 changes: 0 additions & 8 deletions packages/core-mobile/ios/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1032,10 +1032,6 @@ PODS:
- React-Core
- react-native-camera/RN (4.2.1):
- React-Core
- react-native-compat (2.11.0):
- glog
- RCT-Folly (= 2022.05.16.00)
- React-Core
- react-native-config (1.5.3):
- react-native-config/App (= 1.5.3)
- react-native-config/App (1.5.3):
Expand Down Expand Up @@ -1392,7 +1388,6 @@ DEPENDENCIES:
- react-native-aes (from `../node_modules/react-native-aes-crypto`)
- "react-native-blur (from `../node_modules/@react-native-community/blur`)"
- react-native-camera (from `../node_modules/react-native-camera`)
- "react-native-compat (from `../node_modules/@walletconnect/react-native-compat`)"
- react-native-config (from `../node_modules/react-native-config`)
- "react-native-menu (from `../node_modules/@react-native-menu/menu`)"
- react-native-mmkv (from `../node_modules/react-native-mmkv`)
Expand Down Expand Up @@ -1584,8 +1579,6 @@ EXTERNAL SOURCES:
:path: "../node_modules/@react-native-community/blur"
react-native-camera:
:path: "../node_modules/react-native-camera"
react-native-compat:
:path: "../node_modules/@walletconnect/react-native-compat"
react-native-config:
:path: "../node_modules/react-native-config"
react-native-menu:
Expand Down Expand Up @@ -1793,7 +1786,6 @@ SPEC CHECKSUMS:
react-native-aes: c6e4e3ffcff410535e31e161fca95d50e608d4ee
react-native-blur: 4568dd93d1d82748c180df8beb2d929c97b13b47
react-native-camera: 3eae183c1d111103963f3dd913b65d01aef8110f
react-native-compat: 5a5b7a043bec932a7814dc35f0649712bc10324e
react-native-config: 8f7283449bbb048902f4e764affbbf24504454af
react-native-menu: c30eb7a85d7b04d51945f61ea8a8986ed366ac5c
react-native-mmkv: 1fdc81aa70c1aba09370718e6a63a09cbbbac8d2
Expand Down
5 changes: 2 additions & 3 deletions packages/core-mobile/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
},
"dependencies": {
"@avalabs/avalanche-module": "0.11.12",
"@avalabs/avalanchejs": "4.1.0-alpha.25",
"@avalabs/avalanchejs": "4.1.2-alpha.1",
"@avalabs/bitcoin-module": "0.11.12",
"@avalabs/bridge-unified": "3.1.1",
"@avalabs/core-bridge-sdk": "3.1.0-alpha.19",
Expand Down Expand Up @@ -72,6 +72,7 @@
"@react-navigation/native-stack": "6.11.0",
"@react-navigation/stack": "6.4.1",
"@reduxjs/toolkit": "1.8.1",
"@reown/walletkit": "^1.0.0",
"@sentry/react-native": "5.33.2",
"@shopify/flash-list": "1.7.1",
"@shopify/react-native-performance": "4.1.2",
Expand All @@ -80,10 +81,8 @@
"@tanstack/react-query": "5.59.8",
"@tanstack/react-query-persist-client": "5.59.6",
"@tradle/react-native-http": "2.0.1",
"@walletconnect/react-native-compat": "2.11.0",
"@walletconnect/types": "2.11.0",
"@walletconnect/utils": "2.11.0",
"@walletconnect/web3wallet": "1.10.0",
"@zodios/core": "10.9.6",
"assert": "2.1.0",
"asyncstorage-down": "4.2.0",
Expand Down

This file was deleted.

1 change: 0 additions & 1 deletion packages/core-mobile/polyfills/index.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import './promise'
import 'react-native-gesture-handler'
import 'react-native-quick-crypto' // to override the global.crypto object
import '@walletconnect/react-native-compat'
import 'react-native-url-polyfill/auto'
import '../shim'
import './read_as_array_buffer_shim'
Expand Down
Loading

0 comments on commit 7ecdd1c

Please sign in to comment.