Fireblocks Java SDK: WriteCallFunction api input is not working with array types

I’m using the Fireblocks Java SDK (version 10.4.0), I’m having trouble executing write functions where the input is an array type (uint256[]) using the writeCallFunction API. For example, i have a simple contract with this solidity code:

// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;

contract NumberStorage {
   uint256 private numberSingle;
   uint256[] private numberList;

   constructor() {
       numberSingle = 42;
       numberList = [1, 2, 3, 4, 5];
   }

   function getNumberSingle() public view returns (uint256) {
       return numberSingle;
   }

   function setNumberSingle(uint256 _newNumber) public {
       numberSingle = _newNumber;
   }

   function getNumberList() public view returns (uint256[] memory) {
       return numberList;
   }

   function setNumberList(uint256[] memory _newList) public {
       numberList = _newList;
   }
}

To execute the setNumberList function, i construct the WriteAbiFunction object like this:

class WriteAbiFunction {
    stateMutability: nonpayable
    outputs: null
    type: function
    name: setNumberList
    inputs: [class ParameterWithValue {
        name: _newList
        description: null
        internalType: null
        type: uint256[]
        components: null
        value: [1,2,3,4,5]
        functionValue: null
    }]
    description: null
}

I set the value of the ParameterWithValue to “[1,2,3,4,5]”, since in the ParameterWithValue class the value is provided as String type:


However, the writeCallFunction api call always return with server error.

Exception in thread "main" java.util.concurrent.CompletionException: com.fireblocks.sdk.ApiException: writeCallFunction call failed with: 500 - {"error":"Internal Server Error","statusCode":500}
	at java.base/java.util.concurrent.CompletableFuture.encodeRelay(CompletableFuture.java:368)
	at java.base/java.util.concurrent.CompletableFuture.completeRelay(CompletableFuture.java:377)
	at java.base/java.util.concurrent.CompletableFuture$UniCompose.tryFire(CompletableFuture.java:1152)
	at java.base/java.util.concurrent.CompletableFuture$Completion.exec(CompletableFuture.java:483)
	at java.base/java.util.concurrent.ForkJoinTask.doExec$$$capture(ForkJoinTask.java:387)
	at java.base/java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java)

I tried a lot of diffirent formats of the input value (like [“1”, “2”, “3”, “4”, “5”] or “1, 2, 3, 4, 5”,…) but none of them work.
Given this, is there any way to successfully execute a write function with array input type (uint256[]) using the writeCallFunction API in the Fireblocks SDK? (I cannot use createTransaction API because of the client’s requirement)

I hope to get your support on this, thank you very much!

Hi Sangnh99,

Can you please provide me with your workspace name ,the API user you are initiating this request with and a timestamp of when you received this error?

Thank you

Hi Rotem,

  • The workspace name i’m using is: Workspace 2 (i’m using sandbox environment)
  • API user i’m initiating this request with: I’m not quite sure what you mean by ‘API user’ here, but i login with the email: edward+1@vinova.sg, and the vault account i’m using is: Sam vault (vaultId = 5)
  • Timestamp of when i received this error: Every time i call the writeCallFunction with array input type with Java SDK, i keep getting this error (the last time i tested this is 20-Jul-2025)

If you need any additional information, please feel free to ask.
thank you!

Hi sangh,

I have replicated this on my end with contract: Address: 0xc3600d09...40d4985cf | Etherscan
(Same contract as yours deployed using Hardhat),

On my end it has worked with:
value: [1,2,3,4] & value: [“1”,“2”,“3”,“4”] & value: [‘1’,‘2’,‘3’,‘4’]

You can see the transaction in the explorer:

