> For the complete documentation index, see [llms.txt](https://xpansionchain-1.gitbook.io/xpansionchain/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://xpansionchain-1.gitbook.io/xpansionchain/guides/basic-guides/get-data/trades.md).

# Trades

### Trades[​](https://docs.x.immutable.com/docs/x/how-to-get-data#trades) <a href="#trades" id="trades"></a>

#### Get list of trades[​](https://docs.x.immutable.com/docs/x/how-to-get-data#get-list-of-trades) <a href="#get-list-of-trades" id="get-list-of-trades"></a>

* Typescript Core SDK

📚SDK REFERENCE

* <mark style="color:blue;">listTrades</mark>

#### Request[​](https://docs.x.immutable.com/docs/x/how-to-get-data#request-14) <a href="#request-14" id="request-14"></a>

Get the last 5 trades made with `ETH` on XpansionChain:

```
const getListTrades = async (partyATokenType: string, pageSize: number) => {
  const response = await client.listTrades({
    partyATokenType,
    pageSize,
  });
  return response;
};
getListTrades('ETH', 5)
  .then((result) => {
    console.log(result);
  })
  .catch((e) => {
    console.log(e);
  });
```

#### Example response[​](https://docs.x.immutable.com/docs/x/how-to-get-data#example-response-12) <a href="#example-response-12" id="example-response-12"></a>

```
{
  result: [
    {
      transaction_id: 56408, // Sequential ID of this trade within XpansionChain
      status: 'success', // Status of this trade
      a: {  // Buy object
        order_id: 1581, // The ID of the order involved in the trade
        token_type: 'ETH', // The type of the token that this trade sold
        sold: '10000000000000000' // The amount of that order\'s asset this trade sold in wei
      },
      b: { // Sell object
        order_id: 1579, // The ID of the order involved in the trade
        token_type: 'ERC721', // The type of the token that this trade sold
        token_id: '1507', // The ID of the token that this trade sold
        token_address: '0x72ec08386b4bbf0c344238b1bb892b2b279f1dcf', // The contract address of the token that this trade sold
        sold: '1'  // The amount of that order\'s asset this trade sold
      },
      timestamp: '2022-09-29T10:33:26.39022Z' // Time this trade occurred
    },
    // Other trades returned
    ...
  ],
  cursor: 'eyJ0cmFuc2FjdGlvbl9pZCI6NTY0MDgsInN0YXR1cyI6InN1Y2Nlc3MiLCJwYXJ0eV9hX29yZGVyX2lkIjoxNTYzLCJwYXJ0eV9hX2V0aGVyX2tleSI6IjB4MGEyMDU3NDRkYTMzZWY4Y2Y2NjY0OWM1OGFhYmFmZGZiY2E3NGFkMSIsInBhcnR5X2Ffc29sZF90b2tlbl90eXBlIjoiRVRIIiwicGFydHlfYV9zb2xkX3Rva2VuX2lkIjoiIiwicGFydHlfYV9zb2xkX3Rva2VuX2FkZHJlc3MiOiIiLCJwYXJ0eV9hX3NvbGRfcXVhbnRpdHkiOiIxMDAwMDAwMDAwMDAwMCIsInBhcnR5X2Jfb3JkZXJfaWQiOjExNzMsInBhcnR5X2JfZXRoZXJfa2V5IjoiMHg2YzQ0MzUxMGNmNmE0YTU2MzQxZDRjZTFhZWEzYjQzOTlhMTRmYmM3IiwicGFydHlfYl9zb2xkX3Rva2VuX3R5cGUiOiJFUkM3MjEiLCJwYXJ0eV9iX3NvbGRfdG9rZW5faWQiOiIxMCIsInBhcnR5X2Jfc29sZF90b2tlbl9hZGRyZXNzIjoiMHhiYzkxYTYxYzU2MWQ1ZDVlYzMxNmE0N2NlMjU1OGJiNjk0ZDUxNmQ1IiwicGFydHlfYl9zb2xkX3F1YW50aXR5IjoiMSIsImNyZWF0ZWRfYXQiOiIyMDIyLTA5LTI5VDEwOjMzOjI2LjM5MDIyWiJ9',
  // Remaining results
  remaining: 1
}
```

* Kotlin (JVM) Core SDK

📚SDK REFERENCE

* <mark style="color:blue;">listTrades</mark>

* Swift Core SDK

📚SDK REFERENCE

* <mark style="color:blue;">listTrades</mark>

* Golang Core SDK

📚SDK REFERENCE

* <mark style="color:blue;">ListTrades</mark>

* C# Core SDK

📚SDK REFERENCE

* <mark style="color:blue;">ListTrades</mark>

**Get details about a trade**[​](https://docs.x.immutable.com/docs/x/how-to-get-data#get-details-about-a-trade)

* Typescript Core SDK

📚SDK REFERENCE

* <mark style="color:blue;">getTrade</mark>

#### Request[​](https://docs.x.immutable.com/docs/x/how-to-get-data#request-15) <a href="#request-15" id="request-15"></a>

Get details about the trade with ID `56408`:

```
const getTrade = async (id: string) => {
  const response = await client.getTrade({
    id,
  });
  return response;
};
getTrade('56715')
  .then((result) => {
    console.log(result);
  })
  .catch((e) => {
    console.log(e);
  });
```

#### Example response[​](https://docs.x.immutable.com/docs/x/how-to-get-data#example-response-13) <a href="#example-response-13" id="example-response-13"></a>

```
{
      transaction_id: 56408, // Sequential ID of this trade within XpansionChain 
      status: 'success', // Status of this trade
      a: {  // Buy object
        order_id: 1581, // The ID of the order involved in the trade
        token_type: 'ETH', // The type of the token that this trade sold
        sold: '10000000000000000' // The amount of that order\'s asset this trade sold in wei
      },
      b: { // Sell object
        order_id: 1579, // The ID of the order involved in the trade
        token_type: 'ERC721', // The type of the token that this trade sold
        token_id: '1507', // The ID of the token that this trade sold
        token_address: '0x72ec08386b4bbf0c344238b1bb892b2b279f1dcf', // The contract address of the token that this trade sold
        sold: '1'  // The amount of that order\'s asset this trade sold
      },
      timestamp: '2022-09-29T10:33:26.39022Z' // Time this trade occurred
    }
```

* Kotlin (JVM) Core SDK

📚SDK REFERENCE

* <mark style="color:blue;">getTrade</mark>

* Swift Core SDK

📚SDK REFERENCE

* <mark style="color:blue;">getTrade</mark>

* Golang Core SDK

📚SDK REFERENCE

* <mark style="color:blue;">GetTrade</mark>

* C# Core SDK

📚SDK REFERENCE

* <mark style="color:blue;">GetTrade</mark>
