Giter Site home page Giter Site logo

Comments (8)

DrasiusMajere avatar DrasiusMajere commented on July 29, 2024 1

Actually send method return the transaction Id as a list of bytes, if you want an hexadecimal id more readable. I found a function that uses web3dart called bytesToHex.
var tranId = bytestoHex(await transaction.prepareForSimpleTransaction( new EthereumAddress("0x[...]"), // your target address EtherAmount.fromUnitAndValue(EtherUnit.finney, 300) ).send(ethClient, chainId: 3));

Maybe it would be recommended divide the code above in smaller parts.

from web3dart.

maxholman avatar maxholman commented on July 29, 2024

@DrasiusMajere Are you using ropsten?

I just submitted PR #16 that will allow you to specify a chainId for transactions. I was getting this same error using infura/ropsten.

from web3dart.

DrasiusMajere avatar DrasiusMajere commented on July 29, 2024

Yes, I'm testing and obviously using ropsten....
Thank you for the support because I'm a newbie in ethereum
But I hope this package will be updated to the solidity 0.5.0

from web3dart.

maxholman avatar maxholman commented on July 29, 2024

The PR will allow you to specify a chainId like this, that should solve the invalid sender error.

transaction.prepareForSimpleTransaction(
  new EthereumAddress("0x[...]"), // your target address 
  EtherAmount.fromUnitAndValue(EtherUnit.finney, 300)
).send(ethClient, chainId: 3);

from web3dart.

DrasiusMajere avatar DrasiusMajere commented on July 29, 2024

It's working.
Now to send a transaction that calls a function that alters state variables is possible.

from web3dart.

ishwarchandratiwari avatar ishwarchandratiwari commented on July 29, 2024

The PR will allow you to specify a chainId like this, that should solve the invalid sender error.

transaction.prepareForSimpleTransaction(
  new EthereumAddress("0x[...]"), // your target address 
  EtherAmount.fromUnitAndValue(EtherUnit.finney, 300)
).send(ethClient, chainId: 3);

i had a same issue invalid sender when sending a transaction,
your snippet worked, but how can i get Transaction id ?

from web3dart.

ishwarchandratiwari avatar ishwarchandratiwari commented on July 29, 2024

Actually send method return the transaction Id as a list of bytes, if you want an hexadecimal id more readable. I found a function that uses web3dart called bytesToHex.
var tranId = bytestoHex(await transaction.prepareForSimpleTransaction( new EthereumAddress("0x[...]"), // your target address EtherAmount.fromUnitAndValue(EtherUnit.finney, 300) ).send(ethClient, chainId: 3));

Maybe it would be recommended divide the code above in smaller parts.

i am getting error
The method 'bytestoHex' isn't defined for the class 'main'.

from web3dart.

DrasiusMajere avatar DrasiusMajere commented on July 29, 2024

import 'package:web3dart/conversions.dart';

What IDE are you using? because you can leave the IDE looks for the appropriate library that contains that function and add the import statements automatically.

from web3dart.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.