The the input this function expects is of type uint256, (array of ints), therefore “[1,2,3,4,5]” is not viable and [“1”, “2”, “3”, “4”, "5”] should work as expected. You can also link the contract via the console using tokenization section and call the method via the console with the said parameters.

Sharing the payload here (using the JS sdk)


 const baseAssetId = "ETH_TEST5";
    const contractAddress = "0xc3600D09Bd1695B52CdB47F534b5bDa40d4985CF";

    const payload = {
      vaultAccountId: "1",
      abiFunction: {
        name: "setNumberList",
        type: "function",
        stateMutability: "nonpayable",
        inputs: [
          {
            name: "_newList",
            type: "uint256[]",
            value: [1,2,3,4]
          }
        ],
        outputs: []
      },
      feeLevel: "MEDIUM",
    };

const writeFunctionResponse = await fireblocks.writeContractCallFunction(baseAssetId, contractAddress, payload);

Hi Rotem, thanks for your reply,
I saw you tried this with the JS SDK.
I also tried these input values ( [1,2,3,4] & value: [“1”,“2”,“3”,“4”] & value: [‘1’,‘2’,‘3’,‘4’]) with JS SDK and it worked well, but when i tried with Java SDK, it keep getting the same error as i mentioned before. So Could you try it in Java to check if this is a bug specific to the Fireblocks Java SDK (version 10.4.0)?
This is my sample code :

    private static void callWriteFunctionSample() throws ApiException {
        // same data as yours
        String vaultAccountId = "1";
        String assetId = "ETH_TEST5";
        String contractAddress = "0xc3600D09Bd1695B52CdB47F534b5bDa40d4985CF";
        String functionName = "setNumberList";

        String type = "uint256[]";

//        String value = "[1,2,3,4]";
//        String value = "[\"1\", \"2\", \"3\", \"4\", \"5\"]";
        String value = "[‘1’,‘2’,‘3’,‘4’]";
        WriteCallFunctionDtoAbiFunction writeCallDto = new WriteCallFunctionDtoAbiFunction();
        WriteAbiFunction abiFunction = new WriteAbiFunction()
                .type(WriteAbiFunction.TypeEnum.FUNCTION)
                .stateMutability(WriteAbiFunction.StateMutabilityEnum.NONPAYABLE)
                .name(functionName);

        abiFunction.addInputsItem(new ParameterWithValue()
                        .name("_newList")
                        .type(type)
                        .value(value));

        writeCallDto.setActualInstance(abiFunction);

        WriteCallFunctionDto dto = new WriteCallFunctionDto()
                .abiFunction(writeCallDto);
        dto.setVaultAccountId(vaultAccountId);

        Fireblocks fireblocks = getFireblocksInstance();
        ApiResponse<WriteCallFunctionResponseDto> response =
                fireblocks.contractInteractions().writeCallFunction(dto, contractAddress, assetId, UUID.randomUUID().toString()).join();
        System.out.println(response.getData());
    }

I believe the error is because you have defined the uint256 as a string and then you are passing the value as a string and not a uint256.

Please define the type not as a string but as an array of strings:
String type = [“1”,”2”,”3”]
you are passing it as a “[…."]” (the whole array is a string which is not the same as in the JS sdk).

Hi Rotem,

As i check, the Java Fireblocks SDK (version 10.4.0) provides the ParameterWithValue() for constructing input params. In this object, the value is define as String, so we cannot pass the array type value as an array of strings

The Fireblocks Java SDK github also mentions that the value must be inputted as String, so there’s no way for us to input the value as array of String (or array of Integer) → I think that’s the diffirence between Java SDK and JS SDK (you can see in my sample code there’s no way to pass the array of Strings into ParameterWithValue().value(value))

This is the Github Fireblocks Java SDK docs:

1 Like

Yes, it’s a bug in the SDK.

I rebuild one writeCallFunction with an address[] parameter without SDK using only the http client.

The SDK sends: "value":"[\"0xa3bf…\",\"0x0586…\"]" with escaped backslashes.

What works is: "value":["0xa3bf…","0x0586…"] - so a plain JSON array.

The latter can’t be a achieved with the SDK as far as I can tell.

Edit: filed an issue, `writeCallFunction` fails with array parameters due to `value` field typed as String · Issue #117 · fireblocks/java-sdk · GitHub