GetScatter / scatter-js

Importable JavaScript library that allows web applications to directly interface with Scatter Desktop, Classic and Mobile.
MIT License
262 stars 148 forks source link

desktop response is different from chrome extension #53

Closed edwardfxiao closed 5 years ago

edwardfxiao commented 5 years ago

for example with chrome extension:


const eos = ScatterJS.scatter.eos(network, Eos);
eos.transfer.then((trx) => {
    const trxId = trx.transaction_id
)

with desktop version v9.5.0:

const eos = ScatterJS.scatter.eos(network, Eos);
eos.transfer.then((trx) => {
    // trx becomes 'Proxy'
    console.log(typeof trx.transaction_id) // 'function'
)

image

currently I have to get the id by Object.getOwnPropertyDescriptor(trx, 'transaction_id').value

am I missing something?

nsjames commented 5 years ago

Hmm, is this with the latest version of the plugin-eosjs?

There was a bug in one of the recent versions which was proxying results for various methods instead of pushing them back normally. I can see it's fixed now on scatterjs-plugin-eosjs@1.3.9 though so you might just have to update your package.

edwardfxiao commented 5 years ago

@nsjames awesome. scatterjs-plugin-eosjs@1.3.9 fixed this.

nsjames commented 5 years ago

There's also a 1.3.10 out now which fixed another bug about not propagating the promise catches so you might want to upgrade to that one too.

edwardfxiao commented 5 years ago

@nsjames I'll take a look at it, thanks for the heads-up.