Security News
PyPI’s New Archival Feature Closes a Major Security Gap
PyPI now allows maintainers to archive projects, improving security and helping users make informed decisions about their dependencies.
gas-station
Advanced tools
Gas Station is a library for React Native apps to easily connect to the Ethereum network and complete transactions.
Gas Station is a React Native library allowing you to build dApps (Decentralized Applications) which transform your mobile device into a light client node on the Ethereum Network and enables you to easily access Ethereum’s entire ecosystem, including interacting with Smart Contracts, make payment, and more.
We just got started. This is what the project timeline looks like:
Using NPM:
npm i gas-station
react-native link gas-station
Using Yarn:
yarn add gas-station
react-native link gas-station
Due to the rapid changes being made in the React Native ecosystem, we are not officially going to support this module on anything but the latest version of React Native. With that said, we will do our best to stay compatible with older versions as much that is practical, and the peer dependency of this requirement is set to "react-native": "*" explicitly for this reason. If you are using an older version of React Native with this module though, some features may be buggy.
import { Alert } from 'react-native'
import GasStation from 'gas-station'
// Do this as soon as you need access to the Ethereum network
// Note that this will bring up a UI the first time it is called!
GasStation.requestUserLogin()
.then(async (eth) => {
// We now have access to the ethereum blockcahin
const addresses = await eth.getAccounts()
Alert.alert('Your wallet address', addresses[0])
})
.catch((e) => {
// Node couldn't start or user cancelled login
})
All API methods below are asynchronous and return Promise instances.
Returns Array denoting the addresses of all wallets that the user has created or has given the current app access to.
Retrieves the address associated with the user's default account.
Returns String with wallet address.
Returns the wei balance of the current account.
Returns String balance.
Returns the wei balance of the specified account.
Parameters
address
String Address of account being looked up.Returns String balance.
Retrieves the current progress of the sync algorithm.
Returns Object Return object sync progress or null
Subscribes to notifications about the current blockchain head.
Returns Boolean – true if subscribed.
Brings up a modal window where the user can manage their accounts.
Brings up a modal window where the user can add Ethereum to their primary account, either by copying their address, viewing their wallet's QR code, or by opening the Coinbase app and starting a transaction to their wallet's address.
Create and send a transaction. The user will see a modal window and will have to agree to sending the transaction.
Parameters
toAddress
String Address destinationamount
Number AmountgasLimit
Number Gas limit (optional, automatically set if left empty)gasPrice
Number Gas price (optional, automatically set if left empty)data
NumberReturns String – transaction HEX identifier
Retrieves the currently suggested gas price to allow a timely execution of a transaction.
Returns Double – suggested gas price
Retrieves this account's pending nonce. This is the nonce you should use when creating a transaction.
Returns Double – nonce
FAQs
A mobile wallet manager for blockchain apps.
The npm package gas-station receives a total of 5 weekly downloads. As such, gas-station popularity was classified as not popular.
We found that gas-station 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.
Security News
PyPI now allows maintainers to archive projects, improving security and helping users make informed decisions about their dependencies.
Research
Security News
Malicious npm package postcss-optimizer delivers BeaverTail malware, targeting developer systems; similarities to past campaigns suggest a North Korean connection.
Security News
CISA's KEV data is now on GitHub, offering easier access, API integration, commit history tracking, and automated updates for security teams and researchers.