Coder Social home page Coder Social logo

neow3j / neow3j Goto Github PK

View Code? Open in Web Editor NEW
136.0 8.0 27.0 9.8 MB

Java/Kotlin/Android Development Toolkit for the Neo Blockchain

Home Page: https://neow3j.io

License: Apache License 2.0

Java 99.98% C# 0.02%
neo neo-blockchain java wallet transaction java-library blockchain raw-transaction kotlin scala

neow3j's Introduction

neow3j Actions Status Maven Central Sonatype Nexus (Snapshots) javadoc codecov Codacy Badge

neow3j: A Java/Kotlin/Android Development Toolkit for the Neo Blockchain

Bongo Cat Neow3j

Neow3j is a development toolkit that provides easy and reliable tools to build Neo dApps and Smart Contracts using the Java platform (Java, Kotlin, Android). It is an open-source project developed by the community and maintained by AxLabs.

Visit neow3j.io for more information and technical documentation.

1ClickNode Logo If you are in need of a testnet or mainnet Neo node for your dApp but don't want to spend hours on setup, check out 1ClickNode.

Quickstart

Neow3j is composed of an SDK for dApp development and a devpack for smart contract development -- which also includes a compiler (JVM to NeoVM). The following sections describe how to get started with them! ๐Ÿš€

SDK

To make use of all neow3j SDK features, add io.neow3j:contract to your dependencies.

Gradle

implementation 'io.neow3j:contract:3.22.1'

Maven

<dependency>
    <groupId>io.neow3j</groupId>
    <artifactId>contract</artifactId>
    <version>3.22.1</version>
</dependency>

Releases are available for Neo Legacy and Neo N3. The example above shows the newest release of neow3j for Neo N3. To use the latest release for Neo Legacy, use the version 2.4.0.

Devpack/Compiler

For smart contract development, you need the io.neow3j:devpack dependency. It provides all Neo-related utilities to write your first smart contract on the Neo blockchain!

Then, add the following dependency to your project.

Gradle

implementation 'io.neow3j:devpack:3.22.1'

Maven

<dependency>
    <groupId>io.neow3j</groupId>
    <artifactId>devpack</artifactId>
    <version>3.22.1</version>
</dependency>

Note: The devpack and compiler are only available for Neo N3. Thus, Java cannot be used to compile smart contracts that are compatible with Neo Legacy.

Who's using neow3j? ๐Ÿš€

Donate ๐Ÿ’ฐ

Help the development of neow3j by sponsoring us using the following addresses:

Crypto Address
Neo N3 NfhQyNmMCLCKaaazL6gbvYxtkZNGVb8kRn
Neo Legacy AHb3PPUY6a36Gd6JXCkn8j8LKtbEUr3UfZ
ETH 0xe85EbabD96943655e2DcaC44d3F21DC75F403B2f
BTC 3L4br7KQ8DCJEZ77nBjJfrukWEdVRXoKiy

Thanks and Credits ๐Ÿ™

neow3j's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

neow3j's Issues

Wallet: method for creating a new wallet and account

As a developer, I would like to have a method (maybe, static) on the Wallet class to create a wallet with an account already on it.

For example, like this a wallet object is created with an account already added to it:

Wallet w1 = Wallet.create();

Or, you can create a wallet object and already persist to a NEP6-compatible .json file, like:

Wallet w1 = Wallet.create("/tmp/wallet.json");

wallet: create, import, recover, and export

