@web3-react/core
Advanced tools
Comparing version 6.1.9 to 8.2.3
@@ -1,2 +0,3 @@ | ||
export { createWeb3ReactRoot, Web3ReactProvider, useWeb3React, getWeb3ReactContext, PRIMARY_KEY } from './provider'; | ||
export { UnsupportedChainIdError } from './manager'; | ||
export * from './hooks'; | ||
export * from './mocks'; | ||
export * from './provider'; |
@@ -1,8 +0,19 @@ | ||
'use strict' | ||
if (process.env.NODE_ENV === 'production') { | ||
module.exports = require('./core.cjs.production.min.js') | ||
} else { | ||
module.exports = require('./core.cjs.development.js') | ||
} | ||
"use strict"; | ||
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { | ||
if (k2 === undefined) k2 = 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) { | ||
if (k2 === undefined) k2 = k; | ||
o[k2] = m[k]; | ||
})); | ||
var __exportStar = (this && this.__exportStar) || function(m, exports) { | ||
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); | ||
}; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
__exportStar(require("./hooks"), exports); | ||
__exportStar(require("./mocks"), exports); | ||
__exportStar(require("./provider"), exports); |
@@ -1,12 +0,41 @@ | ||
import React from 'react'; | ||
import { Web3ReactContextInterface } from './types'; | ||
export declare const PRIMARY_KEY = "primary"; | ||
interface Web3ReactProviderArguments { | ||
getLibrary: (provider?: any, connector?: Required<Web3ReactContextInterface>['connector']) => any; | ||
children: any; | ||
import type { Networkish } from '@ethersproject/networks'; | ||
import type { BaseProvider, Web3Provider } from '@ethersproject/providers'; | ||
import type { Connector, Web3ReactStore } from '@web3-react/types'; | ||
import type { ReactNode } from 'react'; | ||
import type { Web3ReactHooks, Web3ReactPriorityHooks } from './hooks'; | ||
import { getPriorityConnector } from './hooks'; | ||
/** | ||
* @typeParam T - A type argument must only be provided if one or more of the connectors passed to Web3ReactProvider | ||
* is using `connector.customProvider`, in which case it must match every possible type of this | ||
* property, over all connectors. | ||
*/ | ||
export type Web3ContextType<T extends BaseProvider = Web3Provider> = { | ||
connector: Connector; | ||
chainId: ReturnType<Web3ReactPriorityHooks['useSelectedChainId']>; | ||
accounts: ReturnType<Web3ReactPriorityHooks['useSelectedAccounts']>; | ||
isActivating: ReturnType<Web3ReactPriorityHooks['useSelectedIsActivating']>; | ||
account: ReturnType<Web3ReactPriorityHooks['useSelectedAccount']>; | ||
isActive: ReturnType<Web3ReactPriorityHooks['useSelectedIsActive']>; | ||
provider: T | undefined; | ||
ENSNames: ReturnType<Web3ReactPriorityHooks['useSelectedENSNames']>; | ||
ENSName: ReturnType<Web3ReactPriorityHooks['useSelectedENSName']>; | ||
hooks: ReturnType<typeof getPriorityConnector>; | ||
}; | ||
/** | ||
* @param children - A React subtree that needs access to the context. | ||
* @param connectors - Two or more [connector, hooks(, store)] arrays, as returned from initializeConnector. | ||
* If modified in place without re-rendering the parent component, will result in an error. | ||
* @param connectorOverride - A connector whose state will be reflected in useWeb3React if set, overriding the | ||
* priority selection. | ||
* @param network - An optional argument passed along to `useSelectedProvider`. | ||
* @param lookupENS - A flag to enable/disable ENS lookups. | ||
*/ | ||
export interface Web3ReactProviderProps { | ||
children: ReactNode; | ||
connectors: [Connector, Web3ReactHooks][] | [Connector, Web3ReactHooks, Web3ReactStore][]; | ||
connectorOverride?: Connector; | ||
network?: Networkish; | ||
lookupENS?: boolean; | ||
} | ||
export declare function createWeb3ReactRoot(key: string): (args: Web3ReactProviderArguments) => JSX.Element; | ||
export declare const Web3ReactProvider: (args: Web3ReactProviderArguments) => JSX.Element; | ||
export declare function getWeb3ReactContext<T = any>(key?: string): React.Context<Web3ReactContextInterface<T>>; | ||
export declare function useWeb3React<T = any>(key?: string): Web3ReactContextInterface<T>; | ||
export {}; | ||
export declare function Web3ReactProvider({ children, connectors, connectorOverride, network, lookupENS, }: Web3ReactProviderProps): JSX.Element; | ||
export declare function useWeb3React<T extends BaseProvider = Web3Provider>(): Web3ContextType<T>; |
{ | ||
"name": "@web3-react/core", | ||
"publishConfig": { | ||
"access": "public" | ||
}, | ||
"version": "6.1.9", | ||
"description": "A simple, maximally extensible, dependency minimized framework for building modern Ethereum dApps", | ||
"keywords": [ | ||
"react", | ||
"react-hooks", | ||
"hooks", | ||
"ethereum", | ||
"javascript", | ||
"typescript", | ||
"web3", | ||
"context", | ||
"frontend", | ||
"dapp" | ||
"web3-react" | ||
], | ||
"author": "Noah Zinsmeister <noahwz@gmail.com>", | ||
"repository": { | ||
"type": "git", | ||
"url": "git://github.com/NoahZinsmeister/web3-react.git" | ||
"license": "GPL-3.0-or-later", | ||
"repository": "github:Uniswap/web3-react", | ||
"publishConfig": { | ||
"access": "public" | ||
}, | ||
"main": "dist/index.js", | ||
"module": "dist/core.esm.js", | ||
"typings": "dist/index.d.ts", | ||
"version": "8.2.3", | ||
"files": [ | ||
"dist" | ||
"dist/*" | ||
], | ||
"type": "commonjs", | ||
"types": "./dist/index.d.ts", | ||
"main": "./dist/index.js", | ||
"exports": "./dist/index.js", | ||
"scripts": { | ||
"start": "tsdx watch", | ||
"build": "tsdx build", | ||
"test": "tsdx test --env=jsdom", | ||
"lint": "tsdx lint src test" | ||
"prebuild": "rm -rf dist", | ||
"build": "tsc", | ||
"start": "tsc --watch" | ||
}, | ||
"dependencies": { | ||
"@ethersproject/keccak256": "^5.0.0-beta.130", | ||
"@web3-react/abstract-connector": "^6.0.7", | ||
"@web3-react/types": "^6.0.7", | ||
"tiny-invariant": "^1.0.6", | ||
"tiny-warning": "^1.0.3" | ||
"@web3-react/store": "^8.2.3", | ||
"@web3-react/types": "^8.2.3", | ||
"zustand": "4.4.0" | ||
}, | ||
@@ -47,4 +33,6 @@ "peerDependencies": { | ||
}, | ||
"license": "GPL-3.0-or-later", | ||
"gitHead": "fe26e6706a08ec46cef3c1711e3838d1547f7663" | ||
"optionalDependencies": { | ||
"@ethersproject/providers": "^5" | ||
}, | ||
"gitHead": "eef5ea988a8b8b6523ce8705cbde057195b5bad4" | ||
} |
# @web3-react/core | ||
Please visit the [parent `web3-react` repository](https://github.com/NoahZinsmeister/web3-react) for documentation and details on this 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
No repository
Supply chain riskPackage does not have a linked source code repository. Without this field, a package will have no reference to the location of the source code use to generate the package.
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
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 1 instance in 1 package
Minified code
QualityThis package contains minified code. This may be harmless in some cases where minified code is included in packaged libraries, however packages on npm should not minify code.
Found 1 instance in 1 package
5
1
1
67572
12
636
2
+ Added@web3-react/store@^8.2.3
+ Addedzustand@4.4.0
+ Added@ethersproject/abstract-provider@5.7.0(transitive)
+ Added@ethersproject/abstract-signer@5.7.0(transitive)
+ Added@ethersproject/address@5.7.0(transitive)
+ Added@ethersproject/base64@5.7.0(transitive)
+ Added@ethersproject/basex@5.7.0(transitive)
+ Added@ethersproject/bignumber@5.7.0(transitive)
+ Added@ethersproject/constants@5.7.0(transitive)
+ Added@ethersproject/hash@5.7.0(transitive)
+ Added@ethersproject/networks@5.7.1(transitive)
+ Added@ethersproject/properties@5.7.0(transitive)
+ Added@ethersproject/providers@5.7.2(transitive)
+ Added@ethersproject/random@5.7.0(transitive)
+ Added@ethersproject/rlp@5.7.0(transitive)
+ Added@ethersproject/sha2@5.7.0(transitive)
+ Added@ethersproject/signing-key@5.7.0(transitive)
+ Added@ethersproject/strings@5.7.0(transitive)
+ Added@ethersproject/transactions@5.7.0(transitive)
+ Added@ethersproject/web@5.7.1(transitive)
+ Added@web3-react/store@8.2.3(transitive)
+ Added@web3-react/types@8.2.3(transitive)
+ Addedbech32@1.1.4(transitive)
+ Addedbn.js@4.12.05.2.1(transitive)
+ Addedbrorand@1.1.0(transitive)
+ Addedelliptic@6.5.4(transitive)
+ Addedhash.js@1.1.7(transitive)
+ Addedhmac-drbg@1.0.1(transitive)
+ Addedinherits@2.0.4(transitive)
+ Addedminimalistic-assert@1.0.1(transitive)
+ Addedminimalistic-crypto-utils@1.0.1(transitive)
+ Addeduse-sync-external-store@1.2.0(transitive)
+ Addedws@7.4.6(transitive)
+ Addedzustand@4.4.0(transitive)
- Removedtiny-invariant@^1.0.6
- Removedtiny-warning@^1.0.3
- Removed@web3-react/abstract-connector@6.0.7(transitive)
- Removed@web3-react/types@6.0.7(transitive)
- Removedtiny-invariant@1.3.3(transitive)
- Removedtiny-warning@1.0.3(transitive)
Updated@web3-react/types@^8.2.3