
Research
Two Malicious Rust Crates Impersonate Popular Logger to Steal Wallet Keys
Socket uncovers malicious Rust crates impersonating fast_log to steal Solana and Ethereum wallet keys from source code.
react-dapp-requirements
Advanced tools
Checks all requirements that a user needs in order to use a DApp. All checks must pass in order for the DApp to be rendered.
The component uses a composition pattern which means that each requirement is a standalone component and can be used independently.
The component comes with default properties, child components and methods which support web3 0.2.x and 1.x in order to work out of the box but all them can be overridden.
static propTypes = {
// array of supported networks
supportedNetworks: PropTypes.array.isRequired,
// Map of labels for eth network ids
networkMap: PropTypes.object,
// method that checks if web3 is injected on the window obj. Is Metamask installed?
web3Provided: PropTypes.func,
// method that checks for the web3 provider. Connection access granted?
fetchProvider: PropTypes.func,
// polling method for current account
fetchAccount: PropTypes.func,
// method that retrieves the selected ETH network
fetchNetwork: PropTypes.func,
// method that checks for browser(chrome, firefox, opera)
isBrowserSupported: PropTypes.func,
// callback for connection access
onProviderReceived: PropTypes.func,
// callback for network change
onNetworkIdReceived: PropTypes.func,
// callback for account change
onAccountChange: PropTypes.func,
// Render when metamsk is not installed
Web3UnavailableComponent: PropTypes.func,
// Render if the user does not accept connection access
ProviderUnavailableComponent: PropTypes.func,
// Render while waiting for user connection input
ProviderLoadingComponent: PropTypes.func,
// Render if the current browser is not supported
BrowserUnsupportedComponent: PropTypes.func,
// Render if Metamask is locked
AccountUnavailableComponent: PropTypes.func,
// Render while waiting for account information
AccountLoadingComponent: PropTypes.func,
// Render if selected ETH network is not supported
NetworkNotSupportedComponent: PropTypes.func,
// Render while checking the selected network
NetworkLoadingComponent: PropTypes.func,
// Render in case of not Eth network(No internet connect)
NetworkNotFoundComponent: PropTypes.func,
};
class App extends Component {
onProviderReceived = (provider) => {
if (provider) // is null if component failed to retrieve it, most likely is a web3/metamask issue
// Instantiate a instance of web3
};
onNetworkIdReceived = (networkId) => {
if (networkId) // is null if component failed to retrieve it, most likely is a web3/metamask issue
// Do something with the network id(dispatch a redux action for example)
};
onAccountChange = (address, networkId, provider) => {
// This will not be dispatch if component fails to get the provider or the network
// Do something(dispatch a redux action for example)
};
render() {
// Add your on rendering components that can have custom styles,internationalization ,etc
let dappRequirementsScreens = {
BrowserUnsupportedComponent: injectIntl(BrowserUnsupportedScreen),
Web3UnavailableComponent: injectIntl(Web3UnavailableScreen),
ProviderUnavailableComponent: injectIntl(ProviderUnavailableScreen),
ProviderLoadingComponent: injectIntl(ProviderLoadingScreen),
AccountUnavailableComponent: injectIntl(AccountUnavailableScreen),
AccountLoadingComponent: injectIntl(AccountLoadingScreen),
NetworkNotSupportedComponent: injectIntl(NetworkNotSupportedScreen),
NetworkLoadingComponent: injectIntl(NetworkLoadingScreen),
NetworkNotFoundComponent: injectIntl(NetworkNotFoundScreen),
};
return (
<DappRequirements
{...dappRequirementsScreens}
supportedNetworks={['4','42']}
onProviderReceived={this.onProviderReceived}
onNetworkIdReceived={this.onNetworkIdReceived}
onAccountChange={this.onAccountChange}
>
// Render if all checks pass
</DappRequirements>
)
}
}
global.bypassChecks = true;
npm install
or yarn install
npm test
or yarn test
npm run build
or yarn build
Builds the component for production to the dist
folder.
It correctly bundles React in production mode and optimizes the build for the best performance.
0.1.12 (2019-01-14)
<a name="0.1.11"></a>
FAQs
(https://github.com/centrifuge/react-dapp-requirements)
We found that react-dapp-requirements demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Socket uncovers malicious Rust crates impersonating fast_log to steal Solana and Ethereum wallet keys from source code.
Research
A malicious package uses a QR code as steganography in an innovative technique.
Research
/Security News
Socket identified 80 fake candidates targeting engineering roles, including suspected North Korean operators, exposing the new reality of hiring as a security function.