From 1d39757d57f61f78f3e83415fa9cf748f8ce966e Mon Sep 17 00:00:00 2001 From: rocky-fleek Date: Mon, 23 Aug 2021 18:43:58 -0300 Subject: [PATCH] Added proper controller with headers fix, added transactionId attribute on send response, removed extra ) in transfer modal --- package.json | 2 +- source/Background/Keyring.js | 7 +++++-- source/Pages/Notification/components/Transfer/index.jsx | 4 ---- yarn.lock | 8 ++++---- 4 files changed, 10 insertions(+), 11 deletions(-) diff --git a/package.json b/package.json index 92d3999c..314b0602 100644 --- a/package.json +++ b/package.json @@ -31,7 +31,7 @@ "@fleekhq/browser-rpc": "^2.0.2", "@material-ui/core": "^4.11.3", "@material-ui/icons": "^4.11.2", - "@psychedelic/plug-controller": "0.3.6", + "@psychedelic/plug-controller": "0.3.7", "@psychedelic/plug-inpage-provider": "1.1.15", "@reduxjs/toolkit": "^1.6.0", "advanced-css-reset": "^1.2.2", diff --git a/source/Background/Keyring.js b/source/Background/Keyring.js index 275b3202..33cdcf1c 100644 --- a/source/Background/Keyring.js +++ b/source/Background/Keyring.js @@ -119,8 +119,11 @@ export const getKeyringHandler = (type, keyring) => ({ }, [HANDLER_TYPES.SEND_TOKEN]: async ({ to, amount, canisterId }) => { try { - const { height } = await keyring.send(to, BigInt(amount), canisterId); - return { height: parseInt(height.toString(), 10) }; + const { height, transactionId } = await keyring.send(to, BigInt(amount), canisterId); + return { + height: parseInt(height?.toString?.(), 10), + transactionId: parseInt(transactionId?.toString?.(), 10), + }; } catch (error) { return { error: error.message, height: null }; } diff --git a/source/Pages/Notification/components/Transfer/index.jsx b/source/Pages/Notification/components/Transfer/index.jsx index dc357eea..bd2f1403 100644 --- a/source/Pages/Notification/components/Transfer/index.jsx +++ b/source/Pages/Notification/components/Transfer/index.jsx @@ -81,7 +81,6 @@ const Transfer = ({ return ( - {error ? : ( <> { @@ -95,7 +94,6 @@ const Transfer = ({ /> ) } - <>
@@ -130,8 +128,6 @@ const Transfer = ({ }
- ) - )}
diff --git a/yarn.lock b/yarn.lock index 6f0fede5..e6604432 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1369,10 +1369,10 @@ node-gyp "^7.1.0" read-package-json-fast "^2.0.1" -"@psychedelic/plug-controller@0.3.6": - version "0.3.6" - resolved "https://npm.pkg.github.com/download/@psychedelic/plug-controller/0.3.6/54c1e1df00a31a814f88e4711ae6f400772e0bcea058304cf18646da31f59378#a16da18107117b380ca4ad0e6a3d2f143db60787" - integrity sha512-f2kQfpjBJjYwlf8Qc7kqUvVWR630ZfI1sER1BRmMFL9itfCUqC2jb2prjelLbvJQxU1ApXh08IlPuZZmIX5Gew== +"@psychedelic/plug-controller@0.3.7": + version "0.3.7" + resolved "https://npm.pkg.github.com/download/@psychedelic/plug-controller/0.3.7/2e7fdf8abf60f97f91a8289646d70307a02f217ce91b252c8c4156e3acc91926#dcc1921d15bb8de5dd4374af35744c2e67fc879b" + integrity sha512-FwcgIr7VZ8UO1g4x5iNkVFJDYhBOqO6bSx1e0R5OwO2tf4lj6t+89edVy+mBhyUfXv6c8NYoAg2zf1mlvKqd/g== dependencies: "@babel/preset-env" "^7.14.4" "@dfinity/agent" "^0.9.3"