import { BN, BorshAccountsCoder, Address, Program, AnchorProvider } from '@project-serum/anchor';
import { Wallet } from '@project-serum/anchor/dist/cjs/provider';
import { PublicKey, Keypair, Connection, ConfirmOptions } from '@solana/web3.js';
import { u64, MintInfo, AccountInfo } from '@solana/spl-token';
import * as _orca_so_common_sdk from '@orca-so/common-sdk';
import { PDA, TransactionBuilder, Percentage, Instruction } from '@orca-so/common-sdk';
export { Percentage } from '@orca-so/common-sdk';
import Decimal from 'decimal.js';
import BN$1 from 'bn.js';

type Whirlpool$1 = {
    "version": "0.1.0";
    "name": "whirlpool";
    "instructions": [
        {
            "name": "initializeConfig";
            "accounts": [
                {
                    "name": "config";
                    "isMut": true;
                    "isSigner": true;
                },
                {
                    "name": "funder";
                    "isMut": true;
                    "isSigner": true;
                },
                {
                    "name": "systemProgram";
                    "isMut": false;
                    "isSigner": false;
                }
            ];
            "args": [
                {
                    "name": "feeAuthority";
                    "type": "publicKey";
                },
                {
                    "name": "collectProtocolFeesAuthority";
                    "type": "publicKey";
                },
                {
                    "name": "rewardEmissionsSuperAuthority";
                    "type": "publicKey";
                },
                {
                    "name": "defaultProtocolFeeRate";
                    "type": "u16";
                }
            ];
        },
        {
            "name": "initializePool";
            "accounts": [
                {
                    "name": "whirlpoolsConfig";
                    "isMut": false;
                    "isSigner": false;
                },
                {
                    "name": "tokenMintA";
                    "isMut": false;
                    "isSigner": false;
                },
                {
                    "name": "tokenMintB";
                    "isMut": false;
                    "isSigner": false;
                },
                {
                    "name": "funder";
                    "isMut": true;
                    "isSigner": true;
                },
                {
                    "name": "whirlpool";
                    "isMut": true;
                    "isSigner": false;
                },
                {
                    "name": "tokenVaultA";
                    "isMut": true;
                    "isSigner": true;
                },
                {
                    "name": "tokenVaultB";
                    "isMut": true;
                    "isSigner": true;
                },
                {
                    "name": "feeTier";
                    "isMut": false;
                    "isSigner": false;
                },
                {
                    "name": "tokenProgram";
                    "isMut": false;
                    "isSigner": false;
                },
                {
                    "name": "systemProgram";
                    "isMut": false;
                    "isSigner": false;
                },
                {
                    "name": "rent";
                    "isMut": false;
                    "isSigner": false;
                }
            ];
            "args": [
                {
                    "name": "bumps";
                    "type": {
                        "defined": "WhirlpoolBumps";
                    };
                },
                {
                    "name": "tickSpacing";
                    "type": "u16";
                },
                {
                    "name": "initialSqrtPrice";
                    "type": "u128";
                }
            ];
        },
        {
            "name": "initializeTickArray";
            "accounts": [
                {
                    "name": "whirlpool";
                    "isMut": false;
                    "isSigner": false;
                },
                {
                    "name": "funder";
                    "isMut": true;
                    "isSigner": true;
                },
                {
                    "name": "tickArray";
                    "isMut": true;
                    "isSigner": false;
                },
                {
                    "name": "systemProgram";
                    "isMut": false;
                    "isSigner": false;
                }
            ];
            "args": [
                {
                    "name": "startTickIndex";
                    "type": "i32";
                }
            ];
        },
        {
            "name": "initializeFeeTier";
            "accounts": [
                {
                    "name": "config";
                    "isMut": false;
                    "isSigner": false;
                },
                {
                    "name": "feeTier";
                    "isMut": true;
                    "isSigner": false;
                },
                {
                    "name": "funder";
                    "isMut": true;
                    "isSigner": true;
                },
                {
                    "name": "feeAuthority";
                    "isMut": false;
                    "isSigner": true;
                },
                {
                    "name": "systemProgram";
                    "isMut": false;
                    "isSigner": false;
                }
            ];
            "args": [
                {
                    "name": "tickSpacing";
                    "type": "u16";
                },
                {
                    "name": "defaultFeeRate";
                    "type": "u16";
                }
            ];
        },
        {
            "name": "initializeReward";
            "accounts": [
                {
                    "name": "rewardAuthority";
                    "isMut": false;
                    "isSigner": true;
                },
                {
                    "name": "funder";
                    "isMut": true;
                    "isSigner": true;
                },
                {
                    "name": "whirlpool";
                    "isMut": true;
                    "isSigner": false;
                },
                {
                    "name": "rewardMint";
                    "isMut": false;
                    "isSigner": false;
                },
                {
                    "name": "rewardVault";
                    "isMut": true;
                    "isSigner": true;
                },
                {
                    "name": "tokenProgram";
                    "isMut": false;
                    "isSigner": false;
                },
                {
                    "name": "systemProgram";
                    "isMut": false;
                    "isSigner": false;
                },
                {
                    "name": "rent";
                    "isMut": false;
                    "isSigner": false;
                }
            ];
            "args": [
                {
                    "name": "rewardIndex";
                    "type": "u8";
                }
            ];
        },
        {
            "name": "setRewardEmissions";
            "accounts": [
                {
                    "name": "whirlpool";
                    "isMut": true;
                    "isSigner": false;
                },
                {
                    "name": "rewardAuthority";
                    "isMut": false;
                    "isSigner": true;
                },
                {
                    "name": "rewardVault";
                    "isMut": false;
                    "isSigner": false;
                }
            ];
            "args": [
                {
                    "name": "rewardIndex";
                    "type": "u8";
                },
                {
                    "name": "emissionsPerSecondX64";
                    "type": "u128";
                }
            ];
        },
        {
            "name": "openPosition";
            "accounts": [
                {
                    "name": "funder";
                    "isMut": true;
                    "isSigner": true;
                },
                {
                    "name": "owner";
                    "isMut": false;
                    "isSigner": false;
                },
                {
                    "name": "position";
                    "isMut": true;
                    "isSigner": false;
                },
                {
                    "name": "positionMint";
                    "isMut": true;
                    "isSigner": true;
                },
                {
                    "name": "positionTokenAccount";
                    "isMut": true;
                    "isSigner": false;
                },
                {
                    "name": "whirlpool";
                    "isMut": false;
                    "isSigner": false;
                },
                {
                    "name": "tokenProgram";
                    "isMut": false;
                    "isSigner": false;
                },
                {
                    "name": "systemProgram";
                    "isMut": false;
                    "isSigner": false;
                },
                {
                    "name": "rent";
                    "isMut": false;
                    "isSigner": false;
                },
                {
                    "name": "associatedTokenProgram";
                    "isMut": false;
                    "isSigner": false;
                }
            ];
            "args": [
                {
                    "name": "bumps";
                    "type": {
                        "defined": "OpenPositionBumps";
                    };
                },
                {
                    "name": "tickLowerIndex";
                    "type": "i32";
                },
                {
                    "name": "tickUpperIndex";
                    "type": "i32";
                }
            ];
        },
        {
            "name": "openPositionWithMetadata";
            "accounts": [
                {
                    "name": "funder";
                    "isMut": true;
                    "isSigner": true;
                },
                {
                    "name": "owner";
                    "isMut": false;
                    "isSigner": false;
                },
                {
                    "name": "position";
                    "isMut": true;
                    "isSigner": false;
                },
                {
                    "name": "positionMint";
                    "isMut": true;
                    "isSigner": true;
                },
                {
                    "name": "positionMetadataAccount";
                    "isMut": true;
                    "isSigner": false;
                },
                {
                    "name": "positionTokenAccount";
                    "isMut": true;
                    "isSigner": false;
                },
                {
                    "name": "whirlpool";
                    "isMut": false;
                    "isSigner": false;
                },
                {
                    "name": "tokenProgram";
                    "isMut": false;
                    "isSigner": false;
                },
                {
                    "name": "systemProgram";
                    "isMut": false;
                    "isSigner": false;
                },
                {
                    "name": "rent";
                    "isMut": false;
                    "isSigner": false;
                },
                {
                    "name": "associatedTokenProgram";
                    "isMut": false;
                    "isSigner": false;
                },
                {
                    "name": "metadataProgram";
                    "isMut": false;
                    "isSigner": false;
                },
                {
                    "name": "metadataUpdateAuth";
                    "isMut": false;
                    "isSigner": false;
                }
            ];
            "args": [
                {
                    "name": "bumps";
                    "type": {
                        "defined": "OpenPositionWithMetadataBumps";
                    };
                },
                {
                    "name": "tickLowerIndex";
                    "type": "i32";
                },
                {
                    "name": "tickUpperIndex";
                    "type": "i32";
                }
            ];
        },
        {
            "name": "increaseLiquidity";
            "accounts": [
                {
                    "name": "whirlpool";
                    "isMut": true;
                    "isSigner": false;
                },
                {
                    "name": "tokenProgram";
                    "isMut": false;
                    "isSigner": false;
                },
                {
                    "name": "positionAuthority";
                    "isMut": false;
                    "isSigner": true;
                },
                {
                    "name": "position";
                    "isMut": true;
                    "isSigner": false;
                },
                {
                    "name": "positionTokenAccount";
                    "isMut": false;
                    "isSigner": false;
                },
                {
                    "name": "tokenOwnerAccountA";
                    "isMut": true;
                    "isSigner": false;
                },
                {
                    "name": "tokenOwnerAccountB";
                    "isMut": true;
                    "isSigner": false;
                },
                {
                    "name": "tokenVaultA";
                    "isMut": true;
                    "isSigner": false;
                },
                {
                    "name": "tokenVaultB";
                    "isMut": true;
                    "isSigner": false;
                },
                {
                    "name": "tickArrayLower";
                    "isMut": true;
                    "isSigner": false;
                },
                {
                    "name": "tickArrayUpper";
                    "isMut": true;
                    "isSigner": false;
                }
            ];
            "args": [
                {
                    "name": "liquidityAmount";
                    "type": "u128";
                },
                {
                    "name": "tokenMaxA";
                    "type": "u64";
                },
                {
                    "name": "tokenMaxB";
                    "type": "u64";
                }
            ];
        },
        {
            "name": "decreaseLiquidity";
            "accounts": [
                {
                    "name": "whirlpool";
                    "isMut": true;
                    "isSigner": false;
                },
                {
                    "name": "tokenProgram";
                    "isMut": false;
                    "isSigner": false;
                },
                {
                    "name": "positionAuthority";
                    "isMut": false;
                    "isSigner": true;
                },
                {
                    "name": "position";
                    "isMut": true;
                    "isSigner": false;
                },
                {
                    "name": "positionTokenAccount";
                    "isMut": false;
                    "isSigner": false;
                },
                {
                    "name": "tokenOwnerAccountA";
                    "isMut": true;
                    "isSigner": false;
                },
                {
                    "name": "tokenOwnerAccountB";
                    "isMut": true;
                    "isSigner": false;
                },
                {
                    "name": "tokenVaultA";
                    "isMut": true;
                    "isSigner": false;
                },
                {
                    "name": "tokenVaultB";
                    "isMut": true;
                    "isSigner": false;
                },
                {
                    "name": "tickArrayLower";
                    "isMut": true;
                    "isSigner": false;
                },
                {
                    "name": "tickArrayUpper";
                    "isMut": true;
                    "isSigner": false;
                }
            ];
            "args": [
                {
                    "name": "liquidityAmount";
                    "type": "u128";
                },
                {
                    "name": "tokenMinA";
                    "type": "u64";
                },
                {
                    "name": "tokenMinB";
                    "type": "u64";
                }
            ];
        },
        {
            "name": "updateFeesAndRewards";
            "accounts": [
                {
                    "name": "whirlpool";
                    "isMut": true;
                    "isSigner": false;
                },
                {
                    "name": "position";
                    "isMut": true;
                    "isSigner": false;
                },
                {
                    "name": "tickArrayLower";
                    "isMut": false;
                    "isSigner": false;
                },
                {
                    "name": "tickArrayUpper";
                    "isMut": false;
                    "isSigner": false;
                }
            ];
            "args": [];
        },
        {
            "name": "collectFees";
            "accounts": [
                {
                    "name": "whirlpool";
                    "isMut": false;
                    "isSigner": false;
                },
                {
                    "name": "positionAuthority";
                    "isMut": false;
                    "isSigner": true;
                },
                {
                    "name": "position";
                    "isMut": true;
                    "isSigner": false;
                },
                {
                    "name": "positionTokenAccount";
                    "isMut": false;
                    "isSigner": false;
                },
                {
                    "name": "tokenOwnerAccountA";
                    "isMut": true;
                    "isSigner": false;
                },
                {
                    "name": "tokenVaultA";
                    "isMut": true;
                    "isSigner": false;
                },
                {
                    "name": "tokenOwnerAccountB";
                    "isMut": true;
                    "isSigner": false;
                },
                {
                    "name": "tokenVaultB";
                    "isMut": true;
                    "isSigner": false;
                },
                {
                    "name": "tokenProgram";
                    "isMut": false;
                    "isSigner": false;
                }
            ];
            "args": [];
        },
        {
            "name": "collectReward";
            "accounts": [
                {
                    "name": "whirlpool";
                    "isMut": false;
                    "isSigner": false;
                },
                {
                    "name": "positionAuthority";
                    "isMut": false;
                    "isSigner": true;
                },
                {
                    "name": "position";
                    "isMut": true;
                    "isSigner": false;
                },
                {
                    "name": "positionTokenAccount";
                    "isMut": false;
                    "isSigner": false;
                },
                {
                    "name": "rewardOwnerAccount";
                    "isMut": true;
                    "isSigner": false;
                },
                {
                    "name": "rewardVault";
                    "isMut": true;
                    "isSigner": false;
                },
                {
                    "name": "tokenProgram";
                    "isMut": false;
                    "isSigner": false;
                }
            ];
            "args": [
                {
                    "name": "rewardIndex";
                    "type": "u8";
                }
            ];
        },
        {
            "name": "collectProtocolFees";
            "accounts": [
                {
                    "name": "whirlpoolsConfig";
                    "isMut": false;
                    "isSigner": false;
                },
                {
                    "name": "whirlpool";
                    "isMut": true;
                    "isSigner": false;
                },
                {
                    "name": "collectProtocolFeesAuthority";
                    "isMut": false;
                    "isSigner": true;
                },
                {
                    "name": "tokenVaultA";
                    "isMut": true;
                    "isSigner": false;
                },
                {
                    "name": "tokenVaultB";
                    "isMut": true;
                    "isSigner": false;
                },
                {
                    "name": "tokenDestinationA";
                    "isMut": true;
                    "isSigner": false;
                },
                {
                    "name": "tokenDestinationB";
                    "isMut": true;
                    "isSigner": false;
                },
                {
                    "name": "tokenProgram";
                    "isMut": false;
                    "isSigner": false;
                }
            ];
            "args": [];
        },
        {
            "name": "swap";
            "accounts": [
                {
                    "name": "tokenProgram";
                    "isMut": false;
                    "isSigner": false;
                },
                {
                    "name": "tokenAuthority";
                    "isMut": false;
                    "isSigner": true;
                },
                {
                    "name": "whirlpool";
                    "isMut": true;
                    "isSigner": false;
                },
                {
                    "name": "tokenOwnerAccountA";
                    "isMut": true;
                    "isSigner": false;
                },
                {
                    "name": "tokenVaultA";
                    "isMut": true;
                    "isSigner": false;
                },
                {
                    "name": "tokenOwnerAccountB";
                    "isMut": true;
                    "isSigner": false;
                },
                {
                    "name": "tokenVaultB";
                    "isMut": true;
                    "isSigner": false;
                },
                {
                    "name": "tickArray0";
                    "isMut": true;
                    "isSigner": false;
                },
                {
                    "name": "tickArray1";
                    "isMut": true;
                    "isSigner": false;
                },
                {
                    "name": "tickArray2";
                    "isMut": true;
                    "isSigner": false;
                },
                {
                    "name": "oracle";
                    "isMut": false;
                    "isSigner": false;
                }
            ];
            "args": [
                {
                    "name": "amount";
                    "type": "u64";
                },
                {
                    "name": "otherAmountThreshold";
                    "type": "u64";
                },
                {
                    "name": "sqrtPriceLimit";
                    "type": "u128";
                },
                {
                    "name": "amountSpecifiedIsInput";
                    "type": "bool";
                },
                {
                    "name": "aToB";
                    "type": "bool";
                }
            ];
        },
        {
            "name": "closePosition";
            "accounts": [
                {
                    "name": "positionAuthority";
                    "isMut": false;
                    "isSigner": true;
                },
                {
                    "name": "receiver";
                    "isMut": true;
                    "isSigner": false;
                },
                {
                    "name": "position";
                    "isMut": true;
                    "isSigner": false;
                },
                {
                    "name": "positionMint";
                    "isMut": true;
                    "isSigner": false;
                },
                {
                    "name": "positionTokenAccount";
                    "isMut": true;
                    "isSigner": false;
                },
                {
                    "name": "tokenProgram";
                    "isMut": false;
                    "isSigner": false;
                }
            ];
            "args": [];
        },
        {
            "name": "setDefaultFeeRate";
            "accounts": [
                {
                    "name": "whirlpoolsConfig";
                    "isMut": false;
                    "isSigner": false;
                },
                {
                    "name": "feeTier";
                    "isMut": true;
                    "isSigner": false;
                },
                {
                    "name": "feeAuthority";
                    "isMut": false;
                    "isSigner": true;
                }
            ];
            "args": [
                {
                    "name": "defaultFeeRate";
                    "type": "u16";
                }
            ];
        },
        {
            "name": "setDefaultProtocolFeeRate";
            "accounts": [
                {
                    "name": "whirlpoolsConfig";
                    "isMut": true;
                    "isSigner": false;
                },
                {
                    "name": "feeAuthority";
                    "isMut": false;
                    "isSigner": true;
                }
            ];
            "args": [
                {
                    "name": "defaultProtocolFeeRate";
                    "type": "u16";
                }
            ];
        },
        {
            "name": "setFeeRate";
            "accounts": [
                {
                    "name": "whirlpoolsConfig";
                    "isMut": false;
                    "isSigner": false;
                },
                {
                    "name": "whirlpool";
                    "isMut": true;
                    "isSigner": false;
                },
                {
                    "name": "feeAuthority";
                    "isMut": false;
                    "isSigner": true;
                }
            ];
            "args": [
                {
                    "name": "feeRate";
                    "type": "u16";
                }
            ];
        },
        {
            "name": "setProtocolFeeRate";
            "accounts": [
                {
                    "name": "whirlpoolsConfig";
                    "isMut": false;
                    "isSigner": false;
                },
                {
                    "name": "whirlpool";
                    "isMut": true;
                    "isSigner": false;
                },
                {
                    "name": "feeAuthority";
                    "isMut": false;
                    "isSigner": true;
                }
            ];
            "args": [
                {
                    "name": "protocolFeeRate";
                    "type": "u16";
                }
            ];
        },
        {
            "name": "setFeeAuthority";
            "accounts": [
                {
                    "name": "whirlpoolsConfig";
                    "isMut": true;
                    "isSigner": false;
                },
                {
                    "name": "feeAuthority";
                    "isMut": false;
                    "isSigner": true;
                },
                {
                    "name": "newFeeAuthority";
                    "isMut": false;
                    "isSigner": false;
                }
            ];
            "args": [];
        },
        {
            "name": "setCollectProtocolFeesAuthority";
            "accounts": [
                {
                    "name": "whirlpoolsConfig";
                    "isMut": true;
                    "isSigner": false;
                },
                {
                    "name": "collectProtocolFeesAuthority";
                    "isMut": false;
                    "isSigner": true;
                },
                {
                    "name": "newCollectProtocolFeesAuthority";
                    "isMut": false;
                    "isSigner": false;
                }
            ];
            "args": [];
        },
        {
            "name": "setRewardAuthority";
            "accounts": [
                {
                    "name": "whirlpool";
                    "isMut": true;
                    "isSigner": false;
                },
                {
                    "name": "rewardAuthority";
                    "isMut": false;
                    "isSigner": true;
                },
                {
                    "name": "newRewardAuthority";
                    "isMut": false;
                    "isSigner": false;
                }
            ];
            "args": [
                {
                    "name": "rewardIndex";
                    "type": "u8";
                }
            ];
        },
        {
            "name": "setRewardAuthorityBySuperAuthority";
            "accounts": [
                {
                    "name": "whirlpoolsConfig";
                    "isMut": false;
                    "isSigner": false;
                },
                {
                    "name": "whirlpool";
                    "isMut": true;
                    "isSigner": false;
                },
                {
                    "name": "rewardEmissionsSuperAuthority";
                    "isMut": false;
                    "isSigner": true;
                },
                {
                    "name": "newRewardAuthority";
                    "isMut": false;
                    "isSigner": false;
                }
            ];
            "args": [
                {
                    "name": "rewardIndex";
                    "type": "u8";
                }
            ];
        },
        {
            "name": "setRewardEmissionsSuperAuthority";
            "accounts": [
                {
                    "name": "whirlpoolsConfig";
                    "isMut": true;
                    "isSigner": false;
                },
                {
                    "name": "rewardEmissionsSuperAuthority";
                    "isMut": false;
                    "isSigner": true;
                },
                {
                    "name": "newRewardEmissionsSuperAuthority";
                    "isMut": false;
                    "isSigner": false;
                }
            ];
            "args": [];
        }
    ];
    "accounts": [
        {
            "name": "whirlpoolsConfig";
            "type": {
                "kind": "struct";
                "fields": [
                    {
                        "name": "feeAuthority";
                        "type": "publicKey";
                    },
                    {
                        "name": "collectProtocolFeesAuthority";
                        "type": "publicKey";
                    },
                    {
                        "name": "rewardEmissionsSuperAuthority";
                        "type": "publicKey";
                    },
                    {
                        "name": "defaultProtocolFeeRate";
                        "type": "u16";
                    }
                ];
            };
        },
        {
            "name": "feeTier";
            "type": {
                "kind": "struct";
                "fields": [
                    {
                        "name": "whirlpoolsConfig";
                        "type": "publicKey";
                    },
                    {
                        "name": "tickSpacing";
                        "type": "u16";
                    },
                    {
                        "name": "defaultFeeRate";
                        "type": "u16";
                    }
                ];
            };
        },
        {
            "name": "position";
            "type": {
                "kind": "struct";
                "fields": [
                    {
                        "name": "whirlpool";
                        "type": "publicKey";
                    },
                    {
                        "name": "positionMint";
                        "type": "publicKey";
                    },
                    {
                        "name": "liquidity";
                        "type": "u128";
                    },
                    {
                        "name": "tickLowerIndex";
                        "type": "i32";
                    },
                    {
                        "name": "tickUpperIndex";
                        "type": "i32";
                    },
                    {
                        "name": "feeGrowthCheckpointA";
                        "type": "u128";
                    },
                    {
                        "name": "feeOwedA";
                        "type": "u64";
                    },
                    {
                        "name": "feeGrowthCheckpointB";
                        "type": "u128";
                    },
                    {
                        "name": "feeOwedB";
                        "type": "u64";
                    },
                    {
                        "name": "rewardInfos";
                        "type": {
                            "array": [
                                {
                                    "defined": "PositionRewardInfo";
                                },
                                3
                            ];
                        };
                    }
                ];
            };
        },
        {
            "name": "tickArray";
            "type": {
                "kind": "struct";
                "fields": [
                    {
                        "name": "startTickIndex";
                        "type": "i32";
                    },
                    {
                        "name": "ticks";
                        "type": {
                            "array": [
                                {
                                    "defined": "Tick";
                                },
                                88
                            ];
                        };
                    },
                    {
                        "name": "whirlpool";
                        "type": "publicKey";
                    }
                ];
            };
        },
        {
            "name": "whirlpool";
            "type": {
                "kind": "struct";
                "fields": [
                    {
                        "name": "whirlpoolsConfig";
                        "type": "publicKey";
                    },
                    {
                        "name": "whirlpoolBump";
                        "type": {
                            "array": [
                                "u8",
                                1
                            ];
                        };
                    },
                    {
                        "name": "tickSpacing";
                        "type": "u16";
                    },
                    {
                        "name": "tickSpacingSeed";
                        "type": {
                            "array": [
                                "u8",
                                2
                            ];
                        };
                    },
                    {
                        "name": "feeRate";
                        "type": "u16";
                    },
                    {
                        "name": "protocolFeeRate";
                        "type": "u16";
                    },
                    {
                        "name": "liquidity";
                        "type": "u128";
                    },
                    {
                        "name": "sqrtPrice";
                        "type": "u128";
                    },
                    {
                        "name": "tickCurrentIndex";
                        "type": "i32";
                    },
                    {
                        "name": "protocolFeeOwedA";
                        "type": "u64";
                    },
                    {
                        "name": "protocolFeeOwedB";
                        "type": "u64";
                    },
                    {
                        "name": "tokenMintA";
                        "type": "publicKey";
                    },
                    {
                        "name": "tokenVaultA";
                        "type": "publicKey";
                    },
                    {
                        "name": "feeGrowthGlobalA";
                        "type": "u128";
                    },
                    {
                        "name": "tokenMintB";
                        "type": "publicKey";
                    },
                    {
                        "name": "tokenVaultB";
                        "type": "publicKey";
                    },
                    {
                        "name": "feeGrowthGlobalB";
                        "type": "u128";
                    },
                    {
                        "name": "rewardLastUpdatedTimestamp";
                        "type": "u64";
                    },
                    {
                        "name": "rewardInfos";
                        "type": {
                            "array": [
                                {
                                    "defined": "WhirlpoolRewardInfo";
                                },
                                3
                            ];
                        };
                    }
                ];
            };
        }
    ];
    "types": [
        {
            "name": "OpenPositionBumps";
            "type": {
                "kind": "struct";
                "fields": [
                    {
                        "name": "positionBump";
                        "type": "u8";
                    }
                ];
            };
        },
        {
            "name": "OpenPositionWithMetadataBumps";
            "type": {
                "kind": "struct";
                "fields": [
                    {
                        "name": "positionBump";
                        "type": "u8";
                    },
                    {
                        "name": "metadataBump";
                        "type": "u8";
                    }
                ];
            };
        },
        {
            "name": "PositionRewardInfo";
            "type": {
                "kind": "struct";
                "fields": [
                    {
                        "name": "growthInsideCheckpoint";
                        "type": "u128";
                    },
                    {
                        "name": "amountOwed";
                        "type": "u64";
                    }
                ];
            };
        },
        {
            "name": "Tick";
            "type": {
                "kind": "struct";
                "fields": [
                    {
                        "name": "initialized";
                        "type": "bool";
                    },
                    {
                        "name": "liquidityNet";
                        "type": "i128";
                    },
                    {
                        "name": "liquidityGross";
                        "type": "u128";
                    },
                    {
                        "name": "feeGrowthOutsideA";
                        "type": "u128";
                    },
                    {
                        "name": "feeGrowthOutsideB";
                        "type": "u128";
                    },
                    {
                        "name": "rewardGrowthsOutside";
                        "type": {
                            "array": [
                                "u128",
                                3
                            ];
                        };
                    }
                ];
            };
        },
        {
            "name": "WhirlpoolRewardInfo";
            "type": {
                "kind": "struct";
                "fields": [
                    {
                        "name": "mint";
                        "type": "publicKey";
                    },
                    {
                        "name": "vault";
                        "type": "publicKey";
                    },
                    {
                        "name": "authority";
                        "type": "publicKey";
                    },
                    {
                        "name": "emissionsPerSecondX64";
                        "type": "u128";
                    },
                    {
                        "name": "growthGlobalX64";
                        "type": "u128";
                    }
                ];
            };
        },
        {
            "name": "WhirlpoolBumps";
            "type": {
                "kind": "struct";
                "fields": [
                    {
                        "name": "whirlpoolBump";
                        "type": "u8";
                    }
                ];
            };
        },
        {
            "name": "CurrIndex";
            "type": {
                "kind": "enum";
                "variants": [
                    {
                        "name": "Below";
                    },
                    {
                        "name": "Inside";
                    },
                    {
                        "name": "Above";
                    }
                ];
            };
        },
        {
            "name": "TickLabel";
            "type": {
                "kind": "enum";
                "variants": [
                    {
                        "name": "Upper";
                    },
                    {
                        "name": "Lower";
                    }
                ];
            };
        },
        {
            "name": "Direction";
            "type": {
                "kind": "enum";
                "variants": [
                    {
                        "name": "Left";
                    },
                    {
                        "name": "Right";
                    }
                ];
            };
        }
    ];
    "errors": [
        {
            "code": 6000;
            "name": "InvalidEnum";
            "msg": "Enum value could not be converted";
        },
        {
            "code": 6001;
            "name": "InvalidStartTick";
            "msg": "Invalid start tick index provided.";
        },
        {
            "code": 6002;
            "name": "TickArrayExistInPool";
            "msg": "Tick-array already exists in this whirlpool";
        },
        {
            "code": 6003;
            "name": "TickArrayIndexOutofBounds";
            "msg": "Attempt to search for a tick-array failed";
        },
        {
            "code": 6004;
            "name": "InvalidTickSpacing";
            "msg": "Tick-spacing is not supported";
        },
        {
            "code": 6005;
            "name": "ClosePositionNotEmpty";
            "msg": "Position is not empty It cannot be closed";
        },
        {
            "code": 6006;
            "name": "DivideByZero";
            "msg": "Unable to divide by zero";
        },
        {
            "code": 6007;
            "name": "NumberCastError";
            "msg": "Unable to cast number into BigInt";
        },
        {
            "code": 6008;
            "name": "NumberDownCastError";
            "msg": "Unable to down cast number";
        },
        {
            "code": 6009;
            "name": "TickNotFound";
            "msg": "Tick not found within tick array";
        },
        {
            "code": 6010;
            "name": "InvalidTickIndex";
            "msg": "Provided tick index is either out of bounds or uninitializable";
        },
        {
            "code": 6011;
            "name": "SqrtPriceOutOfBounds";
            "msg": "Provided sqrt price out of bounds";
        },
        {
            "code": 6012;
            "name": "LiquidityZero";
            "msg": "Liquidity amount must be greater than zero";
        },
        {
            "code": 6013;
            "name": "LiquidityTooHigh";
            "msg": "Liquidity amount must be less than i64::MAX";
        },
        {
            "code": 6014;
            "name": "LiquidityOverflow";
            "msg": "Liquidity overflow";
        },
        {
            "code": 6015;
            "name": "LiquidityUnderflow";
            "msg": "Liquidity underflow";
        },
        {
            "code": 6016;
            "name": "LiquidityNetError";
            "msg": "Tick liquidity net underflowed or overflowed";
        },
        {
            "code": 6017;
            "name": "TokenMaxExceeded";
            "msg": "Exceeded token max";
        },
        {
            "code": 6018;
            "name": "TokenMinSubceeded";
            "msg": "Did not meet token min";
        },
        {
            "code": 6019;
            "name": "MissingOrInvalidDelegate";
            "msg": "Position token account has a missing or invalid delegate";
        },
        {
            "code": 6020;
            "name": "InvalidPositionTokenAmount";
            "msg": "Position token amount must be 1";
        },
        {
            "code": 6021;
            "name": "InvalidTimestampConversion";
            "msg": "Timestamp should be convertible from i64 to u64";
        },
        {
            "code": 6022;
            "name": "InvalidTimestamp";
            "msg": "Timestamp should be greater than the last updated timestamp";
        },
        {
            "code": 6023;
            "name": "InvalidTickArraySequence";
            "msg": "Invalid tick array sequence provided for instruction.";
        },
        {
            "code": 6024;
            "name": "InvalidTokenMintOrder";
            "msg": "Token Mint in wrong order";
        },
        {
            "code": 6025;
            "name": "RewardNotInitialized";
            "msg": "Reward not initialized";
        },
        {
            "code": 6026;
            "name": "InvalidRewardIndex";
            "msg": "Invalid reward index";
        },
        {
            "code": 6027;
            "name": "RewardVaultAmountInsufficient";
            "msg": "Reward vault requires amount to support emissions for at least one day";
        },
        {
            "code": 6028;
            "name": "FeeRateMaxExceeded";
            "msg": "Exceeded max fee rate";
        },
        {
            "code": 6029;
            "name": "ProtocolFeeRateMaxExceeded";
            "msg": "Exceeded max protocol fee rate";
        },
        {
            "code": 6030;
            "name": "MultiplicationShiftRightOverflow";
            "msg": "Multiplication with shift right overflow";
        },
        {
            "code": 6031;
            "name": "MulDivOverflow";
            "msg": "Muldiv overflow";
        },
        {
            "code": 6032;
            "name": "MulDivInvalidInput";
            "msg": "Invalid div_u256 input";
        },
        {
            "code": 6033;
            "name": "MultiplicationOverflow";
            "msg": "Multiplication overflow";
        },
        {
            "code": 6034;
            "name": "InvalidSqrtPriceLimitDirection";
            "msg": "Provided SqrtPriceLimit not in the same direction as the swap.";
        },
        {
            "code": 6035;
            "name": "ZeroTradableAmount";
            "msg": "There are no tradable amount to swap.";
        },
        {
            "code": 6036;
            "name": "AmountOutBelowMinimum";
            "msg": "Amount out below minimum threshold";
        },
        {
            "code": 6037;
            "name": "AmountInAboveMaximum";
            "msg": "Amount in above maximum threshold";
        },
        {
            "code": 6038;
            "name": "TickArraySequenceInvalidIndex";
            "msg": "Invalid index for tick array sequence";
        },
        {
            "code": 6039;
            "name": "AmountCalcOverflow";
            "msg": "Amount calculated overflows";
        },
        {
            "code": 6040;
            "name": "AmountRemainingOverflow";
            "msg": "Amount remaining overflows";
        }
    ];
};

