## newBlocks **Type:** GraphQL subscriptions **Description:** Subscribe to new blocks as they are produced on the Kadena network. This subscription streams newly mined blocks in real time, allowing clients to react immediately to chain updates without repeatedly polling the API. It is commonly used by explorers, indexers, and event-driven applications that need to stay in sync with the latest state of the blockchain. You can optionally filter the subscription by specific `chainIds` to receive blocks only from selected chains. If omitted, blocks from all chains are included. The `quantity` parameter controls how many of the most recent blocks are returned initially when the subscription starts (default: 20). After the initial batch, new blocks are pushed to the client as they are finalized. ### Arguments - chainIds (String): (Optional) A list of chain IDs to subscribe to. If omitted, the subscription includes new blocks from all chains. - quantity (Int): The number of most recent blocks to include in the initial payload when the subscription starts. ### Response **Type:** Block **Description:** A **Block** is the fundamental unit of the Kadena blockchain. Each block bundles a verified set of transactions and metadata that secure and extend the chain. Blocks are linked together cryptographically — each one referencing its parent — forming the immutable and tamper-evident chain structure. This type exposes all the core properties of a block, including consensus data (like difficulty, nonce, and proof of work), network metadata (like chain ID and epoch), and relations to transactions, events, and neighboring blocks. #### Fields - id (ID): Globally unique identifier for this block node. - hash (String): The cryptographic hash of the block. This serves as its unique identifier within the blockchain. - chainId (BigInt): The specific chain where this block was mined. Kadena is a multi-chain system, and each block belongs to exactly one chain. - creationTime (DateTime): The timestamp when this block was created and added to the chain. - difficulty (BigInt): The network difficulty at the time the block was mined. Higher difficulty reflects the amount of computational work required to produce a valid block. - epoch (DateTime): The epoch timestamp marking when the difficulty was last adjusted. Kadena targets ~30 seconds per block, and the difficulty is recalibrated periodically to maintain that target. - flags (Decimal): Consensus flags used internally by the protocol. - height (BigInt): The height (block number) of this block within its chain. The genesis block is height 0, and each subsequent block increments by 1. - nonce (Decimal): A nonce value used in the proof-of-work process. Miners vary this value to discover a hash below the target threshold. - payloadHash (String): The hash of the payload data contained within the block. This ensures the integrity of the transactions and other included data. - weight (String): The cumulative weight of the chain up to and including this block. Weight increases with each mined block and helps determine the canonical chain. - target (String): The target hash threshold that the block’s proof-of-work hash must fall below. This value adjusts with difficulty to regulate block production time. - coinbase (String): The coinbase transaction data. This transaction rewards the miner and may include information about block rewards or other protocol-defined payouts. - neighbors (BlockNeighbor): The neighboring blocks that reference this block as a parent. These neighbors are essential in Kadena’s braided multi-chain architecture. - powHash (String): The proof-of-work hash of the block. This is the result of hashing the block header with the nonce and must satisfy the target condition. - canonical (Boolean): Indicates whether this block is part of the canonical chain. Non-canonical blocks may occur during temporary forks or reorganizations. - parent (Block): The parent block directly preceding this one in the chain. Together with the hash, this forms the cryptographic link that secures the chain. - totalGasUsedInKda (Decimal): The total amount of gas used by all transactions in this block, expressed in KDA. - events (BlockEventsConnection): Paginated list of events emitted by transactions within this block. - minerAccount (FungibleChainAccount): The account that mined this block and received the coinbase reward. - transactions (BlockTransactionsConnection): Paginated list of transactions included in this block. --- ## transaction **Type:** GraphQL subscriptions **Description:** Subscribe to a transaction and receive an event when it is included in a block and indexed. This subscription lets clients listen for a specific transaction by its `requestKey` and be notified as soon as that transaction is mined, confirmed, and available in the indexer. It is typically used by wallets, explorers, and dApps to update the transaction status in real time without polling the API. You can optionally specify a `chainId` to narrow the search to a single chain. If omitted, the subscription will look for the transaction across all chains. ⚠️ **Note:** The event is emitted **only once** — when the transaction leaves the mempool and becomes part of a block that has been indexed. ### Arguments - chainId (String): (Optional) The chain ID where the transaction is expected to occur. If omitted, all chains are searched. - requestKey (String): The request key of the transaction to listen for. The subscription emits an event once this transaction is confirmed and indexed. ### Response **Type:** Transaction **Description:** Represents a transaction executed on the Kadena blockchain. A `Transaction` encapsulates the full structure and outcome of a blockchain transaction — from the original signed command to the resulting execution details. Each transaction is uniquely identified by its `hash` and includes the submitted command (`cmd`), associated signatures (`sigs`), and the execution result (`result`). This type is fundamental for querying and analyzing blockchain activity, tracking execution outcomes, and verifying signed payloads. #### Fields - id (ID): Globally unique identifier for this transaction node. - cmd (TransactionCommand): The original signed transaction command submitted to the network. Includes metadata, payload, signers, and network information. - hash (String): The unique hash of the transaction. This value is derived from the signed command and serves as the canonical identifier for the transaction on-chain. - result (TransactionInfo): The result of executing the transaction. Includes information such as success/failure status, events, continuation data, and any state changes triggered by execution. - sigs (TransactionSignature): The list of signatures associated with the transaction. Each signature proves authorization from a required signer and is used to validate that the transaction was properly authorized before execution. --- ## transactions **Type:** GraphQL subscriptions **Description:** Subscribe to transactions as they are confirmed on the Kadena network. This subscription streams newly confirmed transactions in real time, allowing clients to react immediately to network activity without polling. It is typically used by explorers, indexers, monitoring tools, and analytics platforms to track transaction flow and update UIs as new data arrives. By default, the subscription delivers transactions that have reached the minimum required confirmation depth, ensuring they are finalized and indexed before being emitted. The `quantity` parameter controls how many of the most recent transactions are included in the initial payload when the subscription starts (default: 20). After the initial batch, new transactions are pushed to the client as they are confirmed. ### Arguments - quantity (Int): The number of most recent confirmed transactions to include in the initial payload when the subscription starts. Defaults to 20. ### Response **Type:** Transaction **Description:** Represents a transaction executed on the Kadena blockchain. A `Transaction` encapsulates the full structure and outcome of a blockchain transaction — from the original signed command to the resulting execution details. Each transaction is uniquely identified by its `hash` and includes the submitted command (`cmd`), associated signatures (`sigs`), and the execution result (`result`). This type is fundamental for querying and analyzing blockchain activity, tracking execution outcomes, and verifying signed payloads. #### Fields - id (ID): Globally unique identifier for this transaction node. - cmd (TransactionCommand): The original signed transaction command submitted to the network. Includes metadata, payload, signers, and network information. - hash (String): The unique hash of the transaction. This value is derived from the signed command and serves as the canonical identifier for the transaction on-chain. - result (TransactionInfo): The result of executing the transaction. Includes information such as success/failure status, events, continuation data, and any state changes triggered by execution. - sigs (TransactionSignature): The list of signatures associated with the transaction. Each signature proves authorization from a required signer and is used to validate that the transaction was properly authorized before execution. --- ## events **Type:** GraphQL subscriptions **Description:** Subscribe to on-chain events by their fully qualified name (e.g., `coin.TRANSFER`). Streams matching events in real time once their containing blocks meet the required confirmation depth. Useful for explorers, wallets, indexers, and analytics apps. `parametersFilter` must be a stringified JSON using Prisma JSON property filter syntax. Example: events( qualifiedEventName: "coin.TRANSFER", parametersFilter: "{\"array_starts_with\": \"k:abcdefg\"}" ) `quantity` controls the size of the initial payload (default: 20); new events are pushed thereafter. ### Arguments - chainId (String): (Optional) Restrict the subscription to a specific chain. If omitted, events from all chains are included. - minimumDepth (Int): (Optional) Minimum number of confirmations a block must have before its events are emitted. - parametersFilter (String): (Optional) A stringified JSON object used to filter event parameters. Must follow Prisma’s JSON property filter syntax. Example: "{\"array_starts_with\": \"k:abcdefg\"}" - qualifiedEventName (String): The fully qualified event name to subscribe to. Example: "coin.TRANSFER". - quantity (Int): Number of most recent matching events to include in the initial payload. Defaults to 20. ### Response **Type:** Event **Description:** Represents an event emitted during the execution of a smart contract function. Events are structured outputs generated by Pact code when certain actions occur on-chain — such as token transfers, mints, burns, or other contract-specific behaviors. They are commonly used by explorers, indexers, wallets, and analytics tools to track contract activity, monitor state changes, and trigger off-chain processes. Each event is associated with a specific block, transaction, and request key, and includes metadata like its qualified name (`moduleName.eventName`), parameters, and position within the transaction. #### Fields - id (ID): Globally unique identifier for this event. - name (String): The name of the event as defined in the smart contract. Example: `"TRANSFER"`. - block (Block): The block in which this event was emitted. - chainId (BigInt): The ID of the chain where the event occurred. - height (BigInt): The height of the block in which this event was emitted. - moduleName (String): The name of the module that emitted the event. Example: `"coin"`. - orderIndex (BigInt): The index position of this event within the transaction’s event list. Useful when multiple events are emitted by the same transaction. - requestKey (String): The request key of the transaction that emitted this event. - parameters (String): The raw JSON-encoded event parameters as emitted by the contract. - parameterText (String): A human-readable text representation of the event parameters. - qualifiedName (String): The fully qualified event name, combining the module and event name. Example: `"coin.TRANSFER"`. - transaction (Transaction): The transaction that emitted this event. --- ## newBlocksFromDepth **Type:** GraphQL subscriptions **Description:** Subscribe to new blocks starting from a specific minimum depth. This subscription behaves like `newBlocks` but only emits blocks that have reached a specified confirmation depth, ensuring they are finalized and stable before being delivered. It is commonly used by indexers, explorers, and analytics tools that require deeper chain finality guarantees rather than reacting to blocks as soon as they are mined. ### Arguments - chainIds (String): (Optional) A list of chain IDs to subscribe to. If omitted, blocks from all chains are included. - minimumDepth (Int): The minimum number of confirmations a block must have before being emitted. Blocks that do not meet this depth will be ignored until they do. - quantity (Int): The number of most recent eligible blocks to include in the initial payload when the subscription starts. ### Response **Type:** Block **Description:** A **Block** is the fundamental unit of the Kadena blockchain. Each block bundles a verified set of transactions and metadata that secure and extend the chain. Blocks are linked together cryptographically — each one referencing its parent — forming the immutable and tamper-evident chain structure. This type exposes all the core properties of a block, including consensus data (like difficulty, nonce, and proof of work), network metadata (like chain ID and epoch), and relations to transactions, events, and neighboring blocks. #### Fields - id (ID): Globally unique identifier for this block node. - hash (String): The cryptographic hash of the block. This serves as its unique identifier within the blockchain. - chainId (BigInt): The specific chain where this block was mined. Kadena is a multi-chain system, and each block belongs to exactly one chain. - creationTime (DateTime): The timestamp when this block was created and added to the chain. - difficulty (BigInt): The network difficulty at the time the block was mined. Higher difficulty reflects the amount of computational work required to produce a valid block. - epoch (DateTime): The epoch timestamp marking when the difficulty was last adjusted. Kadena targets ~30 seconds per block, and the difficulty is recalibrated periodically to maintain that target. - flags (Decimal): Consensus flags used internally by the protocol. - height (BigInt): The height (block number) of this block within its chain. The genesis block is height 0, and each subsequent block increments by 1. - nonce (Decimal): A nonce value used in the proof-of-work process. Miners vary this value to discover a hash below the target threshold. - payloadHash (String): The hash of the payload data contained within the block. This ensures the integrity of the transactions and other included data. - weight (String): The cumulative weight of the chain up to and including this block. Weight increases with each mined block and helps determine the canonical chain. - target (String): The target hash threshold that the block’s proof-of-work hash must fall below. This value adjusts with difficulty to regulate block production time. - coinbase (String): The coinbase transaction data. This transaction rewards the miner and may include information about block rewards or other protocol-defined payouts. - neighbors (BlockNeighbor): The neighboring blocks that reference this block as a parent. These neighbors are essential in Kadena’s braided multi-chain architecture. - powHash (String): The proof-of-work hash of the block. This is the result of hashing the block header with the nonce and must satisfy the target condition. - canonical (Boolean): Indicates whether this block is part of the canonical chain. Non-canonical blocks may occur during temporary forks or reorganizations. - parent (Block): The parent block directly preceding this one in the chain. Together with the hash, this forms the cryptographic link that secures the chain. - totalGasUsedInKda (Decimal): The total amount of gas used by all transactions in this block, expressed in KDA. - events (BlockEventsConnection): Paginated list of events emitted by transactions within this block. - minerAccount (FungibleChainAccount): The account that mined this block and received the coinbase reward. - transactions (BlockTransactionsConnection): Paginated list of transactions included in this block.