UNPKG

@kamino-finance/kliquidity-sdk

Version:

Typescript SDK for interacting with the Kamino Liquidity (kliquidity) protocol

32 lines 2.33 kB
"use strict"; /** * This code was AUTOGENERATED using the Codama library. * Please DO NOT EDIT THIS FILE, instead use visitors * to add features, then rerun Codama to update it. * * @see https://github.com/codama-idl/codama */ Object.defineProperty(exports, "__esModule", { value: true }); exports.getBinAddLiquidityStrategyEncoder = getBinAddLiquidityStrategyEncoder; exports.getBinAddLiquidityStrategyDecoder = getBinAddLiquidityStrategyDecoder; exports.getBinAddLiquidityStrategyCodec = getBinAddLiquidityStrategyCodec; exports.binAddLiquidityStrategy = binAddLiquidityStrategy; exports.isBinAddLiquidityStrategy = isBinAddLiquidityStrategy; const kit_1 = require("@solana/kit"); function getBinAddLiquidityStrategyEncoder() { return (0, kit_1.getDiscriminatedUnionEncoder)([['Uniform', (0, kit_1.getStructEncoder)([['currentBinIndex', (0, kit_1.getI32Encoder)()], ['lowerBinIndex', (0, kit_1.getI32Encoder)()], ['upperBinIndex', (0, kit_1.getI32Encoder)()], ['amountXToDeposit', (0, kit_1.getU64Encoder)()], ['amountYToDeposit', (0, kit_1.getU64Encoder)()], ['xCurrentBin', (0, kit_1.getU64Encoder)()], ['yCurrentBin', (0, kit_1.getU64Encoder)()]])], ['CurrentTick', (0, kit_1.getStructEncoder)([['fields', (0, kit_1.getTupleEncoder)([(0, kit_1.getI32Encoder)()])]])]]); } function getBinAddLiquidityStrategyDecoder() { return (0, kit_1.getDiscriminatedUnionDecoder)([['Uniform', (0, kit_1.getStructDecoder)([['currentBinIndex', (0, kit_1.getI32Decoder)()], ['lowerBinIndex', (0, kit_1.getI32Decoder)()], ['upperBinIndex', (0, kit_1.getI32Decoder)()], ['amountXToDeposit', (0, kit_1.getU64Decoder)()], ['amountYToDeposit', (0, kit_1.getU64Decoder)()], ['xCurrentBin', (0, kit_1.getU64Decoder)()], ['yCurrentBin', (0, kit_1.getU64Decoder)()]])], ['CurrentTick', (0, kit_1.getStructDecoder)([['fields', (0, kit_1.getTupleDecoder)([(0, kit_1.getI32Decoder)()])]])]]); } function getBinAddLiquidityStrategyCodec() { return (0, kit_1.combineCodec)(getBinAddLiquidityStrategyEncoder(), getBinAddLiquidityStrategyDecoder()); } function binAddLiquidityStrategy(kind, data) { return Array.isArray(data) ? { __kind: kind, fields: data } : { __kind: kind, ...(data ?? {}) }; } function isBinAddLiquidityStrategy(kind, value) { return value.__kind === kind; } ; //# sourceMappingURL=binAddLiquidityStrategy.js.map