/**
 * Program ID hosting Orca's Whirlpool program.
 * @category Constants
 */
declare const ORCA_WHIRLPOOL_PROGRAM_ID: PublicKey;
/**
 * Orca's WhirlpoolsConfig PublicKey.
 * @category Constants
 */
declare const ORCA_WHIRLPOOLS_CONFIG: PublicKey;
/**
 * The number of rewards supported by this whirlpool.
 * @category Constants
 */
declare const NUM_REWARDS = 3;
/**
 * The maximum tick index supported by the Whirlpool program.
 * @category Constants
 */
declare const MAX_TICK_INDEX = 443636;
/**
 * The minimum tick index supported by the Whirlpool program.
 * @category Constants
 */
declare const MIN_TICK_INDEX = -443636;
/**
 * The maximum sqrt-price supported by the Whirlpool program.
 * @category Constants
 */
declare const MAX_SQRT_PRICE = "79226673515401279992447579055";
/**
 * The minimum sqrt-price supported by the Whirlpool program.
 * @category Constants
 */
declare const MIN_SQRT_PRICE = "4295048016";
/**
 * The number of initialized ticks that a tick-array account can hold.
 * @category Constants
 */
declare const TICK_ARRAY_SIZE = 88;
/**
 * @category Constants
 */
declare const METADATA_PROGRAM_ADDRESS: PublicKey;
/**
 * The maximum number of tick-arrays that can traversed across in a swap.
 * @category Constants
 */
declare const MAX_SWAP_TICK_ARRAYS = 3;
/**
 * The denominator which the protocol fee rate is divided on.
 * @category Constants
 */
declare const PROTOCOL_FEE_RATE_MUL_VALUE: BN;
/**
 * The denominator which the fee rate is divided on.
 * @category Constants
 */
declare const FEE_RATE_MUL_VALUE: BN;

/**
 * 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
 */
declare enum AccountName {
    WhirlpoolsConfig = "WhirlpoolsConfig",
    Position = "Position",
    TickArray = "TickArray",
    Whirlpool = "Whirlpool",
    FeeTier = "FeeTier"
}
declare const WHIRLPOOL_CODER: BorshAccountsCoder<string>;
/**
 * Size of the Whirlpool account in bytes.
 */
declare const WHIRLPOOL_ACCOUNT_SIZE: number;
/**
 * @category Solana Accounts
 */
type WhirlpoolsConfigData = {
    feeAuthority: PublicKey;
    collectProtocolFeesAuthority: PublicKey;
    rewardEmissionsSuperAuthority: PublicKey;
    defaultFeeRate: number;
    defaultProtocolFeeRate: number;
};
/**
 * @category Solana Accounts
 */
type WhirlpoolRewardInfoData = {
    mint: PublicKey;
    vault: PublicKey;
    authority: PublicKey;
    emissionsPerSecondX64: BN;
    growthGlobalX64: BN;
};
/**
 * @category Solana Accounts
 */
type WhirlpoolBumpsData = {
    whirlpoolBump: number;
};
/**
 * @category Solana Accounts
 */
type WhirlpoolData = {
    whirlpoolsConfig: PublicKey;
    whirlpoolBump: number[];
    feeRate: number;
    protocolFeeRate: number;
    liquidity: BN;
    sqrtPrice: BN;
    tickCurrentIndex: number;
    protocolFeeOwedA: BN;
    protocolFeeOwedB: BN;
    tokenMintA: PublicKey;
    tokenVaultA: PublicKey;
    feeGrowthGlobalA: BN;
    tokenMintB: PublicKey;
    tokenVaultB: PublicKey;
    feeGrowthGlobalB: BN;
    rewardLastUpdatedTimestamp: BN;
    rewardInfos: WhirlpoolRewardInfoData[];
    tickSpacing: number;
};
/**
 * @category Solana Accounts
 */
type TickArrayData = {
    whirlpool: PublicKey;
    startTickIndex: number;
    ticks: TickData[];
};
/**
 * @category Solana Accounts
 */
type TickData = {
    initialized: boolean;
    liquidityNet: BN;
    liquidityGross: BN;
    feeGrowthOutsideA: BN;
    feeGrowthOutsideB: BN;
    rewardGrowthsOutside: BN[];
};
/**
 * @category Solana Accounts
 */
type PositionRewardInfoData = {
    growthInsideCheckpoint: BN;
    amountOwed: BN;
};
/**
 * @category Solana Accounts
 */
type OpenPositionBumpsData = {
    positionBump: number;
};
/**
 * @category Solana Accounts
 */
type OpenPositionWithMetadataBumpsData = {
    positionBump: number;
    metadataBump: number;
};
/**
 * @category Solana Accounts
 */
type PositionData = {
    whirlpool: PublicKey;
    positionMint: PublicKey;
    liquidity: BN;
    tickLowerIndex: number;
    tickUpperIndex: number;
    feeGrowthCheckpointA: BN;
    feeOwedA: BN;
    feeGrowthCheckpointB: BN;
    feeOwedB: BN;
    rewardInfos: PositionRewardInfoData[];
};
/**
 * @category Solana Accounts
 */
type FeeTierData = {
    whirlpoolsConfig: PublicKey;
    tickSpacing: number;
    defaultFeeRate: number;
};

/**
 * Parameters to close a position in a Whirlpool.
 *
 * @category Instruction Types
 * @param receiver - PublicKey for the wallet that will receive the rented lamports.
 * @param position - PublicKey for the position.
 * @param positionMint - PublicKey for the mint token for the Position token.
 * @param positionTokenAccount - The associated token address for the position token in the owners wallet.
 * @param positionAuthority - Authority that owns the position token.
 */
type ClosePositionParams = {
    receiver: PublicKey;
    position: PublicKey;
    positionMint: PublicKey;
    positionTokenAccount: PublicKey;
    positionAuthority: PublicKey;
};

/**
 * Parameters to collect fees from a position.
 *
 * @category Instruction Types
 * @param whirlpool - PublicKey for the whirlpool that the position will be opened for.
 * @param position - PublicKey for the  position will be opened for.
 * @param positionTokenAccount - PublicKey for the position token's associated token address.
 * @param tokenOwnerAccountA - PublicKey for the token A account that will be withdrawed from.
 * @param tokenOwnerAccountB - PublicKey for the token B account that will be withdrawed from.
 * @param tokenVaultA - PublicKey for the tokenA vault for this whirlpool.
 * @param tokenVaultB - PublicKey for the tokenB vault for this whirlpool.
 * @param positionAuthority - authority that owns the token corresponding to this desired position.
 */
type CollectFeesParams = {
    whirlpool: PublicKey;
    position: PublicKey;
    positionTokenAccount: PublicKey;
    tokenOwnerAccountA: PublicKey;
    tokenOwnerAccountB: PublicKey;
    tokenVaultA: PublicKey;
    tokenVaultB: PublicKey;
    positionAuthority: PublicKey;
};

/**
 * Parameters to collect protocol fees for a Whirlpool
 *
 * @category Instruction Types
 * @param whirlpoolsConfig - The public key for the WhirlpoolsConfig this pool is initialized in
 * @param whirlpool - PublicKey for the whirlpool that the position will be opened for.
 * @param tokenVaultA - PublicKey for the tokenA vault for this whirlpool.
 * @param tokenVaultB - PublicKey for the tokenB vault for this whirlpool.
 * @param tokenOwnerAccountA - PublicKey for the associated token account for tokenA in the collection wallet
 * @param tokenOwnerAccountB - PublicKey for the associated token account for tokenA in the collection wallet
 * @param collectProtocolFeesAuthority - assigned authority in the WhirlpoolsConfig that can collect protocol fees
 */
type CollectProtocolFeesParams = {
    whirlpoolsConfig: PublicKey;
    whirlpool: PublicKey;
    tokenVaultA: PublicKey;
    tokenVaultB: PublicKey;
    tokenOwnerAccountA: PublicKey;
    tokenOwnerAccountB: PublicKey;
    collectProtocolFeesAuthority: PublicKey;
};

/**
 * Parameters to collect rewards from a reward index in a position.
 *
 * @category Instruction Types
 * @param whirlpool - PublicKey for the whirlpool that the position will be opened for.
 * @param position - PublicKey for the  position will be opened for.
 * @param positionTokenAccount - PublicKey for the position token's associated token address.
 * @param rewardIndex - The reward index that we'd like to initialize. (0 <= index <= NUM_REWARDS).
 * @param rewardOwnerAccount - PublicKey for the reward token account that the reward will deposit into.
 * @param rewardVault - PublicKey of the vault account that reward will be withdrawn from.
 * @param positionAuthority - authority that owns the token corresponding to this desired position.
 */
type CollectRewardParams = {
    whirlpool: PublicKey;
    position: PublicKey;
    positionTokenAccount: PublicKey;
    rewardIndex: number;
    rewardOwnerAccount: PublicKey;
    rewardVault: PublicKey;
    positionAuthority: PublicKey;
};

/**
 * Parameters to collect all fees and rewards from a list of positions.
 *
 * @category Instruction Types
 * @param positionAddrs - An array of Whirlpool position addresses.
 * @param receiver - The destination wallet that collected fees & reward will be sent to. Defaults to ctx.wallet key.
 * @param positionOwner - The wallet key that contains the position token. Defaults to ctx.wallet key.
 * @param positionAuthority - The authority key that can authorize operation on the position. Defaults to ctx.wallet key.
 * @param payer - The key that will pay for the initialization of ATA token accounts. Defaults to ctx.wallet key.
 */
type CollectAllPositionAddressParams = {
    positions: Address[];
} & CollectAllParams;
type CollectAllParams = {
    receiver?: PublicKey;
    positionOwner?: PublicKey;
    positionAuthority?: PublicKey;
    payer?: PublicKey;
};

/**
 * Parameters to remove liquidity from a position.
 *
 * @category Instruction Types
 * @param liquidityAmount - The total amount of Liquidity the user is withdrawing
 * @param tokenMinA - The minimum amount of token A to remove from the position.
 * @param tokenMinB - The minimum amount of token B to remove from the position.
 * @param whirlpool - PublicKey for the whirlpool that the position will be opened for.
 * @param position - PublicKey for the  position will be opened for.
 * @param positionTokenAccount - PublicKey for the position token's associated token address.
 * @param tokenOwnerAccountA - PublicKey for the token A account that will be withdrawed from.
 * @param tokenOwnerAccountB - PublicKey for the token B account that will be withdrawed from.
 * @param tokenVaultA - PublicKey for the tokenA vault for this whirlpool.
 * @param tokenVaultB - PublicKey for the tokenB vault for this whirlpool.
 * @param tickArrayLower - PublicKey for the tick-array account that hosts the tick at the lower tick index.
 * @param tickArrayUpper - PublicKey for the tick-array account that hosts the tick at the upper tick index.
 * @param positionAuthority - authority that owns the token corresponding to this desired position.
 */
type DecreaseLiquidityParams = {
    whirlpool: PublicKey;
    position: PublicKey;
    positionTokenAccount: PublicKey;
    tokenOwnerAccountA: PublicKey;
    tokenOwnerAccountB: PublicKey;
    tokenVaultA: PublicKey;
    tokenVaultB: PublicKey;
    tickArrayLower: PublicKey;
    tickArrayUpper: PublicKey;
    positionAuthority: PublicKey;
} & DecreaseLiquidityInput;
/**
 * @category Instruction Types
 */
type DecreaseLiquidityInput = {
    tokenMinA: BN;
    tokenMinB: BN;
    liquidityAmount: BN;
};

/**
 * Parameters to increase liquidity for a position.
 *
 * @category Instruction Types
 * @param liquidityAmount - The total amount of Liquidity the user is willing to deposit.
 * @param tokenMaxA - The maximum amount of token A to add to the position.
 * @param tokenMaxB - The maximum amount of token B to add to the position.
 * @param whirlpool - PublicKey for the whirlpool that the position will be opened for.
 * @param position - PublicKey for the  position will be opened for.
 * @param positionTokenAccount - PublicKey for the position token's associated token address.
 * @param tokenOwnerAccountA - PublicKey for the token A account that will be withdrawed from.
 * @param tokenOwnerAccountB - PublicKey for the token B account that will be withdrawed from.
 * @param tokenVaultA - PublicKey for the tokenA vault for this whirlpool.
 * @param tokenVaultB - PublicKey for the tokenB vault for this whirlpool.
 * @param tickArrayLower - PublicKey for the tick-array account that hosts the tick at the lower tick index.
 * @param tickArrayUpper - PublicKey for the tick-array account that hosts the tick at the upper tick index.
 * @param positionAuthority - authority that owns the token corresponding to this desired position.
 */
type IncreaseLiquidityParams = {
    whirlpool: PublicKey;
    position: PublicKey;
    positionTokenAccount: PublicKey;
    tokenOwnerAccountA: PublicKey;
    tokenOwnerAccountB: PublicKey;
    tokenVaultA: PublicKey;
    tokenVaultB: PublicKey;
    tickArrayLower: PublicKey;
    tickArrayUpper: PublicKey;
    positionAuthority: PublicKey;
} & IncreaseLiquidityInput;
/**
 * Input parameters to deposit liquidity into a position.
 *
 * This type is usually generated by a quote class to estimate the amount of tokens required to
 * deposit a certain amount of liquidity into a position.
 *
 * @category Instruction Types
 * @param tokenMaxA - the maximum amount of tokenA allowed to withdraw from the source wallet.
 * @param tokenMaxB - the maximum amount of tokenB allowed to withdraw from the source wallet.
 * @param liquidityAmount - the desired amount of liquidity to deposit into the position/
 */
type IncreaseLiquidityInput = {
    tokenMaxA: u64;
    tokenMaxB: u64;
    liquidityAmount: BN;
};

/**
 * Parameters to initialize a WhirlpoolsConfig account.
 *
 * @category Instruction Types
 * @param whirlpoolsConfigKeypair - Generated keypair for the WhirlpoolsConfig.
 * @param feeAuthority - Authority authorized to initialize fee-tiers and set customs fees.
 * @param collect_protocol_fees_authority - Authority authorized to collect protocol fees.
 * @param rewardEmissionsSuperAuthority - Authority authorized to set reward authorities in pools.
 * @param defaultProtocolFeeRate - The default protocol fee rate. Stored as a basis point of the total fees collected by feeRate.
 * @param funder - The account that would fund the creation of this account
 */
type InitConfigParams = {
    whirlpoolsConfigKeypair: Keypair;
    feeAuthority: PublicKey;
    collectProtocolFeesAuthority: PublicKey;
    rewardEmissionsSuperAuthority: PublicKey;
    defaultProtocolFeeRate: number;
    funder: PublicKey;
};

/**
 * Parameters to initialize a FeeTier account.
 *
 * @category Instruction Types
 * @param whirlpoolsConfig - PublicKey for the whirlpool config space that the fee-tier will be initialized for.
 * @param feeTierPda - PDA for the fee-tier account that will be initialized
 * @param tickSpacing - The tick spacing this fee tier recommends its default fee rate for.
 * @param defaultFeeRate - The default fee rate for this fee-tier. Stored as a hundredths of a basis point.
 * @param feeAuthority - Authority authorized to initialize fee-tiers and set customs fees.
 * @param funder - The account that would fund the creation of this account
 */
type InitFeeTierParams = {
    whirlpoolsConfig: PublicKey;
    feeTierPda: PDA;
    tickSpacing: number;
    defaultFeeRate: number;
    feeAuthority: PublicKey;
    funder: PublicKey;
};

/**
 * Parameters to initialize a Whirlpool account.
 *
 * @category Instruction Types
 * @param initSqrtPrice - The desired initial sqrt-price for this pool
 * @param whirlpoolsConfig - The public key for the WhirlpoolsConfig this pool is initialized in
 * @param whirlpoolPda - PDA for the whirlpool account that would be initialized
 * @param tokenMintA - Mint public key for token A
 * @param tokenMintB - Mint public key for token B
 * @param tokenVaultAKeypair - Keypair of the token A vault for this pool
 * @param tokenVaultBKeypair - Keypair of the token B vault for this pool
 * @param feeTierKey - PublicKey of the fee-tier account that this pool would use for the fee-rate
 * @param tickSpacing - The desired tick spacing for this pool.
 * @param funder - The account that would fund the creation of this account
 */
type InitPoolParams = {
    initSqrtPrice: BN;
    whirlpoolsConfig: PublicKey;
    whirlpoolPda: PDA;
    tokenMintA: PublicKey;
    tokenMintB: PublicKey;
    tokenVaultAKeypair: Keypair;
    tokenVaultBKeypair: Keypair;
    feeTierKey: PublicKey;
    tickSpacing: number;
    funder: PublicKey;
};

/**
 * Parameters to initialize a rewards for a Whirlpool
 *
 * @category Instruction Types
 * @param whirlpool - PublicKey for the whirlpool config space that the fee-tier will be initialized for.
 * @param rewardIndex - The reward index that we'd like to initialize. (0 <= index <= NUM_REWARDS).
 * @param rewardMint - PublicKey for the reward mint that we'd use for the reward index.
 * @param rewardVaultKeypair - Keypair of the vault for this reward index.
 * @param rewardAuthority - Assigned authority by the reward_super_authority for the specified reward-index in this Whirlpool
 * @param funder - The account that would fund the creation of this account
 */
type InitializeRewardParams = {
    whirlpool: PublicKey;
    rewardIndex: number;
    rewardMint: PublicKey;
    rewardVaultKeypair: Keypair;
    rewardAuthority: PublicKey;
    funder: PublicKey;
};

