diff --git a/lib/fireblocks/api/transactions.rb b/lib/fireblocks/api/transactions.rb index 64c8df3..b21e731 100644 --- a/lib/fireblocks/api/transactions.rb +++ b/lib/fireblocks/api/transactions.rb @@ -102,6 +102,20 @@ def destination_payload(**kwargs) def get_transaction_by_id(id) Fireblocks::Request.get(path: "/v1/transactions/#{id}") end + + def estimate_fee_for_transaction(asset_id:, amount:, source_id:, destination:) + body = { + amount: amount, + assetId: asset_id, + source: { + type: VAULT_ACCOUNT, + id: source_id + }, + destination: destination + }.compact + + Fireblocks::Request.post(body: body.slice(*VALID_TRANSACTION_KEYS), path: '/v1/transactions/estimate_fee') + end end end end