# Bids

## All Bids

## /bids

<mark style="color:blue;">`GET`</mark> `https://explorer.protokol.sh/api/nft/exchange/bids`&#x20;

Return all bids

#### Query Parameters

| Name      | Type    | Description                                                                 |
| --------- | ------- | --------------------------------------------------------------------------- |
| page      | integer | The number of page that will be returned                                    |
| limit     | integer | The number of resources per page                                            |
| orderBy   | string  | <p>Order by specific parameter (asc or desc)<br>Example: orderBy=id:asc</p> |
| transform | boolean | Returns modified or raw data                                                |

{% tabs %}
{% tab title="200 " %}

```javascript
{
  "meta": {
    "totalCountIsEstimate": true,
    "count": 2,
    "pageCount": 1,
    "totalCount": 2,
    "next": null,
    "previous": null,
    "self": "/nft/exchange/bids?transform=true&page=1&limit=100",
    "first": "/nft/exchange/bids?transform=true&page=1&limit=100",
    "last": "/nft/exchange/bids?transform=true&page=1&limit=100"
  },
  "data": [
    {
      "id": "73f15a9d387035ac8f860e9f6bce63919735f8cf4eee05048ac31b935d3d69a1",
      "senderPublicKey": "02def27da9336e7fbf63131b8d7e5c9f45b296235db035f1f4242c507398f0f21d",
      "nftBid": {
        "auctionId": "08466d59b86622152c643558c03e4037454dcaf4d8188af876812c79d433ae20",
        "bidAmount": "150000000000"
      },
      "timestamp": {
        "epoch": 143238112,
        "unix": 1633339312,
        "human": "2021-10-04T09:21:52.000Z"
      }
    },
    {
      "id": "ce81232de97526c7be16dc66f7efba4f8f92a686e8b8d1250f48a87dacd45945",
      "senderPublicKey": "02def27da9336e7fbf63131b8d7e5c9f45b296235db035f1f4242c507398f0f21d",
      "nftBid": {
        "auctionId": "91221ffc0838fde5983e5ffe32c427b5720dc5703df6b89f1126fa7f62ebd964",
        "bidAmount": "150000000000"
      },
      "timestamp": {
        "epoch": 143238328,
        "unix": 1633339528,
        "human": "2021-10-04T09:25:28.000Z"
      }
    }
  ]
}
```

{% endtab %}
{% endtabs %}

### Examples

{% tabs %}
{% tab title="Curl" %}

```
curl https://explorer.protokol.sh/api/nft/exchange/bids
```

{% endtab %}

{% tab title="Typescript" %}

```typescript
const response = connection.NFTExchangeApi("bids").getAllBids();

>>> Promise<ApiResponse<BidsResource>>
```

{% endtab %}
{% endtabs %}

## Bids By Id

## /bids/:id

<mark style="color:blue;">`GET`</mark> `https://explorer.protokol.sh/api/nft/exchange/bids/:id`&#x20;

Returns bid by id

#### Path Parameters

| Name | Type   | Description                               |
| ---- | ------ | ----------------------------------------- |
| id   | string | The identifier of the bid to be retrieved |

#### Query Parameters

| Name      | Type    | Description                  |
| --------- | ------- | ---------------------------- |
| transform | boolean | Returns modified or raw data |

{% tabs %}
{% tab title="200 " %}

```javascript
{
  "data": {
    "id": "73f15a9d387035ac8f860e9f6bce63919735f8cf4eee05048ac31b935d3d69a1",
    "senderPublicKey": "02def27da9336e7fbf63131b8d7e5c9f45b296235db035f1f4242c507398f0f21d",
    "nftBid": {
      "auctionId": "08466d59b86622152c643558c03e4037454dcaf4d8188af876812c79d433ae20",
      "bidAmount": "150000000000"
    },
    "timestamp": {
      "epoch": 143238112,
      "unix": 1633339312,
      "human": "2021-10-04T09:21:52.000Z"
    }
  }
}
```

{% endtab %}

{% tab title="404 " %}

```javascript
{
  "statusCode": 404,
  "error": "Not Found",
  "message": "Bid not found"
}
```

{% endtab %}

{% tab title="422 " %}

```javascript
{
  "statusCode": 422,
  "error": "Unprocessable Entity",
  "message": "\"id\" length must be 64 characters long"
}
```

{% endtab %}
{% endtabs %}

### Examples

{% tabs %}
{% tab title="Curl" %}

```
curl https://explorer.protokol.sh/api/nft/exchange/bid/1d1757bc7e598fd73f0ec670e1f2c517d7d9a2a94d447bd5daa0a9384ebd4e7e
```

{% endtab %}

{% tab title="Typescript" %}

