Skip to content

Commit 562bfbc

Browse files
Merge pull request #184 from fireblocks/Add-rescan-txs
added a rescan_transactions
2 parents 1c547be + 8894798 commit 562bfbc

File tree

2 files changed

+25
-0
lines changed

2 files changed

+25
-0
lines changed

fireblocks_sdk/api_types.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -225,6 +225,18 @@ def __init__(self, message="Fireblocks SDK error", error_code=None):
225225
self.error_code = error_code
226226
super().__init__(self.message)
227227

228+
class RescanTx:
229+
"""
230+
Args
231+
asset_id (string): The asset symbol
232+
tx_hash (string): The hash of the transaction
233+
"""
234+
def __init__(self, asset_id, tx_hash):
235+
self.asset_id = asset_id
236+
self.tx_hash = tx_hash
237+
238+
def to_dict(self):
239+
return convert_class_to_dict(self.__dict__)
228240

229241
class PagedVaultAccountsRequestFilters:
230242
""" Optional filters to apply for request

fireblocks_sdk/sdk.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@
4040
SpamTokenOwnershipValues,
4141
TokenOwnershipSpamUpdatePayload,
4242
TokenOwnershipSpamUpdatePayload,
43+
RescanTx,
4344
)
4445
from .tokenization_api_types import \
4546
CreateTokenRequest, \
@@ -2108,6 +2109,18 @@ def get_max_bip44_index_used(self, vault_account_id, asset_id):
21082109

21092110
return self._get_request(url)
21102111

2112+
def rescan_transactions_beta(self, rescan_txs: List[RescanTx]) -> List[Dict[str, Any]]:
2113+
"""initiate rescan for given transactions
2114+
Args:
2115+
rescan_txs: (Array of RescanTx): the transaction asset_id and hash for rescan
2116+
Each RescanTx should have the following keys:
2117+
- 'asset_id': string
2118+
- 'tx_hash': String
2119+
"""
2120+
path = f"/v1/transactions/rescan"
2121+
request_data = [tx.to_dict() for tx in rescan_txs]
2122+
return self._post_request(path, request_data)
2123+
21112124
def get_paginated_addresses(self, vault_account_id, asset_id, limit=500, before=None, after=None):
21122125
"""Gets a paginated response of the addresses for a given vault account and asset
21132126
Args:

0 commit comments

Comments
 (0)