MoralisWeb3 / Moralis-JS-SDK

Moralis Official Javascript SDK
https://docs.moralis.io
Other
368 stars 257 forks source link

Get value from mapping of arrays using runContractFunction #450

Closed stpoa closed 2 years ago

stpoa commented 2 years ago

New Bug Report

Checklist

Issue Description

I have a public mapping in my Solidity code:

  mapping(address => VestingWallet[]) public vestingWallets;

I want to read a value by giving it an address and index.

      runContractFunction<string>({
        functionName: 'fixedVestingWallets',
        params: { '': address, '': index },
      })

But as you probably know, you cannot have object with 2 same key names ''. I even tried to change abi to add name to these params, but it didn't help. How to pass these params to get result?

Steps + code to reproduce

Create contract similar to above, deploy, try running the method.

alexnguyennz commented 2 years ago

You can post on https://forum.moralis.io/ with this issue with more details like your contract code.

ErnoW commented 2 years ago

Yes, the moralis forums is a better place for asking these kind of support questions. Will close this issue as it is not related to the sdk codebase.