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) {
  /* 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.

Response

ActionResponse.* ActionResponse

Any requested field from the ActionResponse object.

Example

Request

query {
  buy(
    chain_id: 1
    listing_id: 5455735
    taker_address: "0x5780A43B37c1E4451c5e485AA99EB092fEF3205E"
  ) {
    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": {
    "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\":\"0x5780a43b37c1e4451c5e485aa99eb092fef3205e\",\"to\":\"0x00000000000001ad428e4906ae43d8f9852d0dd6\",\"data\":\"0xfb0f3ee1000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000009c18ec67d19800000000000000000000000000f014b746d7f8169f0d14886277e5dd0dd49718d8000000000000000000000000004c00500000ad104d7dbd00e3ae0a5c00560c000000000000000000000000006e4c6d9b0930073e958abd2aba516b885260b8ff0000000000000000000000000000000000000000000000000000000000035cde000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000064407420000000000000000000000000000000000000000000000000000000006456b1110000000000000000000000000000000000000000000000000000000000000000360c6ebe00000000000000000000000000000000000000006da0c77c305a4db60000007b02230091a7ed01230072f7006a004d60a8d4e71d599b8104250f00000000007b02230091a7ed01230072f7006a004d60a8d4e71d599b8104250f00000000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000024000000000000000000000000000000000000000000000000000000000000002e000000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000004380663abb8000000000000000000000000000000a26b00c1f0df003000390027140000faa7190000000000000000000000000000000000000000000000000008700cc7577000000000000000000000000000ef0133437ab8da5c5e8873b61189610e2d8cb4f50000000000000000000000000000000000000000000000000000000000000040ae864ba9a9705bf7833a25799dea520748d322fee9574a724c63a08f42563421b3f7f57caac947fd6e8f2f6dc8dda1d5551fbd96710728f328ecdcad0989a69c1d4da48b4bf8877e\",\"value\":\"0xa8c0ff92d4c000\"}",
        "tx_hash": null,
        "order_data": "{}",
        "order_indexes": null
      }
    }
  }
}

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, order_kind, orderbook, price_in_wei) {
  /* 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.

orderbookString

The orderbook name of marketplace on which to create the listing. (Default: ?????) (Possible values: ?????)

order_kind String

?????

price_in_wei String! -- required

The purchase price of the listing.

signature String! -- required

?????

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": "Approve NFT contract",
      "description": "Each NFT collection you want to trade requires a one-time approval transaction",
      "type": "transaction",
      "name": "nft-approval",
      "item": {
        "data": "{}",
        "tx_hash": null,
        "order_data": "{}",
        "order_indexes": [
          0
        ]
      }
    }
  }
}