From 4563216b09a4a3018bb55f5656610f80a74cd891 Mon Sep 17 00:00:00 2001 From: Torres-ssf Date: Wed, 15 Jan 2025 14:51:55 -0300 Subject: [PATCH] implement daCompressedBlock method --- packages/account/src/providers/operations.graphql | 6 ++++++ packages/account/src/providers/provider.ts | 12 ++++++++++++ 2 files changed, 18 insertions(+) diff --git a/packages/account/src/providers/operations.graphql b/packages/account/src/providers/operations.graphql index 80d1aa3ae4..21002a6d30 100644 --- a/packages/account/src/providers/operations.graphql +++ b/packages/account/src/providers/operations.graphql @@ -774,6 +774,12 @@ query getAssetDetails($assetId: AssetId!) { } } +query daCompressedBlock($height: U32!) { + daCompressedBlock(height: $height) { + bytes + } +} + mutation dryRun( $encodedTransactions: [HexString!]! $utxoValidation: Boolean diff --git a/packages/account/src/providers/provider.ts b/packages/account/src/providers/provider.ts index 3e9caeca60..6d8fbbd67b 100644 --- a/packages/account/src/providers/provider.ts +++ b/packages/account/src/providers/provider.ts @@ -1702,6 +1702,18 @@ Supported fuel-core version: ${supportedVersion}.` } } + async daCompressedBlock(height: string) { + const { daCompressedBlock } = await this.operations.daCompressedBlock({ + height, + }); + + if (!daCompressedBlock) { + return null; + } + + return daCompressedBlock; + } + /** * Retrieves transactions based on the provided pagination arguments. * @param paginationArgs - The pagination arguments for retrieving transactions.