New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details
Socket
Book a DemoSign in
Socket

@leapwallet/ondo-gm-core

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@leapwallet/ondo-gm-core

Core package providing fundamental building blocks for Ondo protocol integration - transaction clients, query utilities, state management, and TypeScript types

latest
npmnpm
Version
1.0.1
Version published
Maintainers
1
Created
Source

@leapwallet/ondo-gm-core

Core package providing fundamental building blocks for Ondo protocol integration - transaction clients, query utilities, state management, and TypeScript types.

Features

  • 🔧 Transaction Clients: Prepare and execute Ondo protocol transactions
  • 📊 Query Utilities: TanStack Query configurations for API data fetching
  • 🏪 State Management: MobX-based state stores for application data
  • 📝 TypeScript Types: Comprehensive type definitions for all Ondo protocol entities

Installation

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

Quick Start

Basic Setup

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

// Initialize the API client
const apiClient = new OndoGMApi({
  baseUrl: 'https://api.ondo.finance',
});

Query Utilities

The core package provides pre-configured query options for use with TanStack Query:

import { useQuery } from '@tanstack/react-query';

import { getAssetPriceQuery, getAssetsQuery } from '@leapwallet/ondo-gm-core';

// Fetch all asset prices
const assetsQuery = getAssetsQuery(apiClient);
const { data: assets } = useQuery(assetsQuery);

// Fetch specific asset price
const assetPriceQuery = getAssetPriceQuery(apiClient, {
  asset: 'USDC',
});
const { data: price } = useQuery(assetPriceQuery);

Transaction Client

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

// Prepare transaction parameters
const transactionParams: TransactionParams = {
  chainId: '1',
  fromAddress: '0x...',
  toAddress: '0x...',
  amount: '1000000', // 1 USDC (6 decimals)
  // ... other required fields
};

// Transaction preparation and execution would be handled by chain-specific clients
// (see @leapwallet/ondo-gm-evm-client for EVM implementation)

State Management

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

// Access the global state store
const store = OndoGMState.baseState;

// The state is observable with MobX
// Use with @leapwallet/ondo-gm-react-adapter for React integration

API Reference

Query Functions

  • getAssetsQuery(apiClient, options?) - Fetch all asset prices
  • getAssetPriceQuery(apiClient, query) - Fetch specific asset price
  • getMarketQuery(apiClient, query) - Fetch market data
  • getOHLCQuery(apiClient, query) - Fetch OHLC (candlestick) data
  • getAccountQuery(apiClient, query) - Fetch account information

Transaction Types

  • ChainType - Supported blockchain types (ETHEREUM, SOLANA)
  • TransactionParams - Parameters for transaction preparation
  • PreparedTransaction<T> - Prepared transaction with gas estimates

State Stores

  • OndoGMState.baseState - Global application state store

Type Definitions

The package exports comprehensive TypeScript types for all Ondo protocol entities, generated from the OpenAPI specification.

import type { Account, Asset, Attestation, Market, OHLCData } from '@leapwallet/ondo-gm-core';

Integration with Other Packages

This core package is designed to work seamlessly with other packages in the Ondo SDK:

  • @leapwallet/ondo-gm-react-adapter - React hooks and providers
  • @leapwallet/ondo-gm-evm-client - EVM blockchain client
  • @leapwallet/ondo-gm-react-ui - Pre-built UI components

Dependencies

  • @tanstack/query-core - Query state management
  • mobx - Reactive state management

License

ISC

FAQs

Package last updated on 22 Sep 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts