npm i @7kprotocol/sdk-ts
import { SuiClient, getFullnodeUrl } from "@mysten/sui/client";
import { setSuiClient } from "@7kprotocol/sdk-ts";
const network = "mainnet";
const suiClient = new SuiClient({ url: getFullnodeUrl(network) });
setSuiClient(suiClient);
Note: this package only supports mainnet for now.
See Swap.
See Limit Orders.
See DCA Orders.
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();
If you encounter issues when importing functions from this SDK in a Node.js environment, refer to src/examples/nodejs/ for guidance.
7K TypeScript SDK released under the MIT license. See the LICENSE file for details.