Coder Social home page Coder Social logo

sendtoaddress feature? about neow3j HOT 6 CLOSED

neow3j avatar neow3j commented on June 1, 2024
sendtoaddress feature?

from neow3j.

Comments (6)

gsmachado avatar gsmachado commented on June 1, 2024 1

@pavel-corsaghin thanks for the feature request! Definitely, this would be implemented in the near future.

However, what are you trying to achieve?
If you simply want to send NEO assets from your address to another, and it does not matter where you hold your NEO assets, you can use the raw transaction feature in this project. :-)
If the wallet/address you want to send the assets from is located locked in a NEO node, then, you have two options: 1) either you export the wallet in the WIF format and import it using neow3j; or 2) you can unlock the NEO wallet on the NEO GUI and then use the upcoming sendtoaddress feature as you requested.

from neow3j.

pavel-corsaghin avatar pavel-corsaghin commented on June 1, 2024

Hello @gsmachado, Thank you for reply! I am new in this area so your library very helpful for me. But i have a stupid question, how can i create a raw transaction? I am simply writing an application to send NEO, nep5 tokens and claim GAS from the wallet, I have WIF private key (which created from mnemonic) saved locate in my app and list UTXOs (history transactions) for this address (get from api server). How can I create rawtransaction with your library. Can you create a example for simple transaction instead of "a raw transaction with a 2/3 multisig address". Many thanks and sorry for my english.

from neow3j.

pavel-corsaghin avatar pavel-corsaghin commented on June 1, 2024

i am trying with this:
`
val ecKeyPair = ECKeyPair.create(WIF.getPrivateKeyFromWIF("XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"))
val neoAddress = Keys.getAddress(ecKeyPair)
log("address: $neoAddress")

    val rawTx = RawTransaction.createContractTransaction(
        null, null,
        Arrays.asList(
            RawTransactionInput("9feac4774eb0f01ab5d6817c713144b7c020b98f257c30b1105062d434e6f254", 0)
        ),
        Arrays.asList(
            RawTransactionOutput(0, NEOAsset.HASH_ID, "100.0", "AK2nJJpJr6o664CWJKi1QRXjqeic2zRp8y")
        )
    )
    val rawTxUnsignedArray = rawTx.toArray()
    val rawInvocationScriptList = Arrays.asList(RawInvocationScript(Sign.signMessage(rawTxUnsignedArray, ecKeyPair)))
    rawTx.addScript(rawInvocationScriptList, Keys.getVerificationScriptFromPublicKey(1, ecKeyPair.publicKey))
    val rawTxSignedArray = rawTx.toArray()
    val rawTransactionHexString = Numeric.toHexStringNoPrefix(rawTxSignedArray)
    log("rawTransactionHexString: $rawTransactionHexString" )

`

But i am not sure about list RawTransactionInput. This is list UTXOs (history transactions of sender address)?. What prevHash and prevIndex means?

from neow3j.

gsmachado avatar gsmachado commented on June 1, 2024

@pavel-corsaghin so, release version 1.0.8 includes support to sendtoaddress. :-)

from neow3j.

gsmachado avatar gsmachado commented on June 1, 2024

@pavel-corsaghin just replying to your last message: yes, the RawTransactionInput relates to the unspent amount that you're planning to spend. Then, the prevHash is the hash of the previous unspent transaction (output), and the prevIndex is the index of the previous transaction (also output).

from neow3j.

gsmachado avatar gsmachado commented on June 1, 2024

For now, I'm going to close this issue. Let me know if you have some other issues.
By the way, you are welcome to join NEO Discord and ask neow3j questions on the #java channel.

from neow3j.

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.