As a developer, I would like to have methods on the wallet module (convenience layer, discussed by #25) that I could:

  • create new addresses to a wallet (not only NEP-6 and NEP-2, but also with BIP-39)
  • import a wallet/address (NEP-6, NEP-2, .json format)
  • recover a wallet/address (NEP-6, NEP-2, BIP-39, .json format)
  • export (backup) a wallet/address (NEP-6, NEP-2, .json format)

Most of these functionalities are kind of wrappers (abstraction layer) to the methods implemented on the core and/or crypto modules.

Deploy smart contracts (.avm)

As a developer, I would like to load a contract in the .avm format and then programmatically deploy it. This is great for, e.g., developing tests for smart contracts.

wallet module (wrapper)

As a developer, I would like to have a different module in neow3j that will act as a NEO wallet convenience layer. This module should be called wallet, that people can import using maven.

Tasks / Requirements:

  • Create a wallet java module
  • Provide a file-based database layer, to persist information (like a DAO)
  • Provide methods to get all past activity related to the wallet (e.g., performed transactions related to NEO, GAS, and other NEP-5 assets, when addresses were added, etc.)

The wallet module is intended to connect to one (or more) NEO nodes to perform JSON-RPC calls and get block information relevant for the addresses in the wallet. This information consists for example of UTXOs or transaction outputs for GAS claiming.
The wallet module, therefore, requires a file-based database (to be defined) in order to keep the wallets past activities (history).
It relies only on JSON-RPC nodes of version 2.10.2 and higher. It does not depend on other APIs, like the one of a neoscan server.

Features will be specified on different issues and might be referenced.

Exception when calling the method neow3j.catchUpToLatestAndSubscribeToNewBlocksObservable(new BlockParameterIndex(2009367), true).

  • Reproduction Steps:
    The node http://47.89.10.193:20332 is syncing with testnet, and when it catch up to the latest height from 2009367.
    Neow3j neow3j = Neow3j.build(new HttpService("http://47.89.10.193:20332")); neow3j.catchUpToLatestAndSubscribeToNewBlocksObservable(new BlockParameterIndex(2009367), true) .subscribe((blockReqResult) -> { System.out.println("#######################################"); System.out.println("blockIndex: " + blockReqResult.getBlock().getIndex()); System.out.println("hashId: " + blockReqResult.getBlock().getHash()); System.out.println("confirmations: " + blockReqResult.getBlock().getConfirmations()); System.out.println("transactions: " + blockReqResult.getBlock().getTransactions()); });

  • Build with Maven.

  • Error Message:

#######################################
blockIndex: 2009444
hashId: 0xa1631a3c69113b810a5c062ee8466e05e767c70e0206472888e3ff48b89e97b8
confirmations: 106222
transactions: [Transaction{transactionId='0x54342094ed9b10ebdf56a1f02247cfb4546b59d6c26c33d9116308265c643bbc', size=10, type=MINER_TRANSACTION, version=0, attributes=[], inputs=[], outputs=[], sysFee='0', netFee='0', scripts=[], script='null', gas='null', nonce=4243716855}]
Exception in thread "pool-2-thread-1" java.lang.IllegalStateException: Exception thrown on Scheduler.Worker thread. Add onError handling.
at rx.internal.schedulers.ScheduledAction.run(ScheduledAction.java:57)
at rx.internal.schedulers.ExecutorScheduler$ExecutorSchedulerWorker.run(ExecutorScheduler.java:107)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:180)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)
Caused by: rx.exceptions.OnErrorNotImplementedException: connect timed out
at rx.internal.util.InternalObservableUtils$ErrorNotImplementedAction.call(InternalObservableUtils.java:386)
at rx.internal.util.InternalObservableUtils$ErrorNotImplementedAction.call(InternalObservableUtils.java:383)
at rx.internal.util.ActionSubscriber.onError(ActionSubscriber.java:44)
at rx.observers.SafeSubscriber._onError(SafeSubscriber.java:153)
at rx.observers.SafeSubscriber.onError(SafeSubscriber.java:115)
at rx.internal.operators.OperatorSubscribeOn$1$1.onError(OperatorSubscribeOn.java:59)
at rx.observers.SerializedObserver.onError(SerializedObserver.java:152)
at rx.observers.SerializedSubscriber.onError(SerializedSubscriber.java:78)
at rx.internal.operators.OnSubscribeConcatMap$ConcatMapSubscriber.innerError(OnSubscribeConcatMap.java:192)
at rx.internal.operators.OnSubscribeConcatMap$ConcatMapInnerSubscriber.onError(OnSubscribeConcatMap.java:340)
at rx.internal.operators.OperatorMerge$MergeSubscriber.reportError(OperatorMerge.java:266)
at rx.internal.operators.OperatorMerge$MergeSubscriber.checkTerminate(OperatorMerge.java:818)
at rx.internal.operators.OperatorMerge$MergeSubscriber.emitLoop(OperatorMerge.java:579)
at rx.internal.operators.OperatorMerge$MergeSubscriber.emit(OperatorMerge.java:568)
at rx.internal.operators.OperatorMerge$InnerSubscriber.onError(OperatorMerge.java:852)
at io.neow3j.protocol.core.RemoteCall.lambda$observable$0(RemoteCall.java:53)
at rx.Observable.unsafeSubscribe(Observable.java:10142)
at rx.internal.operators.OperatorMerge$MergeSubscriber.onNext(OperatorMerge.java:248)
at rx.internal.operators.OperatorMerge$MergeSubscriber.onNext(OperatorMerge.java:148)
at rx.internal.operators.OnSubscribeMap$MapSubscriber.onNext(OnSubscribeMap.java:77)
at io.neow3j.utils.Observables.lambda$range$0(Observables.java:40)
at rx.Observable.unsafeSubscribe(Observable.java:10142)
at rx.internal.operators.OnSubscribeMap.call(OnSubscribeMap.java:48)
at rx.internal.operators.OnSubscribeMap.call(OnSubscribeMap.java:33)
at rx.internal.operators.OnSubscribeLift.call(OnSubscribeLift.java:48)
at rx.internal.operators.OnSubscribeLift.call(OnSubscribeLift.java:30)
at rx.Observable.unsafeSubscribe(Observable.java:10142)
at rx.internal.operators.OnSubscribeConcatMap$ConcatMapSubscriber.drain(OnSubscribeConcatMap.java:286)
at rx.internal.operators.OnSubscribeConcatMap$ConcatMapSubscriber.onNext(OnSubscribeConcatMap.java:144)
at rx.internal.operators.OnSubscribeFromArray$FromArrayProducer.slowPath(OnSubscribeFromArray.java:100)
at rx.internal.operators.OnSubscribeFromArray$FromArrayProducer.request(OnSubscribeFromArray.java:63)
at rx.Subscriber.setProducer(Subscriber.java:211)
at rx.internal.operators.OnSubscribeFromArray.call(OnSubscribeFromArray.java:32)
at rx.internal.operators.OnSubscribeFromArray.call(OnSubscribeFromArray.java:24)
at rx.Observable.unsafeSubscribe(Observable.java:10142)
at rx.internal.operators.OnSubscribeConcatMap.call(OnSubscribeConcatMap.java:94)
at rx.internal.operators.OnSubscribeConcatMap.call(OnSubscribeConcatMap.java:42)
at rx.Observable.unsafeSubscribe(Observable.java:10142)
at rx.internal.operators.OperatorSubscribeOn$1.call(OperatorSubscribeOn.java:94)
at rx.internal.schedulers.ScheduledAction.run(ScheduledAction.java:55)
... 8 more
Caused by: java.net.SocketTimeoutException: connect timed out
at java.net.DualStackPlainSocketImpl.waitForConnect(Native Method)
at java.net.DualStackPlainSocketImpl.socketConnect(DualStackPlainSocketImpl.java:85)
at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:350)
at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:206)
at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:188)
at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:172)
at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392)
at java.net.Socket.connect(Socket.java:589)
at okhttp3.internal.platform.Platform.connectSocket(Platform.java:124)
at okhttp3.internal.connection.RealConnection.connectSocket(RealConnection.java:223)
at okhttp3.internal.connection.RealConnection.connect(RealConnection.java:149)
at okhttp3.internal.connection.StreamAllocation.findConnection(StreamAllocation.java:195)
at okhttp3.internal.connection.StreamAllocation.findHealthyConnection(StreamAllocation.java:121)
at okhttp3.internal.connection.StreamAllocation.newStream(StreamAllocation.java:100)
at okhttp3.internal.connection.ConnectInterceptor.intercept(ConnectInterceptor.java:42)
at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:92)
at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:67)
at okhttp3.internal.cache.CacheInterceptor.intercept(CacheInterceptor.java:93)
at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:92)
at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:67)
at okhttp3.internal.http.BridgeInterceptor.intercept(BridgeInterceptor.java:93)
at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:92)
at okhttp3.internal.http.RetryAndFollowUpInterceptor.intercept(RetryAndFollowUpInterceptor.java:120)
at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:92)
at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:67)
at okhttp3.RealCall.getResponseWithInterceptorChain(RealCall.java:185)
at okhttp3.RealCall.execute(RealCall.java:69)
at io.neow3j.protocol.http.HttpService.performIO(HttpService.java:103)
at io.neow3j.protocol.Service.send(Service.java:32)
at io.neow3j.protocol.core.Request.send(Request.java:70)
at io.neow3j.protocol.core.RemoteCall.send(RemoteCall.java:29)
at io.neow3j.protocol.core.RemoteCall.lambda$observable$0(RemoteCall.java:50)
... 32 more

