UNPKG

@renec-foundation/redex-sdk

Version:

Typescript SDK to interact with Orca's Whirlpool program.

39 lines (38 loc) 1.51 kB
"use strict"; var __importDefault = (this && this.__importDefault) || function (mod) { return (mod && mod.__esModule) ? mod : { "default": mod }; }; Object.defineProperty(exports, "__esModule", { value: true }); exports.WHIRLPOOL_ACCOUNT_SIZE = exports.WHIRLPOOL_CODER = exports.AccountName = void 0; const anchor_1 = require("@project-serum/anchor"); const whirlpool_json_1 = __importDefault(require("../../artifacts/whirlpool.json")); /** * This file contains the types that has the same structure as the types anchor functions returns. * These types are hard-casted by the client function. * * This file must be manually updated every time the idl updates as accounts will * be hard-casted to fit the type. */ /** * Supported parasable account names from the Whirlpool contract. * @category Parsables */ var AccountName; (function (AccountName) { AccountName["WhirlpoolsConfig"] = "WhirlpoolsConfig"; AccountName["Position"] = "Position"; AccountName["TickArray"] = "TickArray"; AccountName["Whirlpool"] = "Whirlpool"; AccountName["FeeTier"] = "FeeTier"; })(AccountName = exports.AccountName || (exports.AccountName = {})); const IDL = whirlpool_json_1.default; /** * The Anchor coder for the Whirlpool program. * @category Solana Accounts */ exports.WHIRLPOOL_CODER = new anchor_1.BorshAccountsCoder(IDL); /** * Size of the Whirlpool account in bytes. * @category Solana Accounts */ exports.WHIRLPOOL_ACCOUNT_SIZE = exports.WHIRLPOOL_CODER.size(IDL.accounts[4]);