From dd80279459f7d7cc03384492b19ac8a7bc166d03 Mon Sep 17 00:00:00 2001 From: katspaugh Date: Wed, 7 Feb 2024 14:45:01 +0100 Subject: [PATCH] Feat: add deleteTransaction --- src/index.ts | 14 ++++++++++++++ src/types/api.ts | 23 +++++++++++++++++++++++ 2 files changed, 37 insertions(+) diff --git a/src/index.ts b/src/index.ts index 0da940f5..e3c38a26 100644 --- a/src/index.ts +++ b/src/index.ts @@ -225,6 +225,20 @@ export function getTransactionDetails(chainId: string, transactionId: string): P }) } +/** + * Delete a transaction by its safeTxHash + */ +export function deleteTransaction( + chainId: string, + safeTxHash: string, + signature: operations['delete_transaction']['parameters']['body']['signature'], +): Promise { + return deleteEndpoint(baseUrl, '/v1/chains/{chainId}/transactions/{safeTxHash}', { + path: { chainId, safeTxHash }, + body: { signature }, + }) +} + /** * Request a gas estimate & recommmended tx nonce for a created transaction */ diff --git a/src/types/api.ts b/src/types/api.ts index 254a5839..6d1302eb 100644 --- a/src/types/api.ts +++ b/src/types/api.ts @@ -183,6 +183,15 @@ export interface paths extends PathRegistry { } } } + '/v1/chains/{chainId}/transactions/{safeTxHash}': { + delete: operations['delete_transaction'] + parameters: { + path: { + chainId: string + safeTxHash: string + } + } + } '/v2/chains/{chainId}/safes/{safe_address}/multisig-transactions/estimations': { post: operations['post_safe_gas_estimation'] parameters: { @@ -554,6 +563,20 @@ export interface operations { } } } + delete_transaction: { + parameters: { + path: { + chainId: string + safeTxHash: string + } + body: { signature: string } + } + responses: { + 200: { + schema: void + } + } + } post_safe_gas_estimation: { parameters: { path: {