OPNet
    Preparing search index...

    Interface INativeSwapContract

    This interface represents the NativeSwap contract, including all new/updated methods and type definitions.

    INativeSwapContract

    interface INativeSwapContract {
        address: string | Address;
        get p2opOrTweaked(): string;
        activateWithdrawMode(): Promise<ActivateWithdrawMode>;
        cancelListing(token: Address): Promise<CancelListing>;
        createPool(
            token: Address,
            floorPrice: bigint,
            initialLiquidity: bigint,
            receiver: Buffer,
            receiverStr: string,
            antiBotEnabledFor: number,
            antiBotMaximumTokensPerReservation: bigint,
            maxReservesIn5BlocksPercent: number,
        ): Promise<CreatePool>;
        currentGasParameters(): Promise<BlockGasParameters>;
        decodeEvent(event: NetEvent): OPNetEvent;
        decodeEvents(events: ContractEvents | NetEvent[]): OPNetEvent<{}>[];
        deployer(): Promise<
            CallResult<
                { deployer: Address },
                OPNetEvent<ContractDecodedObjectResult>[],
            >,
        >;
        encodeCalldata(method: string, ...args: unknown[]): Buffer;
        getAntibotSettings(token: Address): Promise<AntiBotSettings>;
        getFees(): Promise<GetFees>;
        getFeesAddress(): Promise<FeesAddressResult>;
        getPriorityQueueCost(): Promise<GetPriorityQueueCost>;
        getProviderDetails(token: Address): Promise<GetProviderDetails>;
        getProviderDetailsById(providerId: bigint): Promise<GetProviderDetailsById>;
        getQueueDetails(token: Address): Promise<QueueDetails>;
        getQuote(token: Address, satoshisIn: bigint): Promise<GetQuote>;
        getReserve(token: Address): Promise<GetReserve>;
        getStakingContractAddress(): Promise<StakingAddressResult>;
        isPaused(): Promise<IsPaused>;
        isWithdrawModeActive(): Promise<IsWithdrawModeActive>;
        listLiquidity(
            token: Address,
            receiver: Buffer,
            receiverStr: string,
            amountIn: bigint,
            priority: boolean,
        ): Promise<ListLiquidity>;
        pause(): Promise<Pause>;
        reserve(
            token: Address,
            maximumAmountIn: bigint,
            minimumAmountOut: bigint,
            forLP: boolean,
            activationDelay: number,
        ): Promise<ReserveNativeSwap>;
        setAccessList(accessList: IAccessList): void;
        setFees(
            reservationBaseFee: bigint,
            priorityQueueBaseFee: bigint,
        ): Promise<SetFees>;
        setFeesAddress(feesAddress: string): Promise<SetFeesAddress>;
        setSender(sender: Address): void;
        setSimulatedHeight(height: undefined | bigint): void;
        setStakingContractAddress(
            stakingContractAddress: Address,
        ): Promise<SetStakingContractAddress>;
        setTransactionDetails(tx: ParsedSimulatedTransaction): void;
        swap(token: Address): Promise<Swap>;
        unpause(): Promise<Unpause>;
        withdrawListing(token: Address): Promise<WithdrawListing>;
        [key: symbol]: CallResult<{}, OPNetEvent<ContractDecodedObjectResult>[]>;
    }

    Hierarchy (View Summary)

    Indexable

    Index

    Properties

    address: string | Address

    Accessors

    Methods

    • Parameters

      • token: Address

        The token address.

      • floorPrice: bigint

        The floor price to set.

      • initialLiquidity: bigint

        The amount of liquidity to seed.

      • receiver: Buffer

        The 33 bytes public key for receiving payments (bytes).

      • receiverStr: string

        The Bitcoin address as a string.

      • antiBotEnabledFor: number

        Number of blocks for anti-bot protection.

      • antiBotMaximumTokensPerReservation: bigint

        Anti-bot max tokens per user.

      • maxReservesIn5BlocksPercent: number

        Cap on reserves in a short window.

      Returns Promise<CreatePool>

      Creates a new liquidity pool.

    • Parameters

      • token: Address

        The address of the token to list.

      • receiver: Buffer

        The 33 bytes public key for receiving payments (bytes).

      • receiverStr: string

        The Bitcoin address as a string.

      • amountIn: bigint

        The amount of tokens to list for sale.

      • priority: boolean

        Whether to place this listing in the priority queue.

      Returns Promise<ListLiquidity>

      Lists liquidity for sale.

    • Parameters

      • token: Address

        The address of the token to reserve.

      • maximumAmountIn: bigint

        The maximum amount of satoshis to spend.

      • minimumAmountOut: bigint

        The minimum amount of tokens expected out.

      • forLP: boolean

        Whether this reservation is for LP or not (deprecated/unused).

      • activationDelay: number

        Number of blocks before activation.

      Returns Promise<ReserveNativeSwap>

      Reserves a certain amount of tokens.