0

I'm trying to interact with this entrypoint using taquito

parameter pair
  token_assets list($token_assets_item)
  trigger_time timestamp
token_assets_item pair
  amount nat
  asset_id string
  distribution list($distribution_item)
  token_details $token_details
  uncapped bool
distribution_item pair
  beneficiary_address address
  percentage nat
token_details pair
  address address
  decimals nat
  is_fungible bool
  token_type string

I'm using taquito to call the it like this -

const createUserMethod = contract.methods.createUserParam({
  token_assets : [{
    asset_id : "1",
    amount : 100,
    uncapped : false,
    token_details : {
      address : "KT...",
      decimals : 10, 
      is_fungible : true,
      token_type : "FA1.2"
    },
    distribution : [
    {
      beneficiary_address : "tz...",
      percentage : 100
    }
    ]
  }] ,
  trigger_time : Date.now()
})

But when I send() this method, I get this error -

ListValidationError {value: {…}, token: ListToken, name: 'ListValidationError', message: '[token_assets] Value must be an array'}

How can I fix this?

-- EDIT 1

Here is the 'value' field in ListValidationError

[
    {
        "asset_id": "1",
        "amount": 100,
        "uncapped": false,
        "token_details": {
            "address": "KT1KuoFrHs4bxRbLRm79qGs69xP93hKVnsD9",
            "decimals": 10,
            "is_fungible": true,
            "token_type": "FA1.2"
        },
        "distribution": [
            {
                "beneficiary_address": "tz1VSUr8wwNhLAzempoch5d6hLRiTh8Cjcjb",
                "percentage": 100
            }
        ]
    }
]
4
  • Can you update the question and expand the value in ListValidationError so we can see which value triggered the error? May 16, 2022 at 6:58
  • Done @ClaudeBarde
    – tinuggunit
    May 16, 2022 at 7:37
  • Not that it should be relevant to the current problem (and if it is, it is definitely a bug!), but timestamps must be passed as ISO strings, can you try to replace Date.now() with new Date(Date.now()).toISOString() and see what happens? May 16, 2022 at 7:53
  • Done. Same error @ClaudeBarde
    – tinuggunit
    May 16, 2022 at 8:03

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.