0.0.1 • Published 7 months ago
@abstraxn/relayer-v5 v0.0.1
Relayer
Overview
The Abstraxn Relayer package is designed for handling gas-less transactions, facilitating smart contract interactions, and efficiently relaying user transactions on the Ethereum blockchain.
Installation
Using npm package manager:
npm install @abstraxn/relayerOr using yarn package manager:
yarn add @abstraxn/relayerUsage
import { Relayer } from "@abstraxn/relayer";
import { ChainId } from "@abstraxn/core-types";
const relayerConfig = {
relayerUrl: "https://your-relayer-url.com",
chainId: ChainId.MAINNET,
signer: yourSignerInstance,
provider: yourProviderInstance,
};
const relayer = new Relayer(relayerConfig);
// Example: Building a relayer transaction
const buildTxParams = {
contractAddress: "0xYourContractAddress",
abi: yourContractAbi,
method: "yourMethodName",
args: ["arg1", "arg2"],
};
relayer.buildRelayerTx(buildTxParams).then((response) => {
console.log("Build Relayer Transaction Response: ", response);
});API
Methods
buildRelayerTx(params: BuildRelayerTxParams)
- Builds a transaction to be sent to the relayer.
sendRelayerTx(params: SendRelayerTxParams)
- Sends a transaction to the relayer for processing.
getRelayerTxStatus(transactionId: string)
- Retrieves the status of a relayer transaction.
0.0.1
7 months ago