@kompose-app/klaytn-provider-engine

    1.0.0 • Public • Published

    Klaytn ProviderEngine

    Klaytn ProviderEngine is a tool for composing your own klaytn providers.

    Originally created for MetaMask and Ethereum, but forked by Kompose for Klaytn usage.

    Composable

    Built to be modular - works via a stack of 'sub-providers' which are like normal web3 providers but only handle a subset of rpc methods.

    The subproviders can emit new rpc requests in order to handle their own; e.g. klay_call may trigger klay_getAccountBalance, klay_getCode, and others. The provider engine also handles caching of rpc request results.

    const ProviderEngine = require('@kompose-app/klaytn-provider-engine')
     
    // cache layer
    engine.addProvider(new CacheSubprovider())
     
    // filters
    engine.addProvider(new FilterSubprovider())
     
    // pending nonce
    engine.addProvider(new NonceSubprovider())
     
    // vm
    engine.addProvider(new VmSubprovider())

    When importing in webpack:

    import * as Web3ProviderEngine  from 'web3-provider-engine';

    License

    MIT

    Keywords

    none

    Install

    npm i @kompose-app/klaytn-provider-engine

    DownloadsWeekly Downloads

    3

    Version

    1.0.0

    License

    MIT

    Unpacked Size

    114 kB

    Total Files

    26

    Last publish

    Collaborators

    • xlab_is