Hello,
I want to initiate transactions from a Vault account to fireblocks network connection but i have this error : HTTP response body: message=‘Destination address is invalid’ code=1424
from fireblocks.client import Fireblocks
from fireblocks.client_configuration import ClientConfiguration
from fireblocks.models.destination_transfer_peer_path import DestinationTransferPeerPath
from fireblocks.models.source_transfer_peer_path import SourceTransferPeerPath
from fireblocks.models.transfer_peer_path_type import TransferPeerPathType
from fireblocks.models.transaction_request import TransactionRequest
from fireblocks.models.transaction_request_amount import TransactionRequestAmount
from pprint import pprint
with open(myPath, 'r') as file:
secret_key_value = file.read()
configuration = ClientConfiguration(
api_key= myAPI_key
secret_key=secret_key_value,
base_path="https://api.fireblocks.io/v1"
)
connection_ID = "ID"
def create_transaction(asset_id, amount, src_id, address):
with Fireblocks(configuration) as fireblocks:
transaction_request = TransactionRequest(
asset_id=asset_id,
amount=TransactionRequestAmount(str(amount)),
source=SourceTransferPeerPath(
type=TransferPeerPathType.VAULT_ACCOUNT,
id=src_id
),
destination=DestinationTransferPeerPath(
type=TransferPeerPathType.NETWORK_CONNECTION,
id=address
),
note="Test"
)
try:
# Correct method call: fireblocks.transactions.create_transaction()
future = fireblocks.transactions.create_transaction(transaction_request=transaction_request)
tx_result = future.result() # Wait for the response
print("Transaction successful:\n")
pprint(tx_result)
except Exception as e:
print("Transaction failed! Reason:", str(e))
# Execute the function
create_transaction("SOL", "0.00001", "0", connection_ID)