1.0.1 • Published 2 years ago

@loffinity/relay-provider v1.0.1

Weekly downloads
-
License
ISC
Repository
-
Last release
2 years ago

GSN Web3 Provider

GSN, the Ethereum Gas Station Network abstracts away gas to minimize onboarding & UX friction for dapps.

This module contains a Web3 provider for client-facing JavaScript dapps and Server Side that uses GSN to relay transactions.

Please see the tutorial here.

How to config for server side

import { RelayProvider } from "@loffinity/relay-provider";

const provider = "RPC URL";
const key = "PRIVATE KEY";
const { wallet, gsnSigner } = await RelayProvider.newProviderWithOutSigning({
        privateKey: key,
        provider,
        config: {
            preferredRelays: ["http://localhost:8000"],
            useClientDefaultConfigUrl: false,
            paymasterAddress: "PAYMASTER ADDRESS",
        },
  });

Please see the example here.