Skip to main content

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:


_10
import * as sdk from "@onflow/sdk"
_10
_10
sdk.resolveArguments(ix)

Or import directly the specific function:


_10
import { resolveArguments } from "@onflow/sdk"
_10
_10
resolveArguments(ix)

Usage


_16
import * as fcl from "@onflow/fcl";
_16
_16
// Arguments are automatically resolved during send()
_16
await 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

Returns

Promise<Interaction>


Rate this page