> ## Documentation Index
> Fetch the complete documentation index at: https://docs.sequence.xyz/llms.txt
> Use this file to discover all available pages before exploring further.

# Filling Orders

In order to fill an order (partially or completely) or to cancel an order, you'll be generating and submitting transactions.

The `ICheckout` interface, implemented by `Checkout`, exposes a few helpful methods and events.

## Building Transactions to Interact with Orders

The following async requests will return a `Step[]` these are used to generate transactions that, when submitted, perform the desired action.

```
Step[] steps = await <insert here your desired method>;
TransactionReturn result = await steps.SubmitAsTransactions(_wallet, _chain);
// or 
Transaction[] stepTransactions = steps.AsTransactionArray();
```

All of these methods can be awaited directly. You can also subscribe to the `OnTransactionStepsReturn` and `OnTransactionStepsError` events to handle the responses elsewhere.

1. `GenerateBuyTransaction` is used to buy a specified amount of a given collectible in the provided `Order[]`/listings

```
ICheckout checkout = new Checkout(_wallet, _chain);
Step[] steps = await checkout.GenerateBuyTransaction(listings, 5);
```

2. `GenerateSellTransaction` is used to sell a specified amount for a given collectible in the provided `Order[]`/offers

```
ICheckout checkout = new Checkout(_wallet, _chain);
Step[] steps = await checkout.GenerateSellTransaction(offers, 3);
```

3. `GenerateListingTransaction` is used to create a new listing for a given collectible, amount, and price.

```
ICheckout checkout = new Checkout(_wallet, _chain);
Step[] steps = await checkout.GenerateListingTransaction(collectionContractAddress, tokenId, 17, ContractType.ERC1155, currencyTokenAddress, 1000, expiryDateTime);
```

4. `GenerateOfferTransaction` is used to create a new offer for a given collectible, amount, and price.

```
ICheckout checkout = new Checkout(_wallet, _chain);
Step[] steps = await checkout.GenerateOfferTransaction(collectionContractAddress, tokenId, 46, ContractType.ERC1155, currencyTokenAddress, 850, expiryDateTime);
```

5. `GenerateCancelTransaction` is used to cancel an existing order created by the user.

```
ICheckout checkout = new Checkout(_wallet, _chain);
Step[] steps = await checkout.GenerateCancelTransaction(collectionContractAddress, order);
// Or alternatively provide the order id 
Step[] steps = await checkout.GenerateCancelTransaction(collectionContractAddress, orderIdString);
```
