Function in abi.json is not read only

How i can fixed that problem?

my function

{“constant”:true,“inputs”:[{“name”:"_to",“type”:“address”},{“name”:"_value",“type”:“uint256”}],“name”:“transfer”,“outputs”:[{“name”:“success”,“type”:“bool”}],“payable”:false,“type”:“function”,“state_mutability”:“view”}

this is the function

image

{

  "constant": false,

  "inputs": [

    { "name": "_to", "type": "address" },

    { "name": "_value", "type": "uint256" }

  ],

  "name": "transfer",

  "outputs": [{ "name": "success", "type": "bool" }],

  "payable": false,

  "stateMutability": "nonpayable",

 

  "type": "function"

},

original

Hi @alivier

If you are trying to call the write function from a contract I recommend using the wagmi sdk. Moralis API can only call the read only functions.

wagmi functions can be used from node oh my backend

Wagmi is a frontend library. So it may not work on the backend.

For using on backend you can try using ether.js library. This can help you to execute transactions directly from the backend using your private key.

1 Like