Skip to content
Open
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
14 changes: 14 additions & 0 deletions lib/fireblocks/api/transactions.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down