xclud / web3dart

Ethereum library, written in Dart.
https://pub.dev/packages/web3dart
MIT License
170 stars 94 forks source link

Sending hex of bytes32 instead of Uint8List #122

Open ParhaMDeF opened 9 months ago

ParhaMDeF commented 9 months ago

I have a function in my smart contract that gets bytes32 as input which is the CID of IPFS. The example of CID is: bafybeicxndpeycrra7q7b3hus5m537yiq6u6nztaj3sdtmtobnvtxhxhgm. I should convert this string to bytes32 and then transact the function but it gives me an error that the length of Uint8List must be exactly 32. Is there any way that I can use the hex of byte32 instead of Uint8List like this:

0x6261667962656963786e64706579637272613771376233687573356d3533377969713675366e7a74616a337364746d746f626e767478687868676d