This repository has been archived by the owner on Jun 7, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 86
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Accounts beta release - 1.0.0-beta4 (#157)
* Event management system * Account builder and API builder rewrite for re-usability * Split storage and config modules * Reattach/Promote plugin (runs every 30 seconds, excluding POW time when doing local) * Incoming transfer plugin * Outgoing transfer plugin * Added account state and deposit methods * load/save account state using JSON file * Added a custom seed provider * Address generation cache * Added shutdown event, called before account "shutdown()" * Added some documentation and tests to account module * Added javadoc to connection, allow custom connection methods * Updated to Junit 5 (tests are still Junit 4 using legacy plugin) * Added QRCode and Magnet link creation from a CDA * Addded a MongoDB storage class * Organised imports
- Loading branch information
Showing
226 changed files
with
13,087 additions
and
929 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
{"LXQHWNY9CQOHPNMKFJFIJHGEPAENAOVFRDIBF99PPHDTWJDCGHLYETXT9NPUVSNKT9XDTDYNJKJCPQMZC":{"keyIndex":4,"depositRequests":{"1":{"timeOut":0,"multiUse":false,"expectedAmount":5}},"pendingTransfers":{}}} |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,118 @@ | ||
package org.iota.jota; | ||
|
||
import java.util.List; | ||
|
||
import org.apache.commons.lang3.builder.ReflectionToStringBuilder; | ||
import org.apache.commons.lang3.builder.ToStringStyle; | ||
import org.iota.jota.builder.ApiBuilderSettings; | ||
import org.iota.jota.config.options.ApiConfig; | ||
import org.iota.jota.connection.Connection; | ||
import org.iota.jota.pow.ICurl; | ||
|
||
/** | ||
* | ||
* The current instance of API configuration options based on env, file and defaults | ||
* Modifications can be made but will not persist throughout restarts | ||
* | ||
*/ | ||
public class ApiOptions implements ApiConfig, ApiBuilderSettings { | ||
|
||
private int legacyPort; | ||
private String legacyProtocol; | ||
private String legacyHost; | ||
|
||
private ICurl customCurl; | ||
private IotaLocalPoW localPoW; | ||
|
||
//Nodes are not active | ||
private List<Connection> nodes; | ||
private int timeout; | ||
|
||
public ApiOptions(IotaAPI.Builder builder) { | ||
localPoW = builder.getLocalPoW(); | ||
customCurl = builder.getCustomCurl(); | ||
legacyProtocol = builder.getProtocol(); | ||
legacyHost = builder.getHost(); | ||
legacyPort = builder.getPort(); | ||
nodes = builder.getNodes(); | ||
} | ||
|
||
|
||
public List<Connection> getNodes() { | ||
return nodes; | ||
} | ||
|
||
@Override | ||
public boolean hasNodes() { | ||
return this.nodes != null && this.nodes.size() > 0; | ||
} | ||
|
||
|
||
public void setNodes(List<Connection> nodes) { | ||
this.nodes = nodes; | ||
} | ||
|
||
@Override | ||
public int getLegacyPort() { | ||
return legacyPort; | ||
} | ||
|
||
|
||
public void setLegacyPort(int legacyPort) { | ||
this.legacyPort = legacyPort; | ||
} | ||
|
||
@Override | ||
public String getLegacyProtocol() { | ||
return legacyProtocol; | ||
} | ||
|
||
|
||
public void setLegacyProtocol(String legacyProtocol) { | ||
this.legacyProtocol = legacyProtocol; | ||
} | ||
|
||
@Override | ||
public String getLegacyHost() { | ||
return legacyHost; | ||
} | ||
|
||
|
||
public void setLegacyHost(String legacyHost) { | ||
this.legacyHost = legacyHost; | ||
} | ||
|
||
@Override | ||
public ICurl getCustomCurl() { | ||
return customCurl; | ||
} | ||
|
||
|
||
public void setCustomCurl(ICurl customCurl) { | ||
this.customCurl = customCurl; | ||
} | ||
|
||
@Override | ||
public IotaLocalPoW getLocalPoW() { | ||
return localPoW; | ||
} | ||
|
||
|
||
public void setLocalPoW(IotaLocalPoW localPoW) { | ||
this.localPoW = localPoW; | ||
} | ||
|
||
@Override | ||
public int getConnectionTimeout() { | ||
return timeout; | ||
} | ||
|
||
public void setTimeout(int timeout) { | ||
this.timeout = timeout; | ||
} | ||
|
||
@Override | ||
public String toString() { | ||
return new ReflectionToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE).toString(); | ||
} | ||
} |
Oops, something went wrong.