/**
 * Parameters to initialize a TickArray account.
 *
 * @category Instruction Types
 * @param whirlpool - PublicKey for the whirlpool that the initialized tick-array will host ticks for.
 * @param tickArrayPda - PDA for the tick array account that will be initialized
 * @param startTick - The starting tick index for this tick-array. Has to be a multiple of TickArray size & the tick spacing of this pool.
 * @param funder - The account that would fund the creation of this account
 */
type InitTickArrayParams = {
    whirlpool: PublicKey;
    tickArrayPda: PDA;
    startTick: number;
    funder: PublicKey;
};

/**
 * Parameters to open a position in a Whirlpool.
 *
 * @category Instruction Types
 * @param whirlpool - PublicKey for the whirlpool that the position will be opened for.
 * @param ownerKey - PublicKey for the wallet that will host the minted position token.
 * @param positionPda - PDA for the derived position address.
 * @param positionMintAddress - PublicKey for the mint token for the Position token.
 * @param positionTokenAccount - The associated token address for the position token in the owners wallet.
 * @param tickLowerIndex - The tick specifying the lower end of the position range.
 * @param tickUpperIndex - The tick specifying the upper end of the position range.
 * @param funder - The account that would fund the creation of this account
 */
type OpenPositionParams = {
    whirlpool: PublicKey;
    owner: PublicKey;
    positionPda: PDA;
    positionMintAddress: PublicKey;
    positionTokenAccount: PublicKey;
    tickLowerIndex: number;
    tickUpperIndex: number;
    funder: PublicKey;
};

/**
 * Parameters to set the collect fee authority in a WhirlpoolsConfig
 *
 * @category Instruction Types
 * @param whirlpoolsConfig - The public key for the WhirlpoolsConfig this pool is initialized in
 * @param collectProtocolFeesAuthority - The current collectProtocolFeesAuthority in the WhirlpoolsConfig
 * @param newCollectProtocolFeesAuthority - The new collectProtocolFeesAuthority in the WhirlpoolsConfig
 */
type SetCollectProtocolFeesAuthorityParams = {
    whirlpoolsConfig: PublicKey;
    collectProtocolFeesAuthority: PublicKey;
    newCollectProtocolFeesAuthority: PublicKey;
};

/**
 * Parameters to set the default fee rate for a FeeTier.
 *
 * @category Instruction Types
 * @param whirlpoolsConfig - The public key for the WhirlpoolsConfig this fee-tier is initialized in
 * @param feeAuthority - Authority authorized in the WhirlpoolsConfig to set default fee rates.
 * @param tickSpacing - The tick spacing of the fee-tier that we would like to update.
 * @param defaultFeeRate - The new default fee rate for this fee-tier. Stored as a hundredths of a basis point.
 */
type SetDefaultFeeRateParams = {
    whirlpoolsConfig: PublicKey;
    feeAuthority: PublicKey;
    tickSpacing: number;
    defaultFeeRate: number;
};

/**
 * Parameters to set the default fee rate for a FeeTier.
 *
 * @category Instruction Types
 * @param whirlpoolsConfig - The public key for the WhirlpoolsConfig this pool is initialized in
 * @param feeAuthority - Authority authorized in the WhirlpoolsConfig to set default fee rates.
 * @param defaultProtocolFeeRate - The new default protocol fee rate for this config. Stored as a basis point of the total fees collected by feeRate.
 */
type SetDefaultProtocolFeeRateParams = {
    whirlpoolsConfig: PublicKey;
    feeAuthority: PublicKey;
    defaultProtocolFeeRate: number;
};

/**
 * Parameters to set the fee authority in a WhirlpoolsConfig
 *
 * @category Instruction Types
 * @param whirlpoolsConfig - The public key for the WhirlpoolsConfig this pool is initialized in
 * @param feeAuthority - The current feeAuthority in the WhirlpoolsConfig
 * @param newFeeAuthority - The new feeAuthority in the WhirlpoolsConfig
 */
type SetFeeAuthorityParams = {
    whirlpoolsConfig: PublicKey;
    feeAuthority: PublicKey;
    newFeeAuthority: PublicKey;
};

/**
 * Parameters to set fee rate for a Whirlpool.
 *
 * @category Instruction Types
 * @param whirlpool - PublicKey for the whirlpool to update. This whirlpool has to be part of the provided WhirlpoolsConfig space.
 * @param whirlpoolsConfig - The public key for the WhirlpoolsConfig this pool is initialized in
 * @param feeAuthority - Authority authorized in the WhirlpoolsConfig to set default fee rates.
 * @param feeRate - The new fee rate for this fee-tier. Stored as a hundredths of a basis point.
 */
type SetFeeRateParams = {
    whirlpool: PublicKey;
    whirlpoolsConfig: PublicKey;
    feeAuthority: PublicKey;
    feeRate: number;
};

/**
 * Parameters to set fee rate for a Whirlpool.
 *
 * @category Instruction Types
 * @param whirlpool - PublicKey for the whirlpool to update. This whirlpool has to be part of the provided WhirlpoolsConfig space.
 * @param whirlpoolsConfig - The public key for the WhirlpoolsConfig this pool is initialized in
 * @param feeAuthority - Authority authorized in the WhirlpoolsConfig to set default fee rates.
 * @param protocolFeeRate - The new default protocol fee rate for this pool. Stored as a basis point of the total fees collected by feeRate.
 */
type SetProtocolFeeRateParams = {
    whirlpool: PublicKey;
    whirlpoolsConfig: PublicKey;
    feeAuthority: PublicKey;
    protocolFeeRate: number;
};

/**
 * Parameters to update the reward authority at a particular rewardIndex on a Whirlpool.
 *
 * @category Instruction Types
 * @param whirlpool - PublicKey for the whirlpool to update. This whirlpool has to be part of the provided WhirlpoolsConfig space.
 * @param whirlpoolsConfig - The public key for the WhirlpoolsConfig this pool is initialized in
 * @param rewardIndex - The reward index that we'd like to update. (0 <= index <= NUM_REWARDS).
 * @param rewardEmissionsSuperAuthority - The current rewardEmissionsSuperAuthority in the WhirlpoolsConfig
 * @param newRewardAuthority - The new rewardAuthority in the Whirlpool at the rewardIndex
 */
type SetRewardAuthorityBySuperAuthorityParams = {
    whirlpool: PublicKey;
    whirlpoolsConfig: PublicKey;
    rewardIndex: number;
    rewardEmissionsSuperAuthority: PublicKey;
    newRewardAuthority: PublicKey;
};

/**
 * Parameters to update the reward authority at a particular rewardIndex on a Whirlpool.
 *
 * @category Instruction Types
 * @param whirlpool - PublicKey for the whirlpool to update.
 * @param rewardIndex - The reward index that we'd like to update. (0 <= index <= NUM_REWARDS).
 * @param rewardAuthority - The current rewardAuthority in the Whirlpool at the rewardIndex
 * @param newRewardAuthority - The new rewardAuthority in the Whirlpool at the rewardIndex
 */
type SetRewardAuthorityParams = {
    whirlpool: PublicKey;
    rewardIndex: number;
    rewardAuthority: PublicKey;
    newRewardAuthority: PublicKey;
};

/**
 * Parameters to set rewards emissions for a reward in a Whirlpool
 *
 * @category Instruction Types
 * @param whirlpool - PublicKey for the whirlpool which the reward resides in.
 * @param rewardIndex - The reward index that we'd like to initialize. (0 <= index <= NUM_REWARDS).
 * @param rewardVaultKey - PublicKey of the vault for this reward index.
 * @param rewardAuthority - Assigned authority by the reward_super_authority for the specified reward-index in this Whirlpool
 * @param emissionsPerSecondX64 - The new emissions per second to set for this reward.
 */
type SetRewardEmissionsParams = {
    whirlpool: PublicKey;
    rewardIndex: number;
    rewardVaultKey: PublicKey;
    rewardAuthority: PublicKey;
    emissionsPerSecondX64: BN;
};

/**
 * Parameters to set rewards emissions for a reward in a Whirlpool
 *
 * @category Instruction Types
 * @param whirlpoolsConfig - PublicKey for the WhirlpoolsConfig that we want to update.
 * @param rewardEmissionsSuperAuthority - Current reward emission super authority in this WhirlpoolsConfig
 * @param newRewardEmissionsSuperAuthority - New reward emission super authority for this WhirlpoolsConfig
 */
type SetRewardEmissionsSuperAuthorityParams = {
    whirlpoolsConfig: PublicKey;
    rewardEmissionsSuperAuthority: PublicKey;
    newRewardEmissionsSuperAuthority: PublicKey;
};

/**
 * Parameters and accounts to swap on a Whirlpool
 *
 * @category Instruction Types
 * @param aToB - The direction of the swap. True if swapping from A to B. False if swapping from B to A.
 * @param amountSpecifiedIsInput - Specifies the token the parameter `amount`represents. If true, the amount represents
 *                                 the input token of the swap.
 * @param amount - The amount of input or output token to swap from (depending on amountSpecifiedIsInput).
 * @param otherAmountThreshold - The maximum/minimum of input/output token to swap into (depending on amountSpecifiedIsInput).
 * @param sqrtPriceLimit - The maximum/minimum price the swap will swap to.
 * @param tickArray0 - PublicKey of the tick-array where the Whirlpool's currentTickIndex resides in
 * @param tickArray1 - The next tick-array in the swap direction. If the swap will not reach the next tick-aray, input the same array as tickArray0.
 * @param tickArray2 - The next tick-array in the swap direction after tickArray2. If the swap will not reach the next tick-aray, input the same array as tickArray1.
 * @param whirlpool - PublicKey for the whirlpool that the position will be opened for.
 * @param tokenOwnerAccountA - PublicKey for the associated token account for tokenA in the collection wallet
 * @param tokenOwnerAccountB - PublicKey for the associated token account for tokenB in the collection wallet
 * @param tokenVaultA - PublicKey for the tokenA vault for this whirlpool.
 * @param tokenVaultB - PublicKey for the tokenB vault for this whirlpool.
 * @param oracle - PublicKey for the oracle account for this Whirlpool.
 * @param tokenAuthority - authority to withdraw tokens from the input token account
 */
type SwapParams = SwapInput & {
    whirlpool: PublicKey;
    tokenOwnerAccountA: PublicKey;
    tokenOwnerAccountB: PublicKey;
    tokenVaultA: PublicKey;
    tokenVaultB: PublicKey;
    oracle: PublicKey;
    tokenAuthority: PublicKey;
};
/**
 * Parameters to swap on a Whirlpool
 *
 * @category Instruction Types
 * @param aToB - The direction of the swap. True if swapping from A to B. False if swapping from B to A.
 * @param amountSpecifiedIsInput - Specifies the token the parameter `amount`represents. If true, the amount represents
 *                                 the input token of the swap.
 * @param amount - The amount of input or output token to swap from (depending on amountSpecifiedIsInput).
 * @param otherAmountThreshold - The maximum/minimum of input/output token to swap into (depending on amountSpecifiedIsInput).
 * @param sqrtPriceLimit - The maximum/minimum price the swap will swap to.
 * @param tickArray0 - PublicKey of the tick-array where the Whirlpool's currentTickIndex resides in
 * @param tickArray1 - The next tick-array in the swap direction. If the swap will not reach the next tick-aray, input the same array as tickArray0.
 * @param tickArray2 - The next tick-array in the swap direction after tickArray2. If the swap will not reach the next tick-aray, input the same array as tickArray1.
 */
type SwapInput = {
    amount: u64;
    otherAmountThreshold: u64;
    sqrtPriceLimit: BN;
    amountSpecifiedIsInput: boolean;
    aToB: boolean;
    tickArray0: PublicKey;
    tickArray1: PublicKey;
    tickArray2: PublicKey;
};
/**
 * Parameters to swap on a Whirlpool with developer fees
 *
 * @category Instruction Types
 * @param aToB - The direction of the swap. True if swapping from A to B. False if swapping from B to A.
 * @param amountSpecifiedIsInput - Specifies the token the parameter `amount`represents. If true, the amount represents
 *                                 the input token of the swap.
 * @param amount - The amount of input or output token to swap from (depending on amountSpecifiedIsInput).
 * @param otherAmountThreshold - The maximum/minimum of input/output token to swap into (depending on amountSpecifiedIsInput).
 * @param sqrtPriceLimit - The maximum/minimum price the swap will swap to.
 * @param tickArray0 - PublicKey of the tick-array where the Whirlpool's currentTickIndex resides in
 * @param tickArray1 - The next tick-array in the swap direction. If the swap will not reach the next tick-aray, input the same array as tickArray0.
 * @param tickArray2 - The next tick-array in the swap direction after tickArray2. If the swap will not reach the next tick-aray, input the same array as tickArray1.
 * @param devFeeAmount -  FeeAmount (developer fees) charged on this swap
 */
type DevFeeSwapInput = SwapInput & {
    devFeeAmount: u64;
};

/**
 * Parameters to update fees and reward values for a position.
 *
 * @category Instruction Types
 * @param whirlpool - PublicKey for the whirlpool that the position will be opened for.
 * @param position - PublicKey for the  position will be opened for.
 * @param tickArrayLower - PublicKey for the tick-array account that hosts the tick at the lower tick index.
 * @param tickArrayUpper - PublicKey for the tick-array account that hosts the tick at the upper tick index.
 */
type UpdateFeesAndRewardsParams = {
    whirlpool: PublicKey;
    position: PublicKey;
    tickArrayLower: PublicKey;
    tickArrayUpper: PublicKey;
};

/**
 * Extended MintInfo class to host token info.
 * @category WhirlpoolClient
 */
type TokenInfo = MintInfo & {
    mint: PublicKey;
};
type TokenAccountInfo = AccountInfo;
type WhirlpoolRewardInfo = WhirlpoolRewardInfoData & {
    initialized: boolean;
    vaultAmount: u64;
};
/**
 * A wrapper class of a TickArray on a Whirlpool
 * @category WhirlpoolClient
 */
type TickArray = {
    address: PublicKey;
    data: TickArrayData | null;
};

/**
 * Static abstract class definition to parse entities.
 * @category Parsables
 */
interface ParsableEntity<T> {
    /**
     * Parse account data
     *
     * @param accountData Buffer data for the entity
     * @returns Parsed entity
     */
    parse: (accountData: Buffer | undefined | null) => T | null;
}
/**
 * @category Parsables
 */
declare class ParsableWhirlpoolsConfig {
    private constructor();
    static parse(data: Buffer | undefined | null): WhirlpoolsConfigData | null;
}
/**
 * @category Parsables
 */
declare class ParsableWhirlpool {
    private constructor();
    static parse(data: Buffer | undefined | null): WhirlpoolData | null;
}
/**
 * @category Parsables
 */
declare class ParsablePosition {
    private constructor();
    static parse(data: Buffer | undefined | null): PositionData | null;
}
/**
 * @category Parsables
 */
declare class ParsableTickArray {
    private constructor();
    static parse(data: Buffer | undefined | null): TickArrayData | null;
}
/**
 * @category Parsables
 */
declare class ParsableFeeTier {
    private constructor();
    static parse(data: Buffer | undefined | null): FeeTierData | null;
}
/**
 * @category Parsables
 */
declare class ParsableTokenInfo {
    private constructor();
    static parse(data: Buffer | undefined | null): AccountInfo | null;
}
/**
 * @category Parsables
 */
declare class ParsableMintInfo {
    private constructor();
    static parse(data: Buffer | undefined | null): MintInfo | null;
}

/**
 * Supported accounts
 */
type CachedValue = WhirlpoolsConfigData | WhirlpoolData | PositionData | TickArrayData | FeeTierData | AccountInfo | MintInfo;
/**
 * Include both the entity (i.e. type) of the stored value, and the value itself
 */
interface CachedContent<T extends CachedValue> {
    entity: ParsableEntity<T>;
    value: CachedValue | null;
}
/**
 * Filter params for Whirlpools when invoking getProgramAccounts.
 */
type ListWhirlpoolParams = {
    programId: Address;
    configId: Address;
};
/**
 * Tuple containing Whirlpool address and parsed account data.
 */
type WhirlpoolAccount = [Address, WhirlpoolData];
/**
 * Data access layer to access Whirlpool related accounts
 * Includes internal cache that can be refreshed by the client.
 *
 * @category Core
 */
declare class AccountFetcher {
    private readonly connection;
    private readonly _cache;
    private _accountRentExempt;
    constructor(connection: Connection, cache?: Record<string, CachedContent<CachedValue>>);
    /*** Public Methods ***/
    /**
     * Retrieve minimum balance for rent exemption of a Token Account;
     *
     * @param refresh force refresh of account rent exemption
     * @returns minimum balance for rent exemption
     */
    getAccountRentExempt(refresh?: boolean): Promise<number>;
    /**
     * Retrieve a cached whirlpool account. Fetch from rpc on cache miss.
     *
     * @param address whirlpool address
     * @param refresh force cache refresh
     * @returns whirlpool account
     */
    getPool(address: Address, refresh?: boolean): Promise<WhirlpoolData | null>;
    /**
     * Retrieve a cached position account. Fetch from rpc on cache miss.
     *
     * @param address position address
     * @param refresh force cache refresh
     * @returns position account
     */
    getPosition(address: Address, refresh?: boolean): Promise<PositionData | null>;
    /**
     * Retrieve a cached tick array account. Fetch from rpc on cache miss.
     *
     * @param address tick array address
     * @param refresh force cache refresh
     * @returns tick array account
     */
    getTickArray(address: Address, refresh?: boolean): Promise<TickArrayData | null>;
    /**
     * Retrieve a cached fee tier account. Fetch from rpc on cache miss.
     *
     * @param address fee tier address
     * @param refresh force cache refresh
     * @returns fee tier account
     */
    getFeeTier(address: Address, refresh?: boolean): Promise<FeeTierData | null>;
    /**
     * Retrieve a cached token info account. Fetch from rpc on cache miss.
     *
     * @param address token info address
     * @param refresh force cache refresh
     * @returns token info account
     */
    getTokenInfo(address: Address, refresh?: boolean): Promise<AccountInfo | null>;
    /**
     * Retrieve a cached mint info account. Fetch from rpc on cache miss.
     *
     * @param address mint info address
     * @param refresh force cache refresh
     * @returns mint info account
     */
    getMintInfo(address: Address, refresh?: boolean): Promise<MintInfo | null>;
    /**
     * Retrieve a cached whirlpool config account. Fetch from rpc on cache miss.
     *
     * @param address whirlpool config address
     * @param refresh force cache refresh
     * @returns whirlpool config account
     */
    getConfig(address: Address, refresh?: boolean): Promise<WhirlpoolsConfigData | null>;
    /**
     * Retrieve a list of cached whirlpool accounts. Fetch from rpc for cache misses.
     *
     * @param addresses whirlpool addresses
     * @param refresh force cache refresh
     * @returns whirlpool accounts
     */
    listPools(addresses: Address[], refresh: boolean): Promise<(WhirlpoolData | null)[]>;
    /**
     * Retrieve a list of cached whirlpool addresses and accounts filtered by the given params using
     * getProgramAccounts.
     *
     * @param params whirlpool filter params
     * @returns tuple of whirlpool addresses and accounts
     */
    listPoolsWithParams({ programId, configId, }: ListWhirlpoolParams): Promise<WhirlpoolAccount[]>;
    /**
     * Retrieve a list of cached position accounts. Fetch from rpc for cache misses.
     *
     * @param addresses position addresses
     * @param refresh force cache refresh
     * @returns position accounts
     */
    listPositions(addresses: Address[], refresh: boolean): Promise<(PositionData | null)[]>;
    /**
     * Retrieve a list of cached tick array accounts. Fetch from rpc for cache misses.
     *
     * @param addresses tick array addresses
     * @param refresh force cache refresh
     * @returns tick array accounts
     */
    listTickArrays(addresses: Address[], refresh: boolean): Promise<(TickArrayData | null)[]>;
    /**
     * Retrieve a list of cached token info accounts. Fetch from rpc for cache misses.
     *
     * @param addresses token info addresses
     * @param refresh force cache refresh
     * @returns token info accounts
     */
    listTokenInfos(addresses: Address[], refresh: boolean): Promise<(AccountInfo | null)[]>;
    /**
     * Retrieve a list of cached mint info accounts. Fetch from rpc for cache misses.
     *
     * @param addresses mint info addresses
     * @param refresh force cache refresh
     * @returns mint info accounts
     */
    listMintInfos(addresses: Address[], refresh: boolean): Promise<(MintInfo | null)[]>;
    /**
     * Update the cached value of all entities currently in the cache.
     * Uses batched rpc request for network efficient fetch.
     */
    refreshAll(): Promise<void>;
    /*** Private Methods ***/
    /**
     * Retrieve from cache or fetch from rpc, an account
     */
    private get;
    /**
     * Retrieve from cache or fetch from rpc, a list of accounts
     */
    private list;
    /**
     * Make batch rpc request
     */
    private bulkRequest;
}

/**
 * @category Core
 */
declare class WhirlpoolContext {
    readonly connection: Connection;
    readonly wallet: Wallet;
    readonly opts: ConfirmOptions;
    readonly program: Program<Whirlpool$1>;
    readonly provider: AnchorProvider;
    readonly fetcher: AccountFetcher;
    static from(connection: Connection, wallet: Wallet, programId: PublicKey, fetcher?: AccountFetcher, opts?: ConfirmOptions): WhirlpoolContext;
    static fromWorkspace(provider: AnchorProvider, program: Program, fetcher?: AccountFetcher, opts?: ConfirmOptions): WhirlpoolContext;
    static withProvider(provider: AnchorProvider, programId: PublicKey, fetcher?: AccountFetcher, opts?: ConfirmOptions): WhirlpoolContext;
    constructor(provider: AnchorProvider, wallet: Wallet, program: Program, fetcher: AccountFetcher, opts: ConfirmOptions);
}

/**
 * Helper class to help interact with Whirlpool Accounts with a simpler interface.
 *
 * @category Core
 */
interface WhirlpoolClient {
    /**
     * Get this client's WhirlpoolContext object
     * @return a WhirlpoolContext object
     */
    getContext: () => WhirlpoolContext;
    /**
     * Get an AccountFetcher to fetch Whirlpool accounts
     * @return an AccountFetcher instance
     */
    getFetcher: () => AccountFetcher;
    /**
     * Get a Whirlpool object to interact with the Whirlpool account at the given address.
     * @param poolAddress the address of the Whirlpool account
     * @param refresh true to always request newest data from chain with this request
     * @return a Whirlpool object to interact with
     */
    getPool: (poolAddress: Address, refresh?: boolean) => Promise<Whirlpool>;
    /**
     * Get a list of Whirlpool objects matching the provided list of addresses.
     * @param poolAddresses the addresses of the Whirlpool accounts
     * @param refresh true to always request newest data from chain with this request
     * @return a list of Whirlpool objects to interact with
     */
    getPools: (poolAddresses: Address[], refresh?: boolean) => Promise<Whirlpool[]>;
    /**
     * Get a Position object to interact with the Position account at the given address.
     * @param positionAddress the address of the Position account
     * @param refresh true to always request newest data from chain with this request
     * @return a Position object to interact with.
     * @throws error when address does not return a Position account.
     */
    getPosition: (positionAddress: Address, refresh?: boolean) => Promise<Position>;
    /**
     * Get a list of Position objects to interact with the Position account at the given addresses.
     * @param positionAddress the addresses of the Position accounts
     * @param refresh true to always request newest data from chain with this request
     * @return a Record object between account address and Position. If an address is not a Position account, it will be null.
     */
    getPositions: (positionAddresses: Address[], refresh?: boolean) => Promise<Record<string, Position | null>>;
    /**
     * Collect all fees and rewards from a list of positions.
     * @experimental
     * @param positionAddress the addresses of the Position accounts to collect fee & rewards from.
     * @param refresh true to always request newest data from chain with this request
     * @returns A set of transaction-builders to resolve ATA for affliated tokens, collect fee & rewards for all positions.
     *          The first transaction should always be processed as it contains all the resolve ATA instructions to receive tokens.
     */
    collectFeesAndRewardsForPositions: (positionAddresses: Address[], refresh?: boolean) => Promise<TransactionBuilder[]>;
    /**
     * Create a Whirlpool account for a group of token A, token B and tick spacing
     * @param whirlpoolConfig the address of the whirlpool config
     * @param tokenMintA the address of the token A
     * @param tokenMintB the address of the token B
     * @param tickSpacing the space between two ticks in the tick array
     * @param initialTick the initial tick that the pool is set to (derived from initial price)
     * @param funder the account to debit SOL from to fund the creation of the account(s)
     * @return `poolKey`: The public key of the newly created whirlpool account. `tx`: The transaction containing instructions for the on-chain operations.
     * @throws error when the tokens are not in the canonical byte-based ordering. To resolve this, invert the token order and the initialTick (see `TickUtil.invertTick()`, `PriceMath.invertSqrtPriceX64()`, or `PriceMath.invertPrice()`).
     */
    createPool: (whirlpoolsConfig: Address, tokenMintA: Address, tokenMintB: Address, tickSpacing: number, initialTick: number, funder: Address) => Promise<{
        poolKey: PublicKey;
        tx: TransactionBuilder;
    }>;
}
/**
 * Construct a WhirlpoolClient instance to help interact with Whirlpools accounts with.
 *
 * @category WhirlpoolClient
 * @param ctx - WhirlpoolContext object
 * @returns a WhirlpoolClient instance to help with interacting with Whirlpools accounts.
 */
declare function buildWhirlpoolClient(ctx: WhirlpoolContext): WhirlpoolClient;
/**
 * Helper class to interact with a Whirlpool account and build complex transactions.
 * @category WhirlpoolClient
 */
interface Whirlpool {
    /**
     * Return the address for this Whirlpool instance.
     * @return the PublicKey for this Whirlpool instance.
     */
    getAddress: () => PublicKey;
    /**
     * Return the most recently fetched Whirlpool account data.
     * @return most recently fetched WhirlpoolData for this address.
     */
    getData: () => WhirlpoolData;
    /**
     * Fetch and return the most recently fetched Whirlpool account data.
     * @return the most up to date WhirlpoolData for this address.
     */
    refreshData: () => Promise<WhirlpoolData>;
    /**
     * Get the TokenInfo for token A of this pool.
     * @return TokenInfo for token A
     */
    getTokenAInfo: () => TokenInfo;
    /**
     * Get the TokenInfo for token B of this pool.
     * @return TokenInfo for token B
     */
    getTokenBInfo: () => TokenInfo;
    /**
     * Get the TokenAccountInfo for token vault A of this pool.
     * @return TokenAccountInfo for token vault A
     */
    getTokenVaultAInfo: () => TokenAccountInfo;
    /**
     * Get the TokenAccountInfo for token vault B of this pool.
     * @return TokenAccountInfo for token vault B
     */
    getTokenVaultBInfo: () => TokenAccountInfo;
    /**
     * Get the WhirlpoolRewardInfos for this pool.
     * @return Array of 3 WhirlpoolRewardInfos. However, not all of them may be initialized. Use the initialized field on WhirlpoolRewardInfo to check if the reward is active.
     */
    getRewardInfos: () => WhirlpoolRewardInfo[];
    /**
     * Initialize a set of tick-arrays that encompasses the provided ticks.
     *
     * If `funder` is provided, the funder wallet has to sign this transaction.
     *
     * @param ticks - A group of ticks that define the desired tick-arrays to initialize. If the tick's array has been initialized, it will be ignored.
     * @param funder - the wallet that will fund the cost needed to initialize the position. If null, the WhirlpoolContext wallet is used.
     * @param refresh - whether this operation will fetch for the latest accounts if a cache version is available.
     * @return a transaction that will initialize the defined tick-arrays if executed. Return null if all of the tick's arrays are initialized.
     */
    initTickArrayForTicks: (ticks: number[], funder?: Address, refresh?: boolean) => Promise<TransactionBuilder | null>;
    /**
     * Open and fund a position on this Whirlpool.
     *
     * User has to ensure the TickArray for tickLower and tickUpper has been initialized prior to calling this function.
     *
     * If `wallet` or `funder` is provided, those wallets have to sign this transaction.
     *
     * @param tickLower - the tick index for the lower bound of this position
     * @param tickUpper - the tick index for the upper bound of this position
     * @param liquidityInput - an InputLiquidityInput type to define the desired liquidity amount to deposit
     * @param wallet - the wallet to withdraw tokens to deposit into the position and house the position token. If null, the WhirlpoolContext wallet is used.
     * @param funder - the wallet that will fund the cost needed to initialize the position. If null, the WhirlpoolContext wallet is used.
     * @return `positionMint` - the position to be created. `tx` - The transaction containing the instructions to perform the operation on chain.
     */
    openPosition: (tickLower: number, tickUpper: number, liquidityInput: IncreaseLiquidityInput, wallet?: Address, funder?: Address) => Promise<{
        positionMint: PublicKey;
        tx: TransactionBuilder;
    }>;
    /**
     * Open and fund a position with meta-data on this Whirlpool.
     *
     * User has to ensure the TickArray for tickLower and tickUpper has been initialized prior to calling this function.
     *
     * If `wallet` or `funder` is provided, the wallet owners have to sign this transaction.
     *
     * @param tickLower - the tick index for the lower bound of this position
     * @param tickUpper - the tick index for the upper bound of this position
     * @param liquidityInput - input that defines the desired liquidity amount and maximum tokens willing to be to deposited.
     * @param wallet - the wallet to withdraw tokens to deposit into the position and house the position token. If null, the WhirlpoolContext wallet is used.
     * @param funder - the wallet that will fund the cost needed to initialize the position. If null, the WhirlpoolContext wallet is used.
     * @return `positionMint` - the position to be created. `tx` - The transaction containing the instructions to perform the operation on chain.
     */
    openPositionWithMetadata: (tickLower: number, tickUpper: number, liquidityInput: IncreaseLiquidityInput, wallet?: Address, funder?: Address) => Promise<{
        positionMint: PublicKey;
        tx: TransactionBuilder;
    }>;
    /**
     * Withdraw all tokens from a position, close the account and burn the position token.
     *
     * Users have to collect all fees and rewards from this position prior to closing the account.
     *
     * If `positionWallet`, `payer` is provided, the wallet owner has to sign this transaction.
     *
     * @param positionAddress - The address of the position account.
     * @param slippageTolerance - The amount of slippage the caller is willing to accept when withdrawing liquidity.
     * @param destinationWallet - The wallet that the tokens withdrawn and rent lamports will be sent to. If null, the WhirlpoolContext wallet is used.
     * @param positionWallet - The wallet that houses the position token that corresponds to this position address. If null, the WhirlpoolContext wallet is used.
     * @param payer - the wallet that will fund the cost needed to initialize the token ATA accounts. If null, the WhirlpoolContext wallet is used.
     */
    closePosition: (positionAddress: Address, slippageTolerance: Percentage, destinationWallet?: Address, positionWallet?: Address, payer?: Address) => Promise<TransactionBuilder[]>;
    /**
     * Perform a swap between tokenA and tokenB on this pool.
     *
     * @param input - A quote on the desired tokenIn and tokenOut for this swap. Use @link {swapQuote} to generate this object.
     * @param wallet - The wallet that tokens will be withdrawn and deposit into. If null, the WhirlpoolContext wallet is used.
     * @return a transaction that will perform the swap once executed.
     */
    swap: (input: SwapInput, wallet?: PublicKey) => Promise<TransactionBuilder>;
    /**
     * Collect a developer fee and perform a swap between tokenA and tokenB on this pool.
     *
     * @param input - A quote on the desired tokenIn and tokenOut for this swap. Use @link {swapQuote} to generate this object.
     * @param devFeeWallet - The wallet that developer fees will be deposited into.
     * @param wallet - The wallet that swap tokens will be withdrawn and deposit into. If null, the WhirlpoolContext wallet is used.
     * @param payer - The wallet that will fund the cost needed to initialize the dev wallet token ATA accounts. If null, the WhirlpoolContext wallet is used.
     * @return a transaction that will perform the swap once executed.
     */
    swapWithDevFees: (input: DevFeeSwapInput, devFeeWallet: PublicKey, wallet?: PublicKey, payer?: PublicKey) => Promise<TransactionBuilder>;
}
/**
 * Helper class to interact with a Position account and build complex transactions.
 * @category WhirlpoolClient
 */
