@soku-dex/sdk
    Preparing search index...

    Class DexWrapper

    Implements

    • Contract
    Index

    Constructors

    • Parameters

      • address: Address
      • Optionalinit: { code: Cell; data: Cell }

      Returns DexWrapper

    Properties

    abi: ContractABI = ...
    address: Address
    init?: { code: Cell; data: Cell }
    errors: {
        "'Unknown' error": 11;
        "Access denied": 132;
        "Account state size exceeded limits": 50;
        "Action is invalid or not supported": 34;
        "Action list is invalid": 32;
        "Action list is too long": 33;
        "Already initialized": 2977;
        "amount in message is not enough": 12712;
        "amountIn cannot be 0": 16659;
        "Cannot process a message": 40;
        "Cell overflow": 8;
        "Cell underflow": 9;
        "Code of a contract was not found": 135;
        "Constraints error": 131;
        "Contract stopped": 133;
        "ctx.value is not enough": 17474;
        "Dictionary error": 10;
        "Exceeded maximum number of cells in the library or the maximum depth of the Merkle tree": 43;
        "Failed expectedOut condition": 15373;
        "Fatal error": 12;
        "Integer out of expected range": 5;
        "Integer overflow": 4;
        "Invalid argument": 134;
        "Invalid destination address in outbound message": 36;
        "Invalid incoming message": 130;
        "Invalid opcode": 6;
        "Invalid serialization prefix": 129;
        "Invalid source address in outbound message": 35;
        "Invalid standard address": 136;
        "Library change action error": 42;
        "Library reference is null": 41;
        "Not a basechain address": 138;
        "Not enough extra currencies": 38;
        "Not enough Toncoin": 37;
        "Not enough value to cover swap": 54734;
        "Not initialized": 7657;
        "Null reference exception": 128;
        "Out of gas error": 13;
        "Outbound message does not fit into a cell after rewriting": 39;
        "Stack overflow": 3;
        "Stack underflow": 2;
        "Ton in and Ton out swaps are not supported": 49478;
        "Type check error": 7;
        "Virtualization error": 14;
    } = Dex_errors_backward
    opcodes: {
        AddLiquidityOp: number;
        ChangeOwner: number;
        ChangeOwnerOk: number;
        Deploy: number;
        DeployOk: number;
        DexAddLiquidity: number;
        DexCollectFees: number;
        DexInitialize: number;
        DexInitialized: number;
        DexMerge: number;
        DexMergeNotification: number;
        DexRemoveLiquidity: number;
        DexSplit: number;
        DexSplitNotification: number;
        FactoryDeploy: number;
        Mint: number;
        NativeTonTransfer: number;
        SwapOp: number;
        TokenBurn: number;
        TokenBurnNotification: number;
        TokenExcesses: number;
        TokenNotification: number;
        TokenTransfer: number;
        TokenTransferInternal: number;
        TokenUpdateContent: number;
    } = Dex_opcodes
    storageReserve: 0n

    Methods

    • Parameters

      • provider: ContractProvider

      Returns Promise<Address>

    • Parameters

      • provider: ContractProvider
      • directionIn: boolean
      • amountIn: bigint

      Returns Promise<
          {
              $$type: "SwapSimulationOutput";
              amountOut: bigint;
              fees: bigint;
              newReserve0: bigint;
              newReserve1: bigint;
          },
      >

    • Parameters

      • provider: ContractProvider
      • directionIn: boolean
      • amountIn: bigint

      Returns Promise<
          {
              $$type: "SwapSimulationOutput";
              amountOut: bigint;
              fees: bigint;
              newReserve0: bigint;
              newReserve1: bigint;
          },
      >

    • Parameters

      • provider: ContractProvider
      • via: Sender
      • args: { bounce?: null | boolean; value: bigint }
      • message:
            | null
            | TokenNotification
            | AddLiquidityOp
            | SwapOp
            | DexInitialize
            | DexSplit
            | DexMerge

      Returns Promise<void>

    • Parameters

      • address: Address

      Returns DexWrapper

    • Parameters

      • initialized: boolean
      • active: boolean
      • owner: Address
      • shard: bigint
      • curveType: bigint
      • tokenType0: bigint
      • tokenType1: bigint
      • tokenMaster0: null | Address
      • tokenMaster1: null | Address
      • tokenWallet0: null | Address
      • tokenWallet1: null | Address
      • reserve0: bigint
      • reserve1: bigint
      • unconfirmedReserves: Dictionary<bigint, UnconfirmedReserves>
      • feeNominator: bigint
      • feeDenominator: bigint
      • collectedFees0: bigint
      • collectedFees1: bigint
      • lpAddress: null | Address
      • nonce: bigint

      Returns Promise<DexWrapper>

    • Parameters

      • initialized: boolean
      • active: boolean
      • owner: Address
      • shard: bigint
      • curveType: bigint
      • tokenType0: bigint
      • tokenType1: bigint
      • tokenMaster0: null | Address
      • tokenMaster1: null | Address
      • tokenWallet0: null | Address
      • tokenWallet1: null | Address
      • reserve0: bigint
      • reserve1: bigint
      • unconfirmedReserves: Dictionary<bigint, UnconfirmedReserves>
      • feeNominator: bigint
      • feeDenominator: bigint
      • collectedFees0: bigint
      • collectedFees1: bigint
      • lpAddress: null | Address
      • nonce: bigint

      Returns Promise<{ code: Cell; data: Cell }>