I found a few problems

  1. For the asynchronous method, it takes a long time to finish after execution, why?
  2. When the rpc server returns error, neow3j sdk "getResult" function will only return a null, I think it should return error.message.
  3. When I create a new wallet, I have to manually key pairs. I think it is unreasonable. It should be just create the wallet object.
  4. When importing and exporting the wallet json file, you need to fill in a "ScryptParams". How do we know what these parameters are for normal developers?

CipherException when creating BIP39 wallet and creating a wallet file with a newly created account

Version: 1.0.6

Exception in thread "main" io.neow3j.crypto.exceptions.CipherException: Error performing cipher operation
at io.neow3j.crypto.Wallet.performCipherOperation(Wallet.java:172)
at io.neow3j.crypto.Wallet.encrypt(Wallet.java:124)
at io.neow3j.crypto.Wallet.createAccount(Wallet.java:59)
at io.neow3j.crypto.Wallet.createStandardAccount(Wallet.java:75)
at io.neow3j.crypto.WalletUtils.generateWalletFile(WalletUtils.java:53)
at io.neow3j.crypto.WalletUtils.generateBip39Wallet(WalletUtils.java:93)
at Main.main(Main.java:123)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at com.intellij.rt.execution.application.AppMain.main(AppMain.java:147)
Caused by: java.security.InvalidKeyException: Illegal key size or default parameters
at javax.crypto.Cipher.checkCryptoPerm(Cipher.java:1026)
at javax.crypto.Cipher.implInit(Cipher.java:801)
at javax.crypto.Cipher.chooseProvider(Cipher.java:864)
at javax.crypto.Cipher.init(Cipher.java:1249)
at javax.crypto.Cipher.init(Cipher.java:1186)
at io.neow3j.crypto.Wallet.performCipherOperation(Wallet.java:167)
... 11 more

