From 7a5918872ede386c800bc54e44dc34d3c0927278 Mon Sep 17 00:00:00 2001 From: izadimrantan <52109023+izadimrantan@users.noreply.github.com> Date: Tue, 11 Mar 2025 02:45:47 -0400 Subject: [PATCH] =?UTF-8?q?=F0=9F=A4=96=20Merge=20PR=20#71830=20Changed=20?= =?UTF-8?q?input=20type=20for=20Block=20object=20functions=20and=20changed?= =?UTF-8?q?=20Response=20object=20(zetrix-sdk-nodejs)=20by=20@izadimrantan?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Izad Imran Tan --- types/zetrix-sdk-nodejs/index.d.ts | 11 ++++++----- types/zetrix-sdk-nodejs/zetrix-sdk-nodejs-tests.ts | 8 ++++---- 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/types/zetrix-sdk-nodejs/index.d.ts b/types/zetrix-sdk-nodejs/index.d.ts index c79470a9fa7f42..0721bcd9074de0 100644 --- a/types/zetrix-sdk-nodejs/index.d.ts +++ b/types/zetrix-sdk-nodejs/index.d.ts @@ -59,19 +59,19 @@ declare namespace ZtxChainSDK { checkStatus(): Response; - getTransactions(blockNumber: number): Response; + getTransactions(blockNumber: string): Response; - getInfo(blockNumber: number): Response; + getInfo(blockNumber: string): Response; getLatestInfo(): Response; - getValidators(blockNumber: number): Response; + getValidators(blockNumber: string): Response; getLatestValidators(): Response; getLatestReward(): Response; - getFees(blockNumber: number): Response; + getFees(blockNumber: string): Response; getLatestFees(): Response; } @@ -115,6 +115,7 @@ declare namespace ZtxChainSDK { interface Response { result: any; - error: any; + errorCode: any; + errorDesc: any; } } diff --git a/types/zetrix-sdk-nodejs/zetrix-sdk-nodejs-tests.ts b/types/zetrix-sdk-nodejs/zetrix-sdk-nodejs-tests.ts index 90a2c2d2db55d4..06117f8adbc64e 100644 --- a/types/zetrix-sdk-nodejs/zetrix-sdk-nodejs-tests.ts +++ b/types/zetrix-sdk-nodejs/zetrix-sdk-nodejs-tests.ts @@ -33,13 +33,13 @@ const tokenInfo: ZtxChainSDK.Response = token.getInfo({}); const block: ZtxChainSDK.Block = sdk.block; const blockNumber: ZtxChainSDK.Response = block.getNumber(); const blockStatus: ZtxChainSDK.Response = block.checkStatus(); -const blockTransactions: ZtxChainSDK.Response = block.getTransactions(1); -const blockInfo: ZtxChainSDK.Response = block.getInfo(1); +const blockTransactions: ZtxChainSDK.Response = block.getTransactions("1"); +const blockInfo: ZtxChainSDK.Response = block.getInfo("1"); const latestBlockInfo: ZtxChainSDK.Response = block.getLatestInfo(); -const validators: ZtxChainSDK.Response = block.getValidators(1); +const validators: ZtxChainSDK.Response = block.getValidators("1"); const latestValidators: ZtxChainSDK.Response = block.getLatestValidators(); const latestReward: ZtxChainSDK.Response = block.getLatestReward(); -const fees: ZtxChainSDK.Response = block.getFees(1); +const fees: ZtxChainSDK.Response = block.getFees("1"); const latestFees: ZtxChainSDK.Response = block.getLatestFees(); // Test Operation interface