Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add documentation on how to sign Michelson data #588

Closed
roxaneletourneau opened this issue Jan 26, 2021 · 0 comments
Closed

Add documentation on how to sign Michelson data #588

roxaneletourneau opened this issue Jan 26, 2021 · 0 comments
Assignees
Labels
documentation Improvements or additions to documentation good first issue Good for newcomers
Milestone

Comments

@roxaneletourneau
Copy link
Collaborator

Add examples/explanations on how to sign Michelson data.

One scenario example will be to start with raw Michelson data, parse it to Michelson JSON, pack it, and then sign:

const data = `(Pair (Pair { Elt 1
                  (Pair (Pair "tz1gjaF81ZRRvdzjobyfVNsAeSC6PScjfQwN" "tz1KqTpEZ7Yob7QbPE4Hy4Wo8fHG8LhKxZSx")
                        0x0501000000026869) }
            10000000)
      (Pair 2 333))`;
const type = `(pair (pair (map int (pair (pair address address) bytes)) int) (pair int int))`;
const p = new Parser()
const dataJSON  = p.parseMichelineExpression(data)
const typeJSON = p.parseMichelineExpression(type)
const pack = await tezos.rpc.packData({ data: dataJSON as MichelsonV1Expression, type: typeJSON as MichelsonV1Expression });
const sign = await tezos.signer.sign(pack.packed);
@Innkst Innkst added the documentation Improvements or additions to documentation label Jan 26, 2021
@Innkst Innkst added this to the v8.1 milestone Feb 2, 2021
@jevonearth jevonearth added the good first issue Good for newcomers label Feb 5, 2021
@Innkst Innkst modified the milestones: v8.1, v8.2 Mar 3, 2021
@Innkst Innkst modified the milestones: v10.2, v10.1 Jul 27, 2021
@Innkst Innkst modified the milestones: v10.2, v11 Sep 29, 2021
@ac10n ac10n moved this to Done in Taquito Dev Jun 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation good first issue Good for newcomers
Projects
Status: Done
Development

No branches or pull requests

4 participants