OrderMatching

type ContractPrice

ContractPrice(
    int pairId,
    String marketPrice,
)

input:

  • pairId: The contract pair id defined by zkLink.

  • marketPrice: The market price of the contract pair

type SpotPriceInfo

SpotPriceInfo(
    int tokenId,
    String price,
)

input:

  • tokenId: The token id defined by zkLink.

  • price: The spot price of the token.

type Order

The Order struct of taker and maker.

Order(
    int accountId,
    int subAccountId,
    int slotId,
    int nonce,
    int baseTokenId,
    int quoteTokenId,
    String amount,
    String price,
    bool isSell,
    int makerFeeRate,
    int takerFeeRate,
    bool hasSubsidy,
)

func sign

void sign(ZkLinkSigner zkLinkSigner)

Sign order with given ZkLinkSigner

func toJson

String toJson()

Get the json str of Order

type OrderMatching

OrderMatching transaction type.

OrderMatching(
    int accountId,
    int subAccountId,
    Order taker,
    Order maker,
    String fee,
    int feeToken,
    List<ContractPrice> contractPrices,
    List<SpotPriceInfo> marginPrices,
    String expectBaseAmount,
    String expectQuoteAmount,
)

func sign

void sign(ZkLinkSigner zkLinkSigner)

Sign transaction with given ZkLinkSigner

func toJson

String toJson()

Get the json str of OrderMatching

Last updated