Security News
Introducing the Socket Python SDK
The initial version of the Socket Python SDK is now on PyPI, enabling developers to more easily interact with the Socket REST API in Python projects.
@venly/web3-provider
Advanced tools
The Venly Web3 provider is a smart wrapper around the existing Web3 Ethereum JavaScript API.
If you already have an application running using web3 technology, you can make use of this wrapper to leverage the full potential of Venly Wallet API. Your existing infrastructure is just one code block away from being Venly Wallet Enabled.
Install and import the module in your project
npm i @venly/web3-provider
import { VenlyProvider } from "@venly/web3-provider";
Alternatively, you can load our script from one of the following CDNs
<script src="https://unpkg.com/@venly/web3-provider/umd/index.js"></script>
<script src="https://cdn.jsdelivr.net/npm/@venly/web3-provider/umd/index.js"></script>
const Venly = new VenlyProvider();
The VenlyProvider object is the gateway for creating the web3 wrapper and fully integrates Venly Connect.
const options: VenlyProviderOptions = {
clientId: 'YOUR_CLIENT_ID',
environment: 'staging', //optional, production by default
secretType: SecretType.ETHEREUM, //optional, ETHEREUM by default
windowMode: WindowMode.POPUP, //optional, POPUP by default
bearerTokenProvider: () => 'obtained_bearer_token', //optional, default undefined
skipAuthentication: false //optional, false by default
};
const provider = await Venly.createProvider(options);
const web3 = new Web3(provider);
The web3 instance now works as if it was injected by parity or metamask. You can fetch your wallets or sign transactions and messages.
If you provide your own implementation of bearerTokenProvider
, the web3 provider will not attempt to obtain an authentication code, but rather use the one provided by you.
Use the Web3Provider class to wrap our existing Web3-compatible provider and expose it as an ethers.js Provider. (Requires ethers.js v5)
const options = {
clientId: 'YOUR_CLIENT_ID'
};
const provider = await Venly.createProvider(options);
const ethers = new ethers.providers.Web3Provider(provider);
After initializing the Venly Provider, an instance of VenlyConnect is added to the Venly object. As a result, it's possible to call Venly Connect natively.
Venly.connect.getProfile();
The full documentation for Venly Connect can be found here: https://docs.venly.io/widget/widget/introduction
We've created two examples of the Web3 Provider in our demo application.
One only checks authentication and shows the login form after the user clicks a button:
The other checks if a user is logged in on page load. If not, it shows the login button, otherwise it fetches the users' wallets:
Not sure yet what Venly is all about? Be sure to check out our website: https://www.venly.io/
[3.1.1]
wallet_switchEthereumChain
RPC method and switchSecretType()
no longer require reinitializing the provider.FAQs
Venly enabled Web3 Provider for the web
The npm package @venly/web3-provider receives a total of 224 weekly downloads. As such, @venly/web3-provider popularity was classified as not popular.
We found that @venly/web3-provider demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 4 open source maintainers 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
The initial version of the Socket Python SDK is now on PyPI, enabling developers to more easily interact with the Socket REST API in Python projects.
Security News
Floating dependency ranges in npm can introduce instability and security risks into your project by allowing unverified or incompatible versions to be installed automatically, leading to unpredictable behavior and potential conflicts.
Security News
A new Rust RFC proposes "Trusted Publishing" for Crates.io, introducing short-lived access tokens via OIDC to improve security and reduce risks associated with long-lived API tokens.