Before submitting a new issue
Bug summary
When calling WDKService.getAssetAddress(NetworkType.TRON, 0) to get the TRON gas-free address, the worklet throws a TypeError in the bare-crypto HMAC implementation.
Error
TypeError: Cannot read properties of undefined (reading 'buffer')
at new CryptoHmac (file:///wdk.manager.worklet.bundle/node_modules/bare-crypto/lib/hmac.js:15:11)
at createHmac (file:///wdk.manager.worklet.bundle/node_modules/bare-crypto/index.js:21:10)
at WalletAccountTronGasfree._sendRequestToGasfreeProvider (file:///wdk.manager.worklet.bundle/node_modules/@wdk/wallet-tron-gasfree/src/wallet-account-read-only-tron-gasfree.js:174:23)
at WalletAccountTronGasfree._getGasfreeAccount (file:///wdk.manager.worklet.bundle/node_modules/@wdk/wallet-tron-gasfree/src/wallet-account-read-only-tron-gasfree.js:150:35)
at WalletAccountTronGasfree.getAddress (file:///wdk.manager.worklet.bundle/node_modules/@wdk/wallet-tron-gasfree/src/wallet-account-read-only-tron-gasfree.js:70:43)
at WdkManager.getAbstractedAddress (file:///wdk.manager.worklet.bundle/node_modules/@tetherto/pear-wrk-wdk/src/wdk-core/wdk-manager.js:299:26)
Expected Behavior
Should return the TRON gas-free address object with { address: "T..." }
Actual Behavior
Throws TypeError: Cannot read properties of undefined (reading 'buffer') at bare-crypto/lib/hmac.js:15
Additional Context
- Bitcoin addresses work fine via addresses[NetworkType.SEGWIT] - this code path doesn't use HMAC
- The bug is in the pre-built worklet bundle (wdk.manager.worklet.bundle), not in user-land code
- Attempted upgrading @tetherto/pear-wrk-wdk to beta.5 but install fails due to missing http2 module during gen:mobile-bundle postinstall script
Library version
1.0.0-beta.3
Environment info
- @tetherto/wdk-react-native-provider: 1.0.0-beta.3
- @tetherto/pear-wrk-wdk: 1.0.0-beta.4
- react-native-bare-kit: 0.10.9
- React Native: 0.76.9
- Expo SDK: 52
- Platform: iOS Simulator (arm64)
- Node: 22.x
Steps to reproduce
- Initialize WalletProvider with TronChainConfig including gas-free settings
- Create or unlock a wallet
- Call WDKService.getAssetAddress(NetworkType.TRON, 0)
Reproducible example repository
http://
Before submitting a new issue
Bug summary
When calling WDKService.getAssetAddress(NetworkType.TRON, 0) to get the TRON gas-free address, the worklet throws a TypeError in the bare-crypto HMAC implementation.
Error
TypeError: Cannot read properties of undefined (reading 'buffer')
at new CryptoHmac (file:///wdk.manager.worklet.bundle/node_modules/bare-crypto/lib/hmac.js:15:11)
at createHmac (file:///wdk.manager.worklet.bundle/node_modules/bare-crypto/index.js:21:10)
at WalletAccountTronGasfree._sendRequestToGasfreeProvider (file:///wdk.manager.worklet.bundle/node_modules/@wdk/wallet-tron-gasfree/src/wallet-account-read-only-tron-gasfree.js:174:23)
at WalletAccountTronGasfree._getGasfreeAccount (file:///wdk.manager.worklet.bundle/node_modules/@wdk/wallet-tron-gasfree/src/wallet-account-read-only-tron-gasfree.js:150:35)
at WalletAccountTronGasfree.getAddress (file:///wdk.manager.worklet.bundle/node_modules/@wdk/wallet-tron-gasfree/src/wallet-account-read-only-tron-gasfree.js:70:43)
at WdkManager.getAbstractedAddress (file:///wdk.manager.worklet.bundle/node_modules/@tetherto/pear-wrk-wdk/src/wdk-core/wdk-manager.js:299:26)
Expected Behavior
Should return the TRON gas-free address object with { address: "T..." }
Actual Behavior
Throws TypeError: Cannot read properties of undefined (reading 'buffer') at bare-crypto/lib/hmac.js:15
Additional Context
Library version
1.0.0-beta.3
Environment info
Steps to reproduce
Reproducible example repository
http://