add signTypedData_V4 to Keycard and update status-go
Signed-off-by: Michele Balistreri <michele@bitgamma.com>
This commit is contained in:
parent
6c7d689a7c
commit
8cb0ad9285
|
@ -918,6 +918,24 @@ class StatusModule extends ReactContextBaseJavaModule implements LifecycleEventL
|
||||||
StatusThreadPoolExecutor.getInstance().execute(r);
|
StatusThreadPoolExecutor.getInstance().execute(r);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ReactMethod
|
||||||
|
public void hashTypedDataV4(final String data, final Callback callback) {
|
||||||
|
Log.d(TAG, "hashTypedDataV4");
|
||||||
|
if (!checkAvailability()) {
|
||||||
|
callback.invoke(false);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
Runnable r = new Runnable() {
|
||||||
|
@Override
|
||||||
|
public void run() {
|
||||||
|
String res = Statusgo.hashTypedDataV4(data);
|
||||||
|
callback.invoke(res);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
StatusThreadPoolExecutor.getInstance().execute(r);
|
||||||
|
}
|
||||||
|
|
||||||
@ReactMethod
|
@ReactMethod
|
||||||
public void sendTransactionWithSignature(final String txArgsJSON, final String signature, final Callback callback) {
|
public void sendTransactionWithSignature(final String txArgsJSON, final String signature, final Callback callback) {
|
||||||
|
|
|
@ -321,6 +321,16 @@ RCT_EXPORT_METHOD(hashTypedData:(NSString *)data
|
||||||
callback(@[result]);
|
callback(@[result]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//////////////////////////////////////////////////////////////////// hashTypedDataV4
|
||||||
|
RCT_EXPORT_METHOD(hashTypedDataV4:(NSString *)data
|
||||||
|
callback:(RCTResponseSenderBlock)callback) {
|
||||||
|
#if DEBUG
|
||||||
|
NSLog(@"hashTypedDataV4() method called");
|
||||||
|
#endif
|
||||||
|
NSString *result = StatusgoHashTypedDataV4(data);
|
||||||
|
callback(@[result]);
|
||||||
|
}
|
||||||
|
|
||||||
//////////////////////////////////////////////////////////////////// sendTransactionWithSignature
|
//////////////////////////////////////////////////////////////////// sendTransactionWithSignature
|
||||||
RCT_EXPORT_METHOD(sendTransactionWithSignature:(NSString *)txArgsJSON
|
RCT_EXPORT_METHOD(sendTransactionWithSignature:(NSString *)txArgsJSON
|
||||||
signature:(NSString *)signature
|
signature:(NSString *)signature
|
||||||
|
|
|
@ -229,6 +229,12 @@
|
||||||
(log/debug "[native-module] hash-typed-data")
|
(log/debug "[native-module] hash-typed-data")
|
||||||
(.hashTypedData ^js (status) data callback))
|
(.hashTypedData ^js (status) data callback))
|
||||||
|
|
||||||
|
(defn hash-typed-data-v4
|
||||||
|
"used for keycard"
|
||||||
|
[data callback]
|
||||||
|
(log/debug "[native-module] hash-typed-data-v4")
|
||||||
|
(.hashTypedDataV4 ^js (status) data callback))
|
||||||
|
|
||||||
(defn send-transaction-with-signature
|
(defn send-transaction-with-signature
|
||||||
"used for keycard"
|
"used for keycard"
|
||||||
[rpcParams sig callback]
|
[rpcParams sig callback]
|
||||||
|
|
|
@ -18,8 +18,10 @@
|
||||||
|
|
||||||
(re-frame/reg-fx
|
(re-frame/reg-fx
|
||||||
::hash-typed-data
|
::hash-typed-data
|
||||||
(fn [{:keys [data on-completed]}]
|
(fn [{:keys [v4 data on-completed]}]
|
||||||
(status/hash-typed-data data on-completed)))
|
(if v4
|
||||||
|
(status/hash-typed-data-v4 data on-completed)
|
||||||
|
(status/hash-typed-data data on-completed))))
|
||||||
|
|
||||||
(defn prepare-transaction
|
(defn prepare-transaction
|
||||||
[{:keys [gas gasPrice data nonce tx-obj]}]
|
[{:keys [gas gasPrice data nonce tx-obj]}]
|
||||||
|
@ -38,10 +40,11 @@
|
||||||
(assoc :nonce nonce))))
|
(assoc :nonce nonce))))
|
||||||
|
|
||||||
(fx/defn hash-message
|
(fx/defn hash-message
|
||||||
[_ {:keys [data typed? on-completed]}]
|
[_ {:keys [v4 data typed? on-completed]}]
|
||||||
(if typed?
|
(if typed?
|
||||||
{::hash-typed-data
|
{::hash-typed-data
|
||||||
{:data data
|
{:data data
|
||||||
|
:v4 v4
|
||||||
:on-completed
|
:on-completed
|
||||||
(or on-completed
|
(or on-completed
|
||||||
#(re-frame/dispatch
|
#(re-frame/dispatch
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
"_comment": "DO NOT EDIT THIS FILE BY HAND. USE 'scripts/update-status-go.sh <tag>' instead",
|
"_comment": "DO NOT EDIT THIS FILE BY HAND. USE 'scripts/update-status-go.sh <tag>' instead",
|
||||||
"owner": "status-im",
|
"owner": "status-im",
|
||||||
"repo": "status-go",
|
"repo": "status-go",
|
||||||
"version": "v0.77.0",
|
"version": "v0.77.1",
|
||||||
"commit-sha1": "6037570901233477cbef85d5494b257076a3acd9",
|
"commit-sha1": "6a930ed0c601aca3dd13c9d4dedf3ea2d444848f",
|
||||||
"src-sha256": "1f5pr4w5a8lby2sqginddbjff2fp1d906nnr1y7zbsgafpi82j83"
|
"src-sha256": "0jz4696xm99cy4dxi3dfd0b4rj5pqrsfj92zsfyxilgzjkwyzf78"
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue