Queries for Actions (NFT Trading)

buy

Buy is used to purchase a listing using its id. The buying process takes several "steps" or calls of the same buy query until the process is complete. Please see Buying Guide.

buy(chain_id, listing_id, taker_address, signature, skip_network_check, tx_hash) {
  /* ActionResponse fields */
}

Arguments

chain_id Int! -- required

The identifier of the chain on which the buy transaction is to take place.

listing_id Int! -- required

The identifier of the listing the purchasing user wishes to buy.

taker_address String! -- required

The wallet address of the purchasing user.

signature String

If the user is prompted to sign into Blur, the signature needs to be generated and passed in to make sure Blur is authorized

skip_network_check Boolean (default false)

When true and the listing's chain ID is different from the chain_id , the buy returns a step to switch network

tx_hash String

The transaction hash (txHash) from the transaction step in the buy step to keep track of the transaction status.

Response

ActionResponse.* ActionResponse

Any requested field from the ActionResponse object.

Example

Request

query {
  buy(
    chain_id: 1,
    listing_id: 6762667,
    taker_address: "0x1611036b9Fd2091741F320d45f4B2Ec7785DE274",
    skip_network_check: true
  ) {
    label
    description
    type
    name
    item {
      data
      tx_hash
      order_data
      order_indexes
    }
    steps_summary {
      description
      label
      name
      status
    }
  }
}

Response

/* One of several possible responses -- all responses follow this basic structure */
{
  "data": {
    "buy": {
      "label": "Confirm transaction in your wallet",
      "description": "To purchase this item you must confirm the transaction and pay the gas fee",
      "type": "transaction",
      "name": "sale",
      "item": {
        "data": "{\"from\":\"0x1611036b9fd2091741f320d45f4b2ec7785de274\",\"to\":\"0x00000000000000adc04c56bf30ac9d3c0aaf14dc\",\"data\":\"0x0000000000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000581a8f21c8f000000000000000000000000000622a5b6c4e544a4c085745c4b147d995bb235bbe000000000000000000000000004c00500000ad104d7dbd00e3ae0a5c00560c000000000000000000000000006e4c6d9b0930073e958abd2aba516b885260b8ff00000000000000000000000000000000000000000000000000000000000203c7000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000064dc162d0000000000000000000000000000000000000000000000000000000064dc243d000000000000000000000000000000000000000000000000000000000000000072db8c0b0000000000000000000000000000000000000000305f52bd170fdee70000007b02230091a7ed01230072f7006a004d60a8d4e71d599b8104250f00000000007b02230091a7ed01230072f7006a004d60a8d4e71d599b8104250f000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000240000000000000000000000000000000000000000000000000000000000000026000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000040b56064a4d0e695d7a289df8d7df9550c411b14a57f966ce41f490688b6a1a14f23018aac61fabe2e94fe213e8295bfd2505e2efa717a42a83deee954b79ecce01d4da48b4bf8877e\",\"value\":\"0x581a8f21c8f000\"}",
        "tx_hash": null,
        "order_data": "{}",
        "order_indexes": null
      },
      "steps_summary": [
        {
          "description": "To purchase this item you must confirm the transaction and pay the gas fee",
          "label": "Confirm transaction in your wallet",
          "name": "sale",
          "status": "incomplete"
        }
      ]
    }
  }
}

list

List is used to create a listing for an NFT. The listing process takes several "steps" or calls of the same list query until the process is complete. Please see Listing Guide.

list(asset_id, chain_id, currency, signature, maker_address, price_in_wei, skip_network_check) {
  /* ActionResponse fields */
}

Arguments

asset_id Int! -- required

The identifier of the asset being listed.

chain_id Int! -- required

The identifier of the chain on which the list transaction is to take place.

currency String! -- required

The currency the listing requires for payment.

maker_address String! -- required

The wallet address of the user creating the listing.

price_in_wei String! -- required

The purchase price of the listing.

tx_hash String

The transaction hash (txHash) from the transaction step in the cancellation step to keep track of the transaction status.

skip_network_check Boolean (default false)

