Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@kwenta/sdk

Package Overview
Dependencies
Maintainers
5
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@kwenta/sdk

SDK for headless interaction with Kwenta

  • 1.1.15
  • npm
  • Socket score

Version published
Weekly downloads
5
decreased by-61.54%
Maintainers
5
Weekly downloads
 
Created
Source

Kwenta SDK

Note: This document is a work in progress, as the implementation of the Kwenta SDK is still in progress. Interfaces, types and overall structure are subject to change.

Architecture

The SDK is a collection of multiple classes, objects and functions which can generally be categorized as follows:

Context

The context class (pending implementation) contains attributes that are used by other classes, especially services (see the section below), to determine what context they are being called in. For example, the context class contains information about the provider, signer, wallet address and network ID.

Services

Services are collection of methods that function together to enable. We have services for futures, exchange, synths and transactions. A service's methods are available under sdk.[service-name]. While services function independently for the most part, they may also call methods on other services.

Events

In certain situations where the SDK needs to inform a client about data changes (for example, exchange rate updates), we emit events that clients can listen to.

Contracts

Based on the currently selected networkId, we maintain a list of available contracts in the context, used for subsequent contract calls. When there is an attempt to access a contract that is not available on the network, an error is thrown.

Synths

Similarly to contracts, we maintain a list of synths on the current network, which is used for fetching balances, synth names etc.

Testing

One of the main benefits of extracting Kwenta's logic into an SDK is the ability to test business logic independently of the UI. The tests folder will contain a number of unit and integration tests that will help us remain confident in the functionality of the SDK, as well as our ability to output sensible errors when one or more of our dependencies do not behave as expected. These tests will also be updated frequently as new features are added and bugs are fixed.

FAQs

Package last updated on 26 Sep 2024

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

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc