0

I am using the node: https://babylonnet.tezos.org.ua

I am using taquito node module to test a faucet account:

taquito.Tezos.setProvider({rpc:'https://babylonnet.tezos.org.ua'})
taquito.Tezos.importKey(email,password,mnemonic.join(" "),secret)
taquito.Tezos.contract.transfer({to:address,amount:amount})  
.then(op=>{console.log(op.confirmation)})
.then(block=>{console.log(block)})
.catch(error=>{console.log(JSON.stringify(error))})

The output is:

{
  "message": "Http error response: (400) Failed to parsed an argument in    path. After \"chains/main/blocks/head/context/contracts/balance\", the value \"Cannot parse contract id\" is not acceptable for type \"contract_id\"",
  "status": 400,
  "statusText": "Bad Request",
  "body": "Failed to parsed an argument in path. After \"chains/main/blocks/head/context/contracts/balance\", the value \"Cannot parse contract id\" is not acceptable for type \"contract_id\"",
  "name": "HttpResponse"
}

How do i successfully send tez?

0

You have an error in your code because you are not sending an address to the RPC-URL. The error says this:

Failed to parsed an argument in path. After "chains/main/blocks/head/context/contracts/balance"

But the correct path should be this, as example:

chains/main/blocks/head/context/contracts/tz1YH2LE6p7Sj16vF6irfHX92QV45XAZYHnX/balance

So you are missing a key piece of information when fetching the balance, which is the address itself. Check the variable 'address' and make sure it is populated.

| improve this answer | |
  • Yes it has an address: – BigNumber888 Feb 24 at 15:54
  • const address='tz....' const amount=2 taquito.Tezos.importKey(email,password,mnemonic.join(' '),secret) taquito.Tezos.contract.transfer({to: address,amount: amount}) .then(op=>{console.log(op.confirmation)}) .then(block=>{console.log(block)}) .catch(error=>{console.log(JSON.stringify(error))}) – BigNumber888 Feb 24 at 15:55
  • The variable address is a "const address='tz.....'" – BigNumber888 Feb 24 at 16:07
  • Well, again, for whatever reason, the code you have is not putting the address into the URL for the RPC call. I don't use Taquito; I can only tell you that what it is doing is not correct. The address has to be part of the "/balance" URL call. – utdrmac Feb 24 at 18:05

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.