interface Position {
    /**
     * Return the address for this Whirlpool instance.
     * @return the PublicKey for this Whirlpool instance.
     */
    getAddress: () => PublicKey;
    /**
     * Return the most recently fetched Position account data.
     * @return most recently fetched PositionData for this address.
     */
    getData: () => PositionData;
    /**
     * Return the most recently fetched Whirlpool account data for this position.
     * @return most recently fetched WhirlpoolData for this position.
     */
    getWhirlpoolData: () => WhirlpoolData;
    /**
     * Return the most recently fetched TickData account data for this position's lower tick.
     * @return most recently fetched TickData for this position's lower tick.
     */
    getLowerTickData: () => TickData;
    /**
     * Return the most recently fetched TickData account data for this position's upper tick.
     * @return most recently fetched TickData for this position's upper tick.
     */
    getUpperTickData: () => TickData;
    /**
     * Fetch and return the most recently fetched Position account data.
     * @return the most up to date PositionData for this address.
     */
    refreshData: () => Promise<PositionData>;
    /**
     * Deposit additional tokens into this postiion.
     * The wallet must contain the position token and the necessary token A & B to complete the deposit.
     * If  `positionWallet` and `wallet` is provided, the wallet owners have to sign this transaction.
     *
     * @param liquidityInput - input that defines the desired liquidity amount and maximum tokens willing to be to deposited.
     * @param resolveATA - if true, add instructions to create associated token accounts for tokenA,B for the destinationWallet if necessary. (RPC call required)
     * @param wallet - to withdraw tokens to deposit into the position. If null, the WhirlpoolContext wallet is used.
     * @param positionWallet - the wallet to that houses the position token. If null, the WhirlpoolContext wallet is used.
     * @param ataPayer - wallet that will fund the creation of the new associated token accounts
     * @return the transaction that will deposit the tokens into the position when executed.
     */
    increaseLiquidity: (liquidityInput: IncreaseLiquidityInput, resolveATA?: boolean, wallet?: Address, positionWallet?: Address, ataPayer?: Address) => Promise<TransactionBuilder>;
    /**
     * Withdraw liquidity from this position.
     *
     * If `positionWallet` is provided, the wallet owners have to sign this transaction.
     *
     * @param liquidityInput - input that defines the desired liquidity amount and minimum tokens willing to be to withdrawn from the position.
     * @param resolveATA -  if true, add instructions to create associated token accounts for tokenA,B for the destinationWallet if necessary. (RPC call required)
     * @param destinationWallet - the wallet to deposit tokens into when withdrawing from the position. If null, the WhirlpoolContext wallet is used.
     * @param positionWallet - the wallet to that houses the position token. If null, the WhirlpoolContext wallet is used.
     * @param ataPayer - wallet that will fund the creation of the new associated token accounts
     * @return the transaction that will deposit the tokens into the position when executed.
     */
    decreaseLiquidity: (liquidityInput: DecreaseLiquidityInput, resolveATA?: boolean, destinationWallet?: Address, positionWallet?: Address, ataPayer?: Address) => Promise<TransactionBuilder>;
    /**
     * Collect fees from this position
     *
     * If `positionWallet` is provided, the wallet owners have to sign this transaction.
     *
     * @param updateFeesAndRewards -  if true, add instructions to refresh the accumulated fees and rewards data (default to true unless you know that the collect fees quote and on-chain data match for the "feeOwedA" and "feeOwedB" fields in the Position account)
     * @param ownerTokenAccountMap - A record that maps a given mint to the owner's token account for that mint (if an entry doesn't exist, it will be automatically resolved)
     * @param destinationWallet - the wallet to deposit tokens into when withdrawing from the position. If null, the WhirlpoolContext wallet is used.
     * @param positionWallet - the wallet to that houses the position token. If null, the WhirlpoolContext wallet is used.
     * @param ataPayer - wallet that will fund the creation of the new associated token accounts
     * @param refresh - set to true to bypass cached on-chain data
     * @return the transaction that will collect fees from the position
     */
    collectFees: (updateFeesAndRewards?: boolean, ownerTokenAccountMap?: Partial<Record<string, Address>>, destinationWallet?: Address, positionWallet?: Address, ataPayer?: Address, refresh?: boolean) => Promise<TransactionBuilder>;
    /**
     * Collect rewards from this position
     *
     * If `positionWallet` is provided, the wallet owners have to sign this transaction.
     *
     * @param rewardsToCollect - reward mints to collect (omitting this parameter means all rewards will be collected)
     * @param updateFeesAndRewards -  if true, add instructions to refresh the accumulated fees and rewards data (default to true unless you know that the collect fees quote and on-chain data match for the "feeOwedA" and "feeOwedB" fields in the Position account)
     * @param ownerTokenAccountMap - A record that maps a given mint to the owner's token account for that mint (if an entry doesn't exist, it will be automatically resolved)
     * @param destinationWallet - the wallet to deposit tokens into when withdrawing from the position. If null, the WhirlpoolContext wallet is used.
     * @param positionWallet - the wallet to that houses the position token. If null, the WhirlpoolContext wallet is used.
     * @param ataPayer - wallet that will fund the creation of the new associated token accounts
     * @param refresh - set to true to bypass cached on-chain data
     * @return the transaction that will collect fees from the position
     */
    collectRewards: (rewardsToCollect?: Address[], updateFeesAndRewards?: boolean, ownerTokenAccountMap?: Partial<Record<string, Address>>, destinationWallet?: Address, positionWallet?: Address, ataPayer?: Address, refresh?: boolean) => Promise<TransactionBuilder>;
}

declare class PositionImpl implements Position {
    readonly ctx: WhirlpoolContext;
    readonly address: PublicKey;
    private data;
    private whirlpoolData;
    private lowerTickArrayData;
    private upperTickArrayData;
    constructor(ctx: WhirlpoolContext, address: PublicKey, data: PositionData, whirlpoolData: WhirlpoolData, lowerTickArrayData: TickArrayData, upperTickArrayData: TickArrayData);
    getAddress(): PublicKey;
    getData(): PositionData;
    getWhirlpoolData(): WhirlpoolData;
    getLowerTickData(): TickData;
    getUpperTickData(): TickData;
    refreshData(): Promise<PositionData>;
    increaseLiquidity(liquidityInput: IncreaseLiquidityInput, resolveATA?: boolean, sourceWallet?: Address, positionWallet?: Address, ataPayer?: Address): Promise<TransactionBuilder>;
    decreaseLiquidity(liquidityInput: DecreaseLiquidityInput, resolveATA?: boolean, sourceWallet?: Address, positionWallet?: Address, ataPayer?: Address): Promise<TransactionBuilder>;
    collectFees(updateFeesAndRewards?: boolean, ownerTokenAccountMap?: Partial<Record<string, Address>>, destinationWallet?: Address, positionWallet?: Address, ataPayer?: Address, refresh?: boolean): Promise<TransactionBuilder>;
    collectRewards(rewardsToCollect?: Address[], updateFeesAndRewards?: boolean, ownerTokenAccountMap?: Partial<Record<string, Address>>, destinationWallet?: Address, positionWallet?: Address, ataPayer?: Address, refresh?: boolean): Promise<TransactionBuilder>;
    private refresh;
    private updateFeesAndRewards;
}

/**
 * Instruction set for the Whirlpools program.
 *
 * @category Core
 */
declare class WhirlpoolIx {
    /**
     * Initializes a WhirlpoolsConfig account that hosts info & authorities
     * required to govern a set of Whirlpools.
     *
     * @param program - program object containing services required to generate the instruction
     * @param params - InitConfigParams object
     * @returns - Instruction to perform the action.
     */
    static initializeConfigIx(program: Program<Whirlpool$1>, params: InitConfigParams): _orca_so_common_sdk.Instruction;
    /**
     * Initializes a fee tier account usable by Whirlpools in this WhirlpoolsConfig space.
     *
     *  Special Errors
     * `FeeRateMaxExceeded` - If the provided default_fee_rate exceeds MAX_FEE_RATE.
     *
     * @param program - program object containing services required to generate the instruction
     * @param params - InitFeeTierParams object
     * @returns - Instruction to perform the action.
     */
    static initializeFeeTierIx(program: Program<Whirlpool$1>, params: InitFeeTierParams): _orca_so_common_sdk.Instruction;
    /**
     * Initializes a tick_array account to represent a tick-range in a Whirlpool.
     *
     * Special Errors
     * `InvalidTokenMintOrder` - The order of mints have to be ordered by
     * `SqrtPriceOutOfBounds` - provided initial_sqrt_price is not between 2^-64 to 2^64
     *
     * @param program - program object containing services required to generate the instruction
     * @param params - InitPoolParams object
     * @returns - Instruction to perform the action.
     */
    static initializePoolIx(program: Program<Whirlpool$1>, params: InitPoolParams): _orca_so_common_sdk.Instruction;
    /**
     * Initialize reward for a Whirlpool. A pool can only support up to a set number of rewards.
     * The initial emissionsPerSecond is set to 0.
     *
     * #### Special Errors
     * - `InvalidRewardIndex` - If the provided reward index doesn't match the lowest uninitialized index in this pool,
     *                          or exceeds NUM_REWARDS, or all reward slots for this pool has been initialized.
     *
     * @param program - program object containing services required to generate the instruction
     * @param params - InitializeRewardParams object
     * @returns - Instruction to perform the action.
     */
    static initializeRewardIx(program: Program<Whirlpool$1>, params: InitializeRewardParams): _orca_so_common_sdk.Instruction;
    /**
     * Initializes a TickArray account.
     *
     * #### Special Errors
     *  `InvalidStartTick` - if the provided start tick is out of bounds or is not a multiple of TICK_ARRAY_SIZE * tick spacing.
     *
     * @param program - program object containing services required to generate the instruction
     * @param params - InitTickArrayParams object
     * @returns - Instruction to perform the action.
     */
    static initTickArrayIx(program: Program<Whirlpool$1>, params: InitTickArrayParams): _orca_so_common_sdk.Instruction;
    /**
     * Open a position in a Whirlpool. A unique token will be minted to represent the position in the users wallet.
     * The position will start off with 0 liquidity.
     *
     * #### Special Errors
     * `InvalidTickIndex` - If a provided tick is out of bounds, out of order or not a multiple of the tick-spacing in this pool.
     *
  
     * @param program - program object containing services required to generate the instruction
     * @param params - OpenPositionParams object
     * @returns - Instruction to perform the action.
     */
    static openPositionIx(program: Program<Whirlpool$1>, params: OpenPositionParams): _orca_so_common_sdk.Instruction;
    /**
     * Open a position in a Whirlpool. A unique token will be minted to represent the position
     * in the users wallet. Additional Metaplex metadata is appended to identify the token.
     * The position will start off with 0 liquidity.
     *
     * #### Special Errors
     * `InvalidTickIndex` - If a provided tick is out of bounds, out of order or not a multiple of the tick-spacing in this pool.
     *
  
     * @param program - program object containing services required to generate the instruction
     * @param params - OpenPositionParams object and a derived PDA that hosts the position's metadata.
     * @returns - Instruction to perform the action.
     */
    static openPositionWithMetadataIx(program: Program<Whirlpool$1>, params: OpenPositionParams & {
        metadataPda: PDA;
    }): _orca_so_common_sdk.Instruction;
    /**
     * Add liquidity to a position in the Whirlpool. This call also updates the position's accrued fees and rewards.
     *
     * #### Special Errors
     * `LiquidityZero` - Provided liquidity amount is zero.
     * `LiquidityTooHigh` - Provided liquidity exceeds u128::max.
     * `TokenMaxExceeded` - The required token to perform this operation exceeds the user defined amount.
     *
     * @param program - program object containing services required to generate the instruction
     * @param params - IncreaseLiquidityParams object
     * @returns - Instruction to perform the action.
     */
    static increaseLiquidityIx(program: Program<Whirlpool$1>, params: IncreaseLiquidityParams): _orca_so_common_sdk.Instruction;
    /**
     * Remove liquidity to a position in the Whirlpool. This call also updates the position's accrued fees and rewards.
     *
     * #### Special Errors
     * - `LiquidityZero` - Provided liquidity amount is zero.
     * - `LiquidityTooHigh` - Provided liquidity exceeds u128::max.
     * - `TokenMinSubceeded` - The required token to perform this operation subceeds the user defined amount.
     *
     * @param program - program object containing services required to generate the instruction
     * @param params - DecreaseLiquidityParams object
     * @returns - Instruction to perform the action.
     */
    static decreaseLiquidityIx(program: Program<Whirlpool$1>, params: DecreaseLiquidityParams): _orca_so_common_sdk.Instruction;
    /**
     * Close a position in a Whirlpool. Burns the position token in the owner's wallet.
     *
  
     * @param program - program object containing services required to generate the instruction
     * @param params - ClosePositionParams object
     * @returns - Instruction to perform the action.
     */
    static closePositionIx(program: Program<Whirlpool$1>, params: ClosePositionParams): _orca_so_common_sdk.Instruction;
    /**
     * Perform a swap in this Whirlpool
     *
     * #### Special Errors
     * - `ZeroTradableAmount` - User provided parameter `amount` is 0.
     * - `InvalidSqrtPriceLimitDirection` - User provided parameter `sqrt_price_limit` does not match the direction of the trade.
     * - `SqrtPriceOutOfBounds` - User provided parameter `sqrt_price_limit` is over Whirlppool's max/min bounds for sqrt-price.
     * - `InvalidTickArraySequence` - User provided tick-arrays are not in sequential order required to proceed in this trade direction.
     * - `TickArraySequenceInvalidIndex` - The swap loop attempted to access an invalid array index during the query of the next initialized tick.
     * - `TickArrayIndexOutofBounds` - The swap loop attempted to access an invalid array index during tick crossing.
     * - `LiquidityOverflow` - Liquidity value overflowed 128bits during tick crossing.
     * - `InvalidTickSpacing` - The swap pool was initialized with tick-spacing of 0.
     *
     * ### Parameters
     * @param program - program object containing services required to generate the instruction
     * @param params - SwapParams object
     * @returns - Instruction to perform the action.
     */
    static swapIx(program: Program<Whirlpool$1>, params: SwapParams): _orca_so_common_sdk.Instruction;
    /**
     * Update the accrued fees and rewards for a position.
     *
     * #### Special Errors
     * `TickNotFound` - Provided tick array account does not contain the tick for this position.
     * `LiquidityZero` - Position has zero liquidity and therefore already has the most updated fees and reward values.
     *
     * @param program - program object containing services required to generate the instruction
     * @param params - UpdateFeesAndRewardsParams object
     * @returns - Instruction to perform the action.
     */
    static updateFeesAndRewardsIx(program: Program<Whirlpool$1>, params: UpdateFeesAndRewardsParams): _orca_so_common_sdk.Instruction;
    /**
     * Collect fees accrued for this position.
     * Call updateFeesAndRewards before this to update the position to the newest accrued values.
     *
     * @param program - program object containing services required to generate the instruction
     * @param params - CollectFeesParams object
     * @returns - Instruction to perform the action.
     */
    static collectFeesIx(program: Program<Whirlpool$1>, params: CollectFeesParams): _orca_so_common_sdk.Instruction;
    /**
     * Collect protocol fees accrued in this Whirlpool.
     *
     * @param program - program object containing services required to generate the instruction
     * @param params - CollectProtocolFeesParams object
     * @returns - Instruction to perform the action.
     */
    static collectProtocolFeesIx(program: Program<Whirlpool$1>, params: CollectProtocolFeesParams): _orca_so_common_sdk.Instruction;
    /**
     * Collect rewards accrued for this reward index in a position.
     * Call updateFeesAndRewards before this to update the position to the newest accrued values.
     *
  
     * @param program - program object containing services required to generate the instruction
     * @param params - CollectRewardParams object
     * @returns - Instruction to perform the action.
     */
    static collectRewardIx(program: Program<Whirlpool$1>, params: CollectRewardParams): _orca_so_common_sdk.Instruction;
    /**
     * Sets the fee authority to collect protocol fees for a WhirlpoolsConfig.
     * Only the current collect protocol fee authority has permission to invoke this instruction.
     *
     * @param program - program object containing services required to generate the instruction
     * @param params - SetCollectProtocolFeesAuthorityParams object
     * @returns - Instruction to perform the action.
     */
    static setCollectProtocolFeesAuthorityIx(program: Program<Whirlpool$1>, params: SetCollectProtocolFeesAuthorityParams): _orca_so_common_sdk.Instruction;
    /**
     * Updates a fee tier account with a new default fee rate. The new rate will not retroactively update
     * initialized pools.
     *
     * #### Special Errors
     * - `FeeRateMaxExceeded` - If the provided default_fee_rate exceeds MAX_FEE_RATE.
     *
     * @param program - program object containing services required to generate the instruction
     * @param params - SetDefaultFeeRateParams object
     * @returns - Instruction to perform the action.
     */
    static setDefaultFeeRateIx(program: Program<Whirlpool$1>, params: SetDefaultFeeRateParams): _orca_so_common_sdk.Instruction;
    /**
     * Updates a WhirlpoolsConfig with a new default protocol fee rate. The new rate will not retroactively update
     * initialized pools.
     *
     * #### Special Errors
     * - `ProtocolFeeRateMaxExceeded` - If the provided default_protocol_fee_rate exceeds MAX_PROTOCOL_FEE_RATE.
     *
     * @param program - program object containing services required to generate the instruction
     * @param params - SetDefaultFeeRateParams object
     * @returns - Instruction to perform the action.
     */
    static setDefaultProtocolFeeRateIx(program: Program<Whirlpool$1>, params: SetDefaultProtocolFeeRateParams): _orca_so_common_sdk.Instruction;
    /**
     * Sets the fee authority for a WhirlpoolsConfig.
     * The fee authority can set the fee & protocol fee rate for individual pools or set the default fee rate for newly minted pools.
     * Only the current fee authority has permission to invoke this instruction.
     *
     * @param program - program object containing services required to generate the instruction
     * @param params - SetFeeAuthorityParams object
     * @returns - Instruction to perform the action.
     */
    static setFeeAuthorityIx(program: Program<Whirlpool$1>, params: SetFeeAuthorityParams): _orca_so_common_sdk.Instruction;
    /**
     * Sets the fee rate for a Whirlpool.
     * Only the current fee authority has permission to invoke this instruction.
     *
     * #### Special Errors
     * - `FeeRateMaxExceeded` - If the provided fee_rate exceeds MAX_FEE_RATE.
     *
     * @param program - program object containing services required to generate the instruction
     * @param params - SetFeeRateParams object
     * @returns - Instruction to perform the action.
     */
    static setFeeRateIx(program: Program<Whirlpool$1>, params: SetFeeRateParams): _orca_so_common_sdk.Instruction;
    /**
     * Sets the protocol fee rate for a Whirlpool.
     * Only the current fee authority has permission to invoke this instruction.
     *
     * #### Special Errors
     * - `ProtocolFeeRateMaxExceeded` - If the provided default_protocol_fee_rate exceeds MAX_PROTOCOL_FEE_RATE.
     *
     * @param program - program object containing services required to generate the instruction
     * @param params - SetFeeRateParams object
     * @returns - Instruction to perform the action.
     */
    static setProtocolFeeRateIx(program: Program<Whirlpool$1>, params: SetProtocolFeeRateParams): _orca_so_common_sdk.Instruction;
    /**
     * Set the whirlpool reward authority at the provided `reward_index`.
     * Only the current reward super authority has permission to invoke this instruction.
     *
     * #### Special Errors
     * - `InvalidRewardIndex` - If the provided reward index doesn't match the lowest uninitialized index in this pool,
     *                          or exceeds NUM_REWARDS.
     *
     * @param program - program object containing services required to generate the instruction
     * @param params - SetRewardAuthorityParams object
     * @returns - Instruction to perform the action.
     */
    static setRewardAuthorityBySuperAuthorityIx(program: Program<Whirlpool$1>, params: SetRewardAuthorityBySuperAuthorityParams): _orca_so_common_sdk.Instruction;
    /**
     * Set the whirlpool reward authority at the provided `reward_index`.
     * Only the current reward authority for this reward index has permission to invoke this instruction.
     *
     * #### Special Errors
     * - `InvalidRewardIndex` - If the provided reward index doesn't match the lowest uninitialized index in this pool,
     *                          or exceeds NUM_REWARDS.
     *
     * @param program - program object containing services required to generate the instruction
     * @param params - SetRewardAuthorityParams object
     * @returns - Instruction to perform the action.
     */
    static setRewardAuthorityIx(program: Program<Whirlpool$1>, params: SetRewardAuthorityParams): _orca_so_common_sdk.Instruction;
    /**
     * Set the reward emissions for a reward in a Whirlpool.
     *
     * #### Special Errors
     * - `RewardVaultAmountInsufficient` - The amount of rewards in the reward vault cannot emit more than a day of desired emissions.
     * - `InvalidTimestamp` - Provided timestamp is not in order with the previous timestamp.
     * - `InvalidRewardIndex` - If the provided reward index doesn't match the lowest uninitialized index in this pool,
     *                          or exceeds NUM_REWARDS.
     *
     * @param program - program object containing services required to generate the instruction
     * @param params - SetRewardEmissionsParams object
     * @returns - Instruction to perform the action.
     */
    static setRewardEmissionsIx(program: Program<Whirlpool$1>, params: SetRewardEmissionsParams): _orca_so_common_sdk.Instruction;
    /**
     * Set the whirlpool reward super authority for a WhirlpoolsConfig
     * Only the current reward super authority has permission to invoke this instruction.
     * This instruction will not change the authority on any `WhirlpoolRewardInfo` whirlpool rewards.
     *
     * @param program - program object containing services required to generate the instruction
     * @param params - SetRewardEmissionsSuperAuthorityParams object
     * @returns - Instruction to perform the action.
     */
    static setRewardEmissionsSuperAuthorityIx(program: Program<Whirlpool$1>, params: SetRewardEmissionsSuperAuthorityParams): _orca_so_common_sdk.Instruction;
    /**
     * A set of transactions to collect all fees and rewards from a list of positions.
     *
     * @param ctx - WhirlpoolContext object for the current environment.
     * @param params - CollectAllPositionAddressParams object.
     * @param refresh - if true, will always fetch for the latest values on chain to compute.
     * @returns
     */
    static collectAllForPositionsTxns(ctx: WhirlpoolContext, params: CollectAllPositionAddressParams, refresh: boolean): Promise<_orca_so_common_sdk.TransactionBuilder[]>;
}

/**
 * @category Quotes
 * @param inputTokenAmount - The amount of input tokens to deposit.
 * @param inputTokenMint - The mint of the input token the user would like to deposit.
 * @param tokenMintA - The mint of tokenA in the Whirlpool the user is depositing into.
 * @param tokenMintB -The mint of tokenB in the Whirlpool the user is depositing into.
 * @param tickCurrentIndex - The Whirlpool's current tickIndex
 * @param sqrtPrice - The Whirlpool's current sqrtPrice
 * @param tickLowerIndex - The lower index of the position that we are withdrawing from.
 * @param tickUpperIndex - The upper index of the position that we are withdrawing from.
 * @param slippageTolerance - The maximum slippage allowed when calculating the minimum tokens received.
 */
type IncreaseLiquidityQuoteParam = {
    inputTokenAmount: u64;
    inputTokenMint: PublicKey;
    tokenMintA: PublicKey;
    tokenMintB: PublicKey;
    tickCurrentIndex: number;
    sqrtPrice: BN;
    tickLowerIndex: number;
    tickUpperIndex: number;
    slippageTolerance: Percentage;
};
/**
 * Return object from increase liquidity quote functions.
 * @category Quotes
 */
type IncreaseLiquidityQuote = IncreaseLiquidityInput & {
    tokenEstA: u64;
    tokenEstB: u64;
};
/**
 * Get an estimated quote on the maximum tokens required to deposit based on a specified input token amount.
 *
 * @category Quotes
 * @param inputTokenAmount - The amount of input tokens to deposit.
 * @param inputTokenMint - The mint of the input token the user would like to deposit.
 * @param tickLower - The lower index of the position that we are withdrawing from.
 * @param tickUpper - The upper index of the position that we are withdrawing from.
 * @param slippageTolerance - The maximum slippage allowed when calculating the minimum tokens received.
 * @param whirlpool - A Whirlpool helper class to help interact with the Whirlpool account.
 * @returns An IncreaseLiquidityInput object detailing the required token amounts & liquidity values to use when calling increase-liquidity-ix.
 */
declare function increaseLiquidityQuoteByInputToken(inputTokenMint: Address, inputTokenAmount: Decimal, tickLower: number, tickUpper: number, slippageTolerance: Percentage, whirlpool: Whirlpool): IncreaseLiquidityQuote;
/**
 * Get an estimated quote on the maximum tokens required to deposit based on a specified input token amount.
 *
 * @category Quotes
 * @param param IncreaseLiquidityQuoteParam
 * @returns An IncreaseLiquidityInput object detailing the required token amounts & liquidity values to use when calling increase-liquidity-ix.
 */
declare function increaseLiquidityQuoteByInputTokenWithParams(param: IncreaseLiquidityQuoteParam): IncreaseLiquidityQuote;

/**
 * @category Quotes
 * @param liquidity - The desired liquidity to withdraw from the Whirlpool
 * @param tickCurrentIndex - The Whirlpool's current tickIndex
 * @param sqrtPrice - The Whirlpool's current sqrtPrice
 * @param tickLowerIndex - The lower index of the position that we are withdrawing from.
 * @param tickUpperIndex - The upper index of the position that we are withdrawing from.
 * @param slippageTolerance - The maximum slippage allowed when calculating the minimum tokens received.
 */
type DecreaseLiquidityQuoteParam = {
    liquidity: BN;
    tickCurrentIndex: number;
    sqrtPrice: BN;
    tickLowerIndex: number;
    tickUpperIndex: number;
    slippageTolerance: Percentage;
};
/**
 * Return object from decrease liquidity quote functions.
 * @category Quotes
 */
type DecreaseLiquidityQuote = DecreaseLiquidityInput & {
    tokenEstA: BN;
    tokenEstB: BN;
};
/**
 * Get an estimated quote on the minimum tokens receivable based on the desired withdraw liquidity value.
 *
 * @category Quotes
 * @param liquidity - The desired liquidity to withdraw from the Whirlpool
 * @param slippageTolerance - The maximum slippage allowed when calculating the minimum tokens received.
 * @param position - A Position helper class to help interact with the Position account.
 * @param whirlpool - A Whirlpool helper class to help interact with the Whirlpool account.
 * @returns An DecreaseLiquidityQuote object detailing the tokenMin & liquidity values to use when calling decrease-liquidity-ix.
 */
declare function decreaseLiquidityQuoteByLiquidity(liquidity: BN, slippageTolerance: Percentage, position: Position, whirlpool: Whirlpool): DecreaseLiquidityQuote;
/**
 * Get an estimated quote on the minimum tokens receivable based on the desired withdraw liquidity value.
 *
 * @category Quotes
 * @param param DecreaseLiquidityQuoteParam
 * @returns An DecreaseLiquidityInput object detailing the tokenMin & liquidity values to use when calling decrease-liquidity-ix.
 */
declare function decreaseLiquidityQuoteByLiquidityWithParams(param: DecreaseLiquidityQuoteParam): DecreaseLiquidityQuote;

/**
 * @category Quotes
 */
type CollectFeesQuoteParam = {
    whirlpool: WhirlpoolData;
    position: PositionData;
    tickLower: TickData;
    tickUpper: TickData;
};
/**
 * @category Quotes
 */
type CollectFeesQuote = {
    feeOwedA: BN;
    feeOwedB: BN;
};
/**
 * Get a quote on the outstanding fees owed to a position.
 *
 * @category Quotes
 * @param param A collection of fetched Whirlpool accounts to faciliate the quote.
 * @returns A quote object containing the fees owed for each token in the pool.
 */
declare function collectFeesQuote(param: CollectFeesQuoteParam): CollectFeesQuote;

/**
 * @category Quotes
 */
type CollectRewardsQuoteParam = {
    whirlpool: WhirlpoolData;
    position: PositionData;
    tickLower: TickData;
    tickUpper: TickData;
};
/**
 * @category Quotes
 */
type CollectRewardsQuote = [BN | undefined, BN | undefined, BN | undefined];
/**
 * Get a quote on the outstanding rewards owed to a position.
 *
 * @category Quotes
 * @param param A collection of fetched Whirlpool accounts to faciliate the quote.
 * @returns A quote object containing the rewards owed for each reward in the pool.
 */
declare function collectRewardsQuote(param: CollectRewardsQuoteParam): CollectRewardsQuote;

/**
 * A collection of estimated values from quoting a swap that collects a developer-fee.
 * @category Quotes
 * @param estimatedAmountIn - Approximate number of input token swapped in the swap
 * @param estimatedAmountOut - Approximate number of output token swapped in the swap
 * @param estimatedEndTickIndex - Approximate tick-index the Whirlpool will land on after this swap
 * @param estimatedEndSqrtPrice - Approximate sqrtPrice the Whirlpool will land on after this swap
 * @param estimatedFeeAmount - Approximate feeAmount (all fees) charged on this swap
 * @param estimatedSwapFeeAmount - Approximate feeAmount (LP + protocol fees) charged on this swap
 * @param devFeeAmount -  FeeAmount (developer fees) charged on this swap
 */
type DevFeeSwapQuote = NormalSwapQuote & {
    amountSpecifiedIsInput: true;
    estimatedSwapFeeAmount: u64;
    devFeeAmount: u64;
};
/**
 * Get an estimated swap quote using input token amount while collecting dev fees.
 *
 * @category Quotes
 * @param whirlpool - Whirlpool to perform the swap on
 * @param inputTokenMint - PublicKey for the input token mint to swap with
 * @param tokenAmount - The amount of input token to swap from
 * @param slippageTolerance - The amount of slippage to account for in this quote
 * @param programId - PublicKey for the Whirlpool ProgramId
 * @param fetcher - AccountFetcher object to fetch solana accounts
 * @param refresh - If true, fetcher would default to fetching the latest accounts
 * @param devFeePercentage - The percentage amount to send to developer wallet prior to the swap. Percentage num/dem values has to match token decimal.
 * @returns a SwapQuote object with slippage adjusted SwapInput parameters & estimates on token amounts, fee & end whirlpool states.
 */
declare function swapQuoteByInputTokenWithDevFees(whirlpool: Whirlpool, inputTokenMint: Address, tokenAmount: u64, slippageTolerance: Percentage, programId: Address, fetcher: AccountFetcher, devFeePercentage: Percentage, refresh: boolean): Promise<DevFeeSwapQuote>;

/**
 * @category Quotes
 *
 * @param tokenAmount - The amount of input or output token to swap from (depending on amountSpecifiedIsInput).
 * @param otherAmountThreshold - The maximum/minimum of input/output token to swap into (depending on amountSpecifiedIsInput).
 * @param sqrtPriceLimit - The maximum/minimum price the swap will swap to.
 * @param aToB - The direction of the swap. True if swapping from A to B. False if swapping from B to A.
 * @param amountSpecifiedIsInput - Specifies the token the parameter `amount`represents. If true, the amount represents
 *                                 the input token of the swap.
 * @param tickArrays - An sequential array of tick-array objects in the direction of the trade to swap on
 */
type SwapQuoteParam = {
    whirlpoolData: WhirlpoolData;
    tokenAmount: u64;
    otherAmountThreshold: u64;
    sqrtPriceLimit: BN;
    aToB: boolean;
    amountSpecifiedIsInput: boolean;
    tickArrays: TickArray[];
};
/**
 * A collection of estimated values from quoting a swap.
 * @category Quotes
 * @link {BaseSwapQuote}
 * @link {DevFeeSwapQuote}
 */
type SwapQuote = NormalSwapQuote | DevFeeSwapQuote;
/**
 * A collection of estimated values from quoting a swap.
 * @category Quotes
 * @param estimatedAmountIn - Approximate number of input token swapped in the swap
 * @param estimatedAmountOut - Approximate number of output token swapped in the swap
 * @param estimatedEndTickIndex - Approximate tick-index the Whirlpool will land on after this swap
 * @param estimatedEndSqrtPrice - Approximate sqrtPrice the Whirlpool will land on after this swap
 * @param estimatedFeeAmount - Approximate feeAmount (all fees) charged on this swap
 */
type NormalSwapQuote = {
    estimatedAmountIn: u64;
    estimatedAmountOut: u64;
    estimatedEndTickIndex: number;
    estimatedEndSqrtPrice: BN;
    estimatedFeeAmount: u64;
} & SwapInput;
/**
 * Get an estimated swap quote using input token amount.
 *
 * @category Quotes
 * @param whirlpool - Whirlpool to perform the swap on
 * @param inputTokenMint - PublicKey for the input token mint to swap with
 * @param tokenAmount - The amount of input token to swap from
 * @param slippageTolerance - The amount of slippage to account for in this quote
 * @param programId - PublicKey for the Whirlpool ProgramId
 * @param fetcher - AccountFetcher object to fetch solana accounts
 * @param refresh - If true, fetcher would default to fetching the latest accounts
 * @returns a SwapQuote object with slippage adjusted SwapInput parameters & estimates on token amounts, fee & end whirlpool states.
 */
declare function swapQuoteByInputToken(whirlpool: Whirlpool, inputTokenMint: Address, tokenAmount: u64, slippageTolerance: Percentage, programId: Address, fetcher: AccountFetcher, refresh: boolean): Promise<SwapQuote>;
/**
 * Get an estimated swap quote using an output token amount.
 *
 * Use this quote to get an estimated amount of input token needed to receive
 * the defined output token amount.
 *
 * @category Quotes
 * @param whirlpool - Whirlpool to perform the swap on
 * @param outputTokenMint - PublicKey for the output token mint to swap into
 * @param tokenAmount - The maximum amount of output token to receive in this swap.
 * @param slippageTolerance - The amount of slippage to account for in this quote
 * @param programId - PublicKey for the Whirlpool ProgramId
 * @param fetcher - AccountFetcher object to fetch solana accounts
 * @param refresh - If true, fetcher would default to fetching the latest accounts
 * @returns a SwapQuote object with slippage adjusted SwapInput parameters & estimates on token amounts, fee & end whirlpool states.
 */
declare function swapQuoteByOutputToken(whirlpool: Whirlpool, outputTokenMint: Address, tokenAmount: u64, slippageTolerance: Percentage, programId: Address, fetcher: AccountFetcher, refresh: boolean): Promise<SwapQuote>;
/**
 * Perform a sync swap quote based on the basic swap instruction parameters.
 *
 * @category Quotes
 * @param params - SwapQuote parameters
 * @param slippageTolerance - The amount of slippage to account for when generating the final quote.
 * @returns a SwapQuote object with slippage adjusted SwapInput parameters & estimates on token amounts, fee & end whirlpool states.
 */
declare function swapQuoteWithParams(params: SwapQuoteParam): SwapQuote;

declare function toTx(ctx: WhirlpoolContext, ix: Instruction): TransactionBuilder;

/**
 * @category Whirlpool Utils
 */
declare class PDAUtil {
    /**
     *
     * @param programId
     * @param whirlpoolsConfigKey
     * @param tokenMintAKey
     * @param tokenMintBKey
     * @param tickSpacing
     * @returns
     */
    static getWhirlpool(programId: PublicKey, whirlpoolsConfigKey: PublicKey, tokenMintAKey: PublicKey, tokenMintBKey: PublicKey, tickSpacing: number): _orca_so_common_sdk.PDA;
    /**
     * @category Program Derived Addresses
     * @param programId
     * @param positionMintKey
     * @returns
     */
    static getPosition(programId: PublicKey, positionMintKey: PublicKey): _orca_so_common_sdk.PDA;
    /**
     * @category Program Derived Addresses
     * @param positionMintKey
     * @returns
     */
    static getPositionMetadata(positionMintKey: PublicKey): _orca_so_common_sdk.PDA;
    /**
     * @category Program Derived Addresses
     * @param programId
     * @param whirlpoolAddress
     * @param startTick
     * @returns
     */
    static getTickArray(programId: PublicKey, whirlpoolAddress: PublicKey, startTick: number): _orca_so_common_sdk.PDA;
    /**
     * Get the PDA of the tick array containing tickIndex.
     * tickArrayOffset can be used to get neighboring tick arrays.
     *
     * @param tickIndex
     * @param tickSpacing
     * @param whirlpool
     * @param programId
     * @param tickArrayOffset
     * @returns
     */
    static getTickArrayFromTickIndex(tickIndex: number, tickSpacing: number, whirlpool: PublicKey, programId: PublicKey, tickArrayOffset?: number): _orca_so_common_sdk.PDA;
    static getTickArrayFromSqrtPrice(sqrtPriceX64: BN, tickSpacing: number, whirlpool: PublicKey, programId: PublicKey, tickArrayOffset?: number): _orca_so_common_sdk.PDA;
    /**
     * @category Program Derived Addresses
     * @param programId
     * @param whirlpoolsConfigAddress
     * @param tickSpacing
     * @returns
     */
    static getFeeTier(programId: PublicKey, whirlpoolsConfigAddress: PublicKey, tickSpacing: number): _orca_so_common_sdk.PDA;
    /**
     * @category Program Derived Addresses
     * @param programId
     * @param whirlpoolAddress
     * @returns
     */
    static getOracle(programId: PublicKey, whirlpoolAddress: PublicKey): _orca_so_common_sdk.PDA;
}

/**
 * An enum for the direction of a swap.
 * @category Whirlpool Utils
 */
declare enum SwapDirection {
    AtoB = "aToB",
    BtoA = "bToA"
}
/**
 * An enum for the token type in a Whirlpool.
 * @category Whirlpool Utils
 */
declare enum TokenType {
    TokenA = 1,
    TokenB = 2
}

/**
 * @category Whirlpool Utils
 */
declare class PoolUtil {
    private constructor();
    static isRewardInitialized(rewardInfo: WhirlpoolRewardInfoData): boolean;
    /**
     * Return the corresponding token type (TokenA/B) for this mint key for a Whirlpool.
     *
     * @param pool The Whirlpool to evaluate the mint against
     * @param mint The token mint PublicKey
     * @returns The match result in the form of TokenType enum. undefined if the token mint is not part of the trade pair of the pool.
     */
    static getTokenType(pool: WhirlpoolData, mint: PublicKey): TokenType | undefined;
    static getFeeRate(feeRate: number): Percentage;
    static getProtocolFeeRate(protocolFeeRate: number): Percentage;
    static orderMints(mintX: Address, mintY: Address): [Address, Address];
    /**
     * @category Whirlpool Utils
     * @param liquidity
     * @param currentSqrtPrice
     * @param lowerSqrtPrice
     * @param upperSqrtPrice
     * @param round_up
     * @returns
     */
    static getTokenAmountsFromLiquidity(liquidity: BN, currentSqrtPrice: BN, lowerSqrtPrice: BN, upperSqrtPrice: BN, round_up: boolean): TokenAmounts;
    /**
     * Estimate the liquidity amount required to increase/decrease liquidity.
     *
     * // TODO: At the top end of the price range, tick calcuation is off therefore the results can be off
     *
     * @category Whirlpool Utils
     * @param currTick - Whirlpool's current tick index (aka price)
     * @param lowerTick - Position lower tick index
     * @param upperTick - Position upper tick index
     * @param tokenAmount - The desired amount of tokens to deposit/withdraw
     * @returns An estimated amount of liquidity needed to deposit/withdraw the desired amount of tokens.
     */
    static estimateLiquidityFromTokenAmounts(currTick: number, lowerTick: number, upperTick: number, tokenAmount: TokenAmounts): BN;
    /**
     * Given an arbitrary pair of token mints, this function returns an ordering of the token mints
     * in the format [base, quote]. USD based stable coins are prioritized as the quote currency
     * followed by variants of SOL.
     *
     * @category Whirlpool Utils
     * @param tokenMintAKey - The mint of token A in the token pair.
     * @param tokenMintBKey - The mint of token B in the token pair.
     * @returns A two-element array with the tokens sorted in the order of [baseToken, quoteToken].
     */
    static toBaseQuoteOrder(tokenMintAKey: PublicKey, tokenMintBKey: PublicKey): [PublicKey, PublicKey];
}
/**
 * @category Whirlpool Utils
 */
type TokenAmounts = {
    tokenA: u64;
    tokenB: u64;
};
/**
 * @category Whirlpool Utils
 */
declare function toTokenAmount(a: number, b: number): TokenAmounts;

/**
 * A collection of utility functions to convert between price, tickIndex and sqrtPrice.
 *
 * @category Whirlpool Utils
 */
declare class PriceMath {
    static priceToSqrtPriceX64(price: Decimal, decimalsA: number, decimalsB: number): BN;
    static sqrtPriceX64ToPrice(sqrtPriceX64: BN, decimalsA: number, decimalsB: number): Decimal;
    /**
     * @param tickIndex
     * @returns
     */
    static tickIndexToSqrtPriceX64(tickIndex: number): BN;
    /**
     *
     * @param sqrtPriceX64
     * @returns
     */
    static sqrtPriceX64ToTickIndex(sqrtPriceX64: BN): number;
    static tickIndexToPrice(tickIndex: number, decimalsA: number, decimalsB: number): Decimal;
    static priceToTickIndex(price: Decimal, decimalsA: number, decimalsB: number): number;
    static priceToInitializableTickIndex(price: Decimal, decimalsA: number, decimalsB: number, tickSpacing: number): number;
    /**
     * Utility to invert the price Pb/Pa to Pa/Pb
     * @param price Pb / Pa
     * @param decimalsA Decimals of original token A (i.e. token A in the given Pb / Pa price)
     * @param decimalsB Decimals of original token B (i.e. token B in the given Pb / Pa price)
     * @returns inverted price, i.e. Pa / Pb
     */
    static invertPrice(price: Decimal, decimalsA: number, decimalsB: number): Decimal;
    /**
     * Utility to invert the sqrtPriceX64 from X64 repr. of sqrt(Pb/Pa) to X64 repr. of sqrt(Pa/Pb)
     * @param sqrtPriceX64 X64 representation of sqrt(Pb / Pa)
     * @returns inverted sqrtPriceX64, i.e. X64 representation of sqrt(Pa / Pb)
     */
    static invertSqrtPriceX64(sqrtPriceX64: BN): BN;
}

/**
 * @category Whirlpool Utils
 */
declare class SwapUtils {
    /**
     * Get the default values for the sqrtPriceLimit parameter in a swap.
     * @param aToB - The direction of a swap
     * @returns The default values for the sqrtPriceLimit parameter in a swap.
     */
    static getDefaultSqrtPriceLimit(aToB: boolean): BN$1;
    /**
     * Get the default values for the otherAmountThreshold parameter in a swap.
     * @param amountSpecifiedIsInput - The direction of a swap
     * @returns The default values for the otherAmountThreshold parameter in a swap.
     */
    static getDefaultOtherAmountThreshold(amountSpecifiedIsInput: boolean): BN$1;
    /**
     * Given the intended token mint to swap, return the swap direction of a swap for a Whirlpool
     * @param pool The Whirlpool to evaluate the mint against
     * @param swapTokenMint The token mint PublicKey the user bases their swap against
     * @param swapTokenIsInput Whether the swap token is the input token. (similar to amountSpecifiedIsInput from swap Ix)
     * @returns The direction of the swap given the swapTokenMint. undefined if the token mint is not part of the trade pair of the pool.
     */
    static getSwapDirection(pool: WhirlpoolData, swapTokenMint: PublicKey, swapTokenIsInput: boolean): SwapDirection | undefined;
    /**
     * Given the current tick-index, returns the dervied PDA and fetched data
     * for the tick-arrays that this swap may traverse across.
     *
     * @category Whirlpool Utils
     * @param tickCurrentIndex - The current tickIndex for the Whirlpool to swap on.
     * @param tickSpacing - The tickSpacing for the Whirlpool.
     * @param aToB - The direction of the trade.
     * @param programId - The Whirlpool programId which the Whirlpool lives on.
     * @param whirlpoolAddress - PublicKey of the whirlpool to swap on.
     * @returns An array of PublicKey[] for the tickArray accounts that this swap may traverse across.
     */
    static getTickArrayPublicKeys(tickCurrentIndex: number, tickSpacing: number, aToB: boolean, programId: PublicKey, whirlpoolAddress: PublicKey): PublicKey[];
    /**
     * Given the current tick-index, returns TickArray objects that this swap may traverse across.
     *
     * @category Whirlpool Utils
     * @param tickCurrentIndex - The current tickIndex for the Whirlpool to swap on.
     * @param tickSpacing - The tickSpacing for the Whirlpool.
     * @param aToB - The direction of the trade.
     * @param programId - The Whirlpool programId which the Whirlpool lives on.
     * @param whirlpoolAddress - PublicKey of the whirlpool to swap on.
     * @param fetcher - AccountFetcher object to fetch solana accounts
     * @param refresh - If true, fetcher would default to fetching the latest accounts
     * @returns An array of PublicKey[] for the tickArray accounts that this swap may traverse across.
     */
    static getTickArrays(tickCurrentIndex: number, tickSpacing: number, aToB: boolean, programId: PublicKey, whirlpoolAddress: PublicKey, fetcher: AccountFetcher, refresh: boolean): Promise<TickArray[]>;
    /**
     * Calculate the SwapInput parameters `amount` & `otherAmountThreshold` based on the amountIn & amountOut estimates from a quote.
     * @param amount - The amount of tokens the user wanted to swap from.
     * @param estAmountIn - The estimated amount of input tokens expected in a `SwapQuote`
     * @param estAmountOut - The estimated amount of output tokens expected from a `SwapQuote`
     * @param slippageTolerance - The amount of slippage to adjust for.
     * @param amountSpecifiedIsInput - Specifies the token the parameter `amount`represents in the swap quote. If true, the amount represents
     *                                 the input token of the swap.
     * @returns A Partial `SwapInput` object containing the slippage adjusted 'amount' & 'otherAmountThreshold' parameters.
     */
    static calculateSwapAmountsFromQuote(amount: BN$1, amountSpecifiedIsInput: boolean): Pick<SwapInput, "amount">;
}

/**
 * A collection of utility functions when interacting with Ticks.
 * @category Whirlpool Utils
 */
declare class TickUtil {
    private constructor();
    /**
     * Get the offset index to access a tick at a given tick-index in a tick-array
     *
     * @param tickIndex The tick index for the tick that this offset would access
     * @param arrayStartIndex The starting tick for the array that this tick-index resides in
     * @param tickSpacing The tickSpacing for the Whirlpool that this tickArray belongs to
     * @returns The offset index that can access the desired tick at the given tick-array
     */
    static getOffsetIndex(tickIndex: number, arrayStartIndex: number, tickSpacing: number): number;
    /**
     * Get the startIndex of the tick array containing tickIndex.
     *
     * @param tickIndex
     * @param tickSpacing
     * @param offset can be used to get neighboring tick array startIndex.
     * @returns
     */
    static getStartTickIndex(tickIndex: number, tickSpacing: number, offset?: number): number;
    /**
     * Get the nearest (rounding down) valid tick index from the tickIndex.
     * A valid tick index is a point on the tick spacing grid line.
     */
    static getInitializableTickIndex(tickIndex: number, tickSpacing: number): number;
    static getNextInitializableTickIndex(tickIndex: number, tickSpacing: number): number;
    static getPrevInitializableTickIndex(tickIndex: number, tickSpacing: number): number;
    /**
     * Get the previous initialized tick index within the same tick array.
     *
     * @param account
     * @param currentTickIndex
     * @param tickSpacing
     * @returns
     */
    static findPreviousInitializedTickIndex(account: TickArrayData, currentTickIndex: number, tickSpacing: number): number | null;
    /**
     * Get the next initialized tick index within the same tick array.
     * @param account
     * @param currentTickIndex
     * @param tickSpacing
     * @returns
     */
    static findNextInitializedTickIndex(account: TickArrayData, currentTickIndex: number, tickSpacing: number): number | null;
    private static findInitializedTick;
    static checkTickInBounds(tick: number): boolean;
    static isTickInitializable(tick: number, tickSpacing: number): boolean;
    /**
     *
     * Returns the tick for the inverse of the price that this tick represents.
     * Eg: Consider tick i where Pb/Pa = 1.0001 ^ i
     * inverse of this, i.e. Pa/Pb = 1 / (1.0001 ^ i) = 1.0001^-i
     * @param tick The tick to invert
     * @returns
     */
    static invertTick(tick: number): number;
}
/**
 * A collection of utility functions when interacting with a TickArray.
 * @category Whirlpool Utils
 */
declare class TickArrayUtil {
    /**
     * Get the tick from tickArray with a global tickIndex.
     */
    static getTickFromArray(tickArray: TickArrayData, tickIndex: number, tickSpacing: number): TickData;
    /**
     * Return a sequence of tick array pdas based on the sequence start index.
     * @param tick - A tick in the first tick-array of your sequence
     * @param tickSpacing - Tick spacing for the whirlpool
     * @param numOfTickArrays - The number of TickArray PDAs to generate
     * @param programId - Program Id of the whirlpool for these tick-arrays
     * @param whirlpoolAddress - Address for the Whirlpool for these tick-arrays
     * @returns TickArray PDAs for the sequence`
     */
    static getTickArrayPDAs(tick: number, tickSpacing: number, numOfTickArrays: number, programId: PublicKey, whirlpoolAddress: PublicKey, aToB: boolean): Promise<_orca_so_common_sdk.PDA[]>;
    static getUninitializedArraysPDAs(ticks: number[], programId: PublicKey, whirlpoolAddress: PublicKey, tickSpacing: number, fetcher: AccountFetcher, refresh: boolean): Promise<{
        startIndex: number;
        pda: _orca_so_common_sdk.PDA;
    }[]>;
    /**
     * Evaluate a list of tick-array data and return the array of indices which the tick-arrays are not initialized.
     * @param tickArrays - a list of TickArrayData or null objects from AccountFetcher.listTickArrays
     * @returns an array of array-index for the input tickArrays that requires initialization.
     */
    static getUninitializedArrays(tickArrays: (TickArrayData | null)[]): number[];
}

export { AccountFetcher, AccountName, ClosePositionParams, CollectFeesParams, CollectFeesQuote, CollectFeesQuoteParam, CollectProtocolFeesParams, CollectRewardParams, CollectRewardsQuote, CollectRewardsQuoteParam, DecreaseLiquidityInput, DecreaseLiquidityParams, DecreaseLiquidityQuote, DecreaseLiquidityQuoteParam, DevFeeSwapQuote, FEE_RATE_MUL_VALUE, FeeTierData, IncreaseLiquidityInput, IncreaseLiquidityParams, IncreaseLiquidityQuote, IncreaseLiquidityQuoteParam, InitConfigParams, InitFeeTierParams, InitPoolParams, InitTickArrayParams, InitializeRewardParams, MAX_SQRT_PRICE, MAX_SWAP_TICK_ARRAYS, MAX_TICK_INDEX, METADATA_PROGRAM_ADDRESS, MIN_SQRT_PRICE, MIN_TICK_INDEX, NUM_REWARDS, NormalSwapQuote, ORCA_WHIRLPOOLS_CONFIG, ORCA_WHIRLPOOL_PROGRAM_ID, OpenPositionBumpsData, OpenPositionParams, OpenPositionWithMetadataBumpsData, PDAUtil, PROTOCOL_FEE_RATE_MUL_VALUE, ParsableEntity, ParsableFeeTier, ParsableMintInfo, ParsablePosition, ParsableTickArray, ParsableTokenInfo, ParsableWhirlpool, ParsableWhirlpoolsConfig, PoolUtil, Position, PositionData, PositionImpl, PositionRewardInfoData, PriceMath, SetCollectProtocolFeesAuthorityParams, SetDefaultFeeRateParams, SetDefaultProtocolFeeRateParams, SetFeeAuthorityParams, SetFeeRateParams, SetProtocolFeeRateParams, SetRewardAuthorityBySuperAuthorityParams, SetRewardAuthorityParams, SetRewardEmissionsParams, SetRewardEmissionsSuperAuthorityParams, SwapDirection, SwapInput, SwapParams, SwapQuote, SwapQuoteParam, SwapUtils, TICK_ARRAY_SIZE, TickArray, TickArrayData, TickArrayUtil, TickData, TickUtil, TokenAccountInfo, TokenAmounts, TokenInfo, TokenType, UpdateFeesAndRewardsParams, WHIRLPOOL_ACCOUNT_SIZE, WHIRLPOOL_CODER, Whirlpool, WhirlpoolBumpsData, WhirlpoolClient, WhirlpoolContext, WhirlpoolData, WhirlpoolIx, WhirlpoolRewardInfo, WhirlpoolRewardInfoData, WhirlpoolsConfigData, buildWhirlpoolClient, collectFeesQuote, collectRewardsQuote, decreaseLiquidityQuoteByLiquidity, decreaseLiquidityQuoteByLiquidityWithParams, increaseLiquidityQuoteByInputToken, increaseLiquidityQuoteByInputTokenWithParams, swapQuoteByInputToken, swapQuoteByInputTokenWithDevFees, swapQuoteByOutputToken, swapQuoteWithParams, toTokenAmount, toTx };
