Skip to content
This repository was archived by the owner on Aug 27, 2024. It is now read-only.

Commit

Permalink
Merge pull request #81 from WalletConnect/feat/update-auth-client
Browse files Browse the repository at this point in the history
feat: pairing idempotency + persistence
  • Loading branch information
ganchoradkov authored Sep 14, 2023
2 parents 4b85b30 + ecd962e commit f38d20b
Show file tree
Hide file tree
Showing 8 changed files with 271 additions and 91 deletions.
76 changes: 38 additions & 38 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions packages/auth-client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,19 +40,19 @@
"@ethersproject/transactions": "^5.7.0",
"@stablelib/random": "^1.0.2",
"@stablelib/sha256": "^1.0.1",
"@walletconnect/core": "^2.9.0",
"@walletconnect/core": "^2.10.1",
"@walletconnect/events": "^1.0.1",
"@walletconnect/heartbeat": "^1.2.1",
"@walletconnect/jsonrpc-utils": "^1.0.8",
"@walletconnect/logger": "^2.0.1",
"@walletconnect/time": "^1.0.2",
"@walletconnect/utils": "^2.9.0",
"@walletconnect/utils": "^2.10.1",
"events": "^3.3.0",
"isomorphic-unfetch": "^3.1.0"
},
"devDependencies": {
"@ethersproject/wallet": "^5.7.0",
"@walletconnect/types": "^2.9.0",
"@walletconnect/types": "^2.10.1",
"aws-sdk": "^2.1169.0",
"lokijs": "^1.5.12"
}
Expand Down
10 changes: 8 additions & 2 deletions packages/auth-client/src/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import {
} from "@walletconnect/logger";
import { EventEmitter } from "events";

import { AuthClientTypes, IAuthClient } from "./types";
import { AuthClientTypes, AuthEngineTypes, IAuthClient } from "./types";
import { AuthEngine } from "./controllers";
import {
AUTH_CLIENT_PROTOCOL,
Expand Down Expand Up @@ -69,7 +69,13 @@ export class AuthClient extends IAuthClient {
"pairingTopics",
AUTH_CLIENT_STORAGE_PREFIX,
);
this.requests = new Store(this.core, this.logger, "requests", AUTH_CLIENT_STORAGE_PREFIX);
this.requests = new Store(
this.core,
this.logger,
"requests",
AUTH_CLIENT_STORAGE_PREFIX,
(val: AuthEngineTypes.PendingRequest) => val.id,
);
this.engine = new AuthEngine(this);
}

Expand Down
Loading

0 comments on commit f38d20b

Please sign in to comment.