Skip to content

Commit

Permalink
UPDATE WC DEPS TO LATEST
Browse files Browse the repository at this point in the history
  • Loading branch information
aaronmgdr committed May 12, 2023
1 parent 6bfb6c6 commit f40bfca
Show file tree
Hide file tree
Showing 5 changed files with 105 additions and 36 deletions.
10 changes: 5 additions & 5 deletions packages/example/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@
"@celo/contractkit": "^3.2.0",
"@celo/react-celo": "5.0.3-dev",
"@celo/utils": "^3.2.0",
"@walletconnect/core": "^2.7.0",
"@walletconnect/sign-client": "^2.7.0",
"@walletconnect/types": "^2.7.0",
"@walletconnect/utils": "^2.7.0",
"@walletconnect/web3wallet": "^1.5.1",
"@walletconnect/core": "^2.7.3",
"@walletconnect/sign-client": "^2.7.3",
"@walletconnect/types": "^2.7.3",
"@walletconnect/utils": "^2.7.3",
"@walletconnect/web3wallet": "^1.7.1",
"next": "^12.1.6",
"postcss": "^8.4.5",
"react": "^18.1.0",
Expand Down
1 change: 1 addition & 0 deletions packages/walletconnect/__tests__/wc-signer.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,7 @@ describe('WalletConnectWallet tests', () => {
const uri = await wallet.getUri();
testWallet?.init(uri as string);
await wallet.init();
await wallet.hasSession();
}, 10000);

afterAll(async () => {
Expand Down
7 changes: 4 additions & 3 deletions packages/walletconnect/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,10 @@
"@celo/utils": ">=2.3.0",
"@celo/wallet-base": ">=2.3.0",
"@celo/wallet-remote": ">=2.3.0",
"@walletconnect/sign-client": "^2.7.0",
"@walletconnect/types": "^2.7.0",
"@walletconnect/utils": "^2.7.0",
"@walletconnect/core": "^2.7.3",
"@walletconnect/sign-client": "^2.7.3",
"@walletconnect/types": "^2.7.3",
"@walletconnect/utils": "^2.7.3",
"debug": "^4.3.3",
"ethereumjs-util": "^7.1.3"
},
Expand Down
8 changes: 5 additions & 3 deletions packages/walletconnect/src/wc-wallet.ts
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,10 @@ export class WalletConnectWallet extends RemoteWallet<WalletConnectSigner> {
});
}

async hasSession() {
await waitForTruthy(() => !!this.session, this.canceler.status);
}

