question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

New error [object Object] is not a DecoratedSignature in v1+

See original GitHub issue

Describe the bug I just upgrade to v1.0.2. Now the following code:

transaction.toEnvelope().toXDR('base64')

is throwing this error:

Error: XDR Write Error: [object Object] is not a DecoratedSignature
    at Function.write (webpack:///./node_modules/js-xdr/lib/struct.js?:67:15)
    at eval (webpack:///./node_modules/js-xdr/lib/var-array.js?:78:34)
    at arrayEach (webpack:///./node_modules/js-xdr/node_modules/lodash/_arrayEach.js?:15:9)
    at forEach (webpack:///./node_modules/js-xdr/node_modules/lodash/forEach.js?:38:10)
    at VarArray.write (webpack:///./node_modules/js-xdr/lib/var-array.js?:77:26)
    at eval (webpack:///./node_modules/js-xdr/lib/struct.js?:75:14)
    at arrayEach (webpack:///./node_modules/js-xdr/node_modules/lodash/_arrayEach.js?:15:9)
    at forEach (webpack:///./node_modules/js-xdr/node_modules/lodash/forEach.js?:38:10)
    at Function.write (webpack:///./node_modules/js-xdr/lib/struct.js?:69:26)
    at Function.toXDR (webpack:///./node_modules/js-xdr/lib/io-mixin.js?:26:10)
    at ChildStruct.toXDR (webpack:///./node_modules/js-xdr/lib/io-mixin.js?:63:35)
    at eval (webpack:///./src/app/resources/crud/resources/transaction-resource.js?:37:26)
    at Array.map (<anonymous>)
    at TransactionResource.submitTransaction (webpack:///./src/app/resources/crud/resources/transaction-resource.js?:35:40)
    at TransactionService._callee$ (webpack:///./src/app/resources/stellar/transaction-service/transaction-service.js?:100:85)
    at tryCatch (webpack:///./node_modules/@babel/runtime/node_modules/regenerator-runtime/runtime.js?:45:40)
    at Generator.invoke [as _invoke] (webpack:///./node_modules/@babel/runtime/node_modules/regenerator-runtime/runtime.js?:271:22)
    at Generator.prototype.<computed> [as next] (webpack:///./node_modules/@babel/runtime/node_modules/regenerator-runtime/runtime.js?:97:21)
    at step (webpack:///./src/app/resources/stellar/transaction-service/transaction-service.js?:12:191)
    at eval (webpack:///./src/app/resources/stellar/transaction-service/transaction-service.js?:12:361)
    at tryCatcher (webpack:///./node_modules/bluebird/js/browser/bluebird.js?:5253:23)
    at Promise._settlePromiseFromHandler (webpack:///./node_modules/bluebird/js/browser/bluebird.js?:3275:31)

where it wasn’t before.

What version are you on? 1.0.2

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
joemags-appscommented, Oct 3, 2020

To add on @ryanleecode here is my fix: From

const StellarHDWallet = require('stellar-hd-wallet');
...
const wallet = StellarHDWallet.fromMnemonic(mnemonic)

const key_pair = wallet.getKeypair(index)

To

const StellarHDWallet = require('stellar-hd-wallet');
const { Keypair } = require('stellar-sdk');
...
const wallet = StellarHDWallet.fromMnemonic(mnemonic)
const secret = wallet.getSecret(uid);

const key_pair = Keypair.fromSecret(secret);

Hope it saves someone’s 2 hours 😃

1reaction
ryanleecodecommented, Jul 12, 2019

I just encountered the same problem. The way I fixed it was importing Keypair from stellar-sdk and not stellar-base. I’m guessing the stellar-base library does not sign the transactions as “decorated”

Read more comments on GitHub >

github_iconTop Results From Across the Web

Pass an object with JS throw new Error in node - Stack Overflow
The constructor for an Error object expects a string, not an object (which is why your scheme doesn't work).
Read more >
Error() constructor - JavaScript - MDN Web Docs
The Error() constructor creates an error object. ... Note: Error() can be called with or without new . Both create a new Error...
Read more >
stellar_sdk.transaction_envelope — py-stellar-base 6.1.1 ...
TransactionEnvelope: """Get an XDR object representation of this ... """Create a new :class:`TransactionEnvelope`, if the internal tx is not v1, ...
Read more >
How to Fix in R: object not found - Statology
This tutorial explains how to fix the 'object not found' error in R, including several examples.
Read more >
Error Objects - Intercom Developer Hub
Error Object Attributes. Each Error Object has the following attributes. Field, Description. code, A string indicating the kind of ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found