0

for this contract on ghostnet, KT1T42LtbG7skEACAkWxNJGqdcCn52Nhp3pH, if I go to tzkt or better call dev, I can see the entrypoint divestLiquidity is listed there. but if I call contract.parameterSchema.generateSchema() , the entrypoint divestLiquidity will be under use.

approve : {__michelsonType: 'pair', schema: {…}}
default : {__michelsonType: 'unit', schema: 'unit'}
getAllowance : {__michelsonType: 'pair', schema: {…}}
getBalance : {__michelsonType: 'pair', schema: {…}}
getReserves : {__michelsonType: 'contract', schema: {…}}
getTotalSupply : {__michelsonType: 'pair', schema: {…}}
transfer : {__michelsonType: 'pair', schema: {…}}
use :
  schema : divestLiquidity : {__michelsonType: 'pair', schema: {…}}
    initializeExchange : {__michelsonType: 'nat', schema: 'nat'}
    investLiquidity : {__michelsonType: 'nat', schema: 'nat'}
    tezToTokenPayment : {__michelsonType: 'pair', schema: {…}}
    tokenToTezPayment : {__michelsonType: 'pair', schema: {…}}
    veto : {__michelsonType: 'pair', schema: {…}}
    vote : {__michelsonType: 'pair', schema: {…}}
    withdrawProfit : {__michelsonType: 'address', schema: 'address'}
  __michelsonType : "or"

It also doesn't seem to be possible to call contract.methodObject.divestLiquidity. Is it possible that I can use all entrypoints under use directly?

3 Answers 3

0

I poked around a little bit and can see that with:

const contract = await tezos.contract.at('KT1T42LtbG7skEACAkWxNJGqdcCn52Nhp3pH')
const entrypoints = contract.parameterSchema.ExtractSignatures();
const op = await contract.methods.divestLiquidity(1,2,3).send();

the contract.methods.divestLiquidity is there and usable I am just not sure about the validation within your contract for what it wants and had it purposely fail with zero gasLimit so I wouldnt leave any lasting interactions with the contract.

The params are usable in both methods and methodsObject only difference are how they take params methods.<entrypoint>(params, order, specific) or methodsObject.<entrypoint>({0: firstParam, 1: nextParam}) please let me know if this helps at all or if this is not even close to what you are experiencing!

From Zainen Suzuki in Slack.

0

Agree with what Zainen is saying above and would like to add. I can see the contract hierarchy of %divestLiquidity is under %use.

I found contract.parameterSchema.ExtractSignatures() helpful when it comes to what entry points a contract has with taquito, a screenshot of the response below.

Then contract.methodsObject.divestLiquidity().getSignature() and contract.methods.divestLiquidity().getSignature() will show you how to pass param to make the contract calls.

enter image description here

From Hui-An Yang in Slack.

0

Thank you both! I think I found what I'm looking for. for ExtractSignatures and getSignature , it doesn't seem to provide a precise Michelson type in some cases. For example, set (string) only shows set. contract 'param shows contract. option 'a shows 'a. is it possible to get precise types and annotations?

1
  • ExtractSignature and getSignature are designed to simplify Michelson type down to javascript abstraction. genrateSchema() might be closest to what you’re looking for
    – user9011
    Commented Apr 22, 2023 at 0:37

Your Answer

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