From cf225667b5f5cad589ea2e61c0c447a26926edb5 Mon Sep 17 00:00:00 2001 From: Marc Espin Date: Mon, 12 Aug 2024 15:05:23 +0200 Subject: [PATCH] feat(sdk): Pair sdk with latest inflation changes (#1733) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * feat(sdk): Pair sdk with latest inflation changes * Update checkpint.ts --------- Co-authored-by: Begoña Álvarez de la Cruz --- crates/iota-open-rpc/spec/openrpc.json | 6 ++++++ sdk/graphql-transport/src/mappers/checkpint.ts | 1 + sdk/typescript/src/client/types/generated.ts | 2 ++ 3 files changed, 9 insertions(+) diff --git a/crates/iota-open-rpc/spec/openrpc.json b/crates/iota-open-rpc/spec/openrpc.json index c43b2fc2a9c..8ff59efbcfb 100644 --- a/crates/iota-open-rpc/spec/openrpc.json +++ b/crates/iota-open-rpc/spec/openrpc.json @@ -6273,6 +6273,7 @@ "type": "object", "required": [ "epochCommitments", + "epochSupplyChange", "nextEpochCommittee", "nextEpochProtocolVersion" ], @@ -6284,6 +6285,11 @@ "$ref": "#/components/schemas/CheckpointCommitment" } }, + "epochSupplyChange": { + "description": "The number of tokens that were minted (if positive) or burnt (if negative) in this epoch.", + "type": "integer", + "format": "int64" + }, "nextEpochCommittee": { "description": "next_epoch_committee is `Some` if and only if the current checkpoint is the last checkpoint of an epoch. Therefore next_epoch_committee can be used to pick the last checkpoint of an epoch, which is often useful to get epoch level summary stats like total gas cost of an epoch, or the total number of transactions from genesis to the end of an epoch. The committee is stored as a vector of validator pub key and stake pairs. The vector should be sorted based on the Committee data structure.", "type": "array", diff --git a/sdk/graphql-transport/src/mappers/checkpint.ts b/sdk/graphql-transport/src/mappers/checkpint.ts index 28d038eabca..a3e2f0739d4 100644 --- a/sdk/graphql-transport/src/mappers/checkpint.ts +++ b/sdk/graphql-transport/src/mappers/checkpint.ts @@ -25,6 +25,7 @@ export function mapGraphQLCheckpointToRpcCheckpoint( nextEpochProtocolVersion: String( endOfEpochTx.kind.transactions.nodes[0].epoch?.protocolConfigs.protocolVersion, ), + epochSupplyChange: 0, // TODO: https://github.com/iotaledger/iota/issues/1738 }; } diff --git a/sdk/typescript/src/client/types/generated.ts b/sdk/typescript/src/client/types/generated.ts index 8a6289371a6..448f4f6e65c 100644 --- a/sdk/typescript/src/client/types/generated.ts +++ b/sdk/typescript/src/client/types/generated.ts @@ -187,6 +187,8 @@ export interface ECMHLiveObjectSetDigest { export interface EndOfEpochData { /** Commitments to epoch specific state (e.g. live object set) */ epochCommitments: CheckpointCommitment[]; + /** The number of tokens that were minted (if positive) or burnt (if negative) in this epoch. */ + epochSupplyChange: number; /** * next_epoch_committee is `Some` if and only if the current checkpoint is the last checkpoint of an * epoch. Therefore next_epoch_committee can be used to pick the last checkpoint of an epoch, which is