npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@leapwallet/ondo-gm-evm-client

v1.0.1

Published

EVM client for Ondo protocol smart contract interactions - provides Ethereum connectivity, transaction execution, and type-safe contract interfaces

Downloads

2

Readme

@leapwallet/ondo-gm-evm-client

EVM client for Ondo protocol smart contract interactions - provides Ethereum connectivity, transaction execution, and type-safe contract interfaces.

Features

  • 🔗 Ethereum Client: Full EVM client implementation with transaction support
  • 📝 Type-Safe Contracts: Auto-generated TypeScript interfaces from ABI definitions
  • Gas Management: Automatic gas estimation and transaction preparation
  • 🔐 EIP-712 Support: Type-safe structured data signing
  • 🛠 Utility Functions: Error handling, data processing, and validation helpers

Installation

npm install @leapwallet/ondo-gm-evm-client @leapwallet/ondo-gm-core ethers
# or
pnpm add @leapwallet/ondo-gm-evm-client @leapwallet/ondo-gm-core ethers
# or
yarn add @leapwallet/ondo-gm-evm-client @leapwallet/ondo-gm-core ethers

Quick Start

Basic Setup

import { ethers } from 'ethers';

import { EvmClient } from '@leapwallet/ondo-gm-evm-client';

// Setup provider and signer
const provider = new ethers.JsonRpcProvider('https://mainnet.infura.io/v3/your-key');
const signer = new ethers.Wallet('your-private-key', provider);

// Initialize the EVM client
const evmClient = new EvmClient({
  provider,
  signer,
  contractAddress: '0x...', // Ondo GM contract address
  feeTokenAddress: '0x...', // Fee token contract address
  chainId: '1', // Ethereum mainnet
});

Prepare Transactions

import type { TransactionParams } from '@leapwallet/ondo-gm-core';

const transactionParams: TransactionParams = {
  chainId: '1',
  fromAddress: '0x123...',
  toAddress: '0x456...',
  amount: '1000000', // 1 USDC (6 decimals)
  // ... other attestation fields
};

// Prepare the transaction with gas estimates
const preparedTx = await evmClient.prepareTransaction(transactionParams);

console.log('Estimated gas:', preparedTx.estimatedGas);
console.log('Transaction data:', preparedTx.data);

Execute Transactions

// Execute the prepared transaction
const result = await evmClient.executeTransaction(preparedTx);

console.log('Transaction hash:', result.transactionHash);
console.log('Status:', result.status); // 'pending' | 'success' | 'failed'

// Wait for confirmation
if (result.status === 'pending') {
  const finalResult = await evmClient.waitForTransaction(result.transactionHash);
  console.log('Final status:', finalResult.status);
}

Contract Interactions

// Access the underlying contract instances
const ondoContract = evmClient.getOndoContract();
const erc20Contract = evmClient.getERC20Contract();

// Check allowance
const allowance = await erc20Contract.allowance(
  '0x...', // owner address
  '0x...' // spender address
);

// Get contract information
const tokenManager = await ondoContract.getFunction('tokenManager');
console.log('Token manager address:', tokenManager);

API Reference

EvmClient Class

Constructor

new EvmClient({
  provider: Provider, // ethers.js provider
  signer: Signer, // ethers.js signer
  contractAddress: string, // Ondo GM contract address
  feeTokenAddress: string, // Fee token contract address
  chainId: string, // Chain ID
});

Methods

Transaction Management
  • prepareTransaction(params) - Prepare transaction with gas estimates
  • executeTransaction(prepared) - Execute a prepared transaction
  • waitForTransaction(hash) - Wait for transaction confirmation
Contract Access
  • getOndoContract() - Get the Ondo protocol contract instance
  • getERC20Contract() - Get the ERC20 token contract instance
Utility Methods
  • estimateGas(params) - Estimate gas for transaction
  • validateTransaction(params) - Validate transaction parameters

Type Definitions

// Transaction arguments for EVM operations
type EthTransactionArg = [
  quote: IGMTokenManager.QuoteStruct,
  signature: BytesLike,
  depositToken: AddressLike,
  depositAmount: BigNumberish,
];

// Prepared transaction for Ethereum
interface EthPreparedTransaction {
  chainId: string;
  data: EthTransactionArg;
  estimatedGas: string;
  gasPrice?: string;
  maxFeePerGas?: string;
  maxPriorityFeePerGas?: string;
}

Contract Interfaces

The package includes auto-generated TypeScript interfaces for all contract interactions:

Ondo Contract (IGMTokenManager)

// Mint tokens
await ondoContract.mint(quote, signature, depositToken, depositAmount);

// Get token manager
const tokenManager = await ondoContract.tokenManager();

// Check if address is sanctioned
const isSanctioned = await ondoContract.sanctionsList('0x...');

ERC20 Contract

// Check balance
const balance = await erc20Contract.balanceOf('0x...');

// Check allowance
const allowance = await erc20Contract.allowance('0x...', '0x...');

// Approve tokens
await erc20Contract.approve('0x...', amount);

Error Handling

import { TxClientError } from '@leapwallet/ondo-gm-core';

try {
  const result = await evmClient.executeTransaction(preparedTx);
} catch (error) {
  if (error instanceof TxClientError) {
    console.error('Transaction error:', error.message);
    console.error('Error code:', error.code);
  } else {
    console.error('Unexpected error:', error);
  }
}

Gas Optimization

// Custom gas settings
const preparedTx = await evmClient.prepareTransaction(params, {
  gasLimit: '200000', // Custom gas limit
  maxFeePerGas: '20000000000', // 20 gwei
  maxPriorityFeePerGas: '2000000000', // 2 gwei
});

Network Support

The EVM client supports all Ethereum-compatible networks:

  • Ethereum Mainnet (chainId: '1')
  • Polygon (chainId: '137')
  • Arbitrum (chainId: '42161')
  • Optimism (chainId: '10')
  • Base (chainId: '8453')
  • Test networks (Goerli, Sepolia, etc.)

Integration Examples

With React Adapter

// In your React hook
import { useOndoEvmClient } from '@leapwallet/ondo-gm-react-adapter';

function useCustomTransaction() {
  const evmClient = useOndoEvmClient();

  return async (params: TransactionParams) => {
    const prepared = await evmClient.prepareTransaction(params);
    return evmClient.executeTransaction(prepared);
  };
}

With Wagmi

import { useWalletClient } from 'wagmi';

import { clientToSigner } from '@leapwallet/ondo-gm-react-adapter';

function useEvmClientFromWagmi() {
  const { data: walletClient } = useWalletClient();

  return useMemo(() => {
    if (!walletClient) return null;

    const signer = clientToSigner(walletClient);
    return new EvmClient({
      provider: signer.provider,
      signer,
      contractAddress: '0x...',
      feeTokenAddress: '0x...',
      chainId: walletClient.chain.id.toString(),
    });
  }, [walletClient]);
}

Dependencies

  • ethers - Ethereum library for blockchain interactions
  • @leapwallet/ondo-gm-core - Core types and interfaces
  • bignumber.js - Arbitrary precision arithmetic

License

ISC