JSPM

ethers-web3-bridge

0.0.1
    • ESM via JSPM
    • ES Module Entrypoint
    • Export Map
    • Keywords
    • License
    • Repository URL
    • TypeScript Types
    • README
    • Created
    • Published
    • Downloads 95
    • Score
      100M100P100Q72917F
    • License MIT

    Enables Web3 instances to connect using an ethers.js Provider.

    Package Exports

    • ethers-web3-bridge

    This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (ethers-web3-bridge) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

    Readme

    Ethers Web3 Provider Bridge

    This is still a very early-stage package, and documentation will be added soon.

    Installing

    /Users/ethers> npm install --save ethers-web3-bridge

    API

    The Web3 Bridge allows a Web3 instance to connect a standard Web3 instance to an ethers.js Provider.

    Synchronous

    If you have access to a Provider and Signer, the object can be connected when it is instantiated.

    var ProviderBridge = require('ethers-provider-bridge');
    
    // Connect to a standard Ethers Provider
    var provider = ethers.provider.getDefaultProvider();
    var wallet = new ethers.Wallet(privateKey);
    
    var web3 = new Web3(new ProviderBridge(provider, signer));

    Asynchronous

    Sometimes it is unknown at the time of Web3 instantiation what the backend Provider or Signer will be, in which case you can create the Web3 instance immediately, and the Bridge will defer all requests until a Provider and Signer are connected.

    var providerBridge = new ProviderBridge(provider, signer);
    var web3 = new Web3(provider);
    
    someLongRunningPromise().then(function(signer, provider) {
        providerBridge.connectEthers(provider, signer);
    });

    License

    MIT License.

    Donations

    I always appreciate people buying me a coffee:

    Ethereum: 0xEA517D5a070e6705Cc5467858681Ed953d285Eb9