Skip to content

Commit c75a737

Browse files
authored
feat: add recommended nonce endpoint (#138)
* feat: add recommended nonce endpoint * chore: Bump version to v3.13.0
1 parent 93dcd18 commit c75a737

File tree

3 files changed

+29
-1
lines changed

3 files changed

+29
-1
lines changed

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@safe-global/safe-gateway-typescript-sdk",
3-
"version": "3.12.0",
3+
"version": "3.13.0",
44
"main": "dist/index.js",
55
"types": "dist/index.d.ts",
66
"files": [

src/index.ts

+6
Original file line numberDiff line numberDiff line change
@@ -229,6 +229,12 @@ export function postSafeGasEstimation(
229229
})
230230
}
231231

232+
export function getRecommendedNonce(chainId: string, address: string): Promise<number> {
233+
return getEndpoint(baseUrl, '/v1/chains/{chainId}/safes/{safe_address}/recommended-nonce', {
234+
path: { chainId, safe_address: address },
235+
})
236+
}
237+
232238
/**
233239
* Propose a new transaction for other owners to sign/execute
234240
*/

src/types/api.ts

+22
Original file line numberDiff line numberDiff line change
@@ -304,6 +304,15 @@ export interface paths extends PathRegistry {
304304
}
305305
}
306306
}
307+
'/v1/chains/{chainId}/safes/{safe_address}/recommended-nonce': {
308+
get: operations['get_recommended_nonce']
309+
parameters: {
310+
path: {
311+
chainId: string
312+
safe_address: string
313+
}
314+
}
315+
}
307316
}
308317

309318
export interface operations {
@@ -760,4 +769,17 @@ export interface operations {
760769
}
761770
}
762771
}
772+
get_recommended_nonce: {
773+
parameters: {
774+
path: {
775+
chainId: string
776+
safe_address: string
777+
}
778+
}
779+
responses: {
780+
200: {
781+
schema: number
782+
}
783+
}
784+
}
763785
}

0 commit comments

Comments
 (0)