add hash-transaction and send-transaction-with-signature
Signed-off-by: Andrea Franz <andrea@gravityblast.com>
This commit is contained in:
parent
a98264014f
commit
d4594d815f
|
@ -667,6 +667,44 @@ class StatusModule extends ReactContextBaseJavaModule implements LifecycleEventL
|
|||
return UUID.randomUUID().toString();
|
||||
}
|
||||
|
||||
@ReactMethod
|
||||
public void hashTransaction(final String txArgsJSON, final Callback callback) {
|
||||
Log.d(TAG, "hashTransaction");
|
||||
if (!checkAvailability()) {
|
||||
callback.invoke(false);
|
||||
return;
|
||||
}
|
||||
|
||||
Runnable r = new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
String res = Statusgo.hashTransaction(txArgsJSON);
|
||||
callback.invoke(res);
|
||||
}
|
||||
};
|
||||
|
||||
StatusThreadPoolExecutor.getInstance().execute(r);
|
||||
}
|
||||
|
||||
@ReactMethod
|
||||
public void sendTransactionWithSignature(final String txArgsJSON, final String signature, final Callback callback) {
|
||||
Log.d(TAG, "sendTransactionWithSignature");
|
||||
if (!checkAvailability()) {
|
||||
callback.invoke(false);
|
||||
return;
|
||||
}
|
||||
|
||||
Runnable r = new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
String res = Statusgo.sendTransactionWithSignature(txArgsJSON, signature);
|
||||
callback.invoke(res);
|
||||
}
|
||||
};
|
||||
|
||||
StatusThreadPoolExecutor.getInstance().execute(r);
|
||||
}
|
||||
|
||||
@ReactMethod
|
||||
public void sendTransaction(final String txArgsJSON, final String password, final Callback callback) {
|
||||
Log.d(TAG, "sendTransaction");
|
||||
|
|
|
@ -52,6 +52,12 @@
|
|||
(defn send-transaction [rpcParams password callback]
|
||||
(native-module/send-transaction rpcParams password callback))
|
||||
|
||||
(defn hash-transaction [rpcParams callback]
|
||||
(native-module/hash-transaction rpcParams callback))
|
||||
|
||||
(defn send-transaction-with-signature [rpcParams sig callback]
|
||||
(native-module/send-transaction-with-signature rpcParams sig callback))
|
||||
|
||||
(defn send-data-notification [m callback]
|
||||
(native-module/send-data-notification m callback))
|
||||
|
||||
|
|
|
@ -100,10 +100,18 @@
|
|||
(when (and @node-started status)
|
||||
(.signMessage status rpcParams callback)))
|
||||
|
||||
(defn hash-transaction [rpcParams callback]
|
||||
(when (and @node-started status)
|
||||
(.hashTransaction status rpcParams callback)))
|
||||
|
||||
(defn send-transaction [rpcParams password callback]
|
||||
(when (and @node-started status)
|
||||
(.sendTransaction status rpcParams password callback)))
|
||||
|
||||
(defn send-transaction-with-signature [rpcParams sig callback]
|
||||
(when (and @node-started status)
|
||||
(.sendTransactionWithSignature status rpcParams sig callback)))
|
||||
|
||||
(defn close-application []
|
||||
(.closeApplication status))
|
||||
|
||||
|
|
Loading…
Reference in New Issue