Skip to main content

Utilities

evvm-js exposes useful helpers to run signed actions and serialize/execute results.

execute()

Executes a SignedAction using the signer's writeContract adapter.

Example:

import { execute } from "@evvm/evvm-js";

const signedAction = await core.pay({
/* params */
});

// execute directly
const txHash = await execute(signer, signedAction);

// or

const serializedSignedAction = JSON.stringify(signedAction);

// when serialized for transport (through http for example)
const txHash = await execute(signer, serializedSignedAction);

Options

execute() can be called with optional arguments:

const txHash = await execute(signer, signedAction, {
gas: 10_000,
});

where

interface IExecuteOptions {
gas?: number;
}