0

After multiple failed attempts with tezos.contract.at(addr).methods.entrypoint(args).send(amount), see Revealed public keys but failed to transfer on GRANADANET, I turned to the API tezbridge.request. But still I cannot come over the problem to inject operations in the blockchain. It kept displaying a warning "forge operation failed" in the tezbridge window.
Did anyone happen to encounter similar issues? Or who knows any platform can let me do some test to debug it with code snippets? Many thanks.

const bet = async (stake_amount,bool_bet) => {
  tezbridge.request({
    method: 'inject_operations',
    operations: [
      {
        kind: 'transaction',
      //tried inserting other parameters like storage_limit, gas_limit, fee, etc.
        amount: stake_amount,
        destination: KT1xxxx,
        parameters: {
          entrypoint: "bet",
          value: bool_bet     //have modified it with many different variations
        }
      }
    ]
  })
}
0

Solved it by checking up the json, https://rpc.tzkt.io/granadanet/chains/main/blocks/541783/operations/3. This can be found via json tab on better call dev.

const bet = async (stake_amount,bool_bet) => {
   var num_stake_amount = stake_amount*1000000;
   var str_stake_amount = num_stake_amount.toString();
   tezbridge.request({
     method: 'inject_operations',
     operations: [
       {
        "kind": "transaction",
        "source": userAddress,
        "amount": str_stake_amount,
        "destination": ledgerInstance.address,
        "parameters":
        {
          "entrypoint":"bet",
          "value":
          {
            "prim":bool_bet
          }
        }
       }
     ]
   })
   .then(result => alert(JSON.stringify(result)))
   .catch(error => alert(error.toString()))
};

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.