Home

Single Transaction

In Openfort, interactions in the blockchain are defined in the field interactions of the transaction intent. The interactions field is an array of objects that contain the information of the contract to interact with, the function to call, and the arguments to pass to the function.

command-line

_10
curl https://api.openfort.xyz/v1/transaction_intents \
_10
-H "Authorization: Bearer $YOUR_SECRET_KEY" \
_10
-d player="pla_..." \
_10
-d chainId=80002 \
_10
-d optimistic=true \
_10
-d "interactions[0][contract]"="con_..." \
_10
-d "interactions[0][functionName]"="mint" \
_10
-d "interactions[0][functionArgs][0]"="0x63B7...484f"

note

Openfort systems check the contract's ABI to find a function signature based on the functionName that you provide and the number of functionArgs.

In the case that, in your contract, you have multiple functions with the same functionName and number of arguments, you can also include the functionName together with the argument types e.g. mint(address)

As you can see, the interactions field contains the contract con_ that has previously been added to Openfort.

Also, the function name defines the function to call from within the contract. If there exist more than one function with the same name, the function arguments will be used to determine which function to call.

Finally, the function arguments are passed as an array of strings. The order of the arguments is important and must match the order of the function's parameters.