> 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/6-contract-matching.md).

# ContractMatching

### 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 Contract

The [Contract](/developer/api-and-sdk/transaction/contract_matching.md) struct of taker and maker in perpetual contract.

```dart
Contract(
    int accountId,
    int subAccountId,
    int slotId,
    int nonce,
    int pairId,
    String size,
    String price,
    bool direction,
    int makerFeeRate,
    int takerFeeRate,
    bool hasSubsidy,
)
```

#### func sign

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

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

#### func toJson

```dart
String toJson()
```

Get the json str of [Contract](#type-contract)

### type ContractMatching

[ContractMatching](/developer/api-and-sdk/transaction/contract_matching.md) transaction type.

```dart
ContractMatching(
    int accountId,
    int subAccountId,
    Contract taker,
    List<Contract> maker,
    String fee,
    int feeToken,
    List<ContractPrice> contractPrices,
    List<SpotPriceInfo> marginPrices,
)
```

#### 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 [ContractMatching](#type-contractmatching)
