Typescript integration code : FuelError: Only one field must be provided

Hi @mahesh_d_luffy, I can see you are passing the Identity parameter incorrectly. It is expecting an enum value and you have just passed the raw b256 address. It can be passed like this. This forum post is actually very similar to your issue.

I’d also reccomend using typegen via the Fuels CLI to create the function inputs to ensure you are passing them correctly.

But I’d expect you to pass the first parameter like so:

const address = { bits: '0xdfa99328085d21926deac89364045a6ebc84da04a051b7c70e2c368eee494b3b' };
const identity = { Address: address };
const result = await contract.functions.mint(identity,subId,amount).txParams({gasPrice:1}).call();

1 Like