makeArgument
Creates an argument resolver and adds it to an interaction. This function is...
Import
You can import the entire package and access the function:
_10import * as sdk from "@onflow/sdk"_10_10sdk.makeArgument(arg)
Or import directly the specific function:
_10import { makeArgument } from "@onflow/sdk"_10_10makeArgument(arg)
Usage
_19import { makeArgument, initInteraction } from "@onflow/sdk"_19import * as fcl from "@onflow/fcl";_19_19const interaction = initInteraction();_19_19// Create an argument resolver (usually you'd use fcl.arg instead)_19const argResolver = {_19 value: 42,_19 xform: fcl.t.Int,_19 resolve: (value, xform) => ({ value, xform })_19};_19_19// Add the argument to the interaction_19makeArgument(argResolver)(interaction);_19_19console.log(interaction.message.arguments.length); // 1_19_19// Preferred way - use fcl.arg instead:_19// fcl.args([fcl.arg(42, fcl.t.Int)])
Parameters
arg
- Type:
Record<string, any>
- Description: The argument configuration object
Returns
function