@web3-react/url
Advanced tools
Comparing version 8.0.14-beta.0 to 8.0.15-beta.0
@@ -1,2 +0,2 @@ | ||
import type { Eip1193Bridge } from '@ethersproject/experimental'; | ||
import type { JsonRpcProvider } from '@ethersproject/providers'; | ||
import type { ConnectionInfo } from '@ethersproject/web'; | ||
@@ -8,3 +8,5 @@ import type { Actions } from '@web3-react/types'; | ||
/** {@inheritdoc Connector.provider} */ | ||
provider: Eip1193Bridge | undefined; | ||
provider: undefined; | ||
/** {@inheritdoc Connector.customProvider} */ | ||
customProvider: JsonRpcProvider | undefined; | ||
private eagerConnection?; | ||
@@ -11,0 +13,0 @@ private url; |
"use strict"; | ||
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { | ||
if (k2 === undefined) k2 = k; | ||
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); | ||
var desc = Object.getOwnPropertyDescriptor(m, k); | ||
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { | ||
desc = { enumerable: true, get: function() { return m[k]; } }; | ||
} | ||
Object.defineProperty(o, k2, desc); | ||
}) : (function(o, m, k, k2) { | ||
@@ -33,5 +37,2 @@ if (k2 === undefined) k2 = k; | ||
const types_1 = require("@web3-react/types"); | ||
function parseChainId(chainId) { | ||
return Number.parseInt(chainId, 16); | ||
} | ||
class Url extends types_1.Connector { | ||
@@ -55,8 +56,4 @@ /** | ||
return this.eagerConnection; | ||
yield (this.eagerConnection = Promise.all([ | ||
Promise.resolve().then(() => __importStar(require('@ethersproject/providers'))).then(({ JsonRpcProvider }) => JsonRpcProvider), | ||
Promise.resolve().then(() => __importStar(require('@ethersproject/experimental'))).then(({ Eip1193Bridge }) => Eip1193Bridge), | ||
]).then(([JsonRpcProvider, Eip1193Bridge]) => { | ||
const provider = new JsonRpcProvider(this.url); | ||
this.provider = new Eip1193Bridge(provider.getSigner(), provider); | ||
return (this.eagerConnection = Promise.resolve().then(() => __importStar(require('@ethersproject/providers'))).then(({ JsonRpcProvider }) => { | ||
return new JsonRpcProvider(this.url); | ||
})); | ||
@@ -68,9 +65,9 @@ }); | ||
return __awaiter(this, void 0, void 0, function* () { | ||
if (!this.provider) | ||
if (!this.customProvider) | ||
this.actions.startActivation(); | ||
yield this.isomorphicInitialize(); | ||
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion | ||
return this.provider.request({ method: 'eth_chainId' }) | ||
.then((chainId) => { | ||
this.actions.update({ chainId: parseChainId(chainId), accounts: [] }); | ||
yield this.isomorphicInitialize() | ||
.then((customProvider) => { | ||
this.customProvider = customProvider; | ||
const { chainId } = this.customProvider.network; | ||
this.actions.update({ chainId, accounts: [] }); | ||
}) | ||
@@ -77,0 +74,0 @@ .catch((error) => { |
@@ -12,3 +12,3 @@ { | ||
}, | ||
"version": "8.0.14-beta.0", | ||
"version": "8.0.15-beta.0", | ||
"files": [ | ||
@@ -27,10 +27,9 @@ "dist/*" | ||
"dependencies": { | ||
"@ethersproject/experimental": "^5.6.0", | ||
"@ethersproject/providers": "^5.6.0", | ||
"@web3-react/types": "^8.0.10-beta.0" | ||
"@web3-react/types": "^8.0.11-beta.0" | ||
}, | ||
"devDependencies": { | ||
"@web3-react/store": "^8.0.14-beta.0" | ||
"@web3-react/store": "^8.0.15-beta.0" | ||
}, | ||
"gitHead": "2f5bafe498df00221ccc0204ac3349d8c4a3ecec" | ||
"gitHead": "b0c7174f076727da6eef9758e48eed23dd9cadb7" | ||
} |
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
2
40295
99
- Removed@ethersproject/experimental@^5.6.0
- Removed@ethersproject/abi@5.7.0(transitive)
- Removed@ethersproject/contracts@5.7.0(transitive)
- Removed@ethersproject/experimental@5.7.0(transitive)
- Removed@ethersproject/hdnode@5.7.0(transitive)
- Removed@ethersproject/json-wallets@5.7.0(transitive)
- Removed@ethersproject/pbkdf2@5.7.0(transitive)
- Removed@ethersproject/solidity@5.7.0(transitive)
- Removed@ethersproject/units@5.7.0(transitive)
- Removed@ethersproject/wallet@5.7.0(transitive)
- Removed@ethersproject/wordlists@5.7.0(transitive)
- Removedaes-js@3.0.0(transitive)
- Removedethers@5.7.2(transitive)
- Removedscrypt-js@3.0.1(transitive)