📅 You're Invited: Meet the Socket team at RSAC (April 28 – May 1).RSVP
Socket
Sign inDemoInstall
Socket

@7kprotocol/sdk-ts

Package Overview
Dependencies
Maintainers
1
Versions
42
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@7kprotocol/sdk-ts

```bash npm i @7kprotocol/sdk-ts ```

2.4.1
latest
Source
npm
Version published
Weekly downloads
1.2K
34.15%
Maintainers
1
Weekly downloads
 
Created
Source

7K TypeScript SDK

Installation

npm i @7kprotocol/sdk-ts

Usage

You can import the entire SDK as a module:

import SevenK from "@7kprotocol/sdk-ts";

or import specific functions as needed:

import { getQuote, buildTx } from "@7kprotocol/sdk-ts";

Config

Configuration is optional, but if provided, it must be set before invoking any SDK functions.

Set API Key

If you’re calling our API from your server, contact us to request dedicated API keys and minimize the risk of rate limiting.

import { Config } from "@7kprotocol/sdk-ts";

Config.setApiKey("YOUR_API_KEY");
console.log("API key", Config.getApiKey());

Set Sui Client

import { SuiClient, getFullnodeUrl } from "@mysten/sui/client";
import { Config } from "@7kprotocol/sdk-ts";

const network = "mainnet";
const suiClient = new SuiClient({ url: getFullnodeUrl(network) });
Config.setSuiClient(suiClient);
console.log("Sui client", Config.getSuiClient());

Note: this package only supports mainnet for now.

Swap

See Swap.

Limit Orders

See Limit Orders.

DCA Orders

See DCA Orders.

Prices

import { getTokenPrice, getTokenPrices, getSuiPrice } from "@7kprotocol/sdk-ts";

const tokenPrice = await getTokenPrice(
  "0xdba34672e30cb065b1f93e3ab55318768fd6fef66c15942c9f7cb846e2f900e7::usdc::USDC",
);

const tokenPrices = await getTokenPrices([
  "0x0000000000000000000000000000000000000000000000000000000000000002::sui::SUI",
  "0xdba34672e30cb065b1f93e3ab55318768fd6fef66c15942c9f7cb846e2f900e7::usdc::USDC",
]);

const suiPrice = await getSuiPrice();

Miscellaneous

If you encounter issues when importing functions from this SDK in a Node.js environment, refer to src/examples/nodejs/ for guidance.

License

7K TypeScript SDK released under the MIT license. See the LICENSE file for details.

Keywords

7k Protocol

FAQs

Package last updated on 17 Apr 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