private setupListeners() {
if (!this.client) return;

Expand Down Expand Up @@ -259,7 +263,7 @@ export class WalletConnectWallet extends RemoteWallet<WalletConnectSigner> {

// wallets will literally fail if they don't support a chainId in the required namespaces
// likewise wallets return an error if they dont support a method in the required namespaces
// how do we get list of chains wallet supports? best would be to ask user to select chain.
// therefore required really is required and we add new chain to namespaces when switching chains. see switchToChain
const { uri, approval } = await this.client.connect({
requiredNamespaces: {
eip155: {
Expand All @@ -274,8 +278,6 @@ export class WalletConnectWallet extends RemoteWallet<WalletConnectSigner> {
.then((session) => {
console.info('approved session', session);
this.session = session;
// TODO reconcile emitting Session Struct vs BaseEventArg [ session _update]
// should we actually even be emitting this here AND in the constructor? we are listening to session_update events from client anyway/.
this.emit('session_update', null, {
id: 1,
topic: session.topic,
Expand Down
115 changes: 90 additions & 25 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2743,7 +2743,7 @@
"@typescript-eslint/types" "5.45.0"
eslint-visitor-keys "^3.3.0"

"@walletconnect/auth-client@^2.0.4":
"@walletconnect/auth-client@2.0.7":
version "2.0.7"
resolved "https://registry.npmjs.org/@walletconnect/auth-client/-/auth-client-2.0.7.tgz#f6e1eeeaa57865d1d219bbc1439d147d5ab2d354"
integrity sha512-hebY0yS3Xwc/sD7uFul987fVToiFS1vxePBCAGOwv6eR1CL3o93uM1LVM7lJFWAkr9m5CRFwaCt/B/qeQvPsNg==
Expand All @@ -2761,7 +2761,28 @@
events "^3.3.0"
isomorphic-unfetch "^3.1.0"

"@walletconnect/core@2.7.0", "@walletconnect/core@^2.6.1", "@walletconnect/core@^2.7.0":
"@walletconnect/core@2.7.3", "@walletconnect/core@^2.7.3":
version "2.7.3"
resolved "https://registry.npmjs.org/@walletconnect/core/-/core-2.7.3.tgz#a81b477b4b451b2d5a4533faa7bffc9595c15c6c"
integrity sha512-Ldb9ZE74jpivioW+Z65Lc5XVuddDQcqmXjmuZleliQwwg8USKi4qjiC3A3796jzGUCIdgKVHN1ZkudkXo2CSNw==
dependencies:
"@walletconnect/heartbeat" "1.2.1"
"@walletconnect/jsonrpc-provider" "^1.0.12"
"@walletconnect/jsonrpc-utils" "^1.0.7"
"@walletconnect/jsonrpc-ws-connection" "^1.0.11"
"@walletconnect/keyvaluestorage" "^1.0.2"
"@walletconnect/logger" "^2.0.1"
"@walletconnect/relay-api" "^1.0.9"
"@walletconnect/relay-auth" "^1.0.4"
"@walletconnect/safe-json" "^1.0.2"
"@walletconnect/time" "^1.0.2"
"@walletconnect/types" "2.7.3"
"@walletconnect/utils" "2.7.3"
events "^3.3.0"
lodash.isequal "4.5.0"
uint8arrays "^3.1.0"

"@walletconnect/core@^2.6.1":
version "2.7.0"
resolved "https://registry.npmjs.org/@walletconnect/core/-/core-2.7.0.tgz#26f19710958648e401968ab2fd427d6b07fb3b37"
integrity sha512-xUeFPpElybgn1a+lknqtHleei4VyuV/4qWgB1nP8qQUAO6a5pNsioODrnB2VAPdUHJYBdx2dCt2maRk6g53IPQ==
Expand Down Expand Up @@ -2806,7 +2827,7 @@
"@walletconnect/time" "^1.0.2"
tslib "1.14.1"

"@walletconnect/jsonrpc-provider@^1.0.12":
"@walletconnect/jsonrpc-provider@1.0.12", "@walletconnect/jsonrpc-provider@^1.0.12":
version "1.0.12"
resolved "https://registry.npmjs.org/@walletconnect/jsonrpc-provider/-/jsonrpc-provider-1.0.12.tgz#965408d99fc889d49c194cd207804282805f45ed"
integrity sha512-6uI2y5281gloZSzICOjk+CVC7CVu0MhtMt2Yzpj05lPb0pzm/bK2oZ2ibxwLerPrqpNt/5bIFVRmoOgPw1mHAQ==
Expand All @@ -2823,7 +2844,7 @@
keyvaluestorage-interface "^1.0.0"
tslib "1.14.1"

"@walletconnect/jsonrpc-utils@^1.0.6", "@walletconnect/jsonrpc-utils@^1.0.7":
"@walletconnect/jsonrpc-utils@1.0.7", "@walletconnect/jsonrpc-utils@^1.0.6", "@walletconnect/jsonrpc-utils@^1.0.7":
version "1.0.7"
resolved "https://registry.npmjs.org/@walletconnect/jsonrpc-utils/-/jsonrpc-utils-1.0.7.tgz#1812d17c784f1ec0735bf03d0884287f60bfa2ce"
integrity sha512-zJziApzUF/Il4VcwabnaU+0yo1QI4eUkYX99zmCVTHJvZOf2l0zjADf/OpKqWyeNFC3Io56Z/8uJHVtcNVvyFA==
Expand Down Expand Up @@ -2851,7 +2872,7 @@
safe-json-utils "^1.1.1"
tslib "1.14.1"

"@walletconnect/logger@^2.0.1":
"@walletconnect/logger@2.0.1", "@walletconnect/logger@^2.0.1":
version "2.0.1"
resolved "https://registry.npmjs.org/@walletconnect/logger/-/logger-2.0.1.tgz"
integrity sha512-SsTKdsgWm+oDTBeNE/zHxxr5eJfZmE9/5yp/Ku+zJtcTAjELb3DXueWkDXmE9h8uHIbJzIb5wj5lPdzyrjT6hQ==
Expand Down Expand Up @@ -2893,19 +2914,19 @@
dependencies:
tslib "1.14.1"

"@walletconnect/sign-client@^2.6.1", "@walletconnect/sign-client@^2.7.0":
version "2.7.0"
resolved "https://registry.npmjs.org/@walletconnect/sign-client/-/sign-client-2.7.0.tgz#c08c90a1fc95340d5d40d2cfd88f59d4d385a676"
integrity sha512-K99xa6GSFS04U+140yrIEi/VJJJ0Q1ov4jCaiqa9euILDKxlBsM7m5GR+9sq6oYyj18SluJY4CJTdeOXUJlarA==
"@walletconnect/sign-client@2.7.3", "@walletconnect/sign-client@^2.7.3":
version "2.7.3"
resolved "https://registry.npmjs.org/@walletconnect/sign-client/-/sign-client-2.7.3.tgz#c57461c4017228bf3b3841c81a351927f40a99b6"
integrity sha512-QDlgBv0EoMt1OQ7SjUJA8DSx3zcKvBcKDueETYUPwP29i1Mc5gSozrpzEoSLcH3TVTt4bTcTEkqVvGvWsglJig==
dependencies:
"@walletconnect/core" "2.7.0"
"@walletconnect/core" "2.7.3"
"@walletconnect/events" "^1.0.1"
"@walletconnect/heartbeat" "1.2.1"
"@walletconnect/jsonrpc-utils" "^1.0.7"
"@walletconnect/logger" "^2.0.1"
"@walletconnect/time" "^1.0.2"
"@walletconnect/types" "2.7.0"
"@walletconnect/utils" "2.7.0"
"@walletconnect/types" "2.7.3"
"@walletconnect/utils" "2.7.3"
events "^3.3.0"

"@walletconnect/time@^1.0.2":
Expand All @@ -2915,7 +2936,7 @@
dependencies:
tslib "1.14.1"

"@walletconnect/types@2.7.0", "@walletconnect/types@^2.6.1", "@walletconnect/types@^2.7.0":
"@walletconnect/types@2.7.0":
version "2.7.0"
resolved "https://registry.npmjs.org/@walletconnect/types/-/types-2.7.0.tgz#af639c463d0d80d0fd03da80f2fc593c73a93ae9"
integrity sha512-aMUDUtO79WSBtC/bDetE6aFwdgwJr0tJ8nC8gnAl5ELsrjygEKCn6M8Q+v6nP9svG9yf5Rds4cImxCT6BWwTyw==
Expand All @@ -2927,7 +2948,19 @@
"@walletconnect/logger" "^2.0.1"
events "^3.3.0"

"@walletconnect/utils@2.7.0", "@walletconnect/utils@^2.6.1", "@walletconnect/utils@^2.7.0":
"@walletconnect/types@2.7.3", "@walletconnect/types@^2.7.3":
version "2.7.3"
resolved "https://registry.npmjs.org/@walletconnect/types/-/types-2.7.3.tgz#cbc894b025383ec1137023caefce55f9824909c9"
integrity sha512-01U/GwrtokgBfBzLwZQQogkYh/+HBvClO4Oet3bClnyzHZ//Jv3Xf3X9LluNrHaulzPqdc9g7wnFkpjkVqKicQ==
dependencies:
"@walletconnect/events" "^1.0.1"
"@walletconnect/heartbeat" "1.2.1"
"@walletconnect/jsonrpc-types" "^1.0.2"
"@walletconnect/keyvaluestorage" "^1.0.2"
"@walletconnect/logger" "^2.0.1"
events "^3.3.0"

"@walletconnect/utils@2.7.0", "@walletconnect/utils@^2.6.1":
version "2.7.0"
resolved "https://registry.npmjs.org/@walletconnect/utils/-/utils-2.7.0.tgz#18482834b8a27e0515ef160a1ff7e4632c9d77f5"
integrity sha512-k32jrQeyJsNZPdmtmg85Y3QgaS5YfzYSPrAxRC2uUD1ts7rrI6P5GG2iXNs3AvWKOuCgsp/PqU8s7AC7CRUscw==
Expand All @@ -2948,18 +2981,40 @@
query-string "7.1.1"
uint8arrays "^3.1.0"

"@walletconnect/web3wallet@^1.5.1":
version "1.5.1"
resolved "https://registry.npmjs.org/@walletconnect/web3wallet/-/web3wallet-1.5.1.tgz#1e9650e8a0dcf1bd6ce3d4b2d2d71a486384f24d"
integrity sha512-kTmm44f/SgzdgqlKPDDGV1Dsb16kHlF6HaZ+0s3U6XlVStyI1+4tdV90XMEHFyKGWIyoC73hTgWdSqfPVdehiw==
"@walletconnect/utils@2.7.3", "@walletconnect/utils@^2.7.3":
version "2.7.3"
resolved "https://registry.npmjs.org/@walletconnect/utils/-/utils-2.7.3.tgz#0a2c1095b74a747e4966e013e76e785f277a9915"
integrity sha512-ecKnoks3N8CaP5KYIrgJct5YNmvlfp1Ec8BuiXw5Gmta1HFnKpzvjmAG1627XGEfB2UVc9O2Rmbx+UmhuyB5KQ==
dependencies:
"@walletconnect/auth-client" "^2.0.4"
"@walletconnect/core" "^2.6.1"
"@stablelib/chacha20poly1305" "1.0.1"
"@stablelib/hkdf" "1.0.1"
"@stablelib/random" "^1.0.2"
"@stablelib/sha256" "1.0.1"
"@stablelib/x25519" "^1.0.3"
"@walletconnect/jsonrpc-utils" "^1.0.7"
"@walletconnect/logger" "^2.0.1"
"@walletconnect/sign-client" "^2.6.1"
"@walletconnect/types" "^2.6.1"
"@walletconnect/utils" "^2.6.1"
"@walletconnect/relay-api" "^1.0.9"
"@walletconnect/safe-json" "^1.0.2"
"@walletconnect/time" "^1.0.2"
"@walletconnect/types" "2.7.3"
"@walletconnect/window-getters" "^1.0.1"
"@walletconnect/window-metadata" "^1.0.1"
detect-browser "5.3.0"
query-string "7.1.3"
uint8arrays "^3.1.0"

"@walletconnect/web3wallet@^1.7.1":
version "1.7.1"
resolved "https://registry.npmjs.org/@walletconnect/web3wallet/-/web3wallet-1.7.1.tgz#88bd463f99db641ee31c7d3d6013e64d22b2de7d"
integrity sha512-yXGnSD8YLTp3VbMm+vdbcxAyGaMORSrlTDaGqwY7VhDj7YVtrTJ3Zg1JfAQWApjSWhcOM9c8hcwwwxJTamlIAQ==
dependencies:
"@walletconnect/auth-client" "2.0.7"
"@walletconnect/core" "2.7.3"
"@walletconnect/jsonrpc-provider" "1.0.12"
"@walletconnect/jsonrpc-utils" "1.0.7"
"@walletconnect/logger" "2.0.1"
"@walletconnect/sign-client" "2.7.3"
"@walletconnect/types" "2.7.3"
"@walletconnect/utils" "2.7.3"

"@walletconnect/window-getters@^1.0.1":
version "1.0.1"
Expand Down Expand Up @@ -4649,7 +4704,7 @@ decimal.js@^10.3.1:
resolved "https://registry.npmjs.org/decimal.js/-/decimal.js-10.4.2.tgz"
integrity sha512-ic1yEvwT6GuvaYwBLLY6/aFFgjZdySKTE8en/fkU3QICTmRtgtSlFn0u0BXN06InZwtfCelR7j8LRiDI/02iGA==

decode-uri-component@^0.2.0, decode-uri-component@^0.2.1:
decode-uri-component@^0.2.0, decode-uri-component@^0.2.2:
version "0.2.2"
resolved "https://registry.npmjs.org/decode-uri-component/-/decode-uri-component-0.2.2.tgz#e69dbe25d37941171dd540e024c444cd5188e1e9"
integrity sha512-FqUYQ+8o158GyGTrMFJms9qh3CqTKvAqgqsTnkLI8sKu0028orqBhxNMFkFen0zGyg6epACD32pjVk58ngIErQ==
Expand Down Expand Up @@ -10142,6 +10197,16 @@ query-string@7.1.1:
split-on-first "^1.0.0"
strict-uri-encode "^2.0.0"

query-string@7.1.3:
version "7.1.3"
resolved "https://registry.npmjs.org/query-string/-/query-string-7.1.3.tgz#a1cf90e994abb113a325804a972d98276fe02328"
integrity sha512-hh2WYhq4fi8+b+/2Kg9CEge4fDPvHS534aOOvOZeQ3+Vf2mCFsaFBYj0i+iXcAq6I9Vzp5fjMFBlONvayDC1qg==
dependencies:
decode-uri-component "^0.2.2"
filter-obj "^1.1.0"
split-on-first "^1.0.0"
strict-uri-encode "^2.0.0"

query-string@^5.0.1:
version "5.1.1"
resolved "https://registry.npmjs.org/query-string/-/query-string-5.1.1.tgz"
Expand Down

0 comments on commit f40bfca

Please sign in to comment.