Ever Platform
RoadmapIdeasDeveloper ToolsSDK
  • About Ever Platform
  • Sandbox endpoint
  • Quick Start
  • Use cases
    • Infrastructure Provider
      • Projects
    • Community-driven development
      • Roadmap
        • Discussions
      • Your ideas
      • DevNet Giver(Faucet)
    • Custom development
      • Our clients
  • Products
    • Evercloud
      • Networks Endpoints
      • Get Started
      • GraphQL API documentation
      • Testnet Faucets
      • About data proofs in Cloud
      • SLA
      • HTTP notifications
    • Dedicated Cloud/Node
    • Dapp Server (DS)
    • Simple Emulator (SE)
      • Endpoint
    • Network Emulator (NE)
    • Functionality comparison
  • Samples
    • GraphQL Samples
      • Send message
      • Network Config
      • Blocks
      • Accounts
      • Transactions
      • Messages
      • Block and Transaction Pagination: Best Practice
      • Multiple Message Processing and Monitoring
      • Subscribe for REMP receipts
  • Reference
    • GraphQL API
      • Quick Start
      • Samples
      • Networks
      • Explore Playground
      • Connect to GraphQL API
      • Schema
      • Blockchain API
      • Info API
      • Query Collections: Query Language
      • Subscribe Collections
      • Message Monitor API
      • Field Descriptions
    • Evercloud API Add-ons
      • Query cost
      • Blockchain Statistics
      • FT (Fungible Token) API
      • Price
      • Counterparties
      • Flex API
    • Changelog
      • Evercloud
      • Dapp Server (DS)
      • Simple Emulator (SE)
    • Breaking changes
      • Policy
      • Deprecation schedule
      • Migration guides
        • GraphQL API 1.0 migration
  • SDK and tools
    • everdev
    • Client Libraries
  • Guides
    • How to connect to GraphQL API
  • 😊Social
    • Feedback page
    • Telegram
    • Discord
Powered by GitBook
On this page
  • Counterparties query
  • All counterparties for specific account
  • Pagination

Was this helpful?

  1. Reference
  2. Evercloud API Add-ons

Counterparties

PreviousPriceNextFlex API

Last updated 2 years ago

Was this helpful?

Returns a list of addresses the specified account interacted with, sorted by the latest interaction time (the latest message time between 2 accounts) DESC. Feature may be useful for wallet applications or for chat-based DApps to show the list of counterparties in descending order. Available only in Cloud API.

Counterparties query

All counterparties for specific account

Query information about the last value flows of all counterparties of the elector account:

query {
	counterparties(
		account: "-1:3333333333333333333333333333333333333333333333333333333333333333"
	) {
		account
		counterparty
		last_message_id
		last_message_at
		last_message_is_reverse
		last_message_value(format: DEC)
	}
}

Result:

{
  "data": {
    "counterparties": [
      {
        "account": "-1:3333333333333333333333333333333333333333333333333333333333333333",
        "counterparty": "-1:0000000000000000000000000000000000000000000000000000000000000000",
        "last_message_id": "14d6f332c520da3101497e875ef4662048276415c8c200c1b744f7c47fb3ea21",
        "last_message_at": 1642155198,
        "last_message_is_reverse": true,
        "last_message_value": "1825000000"
      },
      {
        "account": "-1:3333333333333333333333333333333333333333333333333333333333333333",
        "counterparty": "-1:f18a64fa0ba3c6eeaf40934aae5319890253e5a41ebcd28268831c8ef1601efd",
        "last_message_id": "acce2971f2e51046d52d18dbcd808a1e7481cf8f216986053aa8c3a6784327d3",
        "last_message_at": 1642149742,
        "last_message_is_reverse": false,
        "last_message_value": "45958252455702"
      },
      {
        "account": "-1:3333333333333333333333333333333333333333333333333333333333333333",
        "counterparty": "-1:5555555555555555555555555555555555555555555555555555555555555555",
        "last_message_id": "ea45dc94450d41915c2839ca2758dd68e893a802e16caf002ecb26438f24a27b",
        "last_message_at": 1642149490,
        "last_message_is_reverse": false,
        "last_message_value": "1073741824"
      },

      // ... all other 47 records are omitted...
    ]
  }
}

Pagination

By default, record counts of all results of GraphQL queries are limited by 50. In order to obtain more records you need to do additional requests using cursor from the first or last previously queried record in before or after, respectivelly, filters. This will help you to organize pagination of counterparites queries:

query {
	counterparties(
		account: "-1:3333333333333333333333333333333333333333333333333333333333333333"
		after: "1642131731/-1:97331a562c2de1d03798fc55d2b3fb6377e144bcfec22b13a9e0fc39948661c8"
	) {
		account
		counterparty
		last_message_id
		last_message_at
		last_message_is_reverse
		last_message_value(format: DEC)
		cursor
	}
}

Result:

{
  "data": {
    "counterparties": [
      {
        "account": "-1:3333333333333333333333333333333333333333333333333333333333333333",
        "counterparty": "-1:b35240ac9d6c542bb9e08c969bf85d33ee7601a2eb633d831f9fc67fcc12106f",
        "last_message_id": "3c85978e5d74f67cb160016af146238d73254fcec400e04d30d0b6f82db99834",
        "last_message_at": 1642131722,
        "last_message_is_reverse": false,
        "last_message_value": "1000000000",
        "cursor": "1642131722/-1:b35240ac9d6c542bb9e08c969bf85d33ee7601a2eb633d831f9fc67fcc12106f"
      },
      {
        "account": "-1:3333333333333333333333333333333333333333333333333333333333333333",
        "counterparty": "-1:0d19ad161fb5adc3e7e46ff55021fc0d0c7d6599fcda9606af78f0f907af8fec",
        "last_message_id": "2804027eb2826a5adf2c7dc680faa2a78bb39e498a64dbc2b22ae1794cd7b5a2",
        "last_message_at": 1642131709,
        "last_message_is_reverse": false,
        "last_message_value": "1000000000",
        "cursor": "1642131709/-1:0d19ad161fb5adc3e7e46ff55021fc0d0c7d6599fcda9606af78f0f907af8fec"
      },
      
      // ... other 47 records are omitted ...

      {
        "account": "-1:3333333333333333333333333333333333333333333333333333333333333333",
        "counterparty": "-1:a6639baeeb0842e54b8695cc71343435ffeb76cdd03f5c6e6860bc8c2cf1ec6f",
        "last_message_id": "9aa8b010f59f927c861cafbf1ca18811774342b493ccd32a2dca453c4bbfc538",
        "last_message_at": 1642126820,
        "last_message_is_reverse": false,
        "last_message_value": "1000000000",
        "cursor": "1642126820/-1:a6639baeeb0842e54b8695cc71343435ffeb76cdd03f5c6e6860bc8c2cf1ec6f"
      }
    ]
  }
}
Counterparties queries
All counterparties for specific account
Pagination