Pact Swap

Retrieve all orders of C1 token contract


Retrieves all C1 orders from the specified C1 token contract. C1 orders are bid orders where liquidity providers sell CWEB for L1 tokens. The response includes all orders regardless of their activity status (ACTIVE, COMPLETED, CANCELLING, CANCELLED, EXPIRED, ERROR).

GET
/pactswap_cm/getAllC1Orders

Query Parameters

contractAddressstring

The L2 contract address of the C1 (dex-app.cm) contract. This is the contract address where the orders are stored. The endpoint will retrieve all orders from this contract.

publicKey?string

The public key of the user. This is the public key of owner of the orders.

backendUrl?string

Backend URL. Default is https://api-cloud.coinweb.io/wallet. This URL is used to query the contract's claim storage to retrieve all orders.

Formaturi

Response Body

curl -X GET "https://api.pactswap.io/pactswap_cm/getAllC1Orders?contractAddress=0x1234567890123456789012345678901234567890&publicKey=020a89e0698443aaf4ecd613317d2fdf90ef73b99244182fc7bb3c6b85f375b876&backendUrl=https%3A%2F%2Fapi-cloud.coinweb.io%2Fwallet"
[
  {
    "id": "order-123-abc",
    "baseAmount": "1000000000000000000",
    "l1Amount": "50000000",
    "minL1Amount": "40000000",
    "recipient": "bc1qxy2kgdygjrsqtzq2n0yrf2493p83kkfjhx0wlh",
    "createdAt": 1704067200000,
    "activityStatus": "ACTIVE",
    "funds": "1000000000000000000",
    "chainData": null,
    "txId": "0x1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef",
    "error": "Insufficient funds",
    "expirationDate": 1704153600000,
    "marketMaker": {
      "auth": "EcdsaContract",
      "payload": "020a89e0698443aaf4ecd613317d2fdf90ef73b99244182fc7bb3c6b85f375b876"
    },
    "used": 0,
    "maxUses": 0,
    "history": {
      "historyId": "a1075db55d416d3ca199f55b6084e2115b9345e16c5cf302fc80e9d5fbf5d48d",
      "timestamp": 1717334400
    }
  }
]

Was this documentation helpful? Any suggestions?

Last updated on