I would like to call the stake entry point of a Plenty contract. I only have access to the Michelson source code.
Here is my current non-working code in Typescript with Beacon-SDK (inspired by this example).
import { DAppClient, TezosOperationType } from "@airgap/beacon-sdk"; const PLENTYtoPLENTY = 'KT1QqjR4Fj9YegB37PQEqXUPHmFbhz6VJtwE' const dAppClient = new DAppClient({ name: 'Plenty staker' }) const activeAccount = await dAppClient.getActiveAccount() if (!activeAccount) { const permissions = await dAppClient.requestPermissions() } const ops = new Array(1).fill(0).map((_, i) => { return { kind: TezosOperationType.TRANSACTION, amount: "0", destination: PLENTYtoPLENTY, parameters: { entrypoint: "stake", value: { stake: "10000" }, }, } }) console.log('ops', ops[0]) try { const result = await dAppClient.requestOperation({ operationDetails: ops as any, }); console.log('result', result) } catch (error) { console.log( `The contract call failed and the following error was returned:`, error?.data[1]?.with?.string ); }
I get this error : "Parameters Invalid Some of the parameters you provided are invalid and the request could not be completed. Please check your inputs and try again." I assume the lines
value: { stake: "10000" },
are not correct. How can I know what parameter name I shall use? (also tried "prim" and "int")
value: 10000
? Also, the second link in your post is broken.int: 10000
, orint: "10000"
. I find the documentation of Beacon confusing. If you can find either the michelson code of the contract called here: docs.walletbeacon.io/guides/simple-contract-call or the documentation for what's given torequestOperation
I could probably help more.value: { int : "10000" }
? It seems that: