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);
|
||||
}
|
||||
|
||||
@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
|
||||
public void sendTransactionWithSignature(final String txArgsJSON, final String signature, final Callback callback) {
|
||||
|
|
|
@ -321,6 +321,16 @@ RCT_EXPORT_METHOD(hashTypedData:(NSString *)data
|
|||
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
|
||||
RCT_EXPORT_METHOD(sendTransactionWithSignature:(NSString *)txArgsJSON
|
||||
signature:(NSString *)signature
|
||||
|
|
|
@ -229,6 +229,12 @@
|
|||
(log/debug "[native-module] hash-typed-data")
|
||||
(.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
|
||||
"used for keycard"
|
||||
[rpcParams sig callback]
|
||||
|
|
|
@ -18,8 +18,10 @@
|
|||
|
||||
(re-frame/reg-fx
|
||||
::hash-typed-data
|
||||
(fn [{:keys [data on-completed]}]
|
||||
(status/hash-typed-data data on-completed)))
|
||||
(fn [{:keys [v4 data on-completed]}]
|
||||
(if v4
|
||||
(status/hash-typed-data-v4 data on-completed)
|
||||
(status/hash-typed-data data on-completed))))
|
||||
|
||||
(defn prepare-transaction
|
||||
[{:keys [gas gasPrice data nonce tx-obj]}]
|
||||
|
@ -38,10 +40,11 @@
|
|||
(assoc :nonce nonce))))
|
||||
|
||||
(fx/defn hash-message
|
||||
[_ {:keys [data typed? on-completed]}]
|
||||
[_ {:keys [v4 data typed? on-completed]}]
|
||||
(if typed?
|
||||
{::hash-typed-data
|
||||
{:data data
|
||||
:v4 v4
|
||||
:on-completed
|
||||
(or on-completed
|
||||
#(re-frame/dispatch
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
"_comment": "DO NOT EDIT THIS FILE BY HAND. USE 'scripts/update-status-go.sh <tag>' instead",
|
||||
"owner": "status-im",
|
||||
"repo": "status-go",
|
||||
"version": "v0.77.0",
|
||||
"commit-sha1": "6037570901233477cbef85d5494b257076a3acd9",
|
||||
"src-sha256": "1f5pr4w5a8lby2sqginddbjff2fp1d906nnr1y7zbsgafpi82j83"
|
||||
"version": "v0.77.1",
|
||||
"commit-sha1": "6a930ed0c601aca3dd13c9d4dedf3ea2d444848f",
|
||||
"src-sha256": "0jz4696xm99cy4dxi3dfd0b4rj5pqrsfj92zsfyxilgzjkwyzf78"
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue