executeFunction API

Is there any changes on executeFunction API
I’m trying to run smart contract function but it throws vars is required
tried 2 different smart contracts but it seems like Params is not detected

code example :point_down:

const contractProccessor  =  useWeb3ExecuteFunction()
async function createProfile  ()  {

     let options = {

       contractAddress : addressTwo,

       functionName : "createProfile",

       abi : ABI,

       param :{

         chain: "mumbai",

          to : "0xeb655e6e85b4479450c5903d42e51cd5fa767312",

          handle: "zer0dot",

          imageURI : 'https://ipfs.io/ipfs/QmY9dUwYu67puaWBMxRKW98LPbXCznPwHUbhX5NeWnCJbX',

          followModule: ZERO_ADDRESS,

          followModuleInitData: [],

          followNFTURI: 'https://ipfs.io/ipfs/QmTFLSXdEQ6qsSzaXaCSNtiv6wA56qq87ytXJ182dXDQJS',

       }

     }

     await contractProccessor.fetch({

       params: options,

       onSuccess : () => console.log("congratulations you made  it"),
          onError : (error) => console.log(error)
})

 }

i get this error vars is required

and tried to to use a function from moralis example how to interact with smart contract from moralis

async function donate() {

    let donateOptions = {

      contractAddress: "0x356d2E7a0d592bAd95E86d19479c37cfdBb68Ab9",

          functionName: "newDonation",

          abi : ABI_FOUR,

          Params: {

            Note: "Thanks for your work",

          },

          msgValue: Moralis.Units.ETH(0.1),

    }

      try {

        await Moralis.executeFunction(donateOptions)

      }

      catch(err) {

        console.log('Ohhhh nooo!');

        console.log(err);

      }

  }

this function takes one parameter called note and few weeks a go I’ve tried interacting with it and worked but now it throws an error [ā€˜note is required’]

what could be wrong here

Note here should be in lower case note as that’s the variable name according to the abi.

So the error here too is referring to a parameter expected to be passed to the function called according to your abi

tried to change Note to note but still I get some error

This too should be params

Changing params solved the problem for donate function
but for createProfile function still I don’t know what I’m doing wrong see the function ABI :point_down:

{
      "inputs": [
        {
          "components": [
            {
              "internalType": "address",
              "name": "to",
              "type": "address"
            },
            {
              "internalType": "string",
              "name": "handle",
              "type": "string"
            },
            {
              "internalType": "string",
              "name": "imageURI",
              "type": "string"
            },
            {
              "internalType": "address",
              "name": "followModule",
              "type": "address"
            },
            {
              "internalType": "bytes",
              "name": "followModuleInitData",
              "type": "bytes"
            },
            {
              "internalType": "string",
              "name": "followNFTURI",
              "type": "string"
            }
          ],
          "internalType": "struct DataTypes.CreateProfileData",
          "name": "vars",
          "type": "tuple"
        }
      ],
      "name": "createProfile",
      "outputs": [
        {
          "internalType": "uint256",
          "name": "",
          "type": "uint256"
        }
      ],
      "stateMutability": "nonpayable",
      "type": "function"
    },

and In my function I passed all params :point_down:

async function createProfile  ()  {
      let options = {
        contractAddress : "0xDb46d1Dc155634FbC732f92E853b10B288AD5a1d",
        functionName : "createProfile",
        abi : ABI,
        params :{
          //chain: "mumbai",
          to: '0xeb655e6e85b4479450c5903d42e51cd5fa767312',
          handle: 'abdulkabugu',
          imageURI: 'https://ipfs.io/ipfs/QmY9dUwYu67puaWBMxRKW98LPbXCznPwHUbhX5NeWnCJbX',
          followModule: ZERO_ADDRESS,
          followModuleInitData: [],
          followNFTURI: 'https://ipfs.io/ipfs/QmTFLSXdEQ6qsSzaXaCSNtiv6wA56qq87ytXJ182dXDQJS',
        }
        
      } 
      await contractProccessor.fetch({
        params: options,
        onSuccess : () => console.log("congratulations you made  it"),
          
         
       onError : (error) => console.log(error)
        
       

      })
  }

But it throws vars required
I have no idea

can you help to try running this function on your pc so we can identify the problem source

LINKS :point_down:
their example in docs on how to use the function in local devchain (hardhat)

createProfile function

deployed contract address

Also I noticed another thing at the end of every function ABI there is another parameter called Vars with type of tuple

"internalType": ā€œstruct DataTypes.CreateProfileDataā€,
ā€œnameā€: ā€œvarsā€,
ā€œtypeā€: "tuple"

wha’ts tuple type ??

You can have your options in such way

let options = {
  contractAddress: "0xDb46d1Dc155634FbC732f92E853b10B288AD5a1d",
  functionName: "createProfile",
  abi: ABI,
  params: {
    vars: {
      to: "0xeb655e6e85b4479450c5903d42e51cd5fa767312",
      handle: "abdulkabugu",
      imageURI:
        "https://ipfs.io/ipfs/QmY9dUwYu67puaWBMxRKW98LPbXCznPwHUbhX5NeWnCJbX",
      followModule: ZERO_ADDRESS,
      followModuleInitData: [],
      followNFTURI:
        "https://ipfs.io/ipfs/QmTFLSXdEQ6qsSzaXaCSNtiv6wA56qq87ytXJ182dXDQJS",
    },
  },
};

Thank You :pray: :pray: :pray: :pray: this worked