WAX

swap.alcor

合约

此合约定义的数据结构。

  • balances 的表格行类型

    {
      "name": "BalanceS",
      "base": "",
      "fields": [
        {
          "name": "id",
          "type": "uint64"
        },
        {
          "name": "assetBalance",
          "type": "extended_asset"
        }
      ]
    }
  • banlist 的表格行类型

    {
      "name": "BannedAccountS",
      "base": "",
      "fields": [
        {
          "name": "account",
          "type": "name"
        }
      ]
    }
  • bitmaps 的表格行类型

    {
      "name": "BitmapS",
      "base": "",
      "fields": [
        {
          "name": "pos",
          "type": "int16"
        },
        {
          "name": "bitmap",
          "type": "uint128"
        }
      ]
    }
  • 的结构体属性 PoolS

    {
      "name": "CurrSlotS",
      "base": "",
      "fields": [
        {
          "name": "sqrtPriceX64",
          "type": "uint128"
        },
        {
          "name": "tick",
          "type": "int32"
        },
        {
          "name": "lastObservationTimestamp",
          "type": "uint32"
        },
        {
          "name": "currentObservationNum",
          "type": "uint32"
        },
        {
          "name": "maxObservationNum",
          "type": "uint32"
        }
      ]
    }
  • forzenpools 的表格行类型

    {
      "name": "FrozenPoolS",
      "base": "",
      "fields": [
        {
          "name": "poolId",
          "type": "uint64"
        },
        {
          "name": "isUnlockLiquidityA",
          "type": "bool"
        },
        {
          "name": "isUnlockLiquidityB",
          "type": "bool"
        }
      ]
    }
  • incentpaid 的表格行类型

    {
      "name": "IncentiveFeePaidS",
      "base": "",
      "fields": [
        {
          "name": "payer",
          "type": "name"
        },
        {
          "name": "fee",
          "type": "extended_asset"
        }
      ]
    }
  • incentivefee 的表格行类型

    {
      "name": "IncentiveFeeS",
      "base": "",
      "fields": [
        {
          "name": "id",
          "type": "uint64"
        },
        {
          "name": "fee",
          "type": "extended_asset"
        }
      ]
    }
  • incentives 的表格行类型

    {
      "name": "IncentiveS",
      "base": "",
      "fields": [
        {
          "name": "id",
          "type": "uint64"
        },
        {
          "name": "creator",
          "type": "name"
        },
        {
          "name": "poolId",
          "type": "uint64"
        },
        {
          "name": "reward",
          "type": "extended_asset"
        },
        {
          "name": "periodFinish",
          "type": "uint32"
        },
        {
          "name": "rewardsDuration",
          "type": "uint32"
        },
        {
          "name": "rewardRateE18",
          "type": "uint128"
        },
        {
          "name": "rewardPerTokenStored",
          "type": "uint128"
        },
        {
          "name": "totalStakingWeight",
          "type": "uint64"
        },
        {
          "name": "lastUpdateTime",
          "type": "uint32"
        },
        {
          "name": "numberOfStakes",
          "type": "uint32"
        }
      ]
    }
  • locks 的表格行类型

    {
      "name": "LockS",
      "base": "",
      "fields": [
        {
          "name": "pos_id",
          "type": "uint64"
        },
        {
          "name": "unlockTime",
          "type": "uint32"
        }
      ]
    }
  • markets 的表格行类型

    {
      "name": "MarketS",
      "base": "",
      "fields": [
        {
          "name": "marketName",
          "type": "name"
        },
        {
          "name": "marketFee",
          "type": "uint32"
        }
      ]
    }
  • observations 的表格行类型

    {
      "name": "ObservationS",
      "base": "",
      "fields": [
        {
          "name": "timestampInSec",
          "type": "uint32"
        },
        {
          "name": "tickCumulative",
          "type": "int64"
        },
        {
          "name": "secondsPerLiquidityCumulativeX64",
          "type": "uint128"
        }
      ]
    }
  • pools 的表格行类型

    {
      "name": "PoolS",
      "base": "",
      "fields": [
        {
          "name": "id",
          "type": "uint64"
        },
        {
          "name": "active",
          "type": "bool"
        },
        {
          "name": "tokenA",
          "type": "extended_asset"
        },
        {
          "name": "tokenB",
          "type": "extended_asset"
        },
        {
          "name": "fee",
          "type": "uint32"
        },
        {
          "name": "feeProtocol",
          "type": "uint8"
        },
        {
          "name": "tickSpacing",
          "type": "int32"
        },
        {
          "name": "maxLiquidityPerTick",
          "type": "uint64"
        },
        {
          "name": "currSlot",
          "type": "CurrSlotS"
        },
        {
          "name": "feeGrowthGlobalAX64",
          "type": "uint128"
        },
        {
          "name": "feeGrowthGlobalBX64",
          "type": "uint128"
        },
        {
          "name": "protocolFeeA",
          "type": "asset"
        },
        {
          "name": "protocolFeeB",
          "type": "asset"
        },
        {
          "name": "liquidity",
          "type": "uint64"
        }
      ]
    }
  • positions 的表格行类型

    {
      "name": "PositionS",
      "base": "",
      "fields": [
        {
          "name": "id",
          "type": "uint64"
        },
        {
          "name": "owner",
          "type": "name"
        },
        {
          "name": "tickLower",
          "type": "int32"
        },
        {
          "name": "tickUpper",
          "type": "int32"
        },
        {
          "name": "liquidity",
          "type": "uint64"
        },
        {
          "name": "feeGrowthInsideALastX64",
          "type": "uint128"
        },
        {
          "name": "feeGrowthInsideBLastX64",
          "type": "uint128"
        },
        {
          "name": "feesA",
          "type": "uint64"
        },
        {
          "name": "feesB",
          "type": "uint64"
        }
      ]
    }
  • stakes 的表格行类型

    {
      "name": "StakeS",
      "base": "",
      "fields": [
        {
          "name": "posId",
          "type": "uint64"
        },
        {
          "name": "stakingWeight",
          "type": "uint64"
        },
        {
          "name": "rewards",
          "type": "uint64"
        },
        {
          "name": "userRewardPerTokenPaid",
          "type": "uint128"
        }
      ]
    }
  • stakingpos 的表格行类型

    {
      "name": "StakingPosS",
      "base": "",
      "fields": [
        {
          "name": "posId",
          "type": "uint64"
        },
        {
          "name": "incentiveIds",
          "type": "uint64[]"
        }
      ]
    }
  • system 的表格行类型

    {
      "name": "SymtemS",
      "base": "",
      "fields": [
        {
          "name": "id",
          "type": "uint64"
        },
        {
          "name": "active",
          "type": "bool"
        },
        {
          "name": "poolIdCounter",
          "type": "uint64"
        },
        {
          "name": "posIdCounter",
          "type": "uint64"
        },
        {
          "name": "activeFee",
          "type": "extended_asset"
        }
      ]
    }
  • ticks 的表格行类型

    {
      "name": "TickS",
      "base": "",
      "fields": [
        {
          "name": "id",
          "type": "int32"
        },
        {
          "name": "liquidityGross",
          "type": "uint64"
        },
        {
          "name": "liquidityNet",
          "type": "int64"
        },
        {
          "name": "feeGrowthOutsideAX64",
          "type": "uint128"
        },
        {
          "name": "feeGrowthOutsideBX64",
          "type": "uint128"
        },
        {
          "name": "tickCumulativeOutside",
          "type": "int64"
        },
        {
          "name": "secondsPerLiquidityOutsideX64",
          "type": "uint128"
        },
        {
          "name": "secondsOutside",
          "type": "uint32"
        },
        {
          "name": "initialized",
          "type": "bool"
        }
      ]
    }
  • whitelist 的表格行类型

    {
      "name": "WhitelistTokenS",
      "base": "",
      "fields": [
        {
          "name": "token",
          "type": "extended_asset"
        }
      ]
    }
  • addliquid中的操作参数

    {
      "name": "addliquid",
      "base": "",
      "fields": [
        {
          "name": "poolId",
          "type": "uint64"
        },
        {
          "name": "owner",
          "type": "name"
        },
        {
          "name": "tokenADesired",
          "type": "asset"
        },
        {
          "name": "tokenBDesired",
          "type": "asset"
        },
        {
          "name": "tickLower",
          "type": "int32"
        },
        {
          "name": "tickUpper",
          "type": "int32"
        },
        {
          "name": "tokenAMin",
          "type": "asset"
        },
        {
          "name": "tokenBMin",
          "type": "asset"
        },
        {
          "name": "deadline",
          "type": "uint32"
        }
      ]
    }
  • addoraclerow中的操作参数

    {
      "name": "addoraclerow",
      "base": "",
      "fields": [
        {
          "name": "poolId",
          "type": "uint64"
        },
        {
          "name": "payer",
          "type": "name"
        },
        {
          "name": "previousRam",
          "type": "int64"
        }
      ]
    }
  • banacc中的操作参数

    {
      "name": "banacc",
      "base": "",
      "fields": [
        {
          "name": "acc",
          "type": "name"
        },
        {
          "name": "isBan",
          "type": "bool"
        }
      ]
    }
  • cfgtoken中的操作参数

    {
      "name": "cfgtoken",
      "base": "",
      "fields": [
        {
          "name": "whitelistToken",
          "type": "extended_asset"
        },
        {
          "name": "isErase",
          "type": "bool"
        }
      ]
    }
  • collect中的操作参数

    {
      "name": "collect",
      "base": "",
      "fields": [
        {
          "name": "poolId",
          "type": "uint64"
        },
        {
          "name": "owner",
          "type": "name"
        },
        {
          "name": "recipient",
          "type": "name"
        },
        {
          "name": "tickLower",
          "type": "int32"
        },
        {
          "name": "tickUpper",
          "type": "int32"
        },
        {
          "name": "tokenAMax",
          "type": "asset"
        },
        {
          "name": "tokenBMax",
          "type": "asset"
        }
      ]
    }
  • createpool中的操作参数

    {
      "name": "createpool",
      "base": "",
      "fields": [
        {
          "name": "account",
          "type": "name"
        },
        {
          "name": "tokenA",
          "type": "extended_asset"
        },
        {
          "name": "tokenB",
          "type": "extended_asset"
        },
        {
          "name": "sqrtPriceX64",
          "type": "uint128"
        },
        {
          "name": "fee",
          "type": "uint32"
        }
      ]
    }
  • freezepool中的操作参数

    {
      "name": "freezepool",
      "base": "",
      "fields": [
        {
          "name": "poolId",
          "type": "uint64"
        },
        {
          "name": "frozen",
          "type": "bool"
        },
        {
          "name": "isUnlockLiquidityA",
          "type": "bool"
        },
        {
          "name": "isUnlockLiquidityB",
          "type": "bool"
        }
      ]
    }
  • getfees中的操作参数

    {
      "name": "getfees",
      "base": "",
      "fields": [
        {
          "name": "poolId",
          "type": "uint64"
        },
        {
          "name": "recipient",
          "type": "name"
        },
        {
          "name": "tokenARequested",
          "type": "asset"
        },
        {
          "name": "tokenBRequested",
          "type": "asset"
        }
      ]
    }
  • getreward中的操作参数

    {
      "name": "getreward",
      "base": "",
      "fields": [
        {
          "name": "incentiveId",
          "type": "uint64"
        },
        {
          "name": "posId",
          "type": "uint64"
        }
      ]
    }
  • getstakes中的操作参数

    {
      "name": "getstakes",
      "base": "",
      "fields": [
        {
          "name": "posIds",
          "type": "uint64[]"
        }
      ]
    }
  • init中的操作参数

    {
      "name": "init",
      "base": "",
      "fields": []
    }
  • lockpool中的操作参数

    {
      "name": "lockpool",
      "base": "",
      "fields": [
        {
          "name": "poolId",
          "type": "uint64"
        },
        {
          "name": "active",
          "type": "bool"
        }
      ]
    }
  • lockpos中的操作参数

    {
      "name": "lockpos",
      "base": "",
      "fields": [
        {
          "name": "poolId",
          "type": "uint64"
        },
        {
          "name": "owner",
          "type": "name"
        },
        {
          "name": "tickLower",
          "type": "int32"
        },
        {
          "name": "tickUpper",
          "type": "int32"
        },
        {
          "name": "unlockTime",
          "type": "uint32"
        }
      ]
    }
  • logaddoracle中的操作参数

    {
      "name": "logaddoracle",
      "base": "",
      "fields": [
        {
          "name": "poolId",
          "type": "uint64"
        },
        {
          "name": "payer",
          "type": "name"
        },
        {
          "name": "rows",
          "type": "uint32"
        }
      ]
    }
  • logaddreward中的操作参数

    {
      "name": "logaddreward",
      "base": "",
      "fields": [
        {
          "name": "incentiveId",
          "type": "uint64"
        },
        {
          "name": "reward",
          "type": "extended_asset"
        }
      ]
    }
  • logburn中的操作参数

    {
      "name": "logburn",
      "base": "",
      "fields": [
        {
          "name": "poolId",
          "type": "uint64"
        },
        {
          "name": "posId",
          "type": "uint64"
        },
        {
          "name": "owner",
          "type": "name"
        },
        {
          "name": "tickLower",
          "type": "int32"
        },
        {
          "name": "tickUpper",
          "type": "int32"
        },
        {
          "name": "liquidity",
          "type": "uint64"
        },
        {
          "name": "tokenA",
          "type": "asset"
        },
        {
          "name": "tokenB",
          "type": "asset"
        },
        {
          "name": "reserveA",
          "type": "asset"
        },
        {
          "name": "reserveB",
          "type": "asset"
        },
        {
          "name": "sqrtPriceX64",
          "type": "uint128"
        },
        {
          "name": "tick",
          "type": "int32"
        }
      ]
    }
  • logcollect中的操作参数

    {
      "name": "logcollect",
      "base": "",
      "fields": [
        {
          "name": "poolId",
          "type": "uint64"
        },
        {
          "name": "posId",
          "type": "uint64"
        },
        {
          "name": "owner",
          "type": "name"
        },
        {
          "name": "recipient",
          "type": "name"
        },
        {
          "name": "tickLower",
          "type": "int32"
        },
        {
          "name": "tickUpper",
          "type": "int32"
        },
        {
          "name": "liquidity",
          "type": "uint64"
        },
        {
          "name": "tokenA",
          "type": "asset"
        },
        {
          "name": "tokenB",
          "type": "asset"
        },
        {
          "name": "reserveA",
          "type": "asset"
        },
        {
          "name": "reserveB",
          "type": "asset"
        },
        {
          "name": "sqrtPriceX64",
          "type": "uint128"
        },
        {
          "name": "tick",
          "type": "int32"
        }
      ]
    }
  • loggetfee中的操作参数

    {
      "name": "loggetfee",
      "base": "",
      "fields": [
        {
          "name": "poolId",
          "type": "uint64"
        },
        {
          "name": "recipient",
          "type": "name"
        },
        {
          "name": "tokenA",
          "type": "asset"
        },
        {
          "name": "tokenB",
          "type": "asset"
        }
      ]
    }
  • loglock中的操作参数

    {
      "name": "loglock",
      "base": "",
      "fields": [
        {
          "name": "poolId",
          "type": "uint64"
        },
        {
          "name": "posId",
          "type": "uint64"
        },
        {
          "name": "owner",
          "type": "name"
        },
        {
          "name": "unlockTime",
          "type": "uint32"
        }
      ]
    }
  • logmint中的操作参数

    {
      "name": "logmint",
      "base": "",
      "fields": [
        {
          "name": "poolId",
          "type": "uint64"
        },
        {
          "name": "posId",
          "type": "uint64"
        },
        {
          "name": "owner",
          "type": "name"
        },
        {
          "name": "tickLower",
          "type": "int32"
        },
        {
          "name": "tickUpper",
          "type": "int32"
        },
        {
          "name": "liquidity",
          "type": "uint64"
        },
        {
          "name": "tokenA",
          "type": "asset"
        },
        {
          "name": "tokenB",
          "type": "asset"
        },
        {
          "name": "reserveA",
          "type": "asset"
        },
        {
          "name": "reserveB",
          "type": "asset"
        },
        {
          "name": "sqrtPriceX64",
          "type": "uint128"
        },
        {
          "name": "tick",
          "type": "int32"
        }
      ]
    }
  • lognewincent中的操作参数

    {
      "name": "lognewincent",
      "base": "",
      "fields": [
        {
          "name": "incentiveId",
          "type": "uint64"
        },
        {
          "name": "creator",
          "type": "name"
        },
        {
          "name": "poolId",
          "type": "uint64"
        },
        {
          "name": "rewardToken",
          "type": "extended_asset"
        },
        {
          "name": "duration",
          "type": "uint32"
        }
      ]
    }
  • logpaid中的操作参数

    {
      "name": "logpaid",
      "base": "",
      "fields": [
        {
          "name": "incentiveId",
          "type": "uint64"
        },
        {
          "name": "owner",
          "type": "name"
        },
        {
          "name": "rewardPaid",
          "type": "extended_asset"
        }
      ]
    }
  • logpool中的操作参数

    {
      "name": "logpool",
      "base": "",
      "fields": [
        {
          "name": "poolId",
          "type": "uint64"
        },
        {
          "name": "tokenA",
          "type": "extended_asset"
        },
        {
          "name": "tokenB",
          "type": "extended_asset"
        },
        {
          "name": "fee",
          "type": "uint32"
        },
        {
          "name": "feeProtocol",
          "type": "uint8"
        },
        {
          "name": "tickSpacing",
          "type": "uint32"
        },
        {
          "name": "sqrtPriceX64",
          "type": "uint128"
        },
        {
          "name": "tick",
          "type": "int32"
        }
      ]
    }
  • logsetfee中的操作参数

    {
      "name": "logsetfee",
      "base": "",
      "fields": [
        {
          "name": "poolId",
          "type": "uint64"
        },
        {
          "name": "feeProtocolOld",
          "type": "uint8"
        },
        {
          "name": "feeProtocolNew",
          "type": "uint8"
        }
      ]
    }
  • logstaked中的操作参数

    {
      "name": "logstaked",
      "base": "",
      "fields": [
        {
          "name": "incentiveId",
          "type": "uint64"
        },
        {
          "name": "owner",
          "type": "name"
        },
        {
          "name": "posId",
          "type": "uint64"
        },
        {
          "name": "stakingWeight",
          "type": "uint64"
        }
      ]
    }
  • logswap中的操作参数

    {
      "name": "logswap",
      "base": "",
      "fields": [
        {
          "name": "poolId",
          "type": "uint64"
        },
        {
          "name": "sender",
          "type": "name"
        },
        {
          "name": "recipient",
          "type": "name"
        },
        {
          "name": "tokenA",
          "type": "asset"
        },
        {
          "name": "tokenB",
          "type": "asset"
        },
        {
          "name": "sqrtPriceX64",
          "type": "uint128"
        },
        {
          "name": "liquidity",
          "type": "uint64"
        },
        {
          "name": "tick",
          "type": "int32"
        },
        {
          "name": "reserveA",
          "type": "asset"
        },
        {
          "name": "reserveB",
          "type": "asset"
        }
      ]
    }
  • logtransfer中的操作参数

    {
      "name": "logtransfer",
      "base": "",
      "fields": [
        {
          "name": "poolId",
          "type": "uint64"
        },
        {
          "name": "fromPosId",
          "type": "uint64"
        },
        {
          "name": "from",
          "type": "name"
        },
        {
          "name": "tickLower",
          "type": "int32"
        },
        {
          "name": "tickUpper",
          "type": "int32"
        },
        {
          "name": "fromLiquidity",
          "type": "uint64"
        },
        {
          "name": "toPosId",
          "type": "uint64"
        },
        {
          "name": "to",
          "type": "name"
        },
        {
          "name": "toLiquidity",
          "type": "uint64"
        },
        {
          "name": "isMergePos",
          "type": "bool"
        }
      ]
    }
  • logunstaked中的操作参数

    {
      "name": "logunstaked",
      "base": "",
      "fields": [
        {
          "name": "incentiveId",
          "type": "uint64"
        },
        {
          "name": "owner",
          "type": "name"
        },
        {
          "name": "posId",
          "type": "uint64"
        },
        {
          "name": "stakingWeight",
          "type": "uint64"
        }
      ]
    }
  • newincentive中的操作参数

    {
      "name": "newincentive",
      "base": "",
      "fields": [
        {
          "name": "creator",
          "type": "name"
        },
        {
          "name": "poolId",
          "type": "uint64"
        },
        {
          "name": "rewardToken",
          "type": "extended_asset"
        },
        {
          "name": "duration",
          "type": "uint32"
        }
      ]
    }
  • regmarket中的操作参数

    {
      "name": "regmarket",
      "base": "",
      "fields": [
        {
          "name": "marketName",
          "type": "name"
        },
        {
          "name": "marketFee",
          "type": "uint32"
        }
      ]
    }
  • rmvpool中的操作参数

    {
      "name": "rmvpool",
      "base": "",
      "fields": [
        {
          "name": "poolId",
          "type": "uint64"
        }
      ]
    }
  • setactive中的操作参数

    {
      "name": "setactive",
      "base": "",
      "fields": [
        {
          "name": "active",
          "type": "bool"
        }
      ]
    }
  • setactivefee中的操作参数

    {
      "name": "setactivefee",
      "base": "",
      "fields": [
        {
          "name": "contract",
          "type": "name"
        },
        {
          "name": "fee",
          "type": "asset"
        }
      ]
    }
  • setfee中的操作参数

    {
      "name": "setfee",
      "base": "",
      "fields": [
        {
          "name": "poolId",
          "type": "uint64"
        },
        {
          "name": "feeProtocol",
          "type": "uint8"
        }
      ]
    }
  • setincentfee中的操作参数

    {
      "name": "setincentfee",
      "base": "",
      "fields": [
        {
          "name": "contract",
          "type": "name"
        },
        {
          "name": "fee",
          "type": "asset"
        }
      ]
    }
  • stake中的操作参数

    {
      "name": "stake",
      "base": "",
      "fields": [
        {
          "name": "incentiveId",
          "type": "uint64"
        },
        {
          "name": "posId",
          "type": "uint64"
        }
      ]
    }
  • stakelastpos中的操作参数

    {
      "name": "stakelastpos",
      "base": "",
      "fields": [
        {
          "name": "incentiveId",
          "type": "uint64"
        }
      ]
    }
  • stakereturn 的表格行类型

    getstakes 的操作返回类型

    {
      "name": "stakereturn",
      "base": "",
      "fields": [
        {
          "name": "posId",
          "type": "uint64"
        },
        {
          "name": "incentiveId",
          "type": "uint64"
        },
        {
          "name": "stakingWeight",
          "type": "uint64"
        },
        {
          "name": "rewards",
          "type": "uint64"
        },
        {
          "name": "userRewardPerTokenPaid",
          "type": "uint128"
        }
      ]
    }
  • subliquid中的操作参数

    {
      "name": "subliquid",
      "base": "",
      "fields": [
        {
          "name": "poolId",
          "type": "uint64"
        },
        {
          "name": "owner",
          "type": "name"
        },
        {
          "name": "liquidity",
          "type": "uint64"
        },
        {
          "name": "tickLower",
          "type": "int32"
        },
        {
          "name": "tickUpper",
          "type": "int32"
        },
        {
          "name": "tokenAMin",
          "type": "asset"
        },
        {
          "name": "tokenBMin",
          "type": "asset"
        },
        {
          "name": "deadline",
          "type": "uint32"
        }
      ]
    }
  • transferpos中的操作参数

    {
      "name": "transferpos",
      "base": "",
      "fields": [
        {
          "name": "poolId",
          "type": "uint64"
        },
        {
          "name": "owner",
          "type": "name"
        },
        {
          "name": "to",
          "type": "name"
        },
        {
          "name": "tickLower",
          "type": "int32"
        },
        {
          "name": "tickUpper",
          "type": "int32"
        },
        {
          "name": "memo",
          "type": "string"
        }
      ]
    }
  • unstake中的操作参数

    {
      "name": "unstake",
      "base": "",
      "fields": [
        {
          "name": "incentiveId",
          "type": "uint64"
        },
        {
          "name": "posId",
          "type": "uint64"
        }
      ]
    }
  • unstakepos中的操作参数

    {
      "name": "unstakepos",
      "base": "",
      "fields": [
        {
          "name": "posId",
          "type": "uint64"
        }
      ]
    }
  • withdraw中的操作参数

    {
      "name": "withdraw",
      "base": "",
      "fields": [
        {
          "name": "owner",
          "type": "name"
        },
        {
          "name": "assetInput",
          "type": "extended_asset"
        }
      ]
    }