When true and the listing's chain ID is different from the chain_id , the buy returns a step to switch network

Response

ActionResponse.* ActionResponse

Any requested field from the ActionResponse object.

Example

Request

query {
  list(
    asset_id: 410720
    chain_id: 1
    currency: "0x0000000000000000000000000000000000000000"
    maker_address: "0x5780A43B37c1E4451c5e485AA99EB092fEF3205E"
    priceInWei: "100000000000000000"
  ) {
    label
    description
    type
    name
    item {
      data
      tx_hash
      order_data
      order_indexes
    }
  }
}

Response

/* One of several possible responses -- all responses follow this basic structure */
{
  "data": {
    "list": {
      "label": "Authorize listing",
      "description": "A free off-chain signature to create the listing",
      "type": "signature",
      "name": "order-signature",
      "item": {
        "data": "{\"signatureKind\":\"eip712\",\"domain\":{\"name\":\"Seaport\",\"version\":\"1.5\",\"chainId\":1,\"verifyingContract\":\"0x00000000000000adc04c56bf30ac9d3c0aaf14dc\"},\"types\":{\"OrderComponents\":[{\"name\":\"offerer\",\"type\":\"address\"},{\"name\":\"zone\",\"type\":\"address\"},{\"name\":\"offer\",\"type\":\"OfferItem[]\"},{\"name\":\"consideration\",\"type\":\"ConsiderationItem[]\"},{\"name\":\"orderType\",\"type\":\"uint8\"},{\"name\":\"startTime\",\"type\":\"uint256\"},{\"name\":\"endTime\",\"type\":\"uint256\"},{\"name\":\"zoneHash\",\"type\":\"bytes32\"},{\"name\":\"salt\",\"type\":\"uint256\"},{\"name\":\"conduitKey\",\"type\":\"bytes32\"},{\"name\":\"counter\",\"type\":\"uint256\"}],\"OfferItem\":[{\"name\":\"itemType\",\"type\":\"uint8\"},{\"name\":\"token\",\"type\":\"address\"},{\"name\":\"identifierOrCriteria\",\"type\":\"uint256\"},{\"name\":\"startAmount\",\"type\":\"uint256\"},{\"name\":\"endAmount\",\"type\":\"uint256\"}],\"ConsiderationItem\":[{\"name\":\"itemType\",\"type\":\"uint8\"},{\"name\":\"token\",\"type\":\"address\"},{\"name\":\"identifierOrCriteria\",\"type\":\"uint256\"},{\"name\":\"startAmount\",\"type\":\"uint256\"},{\"name\":\"endAmount\",\"type\":\"uint256\"},{\"name\":\"recipient\",\"type\":\"address\"}]},\"value\":{\"kind\":\"single-token\",\"offerer\":\"0x1611036b9fd2091741f320d45f4b2ec7785de274\",\"zone\":\"0x0000000000000000000000000000000000000000\",\"offer\":[{\"itemType\":2,\"token\":\"0x6e4c6d9b0930073e958abd2aba516b885260b8ff\",\"identifierOrCriteria\":\"167966\",\"startAmount\":\"1\",\"endAmount\":\"1\"}],\"consideration\":[{\"itemType\":0,\"token\":\"0x0000000000000000000000000000000000000000\",\"identifierOrCriteria\":\"0\",\"startAmount\":\"950000000000000000\",\"endAmount\":\"950000000000000000\",\"recipient\":\"0x1611036b9fd2091741f320d45f4b2ec7785de274\"},{\"itemType\":0,\"token\":\"0x0000000000000000000000000000000000000000\",\"identifierOrCriteria\":\"0\",\"startAmount\":\"50000000000000000\",\"endAmount\":\"50000000000000000\",\"recipient\":\"0xef0133437ab8da5c5e8873b61189610e2d8cb4f5\"}],\"orderType\":0,\"startTime\":1692147320,\"endTime\":1707699380,\"zoneHash\":\"0x0000000000000000000000000000000000000000000000000000000000000000\",\"salt\":\"0x4bf8877e1d4da48b0000000000000000b70d42e77be5fee60a41d4e07b25ed97\",\"conduitKey\":\"0x0000007b02230091a7ed01230072f7006a004d60a8d4e71d599b8104250f0000\",\"counter\":\"0\",\"signature\":\"0x0000000000000000000000000000000000000000000000000000000000000000\"},\"primaryType\":\"OrderComponents\"}",
        "tx_hash": null,
        "order_data": "{}",
        "order_indexes": [
          0
        ],
        "__typename": "ActionItem"
      },
      "steps_summary": [
        {
          "description": "Each NFT collection you want to trade requires a one-time approval transaction",
          "label": "Approve NFT contract",
          "name": "nft-approval",
          "status": "complete",
          "__typename": "ActionStepPreview"
        },
        {
          "description": "A free off-chain signature to create the listing",
          "label": "Authorize listing",
          "name": "order-signature",
          "status": "incomplete",
          "__typename": "ActionStepPreview"
        }
      ],
      "__typename": "ActionResponse"
    }
  }
}

Cancel

Cancel is used to cancel a listing for an NFT. The cancellation process takes several "steps" or calls of the same list query until the process is complete. Please see Listing Guide.

cancel(chain_id, listing_id, maker_address, skip_network_check, tx_hash) {
  /* ActionResponse fields */
}

Arguments

chain_id Int! -- required

The identifier of the chain on which the cancel transaction is to take place.

listing_id Int! -- required

The identifier of the listing being canceled.

maker_address String! -- required

The wallet address of the user canceling the listing.

signature String!

The signature returned from the wallet's signature step during the creating the list step.

skip_network_check Boolean (default false)

When true and the listing's chain ID is different from the chain_id , the buy returns a step to switch network

Response

ActionResponse.* ActionResponse

Any requested field from the ActionResponse object.

Example

Request

query {
  cancel(
    chain_id: 1,
    listing_id: 6762805,
    maker_address: "0x1611036b9Fd2091741F320d45f4B2Ec7785DE274",
    skip_network_check: true
  ) {
    label
    description
    type
    name
    item {
      data
      tx_hash
      order_data
      order_indexes
    }
    steps_summary {
      description
      label
      name
      status
    }
  }
}

Response

/* One of several possible responses -- all responses follow this basic structure */
{
  "data": {
    "cancel": {
      "label": "Cancel order",
      "description": "To cancel these orders you must confirm the transaction and pay the gas fee",
      "type": "transaction",
      "name": "cancellation-signature",
      "item": {
        "data": "{\"from\":\"0x1611036b9fd2091741f320d45f4b2ec7785de274\",\"to\":\"0x00000000000000adc04c56bf30ac9d3c0aaf14dc\",\"data\":\"0xfd9f1e100000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000200000000000000000000000001611036b9fd2091741f320d45f4b2ec7785de27400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000160000000000000000000000000000000000000000000000000000000000000022000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000064dc1f210000000000000000000000000000000000000000000000000000000065c96d5d00000000000000000000000000000000000000000000000000000000000000004bf8877e1d4da48b000000000000000073b1c9d7af15692d0028313812a1f9900000007b02230091a7ed01230072f7006a004d60a8d4e71d599b8104250f00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000020000000000000000000000006e4c6d9b0930073e958abd2aba516b885260b8ff000000000000000000000000000000000000000000000000000000000002901e00000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000003f485fd70fc800000000000000000000000000000000000000000000000000003f485fd70fc80000000000000000000000000001611036b9fd2091741f320d45f4b2ec7785de27400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000354a6ba7a1800000000000000000000000000000000000000000000000000000354a6ba7a18000000000000000000000000000ef0133437ab8da5c5e8873b61189610e2d8cb4f5\"}",
        "tx_hash": null,
        "order_data": "{}",
        "order_indexes": null,
        "__typename": "ActionItem"
      },
      "steps_summary": [
        {
          "description": "To cancel these orders you must confirm the transaction and pay the gas fee",
          "label": "Cancel order",
          "name": "cancellation-signature",
          "status": "incomplete",
          "__typename": "ActionStepPreview"
        }
      ],
      "__typename": "ActionResponse"
    }
  }
}