1Money Network
  • Getting Started
  • Overview
  • Developer Guide
  • Quick Start
  • User Guides
    • Custodians & Centralized Exchanges (CEXs)
    • Issuers
  • Validators
  • Integrations
    • Overview
    • Network Access
    • SDKs
      • Typescript
        • Get Started
        • API Methods
      • Golang
        • Get Started
        • API methods
      • Rust
    • REST APIs
      • Chains
        • Get Chain Id
      • Accounts
        • Get account by token
        • Get account nonce
      • Tokens
        • Issue token
        • Get token metadata
        • Update token metadata
        • Grant authority
        • Mint
        • Burn
        • Managelist
        • Pause/Unpause
      • Checkpoints
        • Get the latest Checkpoint number
        • Get checkpoint by number
        • Get checkpoint by hash
      • Transactions
        • Get transaction by hash
        • Get transaction receipt by hash
        • Submit payment
        • Submit cancellation
        • Estimate fee
    • Websocket
      • Subscribing & Unsubscribing
      • Retrieving Transaction Details
      • Keeping the connection alive
      • Stream | Checkpoints
    • Data Dictionary
      • Transaction Types
        • TokenCreate
        • TokenTransfer
        • TokenGrantAuthority
        • TokenRevokeAuthority
        • TokenBlacklistAccount
        • TokenWhitelistAccount
        • TokenMint
        • TokenBurn
        • TokenCloseAccount
        • TokenPause
        • TokenUnpause
        • TokenUpdateMetadata
          • TokenMetadata Structure
            • MetaDataKeyValuePair
        • Other Transaction Types (WiP)
  • Core Concepts
    • The 1Money Protocol
    • System Components
    • Account Model
    • Token Authority
    • Transactions and Instructions
    • Implementation and usability considerations
    • Security
Powered by GitBook
On this page
  • Subscribing
  • Unsubscribing
  1. Integrations
  2. Websocket

Subscribing & Unsubscribing

Subscribing

Subscribing to checkpoints enables you to listen to current state events for accounts, transactions (such as payments) and token activity.

To subscribe to a stream with the name stream send a text frame over the websocket connection with the following JSON payload:

{
  "id": 1,
  "method": "SUBSCRIBE",
  "stream": 
      {
          "name": "CHECKPOINTS",
          "full": true
      }
}

confirmation will be received as below:

{
  "id": 1,
  "result": "11223344556677889900"
}

Have a try with below command in your terminal:

{"id": 1,"method": "SUBSCRIBE","stream": {"name": "CHECKPOINTS","full": true}}

or with below:

{"id": 1,"method": "SUBSCRIBE","stream": {"name": "CHECKPOINTS","full": false}}

Unsubscribing

Similarly, to unsubscribe from a stream with the name stream:

{
  "id", 1,
  "method": "UNSUBSCRIBE",
  "stream": "CHECKPOINTS"
}

confirmation will be received as below:

{
  "id": 1,
  "result": true
}

When subscribed, try with below command in your terminal:

{"id": 1,"method": "UNSUBSCRIBE","stream": "CHECKPOINTS"}

PreviousWebsocketNextRetrieving Transaction Details

Last updated 24 days ago