Transactions Wallet to Wallet

Does anyone know if there are examples of transactions that are wallet to wallet?

Hi Moza,
Have you looked into the post transaction API ?

I’ve been looking at it for awhile. I don’t know what combination of values would allow me to transfer funds from a Vault to a onetime address. There are 2 destination objects. I don’t what combination of fields would allow me to do a simple vault to wallet transfer.

I found (and tested) the following python example which should help clear the parameters:

from fireblocks_sdk import FireblocksSDK, VAULT_ACCOUNT, ONE_TIME_ADDRESS, TransferPeerPath, DestinationTransferPeerPath

api_secret = open('fireblocks_secret.key', 'r').read()
api_key = 'uuid4'
api_url = 'https://sandbox-api.fireblocks.io'
fireblocks = FireblocksSDK(api_secret, api_key, api_base_url=api_url)


def create_transaction(asset_id, amount, src_id, address):
    tx_result = fireblocks.create_transaction(
        asset_id=asset_id,
        amount=amount,
        source=TransferPeerPath(VAULT_ACCOUNT, src_id),
        destination=DestinationTransferPeerPath(ONE_TIME_ADDRESS, None, {"address": address}),
        note="Your first OTA transaction!"
    )
    print(tx_result)
    
create_transaction("ETH_TEST3", "0.001", "0", "0x13277a70e3F48EEAD9C8a8bab12EbEDbC3DB6446")

Please let me know if that helps or not :slight_smile:

Okay I tried another combination and this worked:

{
  "assetId": "ETH_TEST3",
  "source": {
    "type": "VAULT_ACCOUNT",
    "id": "2"
  },
    "destination": {
    "oneTimeAddress": {
      "address": "0x6a079e8D4b1Af2e878ae98e6c0E23cd68A08CCDd",
      "tag": "myaddress"
    },
    "type": "ONE_TIME_ADDRESS"
  },
  "amount": 0.001,
  "feeLevel": "HIGH",
  "note": "Sending ETH to external wallet",
  "operation": "TRANSFER",
  "customerRefId": "user456"
}

There are so many different fields in transaction, some need to be present together, and some of them can’t be present with others. I know Fireblocks probably has different test cases for the create transaction API, sharing those will help.

Adding to this list of transaction payloads, this is the one for Vault to Vault:

{
  "operation": "TRANSFER",
  "source": {
    "type": "VAULT_ACCOUNT",
    "id": "2"
  },
  "destination": {
    "type": "VAULT_ACCOUNT",
    "id": "1"
  },
  "note": "Ticket 123",
  "assetId": "ETH_TEST3",
  "amount": "0.02",
  "treatAsGrossAmount": true,
  "forceSweep": false,
  "feeLevel": "MEDIUM",
  "failOnLowFee": true,
  "customerRefId": "abcdef"
}