Files
bls-wallet/aggregator-proxy
Jacob Caban-Tomski 772e44dd60 Add Optimism Goerli deploy to README
Add Optimism Goerli network config to contracts deploy in main README.
Add Optimism Goerli to extension networks.
Remove or update rinkeby, kovan, and older arbitrum and optimism test networks.
2023-01-23 17:29:17 -07:00
..
2022-05-05 04:54:34 +00:00
2022-12-02 10:58:09 +00:00
2022-05-03 04:55:34 +00:00
2022-05-05 05:02:43 +00:00
2022-12-23 12:17:18 -07:00
2023-01-23 17:29:17 -07:00
2022-05-05 05:02:43 +00:00
2022-12-23 12:17:18 -07:00

Aggregator Proxy

npm version

This package makes it easy to provide an aggregator by proxying another. The primary use-case is to expose a free aggregator based on one that requires payment by augmenting the bundles with transactions that pay tx.origin.

Setup

npm install bls-wallet-aggregator-proxy
yarn install bls-wallet-aggregator-proxy

Usage

import {
  runAggregatorProxy,

  // AggregatorProxyCallback,
  // ^ Alternatively, for manual control, import AggregatorProxyCallback to
  // just generate the req,res callback for use with http.createServer
} from 'bls-wallet-aggregator-proxy';

runAggregatorProxy(
  'https://arbitrum-goerli.blswallet.org',
  async bundle => {
    console.log('proxying bundle', JSON.stringify(bundle, null, 2));

    // Return a different/augmented bundle to send to the upstream aggregator
    return bundle;
  },
  8080,
  '0.0.0.0',
  () => {
    console.log('Proxying aggregator on port 8080');
  },
);

Instant wallet without dapp-sponsored transaction

Instant wallet without dapp-sponsored transactions

Instant wallet with dapp-sponsored transaction

Instant wallet with dapp-sponsored transaction

Example dApp using a proxy aggregator