@loffinity/relay-provider
v1.0.1
Published
Support to run Relay Provider on Server Side
Downloads
8
Readme
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.
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",
},
});