web3dart
web3dart copied to clipboard
Ethereum library, written in Dart.
hello i read your code and can i ask you for one application i can to try implement and dont understand .... i cloned blockchain private and implemented a server...
like js: web3.eth.abi.decodeParameters(['string', 'uint256'], '0x000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000ea000000000000000000000000000000000000000000000000000000000000000848656c6c6f212521000000000000000000000000000000000000000000000000'); > Result { '0': 'Hello!%!', '1': '234' }
code: final hashedPayload = hexToBytes( '9ff86b8a0ac0cf4eda6b379ba9ef340f015c2f9760d42b9e8fa90251e0633b5a'); final privKey = hexToBytes( 'b5efd2c15d04f868f4a924653747f2b4cc4d818fdbb3960fcea10f29dac6215d'); final pkey = privateKeyToPublic(bytesToUnsignedInt(privKey)); final sig = sign(hashedPayload, privKey); final sigbyte = encode_sig(sig); print('sig.r:${HEX.encode(intToBytes(sig.r))},sig.s:${HEX.encode(intToBytes(sig.s))},sig.v:${sig.v},pkey:${HEX.encode(pkey)},sigbyte:${HEX.encode(sigbyte)}'); outout: sig.r:00c4d74f1c1500f134a6312c6f3405d3a98fda0e4deb55bdebf71de6a27a105512,sig.s:69aca52d8f7623a235f09553cd1766599018e7bcba1cb2541ac629109c7e3614,sig.v:27,pkey:8a7620256588ee54d7ee152b76ae7f33d01b7d9fe183993c3be846f0edb4993b4ba5854b5940ed41cab7cb4582361f4858ea4a086634b4ecfd76dd4226d140a1,sigbyte:c4d74f1c1500f134a6312c6f3405d3a98fda0e4deb55bdebf71de6a27a10551269aca52d8f7623a235f09553cd1766599018e7bcba1cb2541ac629109c7e3614 HEX.encode(intToBytes(sig.r)) it should...
When generate file `.g` from `abi.json` const with function name containt `_` in dart `_` is Access Modifiers ( private). I can't call this function from file `.g` in other...
Past events are not returned from an auto-generated .g.dart file function. A generated .g.dart file for a smart contract includes the following `transferEvents` function, which works for live monitoring and...
Hello, I'm using the following method to sign messages: https://github.com/simolus3/web3dart/blob/master/lib/src/credentials/credentials.dart#L51 The method itself works fine and other parties are able to verify signature generated by it. But it's not clear...
final private = EthPrivateKey.fromHex(privakey); final sign =await private.signPersonalMessage(Uint8List.fromList(utf8.encode(message))); final signed =await private.signToSignature(Uint8List.fromList(utf8.encode(message))); var pubKey=bytesToHex(private.publicKey.getEncoded().toList()); bool isV= isValidSignature(Uint8List.fromList(utf8.encode(message)),signed,hexToBytes(pubKey)); final adds= ecRecover(Uint8List.fromList(utf8.encode(message)), signed); print("--验证签名--$isV----恢复数据签名帐户---"+bytesToHex(adds)); print("--publicKey--=----"+pubKey); 验证签名 is. false
Implementing the example on: https://pub.dev/documentation/web3dart/latest/browser/browser-library.html  Is there a way to generate a metamask signature without it looking like a card blanche on Metamask?
I'm trying to learn how web3dart works on Flutter Web and I faced this problem: when I execute this code (with the infura provider): ``` onPressed: () async { Client...
I need to get timestamp from block. ``` BlockNum.current().timestamp ```