@rabby-wallet/eth-coinbase-keyring
Advanced tools
Comparing version 0.0.0-beta.6 to 0.0.0-beta.7
@@ -39,2 +39,3 @@ /// <reference types="node" /> | ||
}, silent: boolean): void; | ||
switchEthereumChain(_: string, chainId: number, address: string): Promise<void>; | ||
} |
@@ -23,2 +23,3 @@ "use strict"; | ||
const version_1 = require("@coinbase/wallet-sdk/dist/version"); | ||
const utils_1 = require("@metamask/utils"); | ||
// eslint-disable-next-line import/no-nodejs-modules | ||
@@ -238,2 +239,19 @@ const events_1 = __importDefault(require("events")); | ||
} | ||
async switchEthereumChain(_, chainId, address) { | ||
const sessionData = Object.values(__classPrivateFieldGet(this, _CoinbaseKeyring_sessions, "f")).find((data) => { var _a; return ((_a = data.account) === null || _a === void 0 ? void 0 : _a.toLowerCase()) === address.toLowerCase(); }); | ||
if (sessionData) { | ||
sessionData.provider | ||
.request({ | ||
method: 'wallet_switchEthereumChain', | ||
params: [ | ||
{ | ||
chainId: (0, utils_1.numberToHex)(chainId), | ||
}, | ||
], | ||
}) | ||
.catch((error) => { | ||
console.error(error); | ||
}); | ||
} | ||
} | ||
} | ||
@@ -240,0 +258,0 @@ exports.default = CoinbaseKeyring; |
{ | ||
"name": "@rabby-wallet/eth-coinbase-keyring", | ||
"version": "0.0.0-beta.6", | ||
"version": "0.0.0-beta.7", | ||
"description": "A keyring that uses the Coinbase Wallet SDK to sign transactions", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
69471
489