Inject Signed Operation Fails With Unrevealed_Key Error2019 Community Moderator ElectionStuck in “Waiting...

Do commercial flights continue with an engine out?

Can I become debt free or should I file for bankruptcy? How do I manage my debt and finances?

Why does the DC-9-80 have this cusp in its fuselage?

How can I improve my fireworks photography?

On what did Lego base the appearance of the new Hogwarts minifigs?

Can a person refuse a presidential pardon?

Could quantum mechanics be necessary to analyze some biology scenarios?

Eww, those bytes are gross

What happens if a wizard reaches level 20 but has no 3rd-level spells that they can use with the Signature Spells feature?

Why zero tolerance on nudity in space?

It took me a lot of time to make this, pls like. (YouTube Comments #1)

Proof by Induction - New to proofs

Has the Isbell–Freyd criterion ever been used to check that a category is concretisable?

I am on the US no-fly list. What can I do in order to be allowed on flights which go through US airspace?

How can I mix up weapons for large groups of similar monsters/characters?

Finding the number of integers that are a square and a cube at the same time

Where was Karl Mordo in Infinity War?

Using AWS Fargate as web server

Why is working on the same position for more than 15 years not a red flag?

Called into a meeting and told we are being made redundant (laid off) and "not to share outside". Can I tell my partner?

Am I using the wrong word all along?

What can I substitute for soda pop in a sweet pork recipe?

Is it a fallacy if someone claims they need an explanation for every word of your argument to the point where they don't understand common terms?

raspberry pi change directory (cd) command not working with USB drive



Inject Signed Operation Fails With Unrevealed_Key Error



2019 Community Moderator ElectionStuck in “Waiting for the operation to be included…” InfinitelyFees for various operationHow do I use RPC to get operation through hashWhy a reveal operation?Is it possible to have a transaction operation in any operation's “contents”?Sotez Forge Method Returns “Type Error: Expected String”












1















I've learned a lot today, and I couldn't have gotten this far so quickly without this StackExchange. I've almost got sending worked out, but I can't for the life of me figure out why this is failing at the point of injection with a "unrevealed_key" error.



I am aware that I should decode the forged transaction and reverify the values to ensure the remote node hasn't tried to change my transaction, but I removed that bit from this post for the sake of simplicity.



const send = (from, to, amount, sk) => {

sotez.rpc.getHead()
.then(head => {
const operation = {
branch: head.hash,
contents: [{
kind: 'transaction',
source: from,
fee: '50000',
counter: '31204',
gas_limit: '10200',
storage_limit: '0',
amount: amount,
destination: to,
}],
}

sotez.tezos.forge(head, operation)
.then(unsigned => {
const binary = unsigned.opbytes

sotez.crypto.sign(binary, sk, '0x03')
.then(signed => {
operation.signature = signed.edsig

sotez.rpc.inject(operation, signed.sbytes)
.then(result => {
console.log(result)
})
})
})
})
}

send('tz1htPf3VPXrHBTX1E7y3tBteib6hA9Teosj', 'tz3WXYtyDUNL91qfiCJtVUX746QpNv5i5ve5', '1000000', 'edskS6KrT1G365PsuQiMVvPgZCS1CKTC5EFc7N...')


Returns: [{"kind":"branch","id":"proto.003-PsddFKi3.contract.unrevealed_key","contract":"tz1htPf3VPXrHBTX1E7y3tBteib6hA9Teosj"}]



Edit:
So I need to reveal this account first. I modified my send method to check if the account has been revealed before, and if not then add the revealing to the list of operations. Now I get {"kind":"permanent","id":"proto.003-PsddFKi3.operation.invalid_signature"}.



const send = (from, to, amount, keys, revealed) => {

tezos.rpc.getHead()
.then(head => {
const operation = {
branch: head.hash,
contents: [{
kind: 'transaction',
source: from,
fee: '50000',
counter: '31205',
gas_limit: '10200',
storage_limit: '0',
amount: amount,
destination: to
}],
}

if (!revealed) {
operation.contents.unshift({
kind: 'reveal',
fee: '1269',
counter: '31204',
public_key: keys.pk,
source: from,
gas_limit: '10000',
storage_limit: '0',
})
}

tezos.tezos.forge(head, operation)
.then(unsigned => {
const binary = unsigned.opbytes

tezos.crypto.sign(binary, keys.sk, '0x03')
.then(signed => {
operation.signature = signed.edsig

tezos.rpc.inject(operation, signed.sbytes)
.then(result => {
console.log(result)
})
})
})
})
}

send('tz1htPf3VPXrHBTX1E7y3tBteib6hA9Teosj', 'tz3WXYtyDUNL91qfiCJtVUX746QpNv5i5ve5', '1000000', keys, false)


Edit2:
This worked, using sendOperation



const send = (from, to, amount, keys) => {

sotez.rpc.getHead()
.then(head => {
const operation = {
kind: 'transaction',
source: from,
fee: '50000',
gas_limit: '10200',
storage_limit: '0',
amount: amount,
destination: to
}

const params = {
from,
operation,
keys
}

sotez.rpc.sendOperation({from, operation, keys})
.then(result => {
console.log(result)
})
})
}

send('tz1htPf3VPXrHBTX1E7y3tBteib6hA9Teosj', 'tz3WXYtyDUNL91qfiCJtVUX746QpNv5i5ve5', '1000000', keys)









share|improve this question









New contributor




Michael Rodriguez is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.

























    1















    I've learned a lot today, and I couldn't have gotten this far so quickly without this StackExchange. I've almost got sending worked out, but I can't for the life of me figure out why this is failing at the point of injection with a "unrevealed_key" error.



    I am aware that I should decode the forged transaction and reverify the values to ensure the remote node hasn't tried to change my transaction, but I removed that bit from this post for the sake of simplicity.



    const send = (from, to, amount, sk) => {

    sotez.rpc.getHead()
    .then(head => {
    const operation = {
    branch: head.hash,
    contents: [{
    kind: 'transaction',
    source: from,
    fee: '50000',
    counter: '31204',
    gas_limit: '10200',
    storage_limit: '0',
    amount: amount,
    destination: to,
    }],
    }

    sotez.tezos.forge(head, operation)
    .then(unsigned => {
    const binary = unsigned.opbytes

    sotez.crypto.sign(binary, sk, '0x03')
    .then(signed => {
    operation.signature = signed.edsig

    sotez.rpc.inject(operation, signed.sbytes)
    .then(result => {
    console.log(result)
    })
    })
    })
    })
    }

    send('tz1htPf3VPXrHBTX1E7y3tBteib6hA9Teosj', 'tz3WXYtyDUNL91qfiCJtVUX746QpNv5i5ve5', '1000000', 'edskS6KrT1G365PsuQiMVvPgZCS1CKTC5EFc7N...')


    Returns: [{"kind":"branch","id":"proto.003-PsddFKi3.contract.unrevealed_key","contract":"tz1htPf3VPXrHBTX1E7y3tBteib6hA9Teosj"}]



    Edit:
    So I need to reveal this account first. I modified my send method to check if the account has been revealed before, and if not then add the revealing to the list of operations. Now I get {"kind":"permanent","id":"proto.003-PsddFKi3.operation.invalid_signature"}.



    const send = (from, to, amount, keys, revealed) => {

    tezos.rpc.getHead()
    .then(head => {
    const operation = {
    branch: head.hash,
    contents: [{
    kind: 'transaction',
    source: from,
    fee: '50000',
    counter: '31205',
    gas_limit: '10200',
    storage_limit: '0',
    amount: amount,
    destination: to
    }],
    }

    if (!revealed) {
    operation.contents.unshift({
    kind: 'reveal',
    fee: '1269',
    counter: '31204',
    public_key: keys.pk,
    source: from,
    gas_limit: '10000',
    storage_limit: '0',
    })
    }

    tezos.tezos.forge(head, operation)
    .then(unsigned => {
    const binary = unsigned.opbytes

    tezos.crypto.sign(binary, keys.sk, '0x03')
    .then(signed => {
    operation.signature = signed.edsig

    tezos.rpc.inject(operation, signed.sbytes)
    .then(result => {
    console.log(result)
    })
    })
    })
    })
    }

    send('tz1htPf3VPXrHBTX1E7y3tBteib6hA9Teosj', 'tz3WXYtyDUNL91qfiCJtVUX746QpNv5i5ve5', '1000000', keys, false)


    Edit2:
    This worked, using sendOperation



    const send = (from, to, amount, keys) => {

    sotez.rpc.getHead()
    .then(head => {
    const operation = {
    kind: 'transaction',
    source: from,
    fee: '50000',
    gas_limit: '10200',
    storage_limit: '0',
    amount: amount,
    destination: to
    }

    const params = {
    from,
    operation,
    keys
    }

    sotez.rpc.sendOperation({from, operation, keys})
    .then(result => {
    console.log(result)
    })
    })
    }

    send('tz1htPf3VPXrHBTX1E7y3tBteib6hA9Teosj', 'tz3WXYtyDUNL91qfiCJtVUX746QpNv5i5ve5', '1000000', keys)









    share|improve this question









    New contributor




    Michael Rodriguez is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
    Check out our Code of Conduct.























      1












      1








      1








      I've learned a lot today, and I couldn't have gotten this far so quickly without this StackExchange. I've almost got sending worked out, but I can't for the life of me figure out why this is failing at the point of injection with a "unrevealed_key" error.



      I am aware that I should decode the forged transaction and reverify the values to ensure the remote node hasn't tried to change my transaction, but I removed that bit from this post for the sake of simplicity.



      const send = (from, to, amount, sk) => {

      sotez.rpc.getHead()
      .then(head => {
      const operation = {
      branch: head.hash,
      contents: [{
      kind: 'transaction',
      source: from,
      fee: '50000',
      counter: '31204',
      gas_limit: '10200',
      storage_limit: '0',
      amount: amount,
      destination: to,
      }],
      }

      sotez.tezos.forge(head, operation)
      .then(unsigned => {
      const binary = unsigned.opbytes

      sotez.crypto.sign(binary, sk, '0x03')
      .then(signed => {
      operation.signature = signed.edsig

      sotez.rpc.inject(operation, signed.sbytes)
      .then(result => {
      console.log(result)
      })
      })
      })
      })
      }

      send('tz1htPf3VPXrHBTX1E7y3tBteib6hA9Teosj', 'tz3WXYtyDUNL91qfiCJtVUX746QpNv5i5ve5', '1000000', 'edskS6KrT1G365PsuQiMVvPgZCS1CKTC5EFc7N...')


      Returns: [{"kind":"branch","id":"proto.003-PsddFKi3.contract.unrevealed_key","contract":"tz1htPf3VPXrHBTX1E7y3tBteib6hA9Teosj"}]



      Edit:
      So I need to reveal this account first. I modified my send method to check if the account has been revealed before, and if not then add the revealing to the list of operations. Now I get {"kind":"permanent","id":"proto.003-PsddFKi3.operation.invalid_signature"}.



      const send = (from, to, amount, keys, revealed) => {

      tezos.rpc.getHead()
      .then(head => {
      const operation = {
      branch: head.hash,
      contents: [{
      kind: 'transaction',
      source: from,
      fee: '50000',
      counter: '31205',
      gas_limit: '10200',
      storage_limit: '0',
      amount: amount,
      destination: to
      }],
      }

      if (!revealed) {
      operation.contents.unshift({
      kind: 'reveal',
      fee: '1269',
      counter: '31204',
      public_key: keys.pk,
      source: from,
      gas_limit: '10000',
      storage_limit: '0',
      })
      }

      tezos.tezos.forge(head, operation)
      .then(unsigned => {
      const binary = unsigned.opbytes

      tezos.crypto.sign(binary, keys.sk, '0x03')
      .then(signed => {
      operation.signature = signed.edsig

      tezos.rpc.inject(operation, signed.sbytes)
      .then(result => {
      console.log(result)
      })
      })
      })
      })
      }

      send('tz1htPf3VPXrHBTX1E7y3tBteib6hA9Teosj', 'tz3WXYtyDUNL91qfiCJtVUX746QpNv5i5ve5', '1000000', keys, false)


      Edit2:
      This worked, using sendOperation



      const send = (from, to, amount, keys) => {

      sotez.rpc.getHead()
      .then(head => {
      const operation = {
      kind: 'transaction',
      source: from,
      fee: '50000',
      gas_limit: '10200',
      storage_limit: '0',
      amount: amount,
      destination: to
      }

      const params = {
      from,
      operation,
      keys
      }

      sotez.rpc.sendOperation({from, operation, keys})
      .then(result => {
      console.log(result)
      })
      })
      }

      send('tz1htPf3VPXrHBTX1E7y3tBteib6hA9Teosj', 'tz3WXYtyDUNL91qfiCJtVUX746QpNv5i5ve5', '1000000', keys)









      share|improve this question









      New contributor




      Michael Rodriguez is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.












      I've learned a lot today, and I couldn't have gotten this far so quickly without this StackExchange. I've almost got sending worked out, but I can't for the life of me figure out why this is failing at the point of injection with a "unrevealed_key" error.



      I am aware that I should decode the forged transaction and reverify the values to ensure the remote node hasn't tried to change my transaction, but I removed that bit from this post for the sake of simplicity.



      const send = (from, to, amount, sk) => {

      sotez.rpc.getHead()
      .then(head => {
      const operation = {
      branch: head.hash,
      contents: [{
      kind: 'transaction',
      source: from,
      fee: '50000',
      counter: '31204',
      gas_limit: '10200',
      storage_limit: '0',
      amount: amount,
      destination: to,
      }],
      }

      sotez.tezos.forge(head, operation)
      .then(unsigned => {
      const binary = unsigned.opbytes

      sotez.crypto.sign(binary, sk, '0x03')
      .then(signed => {
      operation.signature = signed.edsig

      sotez.rpc.inject(operation, signed.sbytes)
      .then(result => {
      console.log(result)
      })
      })
      })
      })
      }

      send('tz1htPf3VPXrHBTX1E7y3tBteib6hA9Teosj', 'tz3WXYtyDUNL91qfiCJtVUX746QpNv5i5ve5', '1000000', 'edskS6KrT1G365PsuQiMVvPgZCS1CKTC5EFc7N...')


      Returns: [{"kind":"branch","id":"proto.003-PsddFKi3.contract.unrevealed_key","contract":"tz1htPf3VPXrHBTX1E7y3tBteib6hA9Teosj"}]



      Edit:
      So I need to reveal this account first. I modified my send method to check if the account has been revealed before, and if not then add the revealing to the list of operations. Now I get {"kind":"permanent","id":"proto.003-PsddFKi3.operation.invalid_signature"}.



      const send = (from, to, amount, keys, revealed) => {

      tezos.rpc.getHead()
      .then(head => {
      const operation = {
      branch: head.hash,
      contents: [{
      kind: 'transaction',
      source: from,
      fee: '50000',
      counter: '31205',
      gas_limit: '10200',
      storage_limit: '0',
      amount: amount,
      destination: to
      }],
      }

      if (!revealed) {
      operation.contents.unshift({
      kind: 'reveal',
      fee: '1269',
      counter: '31204',
      public_key: keys.pk,
      source: from,
      gas_limit: '10000',
      storage_limit: '0',
      })
      }

      tezos.tezos.forge(head, operation)
      .then(unsigned => {
      const binary = unsigned.opbytes

      tezos.crypto.sign(binary, keys.sk, '0x03')
      .then(signed => {
      operation.signature = signed.edsig

      tezos.rpc.inject(operation, signed.sbytes)
      .then(result => {
      console.log(result)
      })
      })
      })
      })
      }

      send('tz1htPf3VPXrHBTX1E7y3tBteib6hA9Teosj', 'tz3WXYtyDUNL91qfiCJtVUX746QpNv5i5ve5', '1000000', keys, false)


      Edit2:
      This worked, using sendOperation



      const send = (from, to, amount, keys) => {

      sotez.rpc.getHead()
      .then(head => {
      const operation = {
      kind: 'transaction',
      source: from,
      fee: '50000',
      gas_limit: '10200',
      storage_limit: '0',
      amount: amount,
      destination: to
      }

      const params = {
      from,
      operation,
      keys
      }

      sotez.rpc.sendOperation({from, operation, keys})
      .then(result => {
      console.log(result)
      })
      })
      }

      send('tz1htPf3VPXrHBTX1E7y3tBteib6hA9Teosj', 'tz3WXYtyDUNL91qfiCJtVUX746QpNv5i5ve5', '1000000', keys)






      operation






      share|improve this question









      New contributor




      Michael Rodriguez is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.











      share|improve this question









      New contributor




      Michael Rodriguez is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.









      share|improve this question




      share|improve this question








      edited 4 hours ago







      Michael Rodriguez













      New contributor




      Michael Rodriguez is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.









      asked 5 hours ago









      Michael RodriguezMichael Rodriguez

      325




      325




      New contributor




      Michael Rodriguez is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.





      New contributor





      Michael Rodriguez is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.






      Michael Rodriguez is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.






















          1 Answer
          1






          active

          oldest

          votes


















          2














          Before sending transactions from an account, a 'reveal' operation must be made for the account. It looks like this account may have been activated, but not yet revealed. To make this work we would need to include the reveal operation in the list of operations:



          sotez.rpc.getHead()
          .then(head => {
          const operation = {
          branch: head.hash,
          contents: [
          {
          kind: 'reveal',
          fee: '1269',
          counter: '31204',
          public_key: keys.pk,
          source: from,
          gas_limit: '10000',
          storage_limit: '0',
          },
          {
          kind: 'transaction',
          source: from,
          fee: '50000',
          counter: '31205',
          gas_limit: '10200',
          storage_limit: '0',
          amount: amount,
          destination: to,
          }
          ],
          }
          ...
          })


          After the account has been revealed, the reveal is not needed to be included in the operations thereafter.



          SendOperation Answer:



          const send = (from, to, amount, keys) => {
          const operation = {
          kind: 'transaction',
          source: from,
          fee: '50000',
          gas_limit: '10200',
          storage_limit: '0',
          amount: `${amount}`,
          destination: to,
          };

          rpc.sendOperation({ from, operation, keys })
          .then(result => console.log(result));
          };





          share|improve this answer










          New contributor




          AKISH is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
          Check out our Code of Conduct.





















          • Thanks! I edited my question with the reveal operation added. When I run it now, it just hangs with no result or error.

            – Michael Rodriguez
            5 hours ago











          • Ah nevermind, it was because of the counter increment. I noticed your edit and fixed it in my method. Oddly, though, now I'm getting this error: {"kind":"permanent","id":"proto.003-PsddFKi3.operation.invalid_signature"}

            – Michael Rodriguez
            5 hours ago











          • Have you tried the same transfer using rpc.sendOperation? sendOperation should handle whether the transaction needs a reveal and all the counters for the operations.

            – AKISH
            4 hours ago






          • 1





            I'll have to see what is making the responses hang, bit I think I tried one of your examples from earlier and noticed that the amount key wasn't being handled correctly in sotez (was supposed to be coerced into a string). If you try your sendOperation and make the amount a string, as well as adding a fee, gas_limit, and storage_limit that may work.

            – AKISH
            4 hours ago








          • 1





            I just remembered that sendOperation takes a params object containing the from, the operation, and the keys. I've updated my question, and it worked!

            – Michael Rodriguez
            4 hours ago











          Your Answer








          StackExchange.ready(function() {
          var channelOptions = {
          tags: "".split(" "),
          id: "698"
          };
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function() {
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled) {
          StackExchange.using("snippets", function() {
          createEditor();
          });
          }
          else {
          createEditor();
          }
          });

          function createEditor() {
          StackExchange.prepareEditor({
          heartbeatType: 'answer',
          autoActivateHeartbeat: false,
          convertImagesToLinks: false,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: null,
          bindNavPrevention: true,
          postfix: "",
          imageUploader: {
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          },
          noCode: true, onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          });


          }
          });






          Michael Rodriguez is a new contributor. Be nice, and check out our Code of Conduct.










          draft saved

          draft discarded


















          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftezos.stackexchange.com%2fquestions%2f670%2finject-signed-operation-fails-with-unrevealed-key-error%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown

























          1 Answer
          1






          active

          oldest

          votes








          1 Answer
          1






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes









          2














          Before sending transactions from an account, a 'reveal' operation must be made for the account. It looks like this account may have been activated, but not yet revealed. To make this work we would need to include the reveal operation in the list of operations:



          sotez.rpc.getHead()
          .then(head => {
          const operation = {
          branch: head.hash,
          contents: [
          {
          kind: 'reveal',
          fee: '1269',
          counter: '31204',
          public_key: keys.pk,
          source: from,
          gas_limit: '10000',
          storage_limit: '0',
          },
          {
          kind: 'transaction',
          source: from,
          fee: '50000',
          counter: '31205',
          gas_limit: '10200',
          storage_limit: '0',
          amount: amount,
          destination: to,
          }
          ],
          }
          ...
          })


          After the account has been revealed, the reveal is not needed to be included in the operations thereafter.



          SendOperation Answer:



          const send = (from, to, amount, keys) => {
          const operation = {
          kind: 'transaction',
          source: from,
          fee: '50000',
          gas_limit: '10200',
          storage_limit: '0',
          amount: `${amount}`,
          destination: to,
          };

          rpc.sendOperation({ from, operation, keys })
          .then(result => console.log(result));
          };





          share|improve this answer










          New contributor




          AKISH is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
          Check out our Code of Conduct.





















          • Thanks! I edited my question with the reveal operation added. When I run it now, it just hangs with no result or error.

            – Michael Rodriguez
            5 hours ago











          • Ah nevermind, it was because of the counter increment. I noticed your edit and fixed it in my method. Oddly, though, now I'm getting this error: {"kind":"permanent","id":"proto.003-PsddFKi3.operation.invalid_signature"}

            – Michael Rodriguez
            5 hours ago











          • Have you tried the same transfer using rpc.sendOperation? sendOperation should handle whether the transaction needs a reveal and all the counters for the operations.

            – AKISH
            4 hours ago






          • 1





            I'll have to see what is making the responses hang, bit I think I tried one of your examples from earlier and noticed that the amount key wasn't being handled correctly in sotez (was supposed to be coerced into a string). If you try your sendOperation and make the amount a string, as well as adding a fee, gas_limit, and storage_limit that may work.

            – AKISH
            4 hours ago








          • 1





            I just remembered that sendOperation takes a params object containing the from, the operation, and the keys. I've updated my question, and it worked!

            – Michael Rodriguez
            4 hours ago
















          2














          Before sending transactions from an account, a 'reveal' operation must be made for the account. It looks like this account may have been activated, but not yet revealed. To make this work we would need to include the reveal operation in the list of operations:



          sotez.rpc.getHead()
          .then(head => {
          const operation = {
          branch: head.hash,
          contents: [
          {
          kind: 'reveal',
          fee: '1269',
          counter: '31204',
          public_key: keys.pk,
          source: from,
          gas_limit: '10000',
          storage_limit: '0',
          },
          {
          kind: 'transaction',
          source: from,
          fee: '50000',
          counter: '31205',
          gas_limit: '10200',
          storage_limit: '0',
          amount: amount,
          destination: to,
          }
          ],
          }
          ...
          })


          After the account has been revealed, the reveal is not needed to be included in the operations thereafter.



          SendOperation Answer:



          const send = (from, to, amount, keys) => {
          const operation = {
          kind: 'transaction',
          source: from,
          fee: '50000',
          gas_limit: '10200',
          storage_limit: '0',
          amount: `${amount}`,
          destination: to,
          };

          rpc.sendOperation({ from, operation, keys })
          .then(result => console.log(result));
          };





          share|improve this answer










          New contributor




          AKISH is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
          Check out our Code of Conduct.





















          • Thanks! I edited my question with the reveal operation added. When I run it now, it just hangs with no result or error.

            – Michael Rodriguez
            5 hours ago











          • Ah nevermind, it was because of the counter increment. I noticed your edit and fixed it in my method. Oddly, though, now I'm getting this error: {"kind":"permanent","id":"proto.003-PsddFKi3.operation.invalid_signature"}

            – Michael Rodriguez
            5 hours ago











          • Have you tried the same transfer using rpc.sendOperation? sendOperation should handle whether the transaction needs a reveal and all the counters for the operations.

            – AKISH
            4 hours ago






          • 1





            I'll have to see what is making the responses hang, bit I think I tried one of your examples from earlier and noticed that the amount key wasn't being handled correctly in sotez (was supposed to be coerced into a string). If you try your sendOperation and make the amount a string, as well as adding a fee, gas_limit, and storage_limit that may work.

            – AKISH
            4 hours ago








          • 1





            I just remembered that sendOperation takes a params object containing the from, the operation, and the keys. I've updated my question, and it worked!

            – Michael Rodriguez
            4 hours ago














          2












          2








          2







          Before sending transactions from an account, a 'reveal' operation must be made for the account. It looks like this account may have been activated, but not yet revealed. To make this work we would need to include the reveal operation in the list of operations:



          sotez.rpc.getHead()
          .then(head => {
          const operation = {
          branch: head.hash,
          contents: [
          {
          kind: 'reveal',
          fee: '1269',
          counter: '31204',
          public_key: keys.pk,
          source: from,
          gas_limit: '10000',
          storage_limit: '0',
          },
          {
          kind: 'transaction',
          source: from,
          fee: '50000',
          counter: '31205',
          gas_limit: '10200',
          storage_limit: '0',
          amount: amount,
          destination: to,
          }
          ],
          }
          ...
          })


          After the account has been revealed, the reveal is not needed to be included in the operations thereafter.



          SendOperation Answer:



          const send = (from, to, amount, keys) => {
          const operation = {
          kind: 'transaction',
          source: from,
          fee: '50000',
          gas_limit: '10200',
          storage_limit: '0',
          amount: `${amount}`,
          destination: to,
          };

          rpc.sendOperation({ from, operation, keys })
          .then(result => console.log(result));
          };





          share|improve this answer










          New contributor




          AKISH is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
          Check out our Code of Conduct.










          Before sending transactions from an account, a 'reveal' operation must be made for the account. It looks like this account may have been activated, but not yet revealed. To make this work we would need to include the reveal operation in the list of operations:



          sotez.rpc.getHead()
          .then(head => {
          const operation = {
          branch: head.hash,
          contents: [
          {
          kind: 'reveal',
          fee: '1269',
          counter: '31204',
          public_key: keys.pk,
          source: from,
          gas_limit: '10000',
          storage_limit: '0',
          },
          {
          kind: 'transaction',
          source: from,
          fee: '50000',
          counter: '31205',
          gas_limit: '10200',
          storage_limit: '0',
          amount: amount,
          destination: to,
          }
          ],
          }
          ...
          })


          After the account has been revealed, the reveal is not needed to be included in the operations thereafter.



          SendOperation Answer:



          const send = (from, to, amount, keys) => {
          const operation = {
          kind: 'transaction',
          source: from,
          fee: '50000',
          gas_limit: '10200',
          storage_limit: '0',
          amount: `${amount}`,
          destination: to,
          };

          rpc.sendOperation({ from, operation, keys })
          .then(result => console.log(result));
          };






          share|improve this answer










          New contributor




          AKISH is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
          Check out our Code of Conduct.









          share|improve this answer



          share|improve this answer








          edited 4 hours ago





















          New contributor




          AKISH is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
          Check out our Code of Conduct.









          answered 5 hours ago









          AKISHAKISH

          1863




          1863




          New contributor




          AKISH is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
          Check out our Code of Conduct.





          New contributor





          AKISH is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
          Check out our Code of Conduct.






          AKISH is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
          Check out our Code of Conduct.













          • Thanks! I edited my question with the reveal operation added. When I run it now, it just hangs with no result or error.

            – Michael Rodriguez
            5 hours ago











          • Ah nevermind, it was because of the counter increment. I noticed your edit and fixed it in my method. Oddly, though, now I'm getting this error: {"kind":"permanent","id":"proto.003-PsddFKi3.operation.invalid_signature"}

            – Michael Rodriguez
            5 hours ago











          • Have you tried the same transfer using rpc.sendOperation? sendOperation should handle whether the transaction needs a reveal and all the counters for the operations.

            – AKISH
            4 hours ago






          • 1





            I'll have to see what is making the responses hang, bit I think I tried one of your examples from earlier and noticed that the amount key wasn't being handled correctly in sotez (was supposed to be coerced into a string). If you try your sendOperation and make the amount a string, as well as adding a fee, gas_limit, and storage_limit that may work.

            – AKISH
            4 hours ago








          • 1





            I just remembered that sendOperation takes a params object containing the from, the operation, and the keys. I've updated my question, and it worked!

            – Michael Rodriguez
            4 hours ago



















          • Thanks! I edited my question with the reveal operation added. When I run it now, it just hangs with no result or error.

            – Michael Rodriguez
            5 hours ago











          • Ah nevermind, it was because of the counter increment. I noticed your edit and fixed it in my method. Oddly, though, now I'm getting this error: {"kind":"permanent","id":"proto.003-PsddFKi3.operation.invalid_signature"}

            – Michael Rodriguez
            5 hours ago











          • Have you tried the same transfer using rpc.sendOperation? sendOperation should handle whether the transaction needs a reveal and all the counters for the operations.

            – AKISH
            4 hours ago






          • 1





            I'll have to see what is making the responses hang, bit I think I tried one of your examples from earlier and noticed that the amount key wasn't being handled correctly in sotez (was supposed to be coerced into a string). If you try your sendOperation and make the amount a string, as well as adding a fee, gas_limit, and storage_limit that may work.

            – AKISH
            4 hours ago








          • 1





            I just remembered that sendOperation takes a params object containing the from, the operation, and the keys. I've updated my question, and it worked!

            – Michael Rodriguez
            4 hours ago

















          Thanks! I edited my question with the reveal operation added. When I run it now, it just hangs with no result or error.

          – Michael Rodriguez
          5 hours ago





          Thanks! I edited my question with the reveal operation added. When I run it now, it just hangs with no result or error.

          – Michael Rodriguez
          5 hours ago













          Ah nevermind, it was because of the counter increment. I noticed your edit and fixed it in my method. Oddly, though, now I'm getting this error: {"kind":"permanent","id":"proto.003-PsddFKi3.operation.invalid_signature"}

          – Michael Rodriguez
          5 hours ago





          Ah nevermind, it was because of the counter increment. I noticed your edit and fixed it in my method. Oddly, though, now I'm getting this error: {"kind":"permanent","id":"proto.003-PsddFKi3.operation.invalid_signature"}

          – Michael Rodriguez
          5 hours ago













          Have you tried the same transfer using rpc.sendOperation? sendOperation should handle whether the transaction needs a reveal and all the counters for the operations.

          – AKISH
          4 hours ago





          Have you tried the same transfer using rpc.sendOperation? sendOperation should handle whether the transaction needs a reveal and all the counters for the operations.

          – AKISH
          4 hours ago




          1




          1





          I'll have to see what is making the responses hang, bit I think I tried one of your examples from earlier and noticed that the amount key wasn't being handled correctly in sotez (was supposed to be coerced into a string). If you try your sendOperation and make the amount a string, as well as adding a fee, gas_limit, and storage_limit that may work.

          – AKISH
          4 hours ago







          I'll have to see what is making the responses hang, bit I think I tried one of your examples from earlier and noticed that the amount key wasn't being handled correctly in sotez (was supposed to be coerced into a string). If you try your sendOperation and make the amount a string, as well as adding a fee, gas_limit, and storage_limit that may work.

          – AKISH
          4 hours ago






          1




          1





          I just remembered that sendOperation takes a params object containing the from, the operation, and the keys. I've updated my question, and it worked!

          – Michael Rodriguez
          4 hours ago





          I just remembered that sendOperation takes a params object containing the from, the operation, and the keys. I've updated my question, and it worked!

          – Michael Rodriguez
          4 hours ago










          Michael Rodriguez is a new contributor. Be nice, and check out our Code of Conduct.










          draft saved

          draft discarded


















          Michael Rodriguez is a new contributor. Be nice, and check out our Code of Conduct.













          Michael Rodriguez is a new contributor. Be nice, and check out our Code of Conduct.












          Michael Rodriguez is a new contributor. Be nice, and check out our Code of Conduct.
















          Thanks for contributing an answer to Tezos Stack Exchange!


          • Please be sure to answer the question. Provide details and share your research!

          But avoid



          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.


          To learn more, see our tips on writing great answers.




          draft saved


          draft discarded














          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftezos.stackexchange.com%2fquestions%2f670%2finject-signed-operation-fails-with-unrevealed-key-error%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown





















































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown

































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown







          Popular posts from this blog

          Why not use the yoke to control yaw, as well as pitch and roll? Announcing the arrival of...

          Couldn't open a raw socket. Error: Permission denied (13) (nmap)Is it possible to run networking commands...

          VNC viewer RFB protocol error: bad desktop size 0x0I Cannot Type the Key 'd' (lowercase) in VNC Viewer...