aeternity / aepp-sdk-js

JavaScript SDK for the æternity blockchain
http://docs.aeternity.com/aepp-sdk-js/
ISC License
120 stars 59 forks source link

SDK13 and 14 have issues with decoding addresses in react #2029

Closed kenodressel closed 1 day ago

kenodressel commented 2 weeks ago

Describe the bug

When running a contract call (static or stateful) where the parameter or return value is an address the following error is produced:

base58check.js:19 Uncaught (in promise) TypeError: Cannot read properties of undefined (reading 'decode')
    at Object.decode (base58check.js:19:1)
    at ApiEncoder.decode (ApiEncoder.js:79:1)
    at ApiEncoder.decodeWithType (ApiEncoder.js:106:1)
    at InternalMapper.toAddress (InternalMapper.js:39:1)
    at InternalMapper.toInternal (InternalMapper.js:20:1)
    at ExternalDataFactory.create (ExternalDataFactory.js:12:1)
    at CompositeDataFactory.js:36:1
    at Array.map (<anonymous>)
    at ExternalDataFactory.createMultiple (CompositeDataFactory.js:36:1)
    at CallDataFactory.create (CallDataFactory.js:19:1)

To Reproduce

https://github.com/kenodressel/sdk-react-issue

Expected behavior

I would love to do any contract call.

Please tell us about your environment:

CC: @thepiwo @yusufseyrek

davidyuk commented 2 weeks ago

should be fixed by https://github.com/aeternity/aepp-calldata-js/pull/296 related issue https://github.com/facebook/create-react-app/issues/12700

yusufseyrek commented 2 days ago

When should we expect this to be fixed?

davidyuk commented 1 day ago

It works with the new release of calldata In the above reproduction I did npm i @aeternity/aepp-calldata@1.9.0 and it worked after that