Path tempDirectory = Files.createTempDirectory("wallet-dir-prefix-test", new FileAttribute[0]); Bip39Wallet bip39Wallet = WalletUtils.generateBip39Wallet("myPassw0rd!@#", tempDirectory.toFile()); String mnemonicWords = bip39Wallet.getMnemonic(); System.out.println("mnemonic words: " + mnemonicWords);

Generate New Wallet File:

Path tempDirectory = Files.createTempDirectory("wallet-dir-prefix-test", new FileAttribute[0]); String fileName = WalletUtils.generateNewWalletFile("myPassw0rd!@#", tempDirectory.toFile()); System.out.println("Wallet file path: " + Paths.get(tempDirectory.toString(), new String[]{fileName}));

Error Message:

Exception in thread "main" io.neow3j.crypto.exceptions.CipherException: Error performing cipher operation at io.neow3j.crypto.Wallet.performCipherOperation(Wallet.java:172) at io.neow3j.crypto.Wallet.encrypt(Wallet.java:124) at io.neow3j.crypto.Wallet.createAccount(Wallet.java:59) at io.neow3j.crypto.Wallet.createStandardAccount(Wallet.java:75) at io.neow3j.crypto.WalletUtils.generateWalletFile(WalletUtils.java:53) at io.neow3j.crypto.WalletUtils.generateNewWalletFile(WalletUtils.java:45) at Main.main(Main.java:153) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at com.intellij.rt.execution.application.AppMain.main(AppMain.java:147) Caused by: java.security.InvalidKeyException: Illegal key size or default parameters at javax.crypto.Cipher.checkCryptoPerm(Cipher.java:1026) at javax.crypto.Cipher.implInit(Cipher.java:801) at javax.crypto.Cipher.chooseProvider(Cipher.java:864) at javax.crypto.Cipher.init(Cipher.java:1249) at javax.crypto.Cipher.init(Cipher.java:1186) at io.neow3j.crypto.Wallet.performCipherOperation(Wallet.java:167) ... 11 more

Migrate from rxJava1 to rxJava2

As a developer, I would like to get better support, performance, and maintainability by using rxJava2 lib. Also, rxJava2 is more compatible friendly for Android.

