0

So I read the TzKT documentation regarding this (https://netezos.dev/docs/call-view-entrypoints.html) and I understood most of it, but I'm trying to do it with Taquito. But I'm fairly new to this and I can't figure out how to call a more complex view entrypoint like this one:

(pair %snapshot
                    (pair
                      (contract %callback (pair
                                           (pair (int %num1)
                                                 (int %num2))
                                           (int %num3)))
                      (int %paramX))
                    (int %paramY)))

How can I call this entrypoint by submitting the 2 parameters I need (paramX and paramY) in order to get all the values I want (num1, num2 and num 3).

Preferably in python or js/ts, I just need one example and I can pretty much go from there.

Sorry if it is a basic question, it is just hard to find more complex examples.

1 Answer 1

1

Using Taquito, this should be helpful: https://tezostaquito.io/docs/lambda_view/.

From what I can read, it would probably look like this:

Tezos.contract
  .at('KT1...')
  .then((contract) => {
    return contract.views
      .snapshot([{ paramX: '0', paramY: '1' }])
      .read();
  })
  .then((response) => {
    println(JSON.stringify(response, null, 2));
  })
  .catch((error) => println(`Error: ${error} ${JSON.stringify(error, null, 2)}`));
1

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.