> For the complete documentation index, see [llms.txt](https://docs.zk.link/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.zk.link/developer/sdk/changelog-2/transactions/5-order-matching.md).

# OrderMatching

### type ContractPrice

```dart
ContractPrice(
    int pairId,
    String marketPrice,
)
```

**input:**

* pairId: The contract pair id defined by zkLink.
* marketPrice: The market price of the contract pair

### type SpotPriceInfo

```dart
SpotPriceInfo(
    int tokenId,
    String price,
)
```

**input:**

* tokenId: The token id defined by zkLink.
* price: The spot price of the token.

### type Order

The [Order](/developer/api-and-sdk/transaction/order_matching.md) struct of taker and maker.

```dart
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

```dart
void sign(ZkLinkSigner zkLinkSigner)
```

Sign order with given [ZkLinkSigner](/developer/sdk/changelog-2/signer.md#type-zklinksigner)

#### func toJson

```dart
String toJson()
```

Get the json str of [Order](#type-order)

### type OrderMatching

[OrderMatching](/developer/api-and-sdk/transaction/order_matching.md) transaction type.

```dart
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

```dart
void sign(ZkLinkSigner zkLinkSigner)
```

Sign transaction with given [ZkLinkSigner](/developer/sdk/changelog-2/signer.md#type-zklinksigner)

#### func toJson

```dart
String toJson()
```

Get the json str of [OrderMatching](#type-ordermatching)