[Suggestion] toString() method for neow3j.protocol.core.methods.response.NeoBlock class

 @Override
    public String toString() {
        return "NeoBlock{" +
                "hash='" + hash + '\'' +
                ", size=" + size +
                ", version=" + version +
                ", prevBlockHash='" + prevBlockHash + '\'' +
                ", merkleRootHash='" + merkleRootHash + '\'' +
                ", time=" + time +
                ", index=" + index +
                ", nonce='" + nonce + '\'' +
                ", nextConsensus='" + nextConsensus + '\'' +
                ", script=" + script +
                ", transactions=" + transactions +
                ", confirmations=" + confirmations +
                ", nextBlockHash='" + nextBlockHash + '\'' +
                '}';

I would suggest them to be showed with raw JSON format, what do you think?

wallet: get balances (NEO and GAS)

As a developer, I would like to have methods exposed in the wallet module (#25) where I could get balances for NEO and GAS assets -- for addresses already existing on the wallet.

The UTXOs should be calculated based on the addresses added to the wallet, and the local file-based database state.

Fix JavaDoc warnings

As a developer, I would like to remove the JavaDoc warnings from the ./gradlew assemble command.

Tests for JsonRpc2_0Rx

As a developer, I would like to make really sure that the reactive interfaces (observables) are working as expected every time that something changes on the neow3j code.

Create checkstyle definitions

Checkstyle definitions should be created to enforce consistent code styling practice for people that work on the neow3j library.

Raw ClaimTransactions

As a developer I need to be able to create and send raw transactions of type ClaimTransactions.

This does not yet include automatic retrieval or tracking of claimable GAS.

wallet: calculate and claim GAS

As a developer, I would like to have methods exposed in the wallet module (#25) that I could:

  • calculate claimable GAS
  • claim GAS

These should happen automatically, i.e., considering the local database state, and only relying on JSON-RPC nodes.

[Suggestion] Add toString() method for listAddress()

current the built-in method toString() print the following:
[io.neow3j.protocol.core.methods.response.NeoListAddress$Address@7fe8ea47, io.neow3j.protocol.core.methods.response.NeoListAddress$Address@226a82c4]
Suggest add override toString method similar with below:

        NeoListAddress neoListAddress = (NeoListAddress)neow3j.listAddress().send();
        List<NeoListAddress.Address> address= neoListAddress.getAddresses();
        System.out.println(address.size());
        for (int i = 0; i < address.size(); i++){
            System.out.println(address.get(i).getHasKey() + ":" + address.get(i).getAddress() + ":" + address.get(i).getLabel() + ":" + address.get(i).getWatchOnly());
        }

No verbose=1 option for RPC getrawtransaction

NeoGetRawTransaction getRawTransaction = neow3j.getRawTransaction("a7556ae2ef6acbf249a5f41e2e19859676f4717b47bf539954440e4a6eb975fe").send();
System.out.println(getRawTransaction.getResult().toCharArray());
System.out.println(getRawTransaction.getJsonrpc());

NEP-5 Token Contract API

As a developer I need a unified API for interacting with NEP-5 token contracts. It should allow to conveniently retrieve token information and make transfers.
Example usage:

NEP5 token = NEP5.fromContractScriptHash("ceab719b8baa2310f232ee0d277c061704541cfb");
token.getBalanceOf("AJzoeKrj7RHMwSrPQDPdv61ciVEYpmhkjk")
token.getTotalSupply() 
...
token.transfer(fromAccount, toAddress, amount);

Allow a wallet object as input to AssetTransfer and ContractInvocation

As a developer I want to be able to execute an asset transfer or a contract invocation by providing a wallet instead of a single account. The library should on its own collect and create the necessary inputs and signatures required for a successful transaction by using any of the accounts in the wallet (e.g. the default account).

Automatic fetching of GAS consumption for contract invocations

Already in NEO 2 one can test-run a contract invocation by calling the RPC methods invoke and invokefunction. But this fails if the invocation runs through a CheckWitness() statement in the invoked smart contract. As mentioned in this related pull-request this problem will probably not be resolved in NEO 2 anymore. But it is planned for NEO 3.

Therefore, with NEO 3 the automatic fetching of the GAS consumption of a contract invocation can be implemented. This is a part of the ContractInvocation class and the necessary code is already available but commented out and not covered by tests.

CipherException when creating a password-protected account (NEP-2) based on a key pair

WalletFile wallet = Wallet.createStandardWallet(); ECKeyPair ecKeyPair1 = Keys.createEcKeyPair(); WalletFile.Account account = Wallet.createStandardAccount("myPassw0rd!@#", ecKeyPair1);

Exception in thread "main" io.neow3j.crypto.exceptions.CipherException: Error performing cipher operation
at io.neow3j.crypto.Wallet.performCipherOperation(Wallet.java:172)
at io.neow3j.crypto.Wallet.encrypt(Wallet.java:124)
at io.neow3j.crypto.Wallet.createAccount(Wallet.java:59)
at io.neow3j.crypto.Wallet.createStandardAccount(Wallet.java:75)
at Main.main(Main.java:145)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at com.intellij.rt.execution.application.AppMain.main(AppMain.java:147)
Caused by: java.security.InvalidKeyException: Illegal key size or default parameters
at javax.crypto.Cipher.checkCryptoPerm(Cipher.java:1026)
at javax.crypto.Cipher.implInit(Cipher.java:801)
at javax.crypto.Cipher.chooseProvider(Cipher.java:864)
at javax.crypto.Cipher.init(Cipher.java:1249)
at javax.crypto.Cipher.init(Cipher.java:1186)
at io.neow3j.crypto.Wallet.performCipherOperation(Wallet.java:167)
... 9 more

Add more transaction input calculation strategies

When collecting necessary inputs (unspent transaction outputs UTXOs) for an asset transfer one can do this with different strategies. At the moment only one strategy is implemented, which simply goes through the list of available UTXOs received from an RPC node and picks each in the order they are in the list until enough inputs are collected.

This issue demands that other strategies are implement. For exmaple:

  • Order UTXOs smallest to biggest (w.r.t. value) and use them in that order.
  • Order UTXOs oldest to newest and use them in that order.

[Suggestion] Add toString() method for getPeers()

Current there is no override toString method for class NeoGetPeers, it will return an list without clear message on the connected address/port.
suggest to provide this method to make it easy for user to print the message.

multisigAddress is inconsistent with the one generated by NEO-GUI

I have three WIF, and generate a 2-signed address, expected it be Adkvh59aCdeEeidXCzAkAyoqYsSBpSvRPw
ECKeyPair ecKeyPair1 = ECKeyPair.create(WIF.getPrivateKeyFromWIF("L3XMvv21K4LUZdZkUaxcm7WTpkaE1FqhyMKXmvc7gkfmjhxP4UFu")); ECKeyPair ecKeyPair2 = ECKeyPair.create(WIF.getPrivateKeyFromWIF("L4ZCr2DsZe5nAkzMA5AVwMpjHnRrq11VoNdxgx7NQxJgip9n6nds")); ECKeyPair ecKeyPair3 = ECKeyPair.create(WIF.getPrivateKeyFromWIF("L53KB4Jmvk5GiVC1RX7GxNRb7b73Aiq9EthfjcQk6TznT6sCyXqy")); String multiSigAddress = Keys.getMultiSigAddress(2, new BigInteger[]{ecKeyPair1.getPublicKey(), ecKeyPair2.getPublicKey(), ecKeyPair3.getPublicKey()});

please have a check. Thanks.

Interact/Call smart contract's methods

As a developer, I would like to use neow3j to invoke/call smart contract's methods using my local key pairs to sign the transaction. This would enable various use cases for the Java community of the NEO blockchain.

Request.sendAsync() keeps process running even after all other statements are completed

When calling Request.sendAsync() the process takes about a minute to terminate, even thought the response has already been received and processed.

Example code:

Neow3j neow3j = Neow3j.build(new HttpService("http://nucbox.axlabs.com:30333"));
NeoGetAccountState getAccountState = neow3j
                .getAccountState("AK2nJJpJr6o664CWJKi1QRXjqeic2zRp8y")
                .sendAsync().get();

wallet: transfer NEO and GAS assets

As a developer, I would like to have methods exposed in the wallet module (#25) that I could:

  • transfer NEO and GAS assets to any NEO address

NEO addresses should be validated before performing the transaction.

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.