Skip to content

Commit

Permalink
Merge pull request #100 from WalletConnect/feat/optional-rpc-id
Browse files Browse the repository at this point in the history
feat: optional request id
  • Loading branch information
ganchoradkov authored May 17, 2023
2 parents bca8a93 + 705f0a8 commit 137e338
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 6 deletions.
4 changes: 2 additions & 2 deletions jsonrpc/provider/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@walletconnect/jsonrpc-provider",
"description": "Provider for JSON-RPC",
"version": "1.0.12",
"version": "1.0.13",
"author": "WalletConnect, Inc. <walletconnect.com>",
"license": "MIT",
"homepage": "https://github.com/WalletConnect/walletconnect-utils/",
Expand Down Expand Up @@ -45,7 +45,7 @@
"prepublishOnly": "npm run test && npm run build"
},
"dependencies": {
"@walletconnect/jsonrpc-utils": "^1.0.7",
"@walletconnect/jsonrpc-utils": "^1.0.8",
"@walletconnect/safe-json": "^1.0.2",
"tslib": "1.14.1"
},
Expand Down
2 changes: 1 addition & 1 deletion jsonrpc/provider/src/provider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ export class JsonRpcProvider extends IJsonRpcProvider {
formatJsonRpcRequest(
request.method,
request.params || [],
getBigIntRpcId().toString() as any,
request.id || (getBigIntRpcId().toString() as any),
), // casting to any is required in order to use BigInt as rpcId
context,
);
Expand Down
2 changes: 1 addition & 1 deletion jsonrpc/types/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@walletconnect/jsonrpc-types",
"description": "Typings for JSON-RPC",
"version": "1.0.2",
"version": "1.0.3",
"author": "WalletConnect, Inc. <walletconnect.com>",
"license": "MIT",
"homepage": "https://github.com/WalletConnect/walletconnect-utils/",
Expand Down
1 change: 1 addition & 0 deletions jsonrpc/types/src/jsonrpc.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ export interface JsonRpcProviderMessage<T = any> {
export interface RequestArguments<T = any> {
method: string;
params?: T;
id?: number;
}

export interface JsonRpcRequest<T = any> extends Required<RequestArguments<T>> {
Expand Down
4 changes: 2 additions & 2 deletions jsonrpc/utils/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@walletconnect/jsonrpc-utils",
"description": "Utilities for JSON-RPC",
"version": "1.0.7",
"version": "1.0.8",
"author": "WalletConnect, Inc. <walletconnect.com>",
"license": "MIT",
"homepage": "https://github.com/WalletConnect/walletconnect-utils/",
Expand Down Expand Up @@ -45,7 +45,7 @@
},
"dependencies": {
"@walletconnect/environment": "^1.0.1",
"@walletconnect/jsonrpc-types": "^1.0.2",
"@walletconnect/jsonrpc-types": "^1.0.3",
"tslib": "1.14.1"
},
"devDependencies": {
Expand Down

0 comments on commit 137e338

Please sign in to comment.