```typescript
const response = connection.NFTExchangeApi("bids").getBidById("VALID_ID");

>>> Promise<ApiResponse<BidsResource>>
```

{% endtab %}
{% endtabs %}

## Bids Wallet

## /bids/:id/wallets

<mark style="color:blue;">`GET`</mark> `https://explorer.protokol.sh/api/nft/exchange/bids/:id/wallets` &#x20;

Returns wallet owning the bid

#### Path Parameters

| Name | Type   | Description                   |
| ---- | ------ | ----------------------------- |
| id   | string | The identifier of the auction |

{% tabs %}
{% tab title="200 " %}

```javascript
{
  "data": {
    "address": "ANBkoGqWeTSiaEVgVzSKZd3jS7UWzv9PSo",
    "publicKey": "03287bfebba4c7881a0509717e71b34b63f31e40021c321f89ae04f84be6d6ac37",
    "nft": {
      "collections": [
        ...
      ],
      "auctions": [
        {
          "auctionId": "08466d59b86622152c643558c03e4037454dcaf4d8188af876812c79d433ae20",
          "nftIds": [
            "4f1f337873d530838dba06c9ec256cfd8a2acf7a94e87fbb0cb4c7304d3e6788"
          ],
          "bids": [
            "6cb1e1b85a6a87108ae37b2e1ca94732bc609caa8ab6d992395b143e3d157cf9"
          ]
        }
      ],
      "lockedBalance": "0"
    }
  }
}
```

{% endtab %}

{% tab title="404 " %}

```javascript
{
  "statusCode": 404,
  "error": "Not Found",
  "message": "Bid not found or it was already accepted/canceled"
}
```

{% endtab %}

{% tab title="422 " %}

```javascript
{
  "statusCode": 422,
  "error": "Unprocessable Entity",
  "message": "\"id\" length must be 64 characters long"
}
```

{% endtab %}
{% endtabs %}

### Examples

{% tabs %}
{% tab title="Curl" %}

```
curl https://explorer.protokol.sh/api/nft/exchange/bids/1d1757bc7e598fd73f0ec670e1f2c517d7d9a2a94d447bd5daa0a9384ebd4e7e/wallets
```

{% endtab %}

{% tab title="Typescript" %}

```typescript
const response = connection.NFTExchangeApi("auctions").getAuctionsWallets("VALID_ID");

>>> Promise<ApiResponse<AuctionsWallet>>
```

{% endtab %}
{% endtabs %}

## Search Bids

## /bids/search

<mark style="color:green;">`POST`</mark> `https://explorer.protokol.sh/api/nft/exchange/bids/search`&#x20;

Seach auctions

#### Query Parameters

| Name      | Type    | Description                                                                 |
| --------- | ------- | --------------------------------------------------------------------------- |
| page      | integer | The number of the page that will be returned                                |
| limit     | integer | The number of resources per page                                            |
| orderBy   | string  | <p>Order by specific parameter (asc or desc)<br>Example: orderBy=id:asc</p> |
| transform | boolean | Returns modified or raw data                                                |

#### Request Body

| Name            | Type   | Description            |
| --------------- | ------ | ---------------------- |
| senderPublicKey | string | Public key of a sender |
| auctionId       | array  | Id of an auction       |
| bidAmount       | string | Amount of a bid        |

{% tabs %}
{% tab title="200 " %}

```javascript
{
  "meta": {
    "totalCountIsEstimate": true,
    "count": 3,
    "pageCount": 1,
    "totalCount": 3,
    "next": null,
    "previous": null,
    "self": "/nft/exchange/bids/search?transform=true&page=1&limit=100",
    "first": "/nft/exchange/bids/search?transform=true&page=1&limit=100",
    "last": "/nft/exchange/bids/search?transform=true&page=1&limit=100"
  },
  "data": [
    {
      "id": "73f15a9d387035ac8f860e9f6bce63919735f8cf4eee05048ac31b935d3d69a1",
      "senderPublicKey": "02def27da9336e7fbf63131b8d7e5c9f45b296235db035f1f4242c507398f0f21d",
      "nftBid": {
        "auctionId": "08466d59b86622152c643558c03e4037454dcaf4d8188af876812c79d433ae20",
        "bidAmount": "150000000000"
      },
      "timestamp": {
        "epoch": 143238112,
        "unix": 1633339312,
        "human": "2021-10-04T09:21:52.000Z"
      }
    },
    ...
  ]
}
```

{% endtab %}
{% endtabs %}

### Examples

{% tabs %}
{% tab title="Curl" %}

```bash
curl --request POST \
  --url https://explorer.protokol.sh/api/nft/exchange/bids/search \
  --header 'content-type: application/json' \
  --data '{
      "bidAmount": "150000000000"
}'
```

{% endtab %}

{% tab title="Typescript" %}

```typescript
const response = connection.NFTExchangeApi("bids").searchByBid({
        auctionId: "VALID_AUCTION_ID",
        senderPublicKey: "VALID_SENDER_PUBLIC_KEY",
        bidAmount: "BID_AMOUNT",
});

>>> Promise<ApiResponse<BidCanceled>>
```

{% endtab %}
{% endtabs %}

## Canceled Bids

## /bids/canceled

<mark style="color:blue;">`GET`</mark> `https://explorer.protokol.sh/api/nft/exchange/bids/canceled` &#x20;

Returns canceled bids transactions

#### Query Parameters

| Name      | Type    | Description                                                                 |
| --------- | ------- | --------------------------------------------------------------------------- |
| page      | integer | The number of the page that will be returned                                |
| limit     | integer | The number of resources per page                                            |
| orderBy   | string  | <p>Order by specific parameter (asc or desc)<br>Example: orderBy=id:asc</p> |
| transform | boolean | Returns modified or raw data                                                |

{% tabs %}
{% tab title="200 " %}

```javascript
{
  "meta": {
    "totalCountIsEstimate": true,
    "count": 1,
    "pageCount": 1,
    "totalCount": 1,
    "next": null,
    "previous": null,
    "self": "/nft/exchange/bids/canceled?transform=true&page=1&limit=100",
    "first": "/nft/exchange/bids/canceled?transform=true&page=1&limit=100",
    "last": "/nft/exchange/bids/canceled?transform=true&page=1&limit=100"
  },
  "data": [
    {
      "id": "59da5fbc385ff7952eeda4829f4f0f8c57ab39930c1a91ac5cecea2ea5f0a9a0",
      "senderPublicKey": "02def27da9336e7fbf63131b8d7e5c9f45b296235db035f1f4242c507398f0f21d",
      "nftBidCancel": {
        "bidId": "73f15a9d387035ac8f860e9f6bce63919735f8cf4eee05048ac31b935d3d69a1"
      },
      "timestamp": {
        "epoch": 143238184,
        "unix": 1633339384,
        "human": "2021-10-04T09:23:04.000Z"
      }
    }
  ]
}
```

{% endtab %}
{% endtabs %}

### Examples

{% tabs %}
{% tab title="Curl" %}

```
curl https://explorer.protokol.sh/api/nft/exchange/bids/canceled
```

{% endtab %}
{% endtabs %}

## Canceled Bids By Id

## /bids/canceled/:id

<mark style="color:blue;">`GET`</mark> `https://explorer.protokol.sh/api/nft/exchange/bids/canceled/:id`&#x20;

Returns canceled bid transaction by id

#### Path Parameters

| Name | Type   | Description                                   |
| ---- | ------ | --------------------------------------------- |
| id   | string | The identifer of canceled bid to be retrieved |

#### Query Parameters

| Name      | Type    | Description                  |
| --------- | ------- | ---------------------------- |
| transform | boolean | Returns modified or raw data |

{% tabs %}
{% tab title="200 " %}

```javascript
{
  "data": {
    "id": "59da5fbc385ff7952eeda4829f4f0f8c57ab39930c1a91ac5cecea2ea5f0a9a0",
    "senderPublicKey": "02def27da9336e7fbf63131b8d7e5c9f45b296235db035f1f4242c507398f0f21d",
    "nftBidCancel": {
      "bidId": "73f15a9d387035ac8f860e9f6bce63919735f8cf4eee05048ac31b935d3d69a1"
    },
    "timestamp": {
      "epoch": 143238184,
      "unix": 1633339384,
      "human": "2021-10-04T09:23:04.000Z"
    }
  }
}
```

{% endtab %}

{% tab title="404 " %}

```javascript
{
  "statusCode": 404,
  "error": "Not Found",
  "message": "Bid not found"
}
```

{% endtab %}

{% tab title="422 " %}

```javascript
{
  "statusCode": 422,
  "error": "Unprocessable Entity",
  "message": "\"id\" length must be 64 characters long"
}
```

{% endtab %}
{% endtabs %}

### Examples

{% tabs %}
{% tab title="Curl" %}

```
curl https://explorer.protokol.sh/api/nft/exchange/bids/canceled/3c26dee62a937aaf49c25e64d2776117362e9dc30dd6f27c839081d1e44608bc
```

{% endtab %}

{% tab title="Typescript" %}

```typescript
const response = connection.NFTExchangeApi("bids").getCanceledBidById("VALID_ID");

>>> Promise<ApiResponse<BidCanceled>>
```

{% endtab %}
{% endtabs %}
