πŸš€ Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more β†’
Socket
DemoInstallSign in
Socket

@metalayer/sdk

Package Overview
Dependencies
Maintainers
8
Versions
34
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@metalayer/sdk

A TypeScript SDK for cross-chain interoperability, providing seamless access to anything-to-anything swaps with composable routes, powered by Caldera's Metalayer and [MetaRouter API](https://docs.caldera.xyz/reference/metarouter).

0.5.2
latest
npm
Version published
Weekly downloads
90
130.77%
Maintainers
8
Weekly downloads
Β 
Created
Source

MetaRouter SDK

A TypeScript SDK for cross-chain interoperability, providing seamless access to anything-to-anything swaps with composable routes, powered by Caldera's Metalayer.

Features

  • πŸ”„ Cross-chain bridges
  • πŸ’° Real-time price quotes
  • πŸ”’ Type-safe with full TypeScript support
  • 🌐 Support for multiple blockchain networks
  • βš›οΈ React hooks for easy frontend integration

Installation

Install the npm package:

pnpm add @metalayer/sdk
# or
npm install @metalayer/sdk
# or
yarn add @metalayer/sdk

Quick Start

import { MetaRouterClient } from '@metalayer/sdk';

const router = MetaRouterClient.init({
  apiKey: 'your-api-key',
  environment: 'development',
  defaultOptions: {
    quotePreference: 'bestReturn',
  },
});

// Get a quote
const quote = await router.quote({
  // ...quote params
});

React Hooks

The SDK provides React hooks for easy integration:

  • useQuote
  • useTokenRoutes
  • useSupportedChains
  • useOrderPolling
  • useWalletOrders
  • MetaRouterProvider (React context provider)

API Reference

MetaRouterClient

Configuration

interface MetaRouterConfig {
  apiKey: string;
  environment: 'production' | 'staging' | 'development';
  defaultOptions?: {
    quotePreference: 'bestReturn' | 'fastest';
  };
}

Methods

  • static init(config: MetaRouterConfig): MetaRouterClient
  • quote(params: QuotesParams): Promise<QuotesResponse>
  • getTokenRoutes(params: TokenRoutesParams): Promise<TokenRoutesResponse>
  • getSupportedChains(params: SupportedChainsParams): Promise<SupportedChainsResponse>
  • getOrder(params: OrderParams): Promise<OrderResponse>
  • getOrders(params: OrdersParams): Promise<OrdersResponse>

Examples

See the example/ directory for full React usage examples, including quotes, token routes, bridge status, and wallet history.

License

See the LICENSE file for details.

FAQs

Package last updated on 30 May 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