UNPKG

@rainfi/sdk

Version:

This package is used to interact with Rain.fi protocol on Solana

365 lines (364 loc) 9.27 kB
/** * This code was GENERATED using the solita package. * Please DO NOT EDIT THIS FILE, instead rerun solita to update it or write a wrapper to add functionality. * * See: https://github.com/metaplex-foundation/solita */ import * as beet from '@metaplex-foundation/beet'; import { Side } from './Side'; /** * This type is used to derive the {@link Swap} type as well as the de/serializer. * However don't refer to it in your code but use the {@link Swap} type instead. * * @category userTypes * @category enums * @category generated * @private */ export type SwapRecord = { Saber: void; SaberAddDecimalsDeposit: void; SaberAddDecimalsWithdraw: void; TokenSwap: void; Sencha: void; Step: void; Cropper: void; Raydium: void; Crema: { aToB: boolean; }; Lifinity: void; Mercurial: void; Cykura: void; Serum: { side: Side; }; MarinadeDeposit: void; MarinadeUnstake: void; Aldrin: { side: Side; }; AldrinV2: { side: Side; }; Whirlpool: { aToB: boolean; }; Invariant: { xToY: boolean; }; Meteora: void; GooseFX: void; DeltaFi: { stable: boolean; }; Balansol: void; MarcoPolo: { xToY: boolean; }; Dradex: { side: Side; }; LifinityV2: void; RaydiumClmm: void; Openbook: { side: Side; }; Phoenix: { side: Side; }; Symmetry: { fromTokenId: beet.bignum; toTokenId: beet.bignum; }; TokenSwapV2: void; HeliumTreasuryManagementRedeemV0: void; StakeDexStakeWrappedSol: void; StakeDexSwapViaStake: { bridgeStakeSeed: number; }; GooseFXV2: void; Perps: void; PerpsAddLiquidity: void; PerpsRemoveLiquidity: void; MeteoraDlmm: void; OpenBookV2: { side: Side; }; RaydiumClmmV2: void; StakeDexPrefundWithdrawStakeAndDepositStake: { bridgeStakeSeed: number; }; Clone: { poolIndex: number; quantityIsInput: boolean; quantityIsCollateral: boolean; }; }; /** * Union type respresenting the Swap data enum defined in Rust. * * NOTE: that it includes a `__kind` property which allows to narrow types in * switch/if statements. * Additionally `isSwap*` type guards are exposed below to narrow to a specific variant. * * @category userTypes * @category enums * @category generated */ export type Swap = beet.DataEnumKeyAsKind<SwapRecord>; export declare const isSwapSaber: (x: Swap) => x is { __kind: "Saber"; } & Omit<void, "void"> & { __kind: 'Saber'; }; export declare const isSwapSaberAddDecimalsDeposit: (x: Swap) => x is { __kind: "SaberAddDecimalsDeposit"; } & Omit<void, "void"> & { __kind: 'SaberAddDecimalsDeposit'; }; export declare const isSwapSaberAddDecimalsWithdraw: (x: Swap) => x is { __kind: "SaberAddDecimalsWithdraw"; } & Omit<void, "void"> & { __kind: 'SaberAddDecimalsWithdraw'; }; export declare const isSwapTokenSwap: (x: Swap) => x is { __kind: "TokenSwap"; } & Omit<void, "void"> & { __kind: 'TokenSwap'; }; export declare const isSwapSencha: (x: Swap) => x is { __kind: "Sencha"; } & Omit<void, "void"> & { __kind: 'Sencha'; }; export declare const isSwapStep: (x: Swap) => x is { __kind: "Step"; } & Omit<void, "void"> & { __kind: 'Step'; }; export declare const isSwapCropper: (x: Swap) => x is { __kind: "Cropper"; } & Omit<void, "void"> & { __kind: 'Cropper'; }; export declare const isSwapRaydium: (x: Swap) => x is { __kind: "Raydium"; } & Omit<void, "void"> & { __kind: 'Raydium'; }; export declare const isSwapCrema: (x: Swap) => x is { __kind: "Crema"; } & Omit<{ aToB: boolean; }, "void"> & { __kind: 'Crema'; }; export declare const isSwapLifinity: (x: Swap) => x is { __kind: "Lifinity"; } & Omit<void, "void"> & { __kind: 'Lifinity'; }; export declare const isSwapMercurial: (x: Swap) => x is { __kind: "Mercurial"; } & Omit<void, "void"> & { __kind: 'Mercurial'; }; export declare const isSwapCykura: (x: Swap) => x is { __kind: "Cykura"; } & Omit<void, "void"> & { __kind: 'Cykura'; }; export declare const isSwapSerum: (x: Swap) => x is { __kind: "Serum"; } & Omit<{ side: Side; }, "void"> & { __kind: 'Serum'; }; export declare const isSwapMarinadeDeposit: (x: Swap) => x is { __kind: "MarinadeDeposit"; } & Omit<void, "void"> & { __kind: 'MarinadeDeposit'; }; export declare const isSwapMarinadeUnstake: (x: Swap) => x is { __kind: "MarinadeUnstake"; } & Omit<void, "void"> & { __kind: 'MarinadeUnstake'; }; export declare const isSwapAldrin: (x: Swap) => x is { __kind: "Aldrin"; } & Omit<{ side: Side; }, "void"> & { __kind: 'Aldrin'; }; export declare const isSwapAldrinV2: (x: Swap) => x is { __kind: "AldrinV2"; } & Omit<{ side: Side; }, "void"> & { __kind: 'AldrinV2'; }; export declare const isSwapWhirlpool: (x: Swap) => x is { __kind: "Whirlpool"; } & Omit<{ aToB: boolean; }, "void"> & { __kind: 'Whirlpool'; }; export declare const isSwapInvariant: (x: Swap) => x is { __kind: "Invariant"; } & Omit<{ xToY: boolean; }, "void"> & { __kind: 'Invariant'; }; export declare const isSwapMeteora: (x: Swap) => x is { __kind: "Meteora"; } & Omit<void, "void"> & { __kind: 'Meteora'; }; export declare const isSwapGooseFX: (x: Swap) => x is { __kind: "GooseFX"; } & Omit<void, "void"> & { __kind: 'GooseFX'; }; export declare const isSwapDeltaFi: (x: Swap) => x is { __kind: "DeltaFi"; } & Omit<{ stable: boolean; }, "void"> & { __kind: 'DeltaFi'; }; export declare const isSwapBalansol: (x: Swap) => x is { __kind: "Balansol"; } & Omit<void, "void"> & { __kind: 'Balansol'; }; export declare const isSwapMarcoPolo: (x: Swap) => x is { __kind: "MarcoPolo"; } & Omit<{ xToY: boolean; }, "void"> & { __kind: 'MarcoPolo'; }; export declare const isSwapDradex: (x: Swap) => x is { __kind: "Dradex"; } & Omit<{ side: Side; }, "void"> & { __kind: 'Dradex'; }; export declare const isSwapLifinityV2: (x: Swap) => x is { __kind: "LifinityV2"; } & Omit<void, "void"> & { __kind: 'LifinityV2'; }; export declare const isSwapRaydiumClmm: (x: Swap) => x is { __kind: "RaydiumClmm"; } & Omit<void, "void"> & { __kind: 'RaydiumClmm'; }; export declare const isSwapOpenbook: (x: Swap) => x is { __kind: "Openbook"; } & Omit<{ side: Side; }, "void"> & { __kind: 'Openbook'; }; export declare const isSwapPhoenix: (x: Swap) => x is { __kind: "Phoenix"; } & Omit<{ side: Side; }, "void"> & { __kind: 'Phoenix'; }; export declare const isSwapSymmetry: (x: Swap) => x is { __kind: "Symmetry"; } & Omit<{ fromTokenId: beet.bignum; toTokenId: beet.bignum; }, "void"> & { __kind: 'Symmetry'; }; export declare const isSwapTokenSwapV2: (x: Swap) => x is { __kind: "TokenSwapV2"; } & Omit<void, "void"> & { __kind: 'TokenSwapV2'; }; export declare const isSwapHeliumTreasuryManagementRedeemV0: (x: Swap) => x is { __kind: "HeliumTreasuryManagementRedeemV0"; } & Omit<void, "void"> & { __kind: 'HeliumTreasuryManagementRedeemV0'; }; export declare const isSwapStakeDexStakeWrappedSol: (x: Swap) => x is { __kind: "StakeDexStakeWrappedSol"; } & Omit<void, "void"> & { __kind: 'StakeDexStakeWrappedSol'; }; export declare const isSwapStakeDexSwapViaStake: (x: Swap) => x is { __kind: "StakeDexSwapViaStake"; } & Omit<{ bridgeStakeSeed: number; }, "void"> & { __kind: 'StakeDexSwapViaStake'; }; export declare const isSwapGooseFXV2: (x: Swap) => x is { __kind: "GooseFXV2"; } & Omit<void, "void"> & { __kind: 'GooseFXV2'; }; export declare const isSwapPerps: (x: Swap) => x is { __kind: "Perps"; } & Omit<void, "void"> & { __kind: 'Perps'; }; export declare const isSwapPerpsAddLiquidity: (x: Swap) => x is { __kind: "PerpsAddLiquidity"; } & Omit<void, "void"> & { __kind: 'PerpsAddLiquidity'; }; export declare const isSwapPerpsRemoveLiquidity: (x: Swap) => x is { __kind: "PerpsRemoveLiquidity"; } & Omit<void, "void"> & { __kind: 'PerpsRemoveLiquidity'; }; export declare const isSwapMeteoraDlmm: (x: Swap) => x is { __kind: "MeteoraDlmm"; } & Omit<void, "void"> & { __kind: 'MeteoraDlmm'; }; export declare const isSwapOpenBookV2: (x: Swap) => x is { __kind: "OpenBookV2"; } & Omit<{ side: Side; }, "void"> & { __kind: 'OpenBookV2'; }; export declare const isSwapRaydiumClmmV2: (x: Swap) => x is { __kind: "RaydiumClmmV2"; } & Omit<void, "void"> & { __kind: 'RaydiumClmmV2'; }; export declare const isSwapStakeDexPrefundWithdrawStakeAndDepositStake: (x: Swap) => x is { __kind: "StakeDexPrefundWithdrawStakeAndDepositStake"; } & Omit<{ bridgeStakeSeed: number; }, "void"> & { __kind: 'StakeDexPrefundWithdrawStakeAndDepositStake'; }; export declare const isSwapClone: (x: Swap) => x is { __kind: "Clone"; } & Omit<{ poolIndex: number; quantityIsInput: boolean; quantityIsCollateral: boolean; }, "void"> & { __kind: 'Clone'; }; /** * @category userTypes * @category generated */ export declare const swapBeet: beet.FixableBeet<Swap, Swap>;