2

I haven't been able to find example usage of some of the methods available in Sotez, so I've been looking at other implementations and learning as I go. I am currently working on forging a transaction so that it can then be signed and broadcasted. I can't seem to get the Forge method to work, though, and I am thinking it's because I have a problem in my operation object.

let operation = {
    kind: "transaction",
    source: "tz1htPf3VPXrHBTX1E7y3tBteib6hA9Teosj",
    fee: "50000",
    counter: "31204",
    gas_limit: "200",
    storage_limit: "0",
    amount: "100000000",
    destination: "tz3WXYtyDUNL91qfiCJtVUX746QpNv5i5ve5"
}

sotez.rpc.getHead()
    .then(head => {
        sotez.tezos.forge(head, operation)
            .then(result => console.log(result))
    })

Returns TypeError: Expected String

1 Answer 1

2

The operation should look like:

const operation = {
  branch: 'BLDnyGuzjz6TuDvxgBtHUZmvY2zZqJ7VShDjZsHsxXQtnzrCrPf', // current head hash
  contents: [{
    kind: 'transaction',
    source: 'tz1htPf3VPXrHBTX1E7y3tBteib6hA9Teosj',
    fee: '50000',
    counter: '31204',
    gas_limit: '10200',
    storage_limit: '0',
    amount: '100000000',
    destination: 'tz3WXYtyDUNL91qfiCJtVUX746QpNv5i5ve5',
  }],
};

sotez.rpc.getHead()
  .then(head => (
    sotez.tezos.forge(head, operation)
      .then(result => console.log(result))
  ));

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.