import { type Address, type Contract, type ContractProvider, type Sender, Cell } from 'ton-core'; /** * SwapState represents the different states of a swap. */ export declare const SwapState: { Active: number; Cancelled: number; Completed: number; }; /** * Interface representing an NFT item, containing an address and whether it has been sent. */ interface NFTItem { addr: Address; sent: boolean; } /** * SwapData represents the information of a swap operation. */ export type SwapData = { state: number; leftAddress: Address; rightAddress: Address; rightNft: NFTItem[]; leftNft: NFTItem[]; supervisorAddress: Address; commissionAddress: Address; leftCommission: bigint; leftAmount: bigint; leftCoinsGot: bigint; rightCommission: bigint; rightAmount: bigint; rightCoinsGot: bigint; }; /** * Class representing an NFT Swap, implementing the Contract interface. */ export declare class NftSwap implements Contract { readonly address: Address; readonly init?: { code: Cell; data: Cell; } | undefined; constructor(address: Address, init?: { code: Cell; data: Cell; } | undefined); static code: Cell; static buildDataCell(data: SwapData): Cell; /** * Method to create a new NftSwap instance from an address. * @param address - The address of the swap. */ static createFromAddress(address: Address): NftSwap; /** * Method to create a new NftSwap instance from a configuration. * @param config - The configuration of the swap. * @param workchain - The workchain of the swap. */ static createFromConfig(config: SwapData, workchain?: number): Promise; /** * Method to send a deploy command to the contract. * @param provider - The contract provider. * @param via - The sender of the deploy command. * @param value - The value sent with the deploy command. */ sendDeploy(provider: ContractProvider, via: Sender, value: bigint): Promise; /** * Sends a cancel command to the contract. * @param provider - The contract provider. * @param via - The sender of the cancel command. * @param params - Parameters for the cancel command including value and optional queryId. */ sendCancel(provider: ContractProvider, via: Sender, params: { value: bigint; queryId?: number; }): Promise; /** * Sends an addCoins command to the contract. * @param provider - The contract provider. * @param via - The sender of the addCoins command. * @param params - Parameters for the addCoins command including value, optional queryId, and coins. */ sendAddCoins(provider: ContractProvider, via: Sender, params: { value: bigint; queryId?: number; coins: bigint; }): Promise; /** * Sends a maintain command to the contract. * @param provider - The contract provider. * @param via - The sender of the maintain command. * @param params - Parameters for the maintain command including value, optional queryId, mode, and msg. */ sendMaintain(provider: ContractProvider, via: Sender, params: { value: bigint; queryId?: number; mode: number; msg: Cell; }): Promise; /** * Sends a topup command to the contract. * @param provider - The contract provider. * @param via - The sender of the topup command. * @param params - Parameters for the topup command including value and optional queryId. */ sendTopup(provider: ContractProvider, via: Sender, params: { value: bigint; queryId?: number; }): Promise; /** * Gets the current state of the trade from the contract. * @param provider - The contract provider. * @returns An object representing the current state of the trade. */ getTradeState(provider: ContractProvider): Promise<{ state: bigint; left_ok: boolean; right_ok: boolean; leftAddress: Address | null; rightAddress: Address | null; leftNft: Cell; rightNft: Cell; leftComm: bigint; leftAmount: bigint; leftGot: bigint; rightComm: bigint; rightAmount: bigint; rightGot: bigint; }>; /** * Gets the supervisor of the contract. * @param provider - The contract provider. * @returns An object representing the supervisor. */ getSupervisor(provider: ContractProvider): Promise<{ supervisor: Address | null; }>; } export {}; //# sourceMappingURL=NftSwap.d.ts.map