@orca-so/whirlpools-sdk
Advanced tools
Comparing version 0.9.0-alpha.5 to 0.9.0-alpha.6
@@ -10,1 +10,2 @@ export * from "./context"; | ||
export * from "./whirlpool-client"; | ||
export * from "./prices"; |
@@ -30,2 +30,3 @@ "use strict"; | ||
__exportStar(require("./whirlpool-client"), exports); | ||
__exportStar(require("./prices"), exports); | ||
// Global rules for Decimals | ||
@@ -32,0 +33,0 @@ // - 40 digits of precision for the largest number |
@@ -15,2 +15,7 @@ /// <reference types="bn.js" /> | ||
/** | ||
* Orca's supported tick spacings. | ||
* @category Constants | ||
*/ | ||
export declare const ORCA_SUPPORTED_TICK_SPACINGS: number[]; | ||
/** | ||
* The number of rewards supported by this whirlpool. | ||
@@ -17,0 +22,0 @@ * @category Constants |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.FEE_RATE_MUL_VALUE = exports.PROTOCOL_FEE_RATE_MUL_VALUE = exports.MAX_SWAP_TICK_ARRAYS = exports.METADATA_PROGRAM_ADDRESS = exports.TICK_ARRAY_SIZE = exports.MIN_SQRT_PRICE = exports.MAX_SQRT_PRICE = exports.MIN_TICK_INDEX = exports.MAX_TICK_INDEX = exports.NUM_REWARDS = exports.ORCA_WHIRLPOOLS_CONFIG = exports.ORCA_WHIRLPOOL_PROGRAM_ID = void 0; | ||
exports.FEE_RATE_MUL_VALUE = exports.PROTOCOL_FEE_RATE_MUL_VALUE = exports.MAX_SWAP_TICK_ARRAYS = exports.METADATA_PROGRAM_ADDRESS = exports.TICK_ARRAY_SIZE = exports.MIN_SQRT_PRICE = exports.MAX_SQRT_PRICE = exports.MIN_TICK_INDEX = exports.MAX_TICK_INDEX = exports.NUM_REWARDS = exports.ORCA_SUPPORTED_TICK_SPACINGS = exports.ORCA_WHIRLPOOLS_CONFIG = exports.ORCA_WHIRLPOOL_PROGRAM_ID = void 0; | ||
const anchor_1 = require("@project-serum/anchor"); | ||
@@ -17,2 +17,7 @@ const web3_js_1 = require("@solana/web3.js"); | ||
/** | ||
* Orca's supported tick spacings. | ||
* @category Constants | ||
*/ | ||
exports.ORCA_SUPPORTED_TICK_SPACINGS = [1, 8, 64, 128]; | ||
/** | ||
* The number of rewards supported by this whirlpool. | ||
@@ -19,0 +24,0 @@ * @category Constants |
@@ -12,2 +12,3 @@ "use strict"; | ||
const decimal_js_1 = __importDefault(require("decimal.js")); | ||
const constants_1 = require("../constants"); | ||
const price_math_1 = require("./price-math"); | ||
@@ -172,8 +173,8 @@ const types_1 = require("./types"); | ||
const QUOTE_TOKENS = { | ||
Es9vMFrzaCERmJfrF4H2FYD4KCoNkY11McCe8BenwNYB: 100, | ||
EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v: 90, | ||
USDH1SM1ojwWUga67PGrgFWUHibbjqMvuMaDkRJTgkX: 80, | ||
So11111111111111111111111111111111111111112: 70, | ||
mSoLzYCxHdYgdzU16g5QSh3i5K3z3KZK7ytfqcJm7So: 60, | ||
"7dHbWXmci3dT8UFYWYZweBLXgycu7Y3iL6trKn1Y7ARj": 50, // stSOL | ||
[constants_1.TOKEN_MINTS["USDT"]]: 100, | ||
[constants_1.TOKEN_MINTS["USDC"]]: 90, | ||
[constants_1.TOKEN_MINTS["USDH"]]: 80, | ||
[constants_1.TOKEN_MINTS["SOL"]]: 70, | ||
[constants_1.TOKEN_MINTS["mSOL"]]: 60, | ||
[constants_1.TOKEN_MINTS["stSOL"]]: 50, // stSOL | ||
}; | ||
@@ -180,0 +181,0 @@ const DEFAULT_QUOTE_PRIORITY = 0; |
import { TransactionBuilder } from "@orca-so/common-sdk"; | ||
import { WhirlpoolContext } from ".."; | ||
export declare function convertListToMap<T>(fetchedData: T[], addresses: string[]): Record<string, T>; | ||
export declare function filterNullObjects<T, K>(firstArray: Array<T | null>, secondArray: Array<K>): [Array<T>, Array<K>]; | ||
export declare function checkMergedTransactionSizeIsValid(ctx: WhirlpoolContext, builders: TransactionBuilder[], latestBlockhash: Readonly<{ | ||
@@ -5,0 +6,0 @@ blockhash: string; |
@@ -12,3 +12,3 @@ "use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.checkMergedTransactionSizeIsValid = exports.convertListToMap = void 0; | ||
exports.checkMergedTransactionSizeIsValid = exports.filterNullObjects = exports.convertListToMap = void 0; | ||
const common_sdk_1 = require("@orca-so/common-sdk"); | ||
@@ -26,2 +26,15 @@ function convertListToMap(fetchedData, addresses) { | ||
exports.convertListToMap = convertListToMap; | ||
// Filter out null objects in the first array and remove the corresponding objects in the second array | ||
function filterNullObjects(firstArray, secondArray) { | ||
const filteredFirstArray = []; | ||
const filteredSecondArray = []; | ||
firstArray.forEach((item, idx) => { | ||
if (item !== null) { | ||
filteredFirstArray.push(item); | ||
filteredSecondArray.push(secondArray[idx]); | ||
} | ||
}); | ||
return [filteredFirstArray, filteredSecondArray]; | ||
} | ||
exports.filterNullObjects = filterNullObjects; | ||
function checkMergedTransactionSizeIsValid(ctx, builders, latestBlockhash) { | ||
@@ -28,0 +41,0 @@ return __awaiter(this, void 0, void 0, function* () { |
{ | ||
"name": "@orca-so/whirlpools-sdk", | ||
"version": "0.9.0-alpha.5", | ||
"version": "0.9.0-alpha.6", | ||
"description": "Typescript SDK to interact with Orca's Whirlpool program.", | ||
@@ -10,3 +10,3 @@ "license": "Apache-2.0", | ||
"@metaplex-foundation/mpl-token-metadata": "1.2.5", | ||
"@orca-so/common-sdk": "^0.1.10", | ||
"@orca-so/common-sdk": "^0.1.12", | ||
"@project-serum/anchor": "~0.25.0", | ||
@@ -13,0 +13,0 @@ "@solana/spl-token": "^0.1.8", |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
804630
190
17360
Updated@orca-so/common-sdk@^0.1.12