@orca-so/whirlpools-client
Version:
Typescript client to interact with Orca's on-chain Whirlpool program.
828 lines (801 loc) • 416 kB
TypeScript
import * as _solana_kit from '@solana/kit';
import { ReadonlyUint8Array, Address, Encoder, Decoder, Codec, EncodedAccount, Account, MaybeEncodedAccount, MaybeAccount, fetchEncodedAccount, FetchAccountConfig, fetchEncodedAccounts, FetchAccountsConfig, GetDiscriminatedUnionVariant, GetDiscriminatedUnionVariantContent, SolanaError, SOLANA_ERROR__INSTRUCTION_ERROR__CUSTOM, IAccountMeta, IInstruction, IInstructionWithData, IInstructionWithAccounts, WritableAccount, ReadonlyAccount, ReadonlySignerAccount, IAccountSignerMeta, TransactionSigner, Option, OptionOrNullable, WritableSignerAccount, GetProgramAccountsMemcmpFilter, Rpc, GetProgramAccountsApi, ProgramDerivedAddress } from '@solana/kit';
declare const ADAPTIVE_FEE_TIER_DISCRIMINATOR: Uint8Array<ArrayBuffer>;
declare function getAdaptiveFeeTierDiscriminatorBytes(): ReadonlyUint8Array;
type AdaptiveFeeTier = {
discriminator: ReadonlyUint8Array;
whirlpoolsConfig: Address;
feeTierIndex: number;
tickSpacing: number;
initializePoolAuthority: Address;
delegatedFeeAuthority: Address;
defaultBaseFeeRate: number;
filterPeriod: number;
decayPeriod: number;
reductionFactor: number;
adaptiveFeeControlFactor: number;
maxVolatilityAccumulator: number;
tickGroupSize: number;
majorSwapThresholdTicks: number;
};
type AdaptiveFeeTierArgs = {
whirlpoolsConfig: Address;
feeTierIndex: number;
tickSpacing: number;
initializePoolAuthority: Address;
delegatedFeeAuthority: Address;
defaultBaseFeeRate: number;
filterPeriod: number;
decayPeriod: number;
reductionFactor: number;
adaptiveFeeControlFactor: number;
maxVolatilityAccumulator: number;
tickGroupSize: number;
majorSwapThresholdTicks: number;
};
declare function getAdaptiveFeeTierEncoder(): Encoder<AdaptiveFeeTierArgs>;
declare function getAdaptiveFeeTierDecoder(): Decoder<AdaptiveFeeTier>;
declare function getAdaptiveFeeTierCodec(): Codec<AdaptiveFeeTierArgs, AdaptiveFeeTier>;
declare function decodeAdaptiveFeeTier<TAddress extends string = string>(encodedAccount: EncodedAccount<TAddress>): Account<AdaptiveFeeTier, TAddress>;
declare function decodeAdaptiveFeeTier<TAddress extends string = string>(encodedAccount: MaybeEncodedAccount<TAddress>): MaybeAccount<AdaptiveFeeTier, TAddress>;
declare function fetchAdaptiveFeeTier<TAddress extends string = string>(rpc: Parameters<typeof fetchEncodedAccount>[0], address: Address<TAddress>, config?: FetchAccountConfig): Promise<Account<AdaptiveFeeTier, TAddress>>;
declare function fetchMaybeAdaptiveFeeTier<TAddress extends string = string>(rpc: Parameters<typeof fetchEncodedAccount>[0], address: Address<TAddress>, config?: FetchAccountConfig): Promise<MaybeAccount<AdaptiveFeeTier, TAddress>>;
declare function fetchAllAdaptiveFeeTier(rpc: Parameters<typeof fetchEncodedAccounts>[0], addresses: Array<Address>, config?: FetchAccountsConfig): Promise<Account<AdaptiveFeeTier>[]>;
declare function fetchAllMaybeAdaptiveFeeTier(rpc: Parameters<typeof fetchEncodedAccounts>[0], addresses: Array<Address>, config?: FetchAccountsConfig): Promise<MaybeAccount<AdaptiveFeeTier>[]>;
declare function getAdaptiveFeeTierSize(): number;
declare enum AccountsType {
TransferHookA = 0,
TransferHookB = 1,
TransferHookReward = 2,
TransferHookInput = 3,
TransferHookIntermediate = 4,
TransferHookOutput = 5,
SupplementalTickArrays = 6,
SupplementalTickArraysOne = 7,
SupplementalTickArraysTwo = 8
}
type AccountsTypeArgs = AccountsType;
declare function getAccountsTypeEncoder(): Encoder<AccountsTypeArgs>;
declare function getAccountsTypeDecoder(): Decoder<AccountsType>;
declare function getAccountsTypeCodec(): Codec<AccountsTypeArgs, AccountsType>;
type AdaptiveFeeConstants = {
filterPeriod: number;
decayPeriod: number;
reductionFactor: number;
adaptiveFeeControlFactor: number;
maxVolatilityAccumulator: number;
tickGroupSize: number;
majorSwapThresholdTicks: number;
reserved: ReadonlyUint8Array;
};
type AdaptiveFeeConstantsArgs = AdaptiveFeeConstants;
declare function getAdaptiveFeeConstantsEncoder(): Encoder<AdaptiveFeeConstantsArgs>;
declare function getAdaptiveFeeConstantsDecoder(): Decoder<AdaptiveFeeConstants>;
declare function getAdaptiveFeeConstantsCodec(): Codec<AdaptiveFeeConstantsArgs, AdaptiveFeeConstants>;
type AdaptiveFeeVariables = {
lastReferenceUpdateTimestamp: bigint;
lastMajorSwapTimestamp: bigint;
volatilityReference: number;
tickGroupIndexReference: number;
volatilityAccumulator: number;
reserved: ReadonlyUint8Array;
};
type AdaptiveFeeVariablesArgs = {
lastReferenceUpdateTimestamp: number | bigint;
lastMajorSwapTimestamp: number | bigint;
volatilityReference: number;
tickGroupIndexReference: number;
volatilityAccumulator: number;
reserved: ReadonlyUint8Array;
};
declare function getAdaptiveFeeVariablesEncoder(): Encoder<AdaptiveFeeVariablesArgs>;
declare function getAdaptiveFeeVariablesDecoder(): Decoder<AdaptiveFeeVariables>;
declare function getAdaptiveFeeVariablesCodec(): Codec<AdaptiveFeeVariablesArgs, AdaptiveFeeVariables>;
type DynamicTick = {
__kind: 'Uninitialized';
} | {
__kind: 'Initialized';
fields: readonly [DynamicTickData];
};
type DynamicTickArgs = {
__kind: 'Uninitialized';
} | {
__kind: 'Initialized';
fields: readonly [DynamicTickDataArgs];
};
declare function getDynamicTickEncoder(): Encoder<DynamicTickArgs>;
declare function getDynamicTickDecoder(): Decoder<DynamicTick>;
declare function getDynamicTickCodec(): Codec<DynamicTickArgs, DynamicTick>;
declare function dynamicTick(kind: 'Uninitialized'): GetDiscriminatedUnionVariant<DynamicTickArgs, '__kind', 'Uninitialized'>;
declare function dynamicTick(kind: 'Initialized', data: GetDiscriminatedUnionVariantContent<DynamicTickArgs, '__kind', 'Initialized'>['fields']): GetDiscriminatedUnionVariant<DynamicTickArgs, '__kind', 'Initialized'>;
declare function isDynamicTick<K extends DynamicTick['__kind']>(kind: K, value: DynamicTick): value is DynamicTick & {
__kind: K;
};
type DynamicTickData = {
liquidityNet: bigint;
liquidityGross: bigint;
feeGrowthOutsideA: bigint;
feeGrowthOutsideB: bigint;
rewardGrowthsOutside: Array<bigint>;
};
type DynamicTickDataArgs = {
liquidityNet: number | bigint;
liquidityGross: number | bigint;
feeGrowthOutsideA: number | bigint;
feeGrowthOutsideB: number | bigint;
rewardGrowthsOutside: Array<number | bigint>;
};
declare function getDynamicTickDataEncoder(): Encoder<DynamicTickDataArgs>;
declare function getDynamicTickDataDecoder(): Decoder<DynamicTickData>;
declare function getDynamicTickDataCodec(): Codec<DynamicTickDataArgs, DynamicTickData>;
declare enum LockType {
Permanent = 0
}
type LockTypeArgs = LockType;
declare function getLockTypeEncoder(): Encoder<LockTypeArgs>;
declare function getLockTypeDecoder(): Decoder<LockType>;
declare function getLockTypeCodec(): Codec<LockTypeArgs, LockType>;
declare enum LockTypeLabel {
Permanent = 0
}
type LockTypeLabelArgs = LockTypeLabel;
declare function getLockTypeLabelEncoder(): Encoder<LockTypeLabelArgs>;
declare function getLockTypeLabelDecoder(): Decoder<LockTypeLabel>;
declare function getLockTypeLabelCodec(): Codec<LockTypeLabelArgs, LockTypeLabel>;
type PositionRewardInfo = {
growthInsideCheckpoint: bigint;
amountOwed: bigint;
};
type PositionRewardInfoArgs = {
growthInsideCheckpoint: number | bigint;
amountOwed: number | bigint;
};
declare function getPositionRewardInfoEncoder(): Encoder<PositionRewardInfoArgs>;
declare function getPositionRewardInfoDecoder(): Decoder<PositionRewardInfo>;
declare function getPositionRewardInfoCodec(): Codec<PositionRewardInfoArgs, PositionRewardInfo>;
type RemainingAccountsInfo = {
slices: Array<RemainingAccountsSlice>;
};
type RemainingAccountsInfoArgs = {
slices: Array<RemainingAccountsSliceArgs>;
};
declare function getRemainingAccountsInfoEncoder(): Encoder<RemainingAccountsInfoArgs>;
declare function getRemainingAccountsInfoDecoder(): Decoder<RemainingAccountsInfo>;
declare function getRemainingAccountsInfoCodec(): Codec<RemainingAccountsInfoArgs, RemainingAccountsInfo>;
type RemainingAccountsSlice = {
accountsType: AccountsType;
length: number;
};
type RemainingAccountsSliceArgs = {
accountsType: AccountsTypeArgs;
length: number;
};
declare function getRemainingAccountsSliceEncoder(): Encoder<RemainingAccountsSliceArgs>;
declare function getRemainingAccountsSliceDecoder(): Decoder<RemainingAccountsSlice>;
declare function getRemainingAccountsSliceCodec(): Codec<RemainingAccountsSliceArgs, RemainingAccountsSlice>;
type Tick = {
initialized: boolean;
liquidityNet: bigint;
liquidityGross: bigint;
feeGrowthOutsideA: bigint;
feeGrowthOutsideB: bigint;
rewardGrowthsOutside: Array<bigint>;
};
type TickArgs = {
initialized: boolean;
liquidityNet: number | bigint;
liquidityGross: number | bigint;
feeGrowthOutsideA: number | bigint;
feeGrowthOutsideB: number | bigint;
rewardGrowthsOutside: Array<number | bigint>;
};
declare function getTickEncoder(): Encoder<TickArgs>;
declare function getTickDecoder(): Decoder<Tick>;
declare function getTickCodec(): Codec<TickArgs, Tick>;
type WhirlpoolRewardInfo = {
mint: Address;
vault: Address;
authority: Address;
emissionsPerSecondX64: bigint;
growthGlobalX64: bigint;
};
type WhirlpoolRewardInfoArgs = {
mint: Address;
vault: Address;
authority: Address;
emissionsPerSecondX64: number | bigint;
growthGlobalX64: number | bigint;
};
declare function getWhirlpoolRewardInfoEncoder(): Encoder<WhirlpoolRewardInfoArgs>;
declare function getWhirlpoolRewardInfoDecoder(): Decoder<WhirlpoolRewardInfo>;
declare function getWhirlpoolRewardInfoCodec(): Codec<WhirlpoolRewardInfoArgs, WhirlpoolRewardInfo>;
declare const DYNAMIC_TICK_ARRAY_DISCRIMINATOR: Uint8Array<ArrayBuffer>;
declare function getDynamicTickArrayDiscriminatorBytes(): ReadonlyUint8Array;
type DynamicTickArray = {
discriminator: ReadonlyUint8Array;
startTickIndex: number;
whirlpool: Address;
tickBitmap: bigint;
ticks: Array<DynamicTick>;
};
type DynamicTickArrayArgs = {
startTickIndex: number;
whirlpool: Address;
tickBitmap: number | bigint;
ticks: Array<DynamicTickArgs>;
};
declare function getDynamicTickArrayEncoder(): Encoder<DynamicTickArrayArgs>;
declare function getDynamicTickArrayDecoder(): Decoder<DynamicTickArray>;
declare function getDynamicTickArrayCodec(): Codec<DynamicTickArrayArgs, DynamicTickArray>;
declare function decodeDynamicTickArray<TAddress extends string = string>(encodedAccount: EncodedAccount<TAddress>): Account<DynamicTickArray, TAddress>;
declare function decodeDynamicTickArray<TAddress extends string = string>(encodedAccount: MaybeEncodedAccount<TAddress>): MaybeAccount<DynamicTickArray, TAddress>;
declare function fetchDynamicTickArray<TAddress extends string = string>(rpc: Parameters<typeof fetchEncodedAccount>[0], address: Address<TAddress>, config?: FetchAccountConfig): Promise<Account<DynamicTickArray, TAddress>>;
declare function fetchMaybeDynamicTickArray<TAddress extends string = string>(rpc: Parameters<typeof fetchEncodedAccount>[0], address: Address<TAddress>, config?: FetchAccountConfig): Promise<MaybeAccount<DynamicTickArray, TAddress>>;
declare function fetchAllDynamicTickArray(rpc: Parameters<typeof fetchEncodedAccounts>[0], addresses: Array<Address>, config?: FetchAccountsConfig): Promise<Account<DynamicTickArray>[]>;
declare function fetchAllMaybeDynamicTickArray(rpc: Parameters<typeof fetchEncodedAccounts>[0], addresses: Array<Address>, config?: FetchAccountsConfig): Promise<MaybeAccount<DynamicTickArray>[]>;
declare const FEE_TIER_DISCRIMINATOR: Uint8Array<ArrayBuffer>;
declare function getFeeTierDiscriminatorBytes(): ReadonlyUint8Array;
type FeeTier = {
discriminator: ReadonlyUint8Array;
whirlpoolsConfig: Address;
tickSpacing: number;
defaultFeeRate: number;
};
type FeeTierArgs = {
whirlpoolsConfig: Address;
tickSpacing: number;
defaultFeeRate: number;
};
declare function getFeeTierEncoder(): Encoder<FeeTierArgs>;
declare function getFeeTierDecoder(): Decoder<FeeTier>;
declare function getFeeTierCodec(): Codec<FeeTierArgs, FeeTier>;
declare function decodeFeeTier<TAddress extends string = string>(encodedAccount: EncodedAccount<TAddress>): Account<FeeTier, TAddress>;
declare function decodeFeeTier<TAddress extends string = string>(encodedAccount: MaybeEncodedAccount<TAddress>): MaybeAccount<FeeTier, TAddress>;
declare function fetchFeeTier<TAddress extends string = string>(rpc: Parameters<typeof fetchEncodedAccount>[0], address: Address<TAddress>, config?: FetchAccountConfig): Promise<Account<FeeTier, TAddress>>;
declare function fetchMaybeFeeTier<TAddress extends string = string>(rpc: Parameters<typeof fetchEncodedAccount>[0], address: Address<TAddress>, config?: FetchAccountConfig): Promise<MaybeAccount<FeeTier, TAddress>>;
declare function fetchAllFeeTier(rpc: Parameters<typeof fetchEncodedAccounts>[0], addresses: Array<Address>, config?: FetchAccountsConfig): Promise<Account<FeeTier>[]>;
declare function fetchAllMaybeFeeTier(rpc: Parameters<typeof fetchEncodedAccounts>[0], addresses: Array<Address>, config?: FetchAccountsConfig): Promise<MaybeAccount<FeeTier>[]>;
declare function getFeeTierSize(): number;
declare const FIXED_TICK_ARRAY_DISCRIMINATOR: Uint8Array<ArrayBuffer>;
declare function getFixedTickArrayDiscriminatorBytes(): ReadonlyUint8Array;
type FixedTickArray = {
discriminator: ReadonlyUint8Array;
startTickIndex: number;
ticks: Array<Tick>;
whirlpool: Address;
};
type FixedTickArrayArgs = {
startTickIndex: number;
ticks: Array<TickArgs>;
whirlpool: Address;
};
declare function getFixedTickArrayEncoder(): Encoder<FixedTickArrayArgs>;
declare function getFixedTickArrayDecoder(): Decoder<FixedTickArray>;
declare function getFixedTickArrayCodec(): Codec<FixedTickArrayArgs, FixedTickArray>;
declare function decodeFixedTickArray<TAddress extends string = string>(encodedAccount: EncodedAccount<TAddress>): Account<FixedTickArray, TAddress>;
declare function decodeFixedTickArray<TAddress extends string = string>(encodedAccount: MaybeEncodedAccount<TAddress>): MaybeAccount<FixedTickArray, TAddress>;
declare function fetchFixedTickArray<TAddress extends string = string>(rpc: Parameters<typeof fetchEncodedAccount>[0], address: Address<TAddress>, config?: FetchAccountConfig): Promise<Account<FixedTickArray, TAddress>>;
declare function fetchMaybeFixedTickArray<TAddress extends string = string>(rpc: Parameters<typeof fetchEncodedAccount>[0], address: Address<TAddress>, config?: FetchAccountConfig): Promise<MaybeAccount<FixedTickArray, TAddress>>;
declare function fetchAllFixedTickArray(rpc: Parameters<typeof fetchEncodedAccounts>[0], addresses: Array<Address>, config?: FetchAccountsConfig): Promise<Account<FixedTickArray>[]>;
declare function fetchAllMaybeFixedTickArray(rpc: Parameters<typeof fetchEncodedAccounts>[0], addresses: Array<Address>, config?: FetchAccountsConfig): Promise<MaybeAccount<FixedTickArray>[]>;
declare function getFixedTickArraySize(): number;
declare const LOCK_CONFIG_DISCRIMINATOR: Uint8Array<ArrayBuffer>;
declare function getLockConfigDiscriminatorBytes(): ReadonlyUint8Array;
type LockConfig = {
discriminator: ReadonlyUint8Array;
position: Address;
positionOwner: Address;
whirlpool: Address;
lockedTimestamp: bigint;
lockType: LockTypeLabel;
};
type LockConfigArgs = {
position: Address;
positionOwner: Address;
whirlpool: Address;
lockedTimestamp: number | bigint;
lockType: LockTypeLabelArgs;
};
declare function getLockConfigEncoder(): Encoder<LockConfigArgs>;
declare function getLockConfigDecoder(): Decoder<LockConfig>;
declare function getLockConfigCodec(): Codec<LockConfigArgs, LockConfig>;
declare function decodeLockConfig<TAddress extends string = string>(encodedAccount: EncodedAccount<TAddress>): Account<LockConfig, TAddress>;
declare function decodeLockConfig<TAddress extends string = string>(encodedAccount: MaybeEncodedAccount<TAddress>): MaybeAccount<LockConfig, TAddress>;
declare function fetchLockConfig<TAddress extends string = string>(rpc: Parameters<typeof fetchEncodedAccount>[0], address: Address<TAddress>, config?: FetchAccountConfig): Promise<Account<LockConfig, TAddress>>;
declare function fetchMaybeLockConfig<TAddress extends string = string>(rpc: Parameters<typeof fetchEncodedAccount>[0], address: Address<TAddress>, config?: FetchAccountConfig): Promise<MaybeAccount<LockConfig, TAddress>>;
declare function fetchAllLockConfig(rpc: Parameters<typeof fetchEncodedAccounts>[0], addresses: Array<Address>, config?: FetchAccountsConfig): Promise<Account<LockConfig>[]>;
declare function fetchAllMaybeLockConfig(rpc: Parameters<typeof fetchEncodedAccounts>[0], addresses: Array<Address>, config?: FetchAccountsConfig): Promise<MaybeAccount<LockConfig>[]>;
declare function getLockConfigSize(): number;
declare const ORACLE_DISCRIMINATOR: Uint8Array<ArrayBuffer>;
declare function getOracleDiscriminatorBytes(): ReadonlyUint8Array;
type Oracle = {
discriminator: ReadonlyUint8Array;
whirlpool: Address;
tradeEnableTimestamp: bigint;
adaptiveFeeConstants: AdaptiveFeeConstants;
adaptiveFeeVariables: AdaptiveFeeVariables;
reserved: ReadonlyUint8Array;
};
type OracleArgs = {
whirlpool: Address;
tradeEnableTimestamp: number | bigint;
adaptiveFeeConstants: AdaptiveFeeConstantsArgs;
adaptiveFeeVariables: AdaptiveFeeVariablesArgs;
reserved: ReadonlyUint8Array;
};
declare function getOracleEncoder(): Encoder<OracleArgs>;
declare function getOracleDecoder(): Decoder<Oracle>;
declare function getOracleCodec(): Codec<OracleArgs, Oracle>;
declare function decodeOracle<TAddress extends string = string>(encodedAccount: EncodedAccount<TAddress>): Account<Oracle, TAddress>;
declare function decodeOracle<TAddress extends string = string>(encodedAccount: MaybeEncodedAccount<TAddress>): MaybeAccount<Oracle, TAddress>;
declare function fetchOracle<TAddress extends string = string>(rpc: Parameters<typeof fetchEncodedAccount>[0], address: Address<TAddress>, config?: FetchAccountConfig): Promise<Account<Oracle, TAddress>>;
declare function fetchMaybeOracle<TAddress extends string = string>(rpc: Parameters<typeof fetchEncodedAccount>[0], address: Address<TAddress>, config?: FetchAccountConfig): Promise<MaybeAccount<Oracle, TAddress>>;
declare function fetchAllOracle(rpc: Parameters<typeof fetchEncodedAccounts>[0], addresses: Array<Address>, config?: FetchAccountsConfig): Promise<Account<Oracle>[]>;
declare function fetchAllMaybeOracle(rpc: Parameters<typeof fetchEncodedAccounts>[0], addresses: Array<Address>, config?: FetchAccountsConfig): Promise<MaybeAccount<Oracle>[]>;
declare function getOracleSize(): number;
declare const POSITION_DISCRIMINATOR: Uint8Array<ArrayBuffer>;
declare function getPositionDiscriminatorBytes(): ReadonlyUint8Array;
type Position = {
discriminator: ReadonlyUint8Array;
whirlpool: Address;
positionMint: Address;
liquidity: bigint;
tickLowerIndex: number;
tickUpperIndex: number;
feeGrowthCheckpointA: bigint;
feeOwedA: bigint;
feeGrowthCheckpointB: bigint;
feeOwedB: bigint;
rewardInfos: Array<PositionRewardInfo>;
};
type PositionArgs = {
whirlpool: Address;
positionMint: Address;
liquidity: number | bigint;
tickLowerIndex: number;
tickUpperIndex: number;
feeGrowthCheckpointA: number | bigint;
feeOwedA: number | bigint;
feeGrowthCheckpointB: number | bigint;
feeOwedB: number | bigint;
rewardInfos: Array<PositionRewardInfoArgs>;
};
declare function getPositionEncoder(): Encoder<PositionArgs>;
declare function getPositionDecoder(): Decoder<Position>;
declare function getPositionCodec(): Codec<PositionArgs, Position>;
declare function decodePosition<TAddress extends string = string>(encodedAccount: EncodedAccount<TAddress>): Account<Position, TAddress>;
declare function decodePosition<TAddress extends string = string>(encodedAccount: MaybeEncodedAccount<TAddress>): MaybeAccount<Position, TAddress>;
declare function fetchPosition<TAddress extends string = string>(rpc: Parameters<typeof fetchEncodedAccount>[0], address: Address<TAddress>, config?: FetchAccountConfig): Promise<Account<Position, TAddress>>;
declare function fetchMaybePosition<TAddress extends string = string>(rpc: Parameters<typeof fetchEncodedAccount>[0], address: Address<TAddress>, config?: FetchAccountConfig): Promise<MaybeAccount<Position, TAddress>>;
declare function fetchAllPosition(rpc: Parameters<typeof fetchEncodedAccounts>[0], addresses: Array<Address>, config?: FetchAccountsConfig): Promise<Account<Position>[]>;
declare function fetchAllMaybePosition(rpc: Parameters<typeof fetchEncodedAccounts>[0], addresses: Array<Address>, config?: FetchAccountsConfig): Promise<MaybeAccount<Position>[]>;
declare function getPositionSize(): number;
declare const POSITION_BUNDLE_DISCRIMINATOR: Uint8Array<ArrayBuffer>;
declare function getPositionBundleDiscriminatorBytes(): ReadonlyUint8Array;
type PositionBundle = {
discriminator: ReadonlyUint8Array;
positionBundleMint: Address;
positionBitmap: ReadonlyUint8Array;
};
type PositionBundleArgs = {
positionBundleMint: Address;
positionBitmap: ReadonlyUint8Array;
};
declare function getPositionBundleEncoder(): Encoder<PositionBundleArgs>;
declare function getPositionBundleDecoder(): Decoder<PositionBundle>;
declare function getPositionBundleCodec(): Codec<PositionBundleArgs, PositionBundle>;
declare function decodePositionBundle<TAddress extends string = string>(encodedAccount: EncodedAccount<TAddress>): Account<PositionBundle, TAddress>;
declare function decodePositionBundle<TAddress extends string = string>(encodedAccount: MaybeEncodedAccount<TAddress>): MaybeAccount<PositionBundle, TAddress>;
declare function fetchPositionBundle<TAddress extends string = string>(rpc: Parameters<typeof fetchEncodedAccount>[0], address: Address<TAddress>, config?: FetchAccountConfig): Promise<Account<PositionBundle, TAddress>>;
declare function fetchMaybePositionBundle<TAddress extends string = string>(rpc: Parameters<typeof fetchEncodedAccount>[0], address: Address<TAddress>, config?: FetchAccountConfig): Promise<MaybeAccount<PositionBundle, TAddress>>;
declare function fetchAllPositionBundle(rpc: Parameters<typeof fetchEncodedAccounts>[0], addresses: Array<Address>, config?: FetchAccountsConfig): Promise<Account<PositionBundle>[]>;
declare function fetchAllMaybePositionBundle(rpc: Parameters<typeof fetchEncodedAccounts>[0], addresses: Array<Address>, config?: FetchAccountsConfig): Promise<MaybeAccount<PositionBundle>[]>;
declare function getPositionBundleSize(): number;
declare const TOKEN_BADGE_DISCRIMINATOR: Uint8Array<ArrayBuffer>;
declare function getTokenBadgeDiscriminatorBytes(): ReadonlyUint8Array;
type TokenBadge = {
discriminator: ReadonlyUint8Array;
whirlpoolsConfig: Address;
tokenMint: Address;
};
type TokenBadgeArgs = {
whirlpoolsConfig: Address;
tokenMint: Address;
};
declare function getTokenBadgeEncoder(): Encoder<TokenBadgeArgs>;
declare function getTokenBadgeDecoder(): Decoder<TokenBadge>;
declare function getTokenBadgeCodec(): Codec<TokenBadgeArgs, TokenBadge>;
declare function decodeTokenBadge<TAddress extends string = string>(encodedAccount: EncodedAccount<TAddress>): Account<TokenBadge, TAddress>;
declare function decodeTokenBadge<TAddress extends string = string>(encodedAccount: MaybeEncodedAccount<TAddress>): MaybeAccount<TokenBadge, TAddress>;
declare function fetchTokenBadge<TAddress extends string = string>(rpc: Parameters<typeof fetchEncodedAccount>[0], address: Address<TAddress>, config?: FetchAccountConfig): Promise<Account<TokenBadge, TAddress>>;
declare function fetchMaybeTokenBadge<TAddress extends string = string>(rpc: Parameters<typeof fetchEncodedAccount>[0], address: Address<TAddress>, config?: FetchAccountConfig): Promise<MaybeAccount<TokenBadge, TAddress>>;
declare function fetchAllTokenBadge(rpc: Parameters<typeof fetchEncodedAccounts>[0], addresses: Array<Address>, config?: FetchAccountsConfig): Promise<Account<TokenBadge>[]>;
declare function fetchAllMaybeTokenBadge(rpc: Parameters<typeof fetchEncodedAccounts>[0], addresses: Array<Address>, config?: FetchAccountsConfig): Promise<MaybeAccount<TokenBadge>[]>;
declare function getTokenBadgeSize(): number;
declare const WHIRLPOOL_DISCRIMINATOR: Uint8Array<ArrayBuffer>;
declare function getWhirlpoolDiscriminatorBytes(): ReadonlyUint8Array;
type Whirlpool = {
discriminator: ReadonlyUint8Array;
whirlpoolsConfig: Address;
whirlpoolBump: ReadonlyUint8Array;
tickSpacing: number;
feeTierIndexSeed: ReadonlyUint8Array;
feeRate: number;
protocolFeeRate: number;
liquidity: bigint;
sqrtPrice: bigint;
tickCurrentIndex: number;
protocolFeeOwedA: bigint;
protocolFeeOwedB: bigint;
tokenMintA: Address;
tokenVaultA: Address;
feeGrowthGlobalA: bigint;
tokenMintB: Address;
tokenVaultB: Address;
feeGrowthGlobalB: bigint;
rewardLastUpdatedTimestamp: bigint;
rewardInfos: Array<WhirlpoolRewardInfo>;
};
type WhirlpoolArgs = {
whirlpoolsConfig: Address;
whirlpoolBump: ReadonlyUint8Array;
tickSpacing: number;
feeTierIndexSeed: ReadonlyUint8Array;
feeRate: number;
protocolFeeRate: number;
liquidity: number | bigint;
sqrtPrice: number | bigint;
tickCurrentIndex: number;
protocolFeeOwedA: number | bigint;
protocolFeeOwedB: number | bigint;
tokenMintA: Address;
tokenVaultA: Address;
feeGrowthGlobalA: number | bigint;
tokenMintB: Address;
tokenVaultB: Address;
feeGrowthGlobalB: number | bigint;
rewardLastUpdatedTimestamp: number | bigint;
rewardInfos: Array<WhirlpoolRewardInfoArgs>;
};
declare function getWhirlpoolEncoder(): Encoder<WhirlpoolArgs>;
declare function getWhirlpoolDecoder(): Decoder<Whirlpool>;
declare function getWhirlpoolCodec(): Codec<WhirlpoolArgs, Whirlpool>;
declare function decodeWhirlpool<TAddress extends string = string>(encodedAccount: EncodedAccount<TAddress>): Account<Whirlpool, TAddress>;
declare function decodeWhirlpool<TAddress extends string = string>(encodedAccount: MaybeEncodedAccount<TAddress>): MaybeAccount<Whirlpool, TAddress>;
declare function fetchWhirlpool<TAddress extends string = string>(rpc: Parameters<typeof fetchEncodedAccount>[0], address: Address<TAddress>, config?: FetchAccountConfig): Promise<Account<Whirlpool, TAddress>>;
declare function fetchMaybeWhirlpool<TAddress extends string = string>(rpc: Parameters<typeof fetchEncodedAccount>[0], address: Address<TAddress>, config?: FetchAccountConfig): Promise<MaybeAccount<Whirlpool, TAddress>>;
declare function fetchAllWhirlpool(rpc: Parameters<typeof fetchEncodedAccounts>[0], addresses: Array<Address>, config?: FetchAccountsConfig): Promise<Account<Whirlpool>[]>;
declare function fetchAllMaybeWhirlpool(rpc: Parameters<typeof fetchEncodedAccounts>[0], addresses: Array<Address>, config?: FetchAccountsConfig): Promise<MaybeAccount<Whirlpool>[]>;
declare function getWhirlpoolSize(): number;
declare const WHIRLPOOLS_CONFIG_DISCRIMINATOR: Uint8Array<ArrayBuffer>;
declare function getWhirlpoolsConfigDiscriminatorBytes(): ReadonlyUint8Array;
type WhirlpoolsConfig = {
discriminator: ReadonlyUint8Array;
feeAuthority: Address;
collectProtocolFeesAuthority: Address;
rewardEmissionsSuperAuthority: Address;
defaultProtocolFeeRate: number;
};
type WhirlpoolsConfigArgs = {
feeAuthority: Address;
collectProtocolFeesAuthority: Address;
rewardEmissionsSuperAuthority: Address;
defaultProtocolFeeRate: number;
};
declare function getWhirlpoolsConfigEncoder(): Encoder<WhirlpoolsConfigArgs>;
declare function getWhirlpoolsConfigDecoder(): Decoder<WhirlpoolsConfig>;
declare function getWhirlpoolsConfigCodec(): Codec<WhirlpoolsConfigArgs, WhirlpoolsConfig>;
declare function decodeWhirlpoolsConfig<TAddress extends string = string>(encodedAccount: EncodedAccount<TAddress>): Account<WhirlpoolsConfig, TAddress>;
declare function decodeWhirlpoolsConfig<TAddress extends string = string>(encodedAccount: MaybeEncodedAccount<TAddress>): MaybeAccount<WhirlpoolsConfig, TAddress>;
declare function fetchWhirlpoolsConfig<TAddress extends string = string>(rpc: Parameters<typeof fetchEncodedAccount>[0], address: Address<TAddress>, config?: FetchAccountConfig): Promise<Account<WhirlpoolsConfig, TAddress>>;
declare function fetchMaybeWhirlpoolsConfig<TAddress extends string = string>(rpc: Parameters<typeof fetchEncodedAccount>[0], address: Address<TAddress>, config?: FetchAccountConfig): Promise<MaybeAccount<WhirlpoolsConfig, TAddress>>;
declare function fetchAllWhirlpoolsConfig(rpc: Parameters<typeof fetchEncodedAccounts>[0], addresses: Array<Address>, config?: FetchAccountsConfig): Promise<Account<WhirlpoolsConfig>[]>;
declare function fetchAllMaybeWhirlpoolsConfig(rpc: Parameters<typeof fetchEncodedAccounts>[0], addresses: Array<Address>, config?: FetchAccountsConfig): Promise<MaybeAccount<WhirlpoolsConfig>[]>;
declare function getWhirlpoolsConfigSize(): number;
declare const WHIRLPOOLS_CONFIG_EXTENSION_DISCRIMINATOR: Uint8Array<ArrayBuffer>;
declare function getWhirlpoolsConfigExtensionDiscriminatorBytes(): ReadonlyUint8Array;
type WhirlpoolsConfigExtension = {
discriminator: ReadonlyUint8Array;
whirlpoolsConfig: Address;
configExtensionAuthority: Address;
tokenBadgeAuthority: Address;
};
type WhirlpoolsConfigExtensionArgs = {
whirlpoolsConfig: Address;
configExtensionAuthority: Address;
tokenBadgeAuthority: Address;
};
declare function getWhirlpoolsConfigExtensionEncoder(): Encoder<WhirlpoolsConfigExtensionArgs>;
declare function getWhirlpoolsConfigExtensionDecoder(): Decoder<WhirlpoolsConfigExtension>;
declare function getWhirlpoolsConfigExtensionCodec(): Codec<WhirlpoolsConfigExtensionArgs, WhirlpoolsConfigExtension>;
declare function decodeWhirlpoolsConfigExtension<TAddress extends string = string>(encodedAccount: EncodedAccount<TAddress>): Account<WhirlpoolsConfigExtension, TAddress>;
declare function decodeWhirlpoolsConfigExtension<TAddress extends string = string>(encodedAccount: MaybeEncodedAccount<TAddress>): MaybeAccount<WhirlpoolsConfigExtension, TAddress>;
declare function fetchWhirlpoolsConfigExtension<TAddress extends string = string>(rpc: Parameters<typeof fetchEncodedAccount>[0], address: Address<TAddress>, config?: FetchAccountConfig): Promise<Account<WhirlpoolsConfigExtension, TAddress>>;
declare function fetchMaybeWhirlpoolsConfigExtension<TAddress extends string = string>(rpc: Parameters<typeof fetchEncodedAccount>[0], address: Address<TAddress>, config?: FetchAccountConfig): Promise<MaybeAccount<WhirlpoolsConfigExtension, TAddress>>;
declare function fetchAllWhirlpoolsConfigExtension(rpc: Parameters<typeof fetchEncodedAccounts>[0], addresses: Array<Address>, config?: FetchAccountsConfig): Promise<Account<WhirlpoolsConfigExtension>[]>;
declare function fetchAllMaybeWhirlpoolsConfigExtension(rpc: Parameters<typeof fetchEncodedAccounts>[0], addresses: Array<Address>, config?: FetchAccountsConfig): Promise<MaybeAccount<WhirlpoolsConfigExtension>[]>;
declare function getWhirlpoolsConfigExtensionSize(): number;
declare const WHIRLPOOL_ERROR__INVALID_ENUM = 6000;
declare const WHIRLPOOL_ERROR__INVALID_START_TICK = 6001;
declare const WHIRLPOOL_ERROR__TICK_ARRAY_EXIST_IN_POOL = 6002;
declare const WHIRLPOOL_ERROR__TICK_ARRAY_INDEX_OUTOF_BOUNDS = 6003;
declare const WHIRLPOOL_ERROR__INVALID_TICK_SPACING = 6004;
declare const WHIRLPOOL_ERROR__CLOSE_POSITION_NOT_EMPTY = 6005;
declare const WHIRLPOOL_ERROR__DIVIDE_BY_ZERO = 6006;
declare const WHIRLPOOL_ERROR__NUMBER_CAST_ERROR = 6007;
declare const WHIRLPOOL_ERROR__NUMBER_DOWN_CAST_ERROR = 6008;
declare const WHIRLPOOL_ERROR__TICK_NOT_FOUND = 6009;
declare const WHIRLPOOL_ERROR__INVALID_TICK_INDEX = 6010;
declare const WHIRLPOOL_ERROR__SQRT_PRICE_OUT_OF_BOUNDS = 6011;
declare const WHIRLPOOL_ERROR__LIQUIDITY_ZERO = 6012;
declare const WHIRLPOOL_ERROR__LIQUIDITY_TOO_HIGH = 6013;
declare const WHIRLPOOL_ERROR__LIQUIDITY_OVERFLOW = 6014;
declare const WHIRLPOOL_ERROR__LIQUIDITY_UNDERFLOW = 6015;
declare const WHIRLPOOL_ERROR__LIQUIDITY_NET_ERROR = 6016;
declare const WHIRLPOOL_ERROR__TOKEN_MAX_EXCEEDED = 6017;
declare const WHIRLPOOL_ERROR__TOKEN_MIN_SUBCEEDED = 6018;
declare const WHIRLPOOL_ERROR__MISSING_OR_INVALID_DELEGATE = 6019;
declare const WHIRLPOOL_ERROR__INVALID_POSITION_TOKEN_AMOUNT = 6020;
declare const WHIRLPOOL_ERROR__INVALID_TIMESTAMP_CONVERSION = 6021;
declare const WHIRLPOOL_ERROR__INVALID_TIMESTAMP = 6022;
declare const WHIRLPOOL_ERROR__INVALID_TICK_ARRAY_SEQUENCE = 6023;
declare const WHIRLPOOL_ERROR__INVALID_TOKEN_MINT_ORDER = 6024;
declare const WHIRLPOOL_ERROR__REWARD_NOT_INITIALIZED = 6025;
declare const WHIRLPOOL_ERROR__INVALID_REWARD_INDEX = 6026;
declare const WHIRLPOOL_ERROR__REWARD_VAULT_AMOUNT_INSUFFICIENT = 6027;
declare const WHIRLPOOL_ERROR__FEE_RATE_MAX_EXCEEDED = 6028;
declare const WHIRLPOOL_ERROR__PROTOCOL_FEE_RATE_MAX_EXCEEDED = 6029;
declare const WHIRLPOOL_ERROR__MULTIPLICATION_SHIFT_RIGHT_OVERFLOW = 6030;
declare const WHIRLPOOL_ERROR__MUL_DIV_OVERFLOW = 6031;
declare const WHIRLPOOL_ERROR__MUL_DIV_INVALID_INPUT = 6032;
declare const WHIRLPOOL_ERROR__MULTIPLICATION_OVERFLOW = 6033;
declare const WHIRLPOOL_ERROR__INVALID_SQRT_PRICE_LIMIT_DIRECTION = 6034;
declare const WHIRLPOOL_ERROR__ZERO_TRADABLE_AMOUNT = 6035;
declare const WHIRLPOOL_ERROR__AMOUNT_OUT_BELOW_MINIMUM = 6036;
declare const WHIRLPOOL_ERROR__AMOUNT_IN_ABOVE_MAXIMUM = 6037;
declare const WHIRLPOOL_ERROR__TICK_ARRAY_SEQUENCE_INVALID_INDEX = 6038;
declare const WHIRLPOOL_ERROR__AMOUNT_CALC_OVERFLOW = 6039;
declare const WHIRLPOOL_ERROR__AMOUNT_REMAINING_OVERFLOW = 6040;
declare const WHIRLPOOL_ERROR__INVALID_INTERMEDIARY_MINT = 6041;
declare const WHIRLPOOL_ERROR__DUPLICATE_TWO_HOP_POOL = 6042;
declare const WHIRLPOOL_ERROR__INVALID_BUNDLE_INDEX = 6043;
declare const WHIRLPOOL_ERROR__BUNDLED_POSITION_ALREADY_OPENED = 6044;
declare const WHIRLPOOL_ERROR__BUNDLED_POSITION_ALREADY_CLOSED = 6045;
declare const WHIRLPOOL_ERROR__POSITION_BUNDLE_NOT_DELETABLE = 6046;
declare const WHIRLPOOL_ERROR__UNSUPPORTED_TOKEN_MINT = 6047;
declare const WHIRLPOOL_ERROR__REMAINING_ACCOUNTS_INVALID_SLICE = 6048;
declare const WHIRLPOOL_ERROR__REMAINING_ACCOUNTS_INSUFFICIENT = 6049;
declare const WHIRLPOOL_ERROR__NO_EXTRA_ACCOUNTS_FOR_TRANSFER_HOOK = 6050;
declare const WHIRLPOOL_ERROR__INTERMEDIATE_TOKEN_AMOUNT_MISMATCH = 6051;
declare const WHIRLPOOL_ERROR__TRANSFER_FEE_CALCULATION_ERROR = 6052;
declare const WHIRLPOOL_ERROR__REMAINING_ACCOUNTS_DUPLICATED_ACCOUNTS_TYPE = 6053;
declare const WHIRLPOOL_ERROR__FULL_RANGE_ONLY_POOL = 6054;
declare const WHIRLPOOL_ERROR__TOO_MANY_SUPPLEMENTAL_TICK_ARRAYS = 6055;
declare const WHIRLPOOL_ERROR__DIFFERENT_WHIRLPOOL_TICK_ARRAY_ACCOUNT = 6056;
declare const WHIRLPOOL_ERROR__PARTIAL_FILL_ERROR = 6057;
declare const WHIRLPOOL_ERROR__POSITION_NOT_LOCKABLE = 6058;
declare const WHIRLPOOL_ERROR__OPERATION_NOT_ALLOWED_ON_LOCKED_POSITION = 6059;
declare const WHIRLPOOL_ERROR__SAME_TICK_RANGE_NOT_ALLOWED = 6060;
declare const WHIRLPOOL_ERROR__INVALID_ADAPTIVE_FEE_CONSTANTS = 6061;
declare const WHIRLPOOL_ERROR__INVALID_FEE_TIER_INDEX = 6062;
declare const WHIRLPOOL_ERROR__INVALID_TRADE_ENABLE_TIMESTAMP = 6063;
declare const WHIRLPOOL_ERROR__TRADE_IS_NOT_ENABLED = 6064;
declare const WHIRLPOOL_ERROR__RENT_CALCULATION_ERROR = 6065;
type WhirlpoolError = typeof WHIRLPOOL_ERROR__AMOUNT_CALC_OVERFLOW | typeof WHIRLPOOL_ERROR__AMOUNT_IN_ABOVE_MAXIMUM | typeof WHIRLPOOL_ERROR__AMOUNT_OUT_BELOW_MINIMUM | typeof WHIRLPOOL_ERROR__AMOUNT_REMAINING_OVERFLOW | typeof WHIRLPOOL_ERROR__BUNDLED_POSITION_ALREADY_CLOSED | typeof WHIRLPOOL_ERROR__BUNDLED_POSITION_ALREADY_OPENED | typeof WHIRLPOOL_ERROR__CLOSE_POSITION_NOT_EMPTY | typeof WHIRLPOOL_ERROR__DIFFERENT_WHIRLPOOL_TICK_ARRAY_ACCOUNT | typeof WHIRLPOOL_ERROR__DIVIDE_BY_ZERO | typeof WHIRLPOOL_ERROR__DUPLICATE_TWO_HOP_POOL | typeof WHIRLPOOL_ERROR__FEE_RATE_MAX_EXCEEDED | typeof WHIRLPOOL_ERROR__FULL_RANGE_ONLY_POOL | typeof WHIRLPOOL_ERROR__INTERMEDIATE_TOKEN_AMOUNT_MISMATCH | typeof WHIRLPOOL_ERROR__INVALID_ADAPTIVE_FEE_CONSTANTS | typeof WHIRLPOOL_ERROR__INVALID_BUNDLE_INDEX | typeof WHIRLPOOL_ERROR__INVALID_ENUM | typeof WHIRLPOOL_ERROR__INVALID_FEE_TIER_INDEX | typeof WHIRLPOOL_ERROR__INVALID_INTERMEDIARY_MINT | typeof WHIRLPOOL_ERROR__INVALID_POSITION_TOKEN_AMOUNT | typeof WHIRLPOOL_ERROR__INVALID_REWARD_INDEX | typeof WHIRLPOOL_ERROR__INVALID_SQRT_PRICE_LIMIT_DIRECTION | typeof WHIRLPOOL_ERROR__INVALID_START_TICK | typeof WHIRLPOOL_ERROR__INVALID_TICK_ARRAY_SEQUENCE | typeof WHIRLPOOL_ERROR__INVALID_TICK_INDEX | typeof WHIRLPOOL_ERROR__INVALID_TICK_SPACING | typeof WHIRLPOOL_ERROR__INVALID_TIMESTAMP | typeof WHIRLPOOL_ERROR__INVALID_TIMESTAMP_CONVERSION | typeof WHIRLPOOL_ERROR__INVALID_TOKEN_MINT_ORDER | typeof WHIRLPOOL_ERROR__INVALID_TRADE_ENABLE_TIMESTAMP | typeof WHIRLPOOL_ERROR__LIQUIDITY_NET_ERROR | typeof WHIRLPOOL_ERROR__LIQUIDITY_OVERFLOW | typeof WHIRLPOOL_ERROR__LIQUIDITY_TOO_HIGH | typeof WHIRLPOOL_ERROR__LIQUIDITY_UNDERFLOW | typeof WHIRLPOOL_ERROR__LIQUIDITY_ZERO | typeof WHIRLPOOL_ERROR__MISSING_OR_INVALID_DELEGATE | typeof WHIRLPOOL_ERROR__MUL_DIV_INVALID_INPUT | typeof WHIRLPOOL_ERROR__MUL_DIV_OVERFLOW | typeof WHIRLPOOL_ERROR__MULTIPLICATION_OVERFLOW | typeof WHIRLPOOL_ERROR__MULTIPLICATION_SHIFT_RIGHT_OVERFLOW | typeof WHIRLPOOL_ERROR__NO_EXTRA_ACCOUNTS_FOR_TRANSFER_HOOK | typeof WHIRLPOOL_ERROR__NUMBER_CAST_ERROR | typeof WHIRLPOOL_ERROR__NUMBER_DOWN_CAST_ERROR | typeof WHIRLPOOL_ERROR__OPERATION_NOT_ALLOWED_ON_LOCKED_POSITION | typeof WHIRLPOOL_ERROR__PARTIAL_FILL_ERROR | typeof WHIRLPOOL_ERROR__POSITION_BUNDLE_NOT_DELETABLE | typeof WHIRLPOOL_ERROR__POSITION_NOT_LOCKABLE | typeof WHIRLPOOL_ERROR__PROTOCOL_FEE_RATE_MAX_EXCEEDED | typeof WHIRLPOOL_ERROR__REMAINING_ACCOUNTS_DUPLICATED_ACCOUNTS_TYPE | typeof WHIRLPOOL_ERROR__REMAINING_ACCOUNTS_INSUFFICIENT | typeof WHIRLPOOL_ERROR__REMAINING_ACCOUNTS_INVALID_SLICE | typeof WHIRLPOOL_ERROR__RENT_CALCULATION_ERROR | typeof WHIRLPOOL_ERROR__REWARD_NOT_INITIALIZED | typeof WHIRLPOOL_ERROR__REWARD_VAULT_AMOUNT_INSUFFICIENT | typeof WHIRLPOOL_ERROR__SAME_TICK_RANGE_NOT_ALLOWED | typeof WHIRLPOOL_ERROR__SQRT_PRICE_OUT_OF_BOUNDS | typeof WHIRLPOOL_ERROR__TICK_ARRAY_EXIST_IN_POOL | typeof WHIRLPOOL_ERROR__TICK_ARRAY_INDEX_OUTOF_BOUNDS | typeof WHIRLPOOL_ERROR__TICK_ARRAY_SEQUENCE_INVALID_INDEX | typeof WHIRLPOOL_ERROR__TICK_NOT_FOUND | typeof WHIRLPOOL_ERROR__TOKEN_MAX_EXCEEDED | typeof WHIRLPOOL_ERROR__TOKEN_MIN_SUBCEEDED | typeof WHIRLPOOL_ERROR__TOO_MANY_SUPPLEMENTAL_TICK_ARRAYS | typeof WHIRLPOOL_ERROR__TRADE_IS_NOT_ENABLED | typeof WHIRLPOOL_ERROR__TRANSFER_FEE_CALCULATION_ERROR | typeof WHIRLPOOL_ERROR__UNSUPPORTED_TOKEN_MINT | typeof WHIRLPOOL_ERROR__ZERO_TRADABLE_AMOUNT;
declare function getWhirlpoolErrorMessage(code: WhirlpoolError): string;
declare function isWhirlpoolError<TProgramErrorCode extends WhirlpoolError>(error: unknown, transactionMessage: {
instructions: Record<number, {
programAddress: Address;
}>;
}, code?: TProgramErrorCode): error is SolanaError<typeof SOLANA_ERROR__INSTRUCTION_ERROR__CUSTOM> & Readonly<{
context: Readonly<{
code: TProgramErrorCode;
}>;
}>;
declare const WHIRLPOOL_PROGRAM_ADDRESS: Address<"whirLbMiicVdio4qvUfM5KAg6Ct8VwpYzGff3uctyCc">;
declare enum WhirlpoolAccount {
AdaptiveFeeTier = 0,
WhirlpoolsConfig = 1,
WhirlpoolsConfigExtension = 2,
DynamicTickArray = 3,
FeeTier = 4,
FixedTickArray = 5,
LockConfig = 6,
Oracle = 7,
Position = 8,
PositionBundle = 9,
TokenBadge = 10,
Whirlpool = 11
}
declare function identifyWhirlpoolAccount(account: {
data: ReadonlyUint8Array;
} | ReadonlyUint8Array): WhirlpoolAccount;
declare enum WhirlpoolInstruction {
InitializeConfig = 0,
InitializePool = 1,
InitializeTickArray = 2,
InitializeDynamicTickArray = 3,
InitializeFeeTier = 4,
InitializeReward = 5,
SetRewardEmissions = 6,
OpenPosition = 7,
OpenPositionWithMetadata = 8,
IncreaseLiquidity = 9,
DecreaseLiquidity = 10,
UpdateFeesAndRewards = 11,
CollectFees = 12,
CollectReward = 13,
CollectProtocolFees = 14,
Swap = 15,
ClosePosition = 16,
SetDefaultFeeRate = 17,
SetDefaultProtocolFeeRate = 18,
SetFeeRate = 19,
SetProtocolFeeRate = 20,
SetFeeAuthority = 21,
SetCollectProtocolFeesAuthority = 22,
SetRewardAuthority = 23,
SetRewardAuthorityBySuperAuthority = 24,
SetRewardEmissionsSuperAuthority = 25,
TwoHopSwap = 26,
InitializePositionBundle = 27,
InitializePositionBundleWithMetadata = 28,
DeletePositionBundle = 29,
OpenBundledPosition = 30,
CloseBundledPosition = 31,
OpenPositionWithTokenExtensions = 32,
ClosePositionWithTokenExtensions = 33,
LockPosition = 34,
ResetPositionRange = 35,
TransferLockedPosition = 36,
InitializeAdaptiveFeeTier = 37,
SetDefaultBaseFeeRate = 38,
SetDelegatedFeeAuthority = 39,
SetInitializePoolAuthority = 40,
SetPresetAdaptiveFeeConstants = 41,
InitializePoolWithAdaptiveFee = 42,
SetFeeRateByDelegatedFeeAuthority = 43,
CollectFeesV2 = 44,
CollectProtocolFeesV2 = 45,
CollectRewardV2 = 46,
DecreaseLiquidityV2 = 47,
IncreaseLiquidityV2 = 48,
InitializePoolV2 = 49,
InitializeRewardV2 = 50,
SetRewardEmissionsV2 = 51,
SwapV2 = 52,
TwoHopSwapV2 = 53,
InitializeConfigExtension = 54,
SetConfigExtensionAuthority = 55,
SetTokenBadgeAuthority = 56,
InitializeTokenBadge = 57,
DeleteTokenBadge = 58,
IdlInclude = 59
}
declare function identifyWhirlpoolInstruction(instruction: {
data: ReadonlyUint8Array;
} | ReadonlyUint8Array): WhirlpoolInstruction;
type ParsedWhirlpoolInstruction<TProgram extends string = 'whirLbMiicVdio4qvUfM5KAg6Ct8VwpYzGff3uctyCc'> = ({
instructionType: WhirlpoolInstruction.InitializeConfig;
} & ParsedInitializeConfigInstruction<TProgram>) | ({
instructionType: WhirlpoolInstruction.InitializePool;
} & ParsedInitializePoolInstruction<TProgram>) | ({
instructionType: WhirlpoolInstruction.InitializeTickArray;
} & ParsedInitializeTickArrayInstruction<TProgram>) | ({
instructionType: WhirlpoolInstruction.InitializeDynamicTickArray;
} & ParsedInitializeDynamicTickArrayInstruction<TProgram>) | ({
instructionType: WhirlpoolInstruction.InitializeFeeTier;
} & ParsedInitializeFeeTierInstruction<TProgram>) | ({
instructionType: WhirlpoolInstruction.InitializeReward;
} & ParsedInitializeRewardInstruction<TProgram>) | ({
instructionType: WhirlpoolInstruction.SetRewardEmissions;
} & ParsedSetRewardEmissionsInstruction<TProgram>) | ({
instructionType: WhirlpoolInstruction.OpenPosition;
} & ParsedOpenPositionInstruction<TProgram>) | ({
instructionType: WhirlpoolInstruction.OpenPositionWithMetadata;
} & ParsedOpenPositionWithMetadataInstruction<TProgram>) | ({
instructionType: WhirlpoolInstruction.IncreaseLiquidity;
} & ParsedIncreaseLiquidityInstruction<TProgram>) | ({
instructionType: WhirlpoolInstruction.DecreaseLiquidity;
} & ParsedDecreaseLiquidityInstruction<TProgram>) | ({
instructionType: WhirlpoolInstruction.UpdateFeesAndRewards;
} & ParsedUpdateFeesAndRewardsInstruction<TProgram>) | ({
instructionType: WhirlpoolInstruction.CollectFees;
} & ParsedCollectFeesInstruction<TProgram>) | ({
instructionType: WhirlpoolInstruction.CollectReward;
} & ParsedCollectRewardInstruction<TProgram>) | ({
instructionType: WhirlpoolInstruction.CollectProtocolFees;
} & ParsedCollectProtocolFeesInstruction<TProgram>) | ({
instructionType: WhirlpoolInstruction.Swap;
} & ParsedSwapInstruction<TProgram>) | ({
instructionType: WhirlpoolInstruction.ClosePosition;
} & ParsedClosePositionInstruction<TProgram>) | ({
instructionType: WhirlpoolInstruction.SetDefaultFeeRate;
} & ParsedSetDefaultFeeRateInstruction<TProgram>) | ({
instructionType: WhirlpoolInstruction.SetDefaultProtocolFeeRate;
} & ParsedSetDefaultProtocolFeeRateInstruction<TProgram>) | ({
instructionType: WhirlpoolInstruction.SetFeeRate;
} & ParsedSetFeeRateInstruction<TProgram>) | ({
instructionType: WhirlpoolInstruction.SetProtocolFeeRate;
} & ParsedSetProtocolFeeRateInstruction<TProgram>) | ({
instructionType: WhirlpoolInstruction.SetFeeAuthority;
} & ParsedSetFeeAuthorityInstruction<TProgram>) | ({
instructionType: WhirlpoolInstruction.SetCollectProtocolFeesAuthority;
} & ParsedSetCollectProtocolFeesAuthorityInstruction<TProgram>) | ({
instructionType: WhirlpoolInstruction.SetRewardAuthority;
} & ParsedSetRewardAuthorityInstruction<TProgram>) | ({
instructionType: WhirlpoolInstruction.SetRewardAuthorityBySuperAuthority;
} & ParsedSetRewardAuthorityBySuperAuthorityInstruction<TProgram>) | ({
instructionType: WhirlpoolInstruction.SetRewardEmissionsSuperAuthority;
} & ParsedSetRewardEmissionsSuperAuthorityInstruction<TProgram>) | ({
instructionType: WhirlpoolInstruction.TwoHopSwap;
} & ParsedTwoHopSwapInstruction<TProgram>) | ({
instructionType: WhirlpoolInstruction.InitializePositionBundle;
} & ParsedInitializePositionBundleInstruction<TProgram>) | ({
instructionType: WhirlpoolInstruction.InitializePositionBundleWithMetadata;
} & ParsedInitializePositionBundleWithMetadataInstruction<TProgram>) | ({
instructionType: WhirlpoolInstruction.DeletePositionBundle;
} & ParsedDeletePositionBundleInstruction<TProgram>) | ({
instructionType: WhirlpoolInstruction.OpenBundledPosition;
} & ParsedOpenBundledPositionInstruction<TProgram>) | ({
instructionType: WhirlpoolInstruction.CloseBundledPosition;
} & ParsedCloseBundledPositionInstruction<TProgram>) | ({
instructionType: WhirlpoolInstruction.OpenPositionWithTokenExtensions;
} & ParsedOpenPositionWithTokenExtensionsInstruction<TProgram>) | ({
instructionType: WhirlpoolInstruction.ClosePositionWithTokenExtensions;
} & ParsedClosePositionWithTokenExtensionsInstruction<TProgram>) | ({
instructionType: WhirlpoolInstruction.LockPosition;
} & ParsedLockPositionInstruction<TProgram>) | ({
instructionType: WhirlpoolInstruction.ResetPositionRange;
} & ParsedResetPositionRangeInstruction<TProgram>) | ({
instructionType: WhirlpoolInstruction.TransferLockedPosition;
} & ParsedTransferLockedPositionInstruction<TProgram>) | ({
instructionType: WhirlpoolInstruction.InitializeAdaptiveFeeTier;
} & ParsedInitializeAdaptiveFeeTierInstruction<TProgram>) | ({
instructionType: WhirlpoolInstruction.SetDefaultBaseFeeRate;
} & ParsedSetDefaultBaseFeeRateInstruction<TProgram>) | ({
instructionType: WhirlpoolInstruction.SetDelegatedFeeAuthority;
} & ParsedSetDelegatedFeeAuthorityInstruction<TProgram>) | ({
instructionType: WhirlpoolInstruction.SetInitializePoolAuthority;
} & ParsedSetInitializePoolAuthorityInstruction<TProgram>) | ({
instructionType: WhirlpoolInstruction.SetPresetAdaptiveFeeConstants;
} & ParsedSetPresetAdaptiveFeeConstantsInstruction<TProgram>) | ({
instructionType: WhirlpoolInstruction.InitializePoolWithAdaptiveFee;
} & ParsedInitializePoolWithAdaptiveFeeInstruction<TProgram>) | ({
instructionType: WhirlpoolInstruction.SetFeeRateByDelegatedFeeAuthority;
} & ParsedSetFeeRateByDelegatedFeeAuthorityInstruction<TProgram>) | ({
instructionType: WhirlpoolInstruction.CollectFeesV2;
} & ParsedCollectFeesV2Instruction<TProgram>) | ({
instructionType: WhirlpoolInstruction.CollectProtocolFeesV2;
} & ParsedCollectProtocolFeesV2Instruction<TProgram>) | ({
instructionType: WhirlpoolInstruction.CollectRewardV2;
} & ParsedCollectRewardV2Instruction<TProgram>) | ({
instructionType: WhirlpoolInstruction.DecreaseLiquidityV2;
} & ParsedDecreaseLiquidityV2Instruction<TProgram>) | ({
instructionType: WhirlpoolInstruction.IncreaseLiquidityV2;
} & ParsedIncreaseLiquidityV2Instruction<TProgram>) | ({
instructionType: WhirlpoolInstruction.InitializePoolV2;
} & ParsedInitializePoolV2Instruction<TProgram>) | ({
instructionType: WhirlpoolInstruction.InitializeRewardV2;
} & ParsedInitializeRewardV2Instruction<TProgram>) | ({
instructionType: WhirlpoolInstruction.SetRewardEmissionsV2;
} & ParsedSetRewardEmissionsV2Instruction<TProgram>) | ({
instructionType: WhirlpoolInstruction.SwapV2;
} & ParsedSwapV2Instruction<TProgram>) | ({
instructionType: WhirlpoolInstruction.TwoHopSwapV2;
} & ParsedTwoHopSwapV2Instruction<TProgram>) | ({
instructionType: WhirlpoolInstruction.InitializeConfigExtension;
} & ParsedInitializeConfigExtensionInstruction<TProgram>) | ({
instructionType: WhirlpoolInstruction.SetConfigExtensionAuthority;
} & ParsedSetConfigExtensionAuthorityInstruction<TProgram>) | ({
instructionType: WhirlpoolInstruction.SetTokenBadgeAuthority;
} & ParsedSetTokenBadgeAuthorityInstruction<TProgram>) | ({
instructionType: WhirlpoolInstruction.InitializeTokenBadge;
} & ParsedInitializeTokenBadgeInstruction<TProgram>) | ({
instructionType: WhirlpoolInstruction.DeleteTokenBadge;
} & ParsedDeleteTokenBadgeInstruction<TProgram>) | ({
instructionType: WhirlpoolInstruction.IdlInclude;
} & ParsedIdlIncludeInstruction<TProgram>);
declare const CLOSE_BUNDLED_POSITION_DISCRIMINATOR: Uint8Array<ArrayBuffer>;
declare function getCloseBundledPositionDiscriminatorBytes(): ReadonlyUint8Array;
type CloseBundledPositionInstruction<TProgram extends string = typeof WHIRLPOOL_PROGRAM_ADDRESS, TAccountBundledPosition extends string | IAccountMeta<string> = string, TAccountPositionBundle extends string | IAccountMeta<string> = string, TAccountPosition