Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

added a rescan_transactions #184

Merged
merged 11 commits into from
Aug 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions fireblocks_sdk/api_types.py
Original file line number Diff line number Diff line change
Expand Up @@ -225,6 +225,18 @@ def __init__(self, message="Fireblocks SDK error", error_code=None):
self.error_code = error_code
super().__init__(self.message)

class RescanTx:
"""
Args
asset_id (string): The asset symbol
tx_hash (string): The hash of the transaction
"""
def __init__(self, asset_id, tx_hash):
self.asset_id = asset_id
self.tx_hash = tx_hash

def to_dict(self):
return convert_class_to_dict(self.__dict__)

class PagedVaultAccountsRequestFilters:
""" Optional filters to apply for request
Expand Down
13 changes: 13 additions & 0 deletions fireblocks_sdk/sdk.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@
SpamTokenOwnershipValues,
TokenOwnershipSpamUpdatePayload,
TokenOwnershipSpamUpdatePayload,
RescanTx,
)
from .tokenization_api_types import \
CreateTokenRequest, \
Expand Down Expand Up @@ -2108,6 +2109,18 @@ def get_max_bip44_index_used(self, vault_account_id, asset_id):

return self._get_request(url)

def rescan_transactions_beta(self, rescan_txs: List[RescanTx]) -> List[Dict[str, Any]]:
"""initiate rescan for given transactions
Args:
rescan_txs: (Array of RescanTx): the transaction asset_id and hash for rescan
Each RescanTx should have the following keys:
- 'asset_id': string
- 'tx_hash': String
"""
path = f"/v1/transactions/rescan"
request_data = [tx.to_dict() for tx in rescan_txs]
return self._post_request(path, request_data)

def get_paginated_addresses(self, vault_account_id, asset_id, limit=500, before=None, after=None):
"""Gets a paginated response of the addresses for a given vault account and asset
Args:
Expand Down
Loading