resolveArguments
Resolves transaction arguments by evaluating argument functions and converting them to appropriate types.
This function processes all arguments in a transaction or script interaction, calling their transform functions to convert JavaScript values into Cadence-compatible argument formats that can be sent to the Flow network.
The resolution process includes:
- Calling argument resolver functions if present
- Applying type transformations using the xform field
- Handling recursive argument resolution up to a depth limit
Import
You can import the entire package and access the function:
_10import * as sdk from "@onflow/sdk"_10_10sdk.resolveArguments(ix)
Or import directly the specific function:
_10import { resolveArguments } from "@onflow/sdk"_10_10resolveArguments(ix)
Usage
_16import * as fcl from "@onflow/fcl";_16_16// Arguments are automatically resolved during send()_16await fcl.send([_16 fcl.script`_16 access(all) fun main(amount: UFix64, recipient: Address): String {_16 return "Sending ".concat(amount.toString()).concat(" to ").concat(recipient.toString())_16 }_16 `,_16 fcl.args([_16 fcl.arg("100.0", fcl.t.UFix64), // Will be resolved to Cadence UFix64_16 fcl.arg("0x01", fcl.t.Address) // Will be resolved to Cadence Address_16 ])_16]).then(fcl.decode);_16_16// The resolveArguments function handles the conversion automatically
Parameters
ix
- Type:
Interaction
- Description: The interaction object containing arguments to resolve