Socket
Book a DemoInstallSign in
Socket

@relay-protocol/client

Package Overview
Dependencies
Maintainers
3
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@relay-protocol/client

Client library for interacting with the Relay Protocol API

0.0.2
latest
npmnpm
Version published
Maintainers
3
Created
Source

@relay-protocol/client

TypeScript client for the Relay Protocol API with type-safe queries and responses.

Installation

yarn add @relay-protocol/client

Features

  • Type-safe API client with automatic types generation
  • High-level methods for common operations
  • Support for custom queries

Usage

Basic Usage

import { RelayVaultService } from '@relay-protocol/client'

const vaultService = new RelayVaultService('https://api.example.com/graphql')

// Use the high-level methods
const pools = await vaultService.getAllPools()
const poolDetails = await vaultService.getRelayPool('0x123...', 1)
const userBalances = await vaultService.getUserBalances('0xabc...')

SDK Access

import { RelayClient } from '@relay-protocol/client'

const client = new RelayClient('https://api.example.com/graphql')

// Use the SDK methods
const { data } = await client.sdk.GetAllPools({
  limit: 20,
  targetTimestamp: Math.floor(Date.now() / 1000).toString(),
  orderDirection: 'desc',
})

Custom Queries

import { RelayVaultService, gql } from '@relay-protocol/client'

const vaultService = new RelayVaultService('https://api.example.com/graphql')

interface CustomResponse {
  relayPools: {
    items: Array<{
      contractAddress: string
      totalApproved: string
    }>
  }
}

const result = await vaultService.query<CustomResponse>(gql`
  query CustomPoolQuery {
    relayPools(limit: 5) {
      items {
        contractAddress
        totalApproved
      }
    }
  }
`)

Development

# Install dependencies
yarn install

# Update schema and regenerate types
yarn update-schema

# Build package
yarn build

FAQs

Package last updated on 25 Mar 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

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.