From 61800fe0f60dbeef3e824ef44ce408f3c49acf41 Mon Sep 17 00:00:00 2001 From: Usame Algan <5880855+usame-algan@users.noreply.github.com> Date: Mon, 30 Oct 2023 11:45:39 +0100 Subject: [PATCH] fix: recommended nonce response (#139) * fix: Recommended nonce response type * chore: Bump version to v3.13.1 --- package.json | 2 +- src/index.ts | 3 ++- src/types/api.ts | 3 ++- src/types/transactions.ts | 4 ++++ 4 files changed, 9 insertions(+), 3 deletions(-) diff --git a/package.json b/package.json index 49d66fe0..4df5af64 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@safe-global/safe-gateway-typescript-sdk", - "version": "3.13.0", + "version": "3.13.1", "main": "dist/index.js", "types": "dist/index.d.ts", "files": [ diff --git a/src/index.ts b/src/index.ts index 78905030..52148e4f 100644 --- a/src/index.ts +++ b/src/index.ts @@ -7,6 +7,7 @@ import type { SafeIncomingTransfersResponse, SafeModuleTransactionsResponse, SafeMultisigTransactionsResponse, + RecommendedNonceResponse, } from './types/transactions' import type { FiatCurrencies, @@ -229,7 +230,7 @@ export function postSafeGasEstimation( }) } -export function getRecommendedNonce(chainId: string, address: string): Promise { +export function getRecommendedNonce(chainId: string, address: string): Promise { return getEndpoint(baseUrl, '/v1/chains/{chainId}/safes/{safe_address}/recommended-nonce', { path: { chainId, safe_address: address }, }) diff --git a/src/types/api.ts b/src/types/api.ts index d36c4efd..d7387959 100644 --- a/src/types/api.ts +++ b/src/types/api.ts @@ -14,6 +14,7 @@ import type { SafeIncomingTransfersResponse, SafeModuleTransactionsResponse, SafeMultisigTransactionsResponse, + RecommendedNonceResponse, } from './transactions' import type { SafeInfo } from './safe-info' import type { ChainListResponse, ChainInfo } from './chains' @@ -778,7 +779,7 @@ export interface operations { } responses: { 200: { - schema: number + schema: RecommendedNonceResponse } } } diff --git a/src/types/transactions.ts b/src/types/transactions.ts index 67f82b06..df03592e 100644 --- a/src/types/transactions.ts +++ b/src/types/transactions.ts @@ -406,6 +406,10 @@ export type SafeTransactionEstimation = { safeTxGas: string } +export type RecommendedNonceResponse = { + nonce: number +} + /* Transaction estimation types end */ export type SafeIncomingTransfersResponse = Page