diff --git a/package.json b/package.json index a39a9fa2..0acbcfd4 100644 --- a/package.json +++ b/package.json @@ -41,7 +41,7 @@ "@ledgerhq/hw-transport": "^4.24.0", "@ledgerhq/hw-transport-node-hid": "4.24.0", "@ledgerhq/ledger-core": "2.0.0-rc.8", - "@ledgerhq/live-common": "4.1.3", + "@ledgerhq/live-common": "4.3.0", "animated": "^0.2.2", "async": "^2.6.1", "axios": "^0.18.0", @@ -74,7 +74,7 @@ "qs": "^6.5.1", "raven": "^2.5.0", "raven-js": "^3.24.2", - "react": "^16.4.1", + "react": "^16.6.1", "react-dom": "^16.4.1", "react-i18next": "^7.7.0", "react-key-handler": "^1.0.1", diff --git a/src/bridge/EthereumJSBridge.js b/src/bridge/EthereumJSBridge.js index e7ecd750..0fd3f2a9 100644 --- a/src/bridge/EthereumJSBridge.js +++ b/src/bridge/EthereumJSBridge.js @@ -73,7 +73,7 @@ const txToOps = (account: Account) => (tx: Tx): Operation[] => { const value = BigNumber(tx.value) const fee = BigNumber(tx.gas_price * tx.gas_used) if (sending) { - ops.push({ + const op: $Exact = { id: `${account.id}-${tx.hash}-OUT`, hash: tx.hash, type: 'OUT', @@ -85,10 +85,12 @@ const txToOps = (account: Account) => (tx: Tx): Operation[] => { senders: [tx.from], recipients: [tx.to], date: new Date(tx.received_at), - }) + extra: {}, + } + ops.push(op) } if (receiving) { - ops.push({ + const op: $Exact = { id: `${account.id}-${tx.hash}-IN`, hash: tx.hash, type: 'IN', @@ -100,7 +102,9 @@ const txToOps = (account: Account) => (tx: Tx): Operation[] => { senders: [tx.from], recipients: [tx.to], date: new Date(new Date(tx.received_at) + 1), // hack: make the IN appear after the OUT in history. - }) + extra: {}, + } + ops.push(op) } return ops } @@ -169,7 +173,7 @@ const signAndBroadcast = async ({ const hash = await api.broadcastTransaction(transaction) - onOperationBroadcasted({ + const op: $Exact = { id: `${a.id}-${hash}-OUT`, hash, type: 'OUT', @@ -182,7 +186,10 @@ const signAndBroadcast = async ({ recipients: [t.recipient], transactionSequenceNumber: nonce, date: new Date(), - }) + extra: {}, + } + + onOperationBroadcasted(op) } } diff --git a/src/bridge/RippleJSBridge.js b/src/bridge/RippleJSBridge.js index 3204cd39..27fe883f 100644 --- a/src/bridge/RippleJSBridge.js +++ b/src/bridge/RippleJSBridge.js @@ -105,7 +105,7 @@ async function signAndBroadcast({ a, t, deviceId, isCancelled, onSigned, onOpera const hash = computeBinaryTransactionHash(transaction) - onOperationBroadcasted({ + const op: $Exact = { id: `${a.id}-${hash}-OUT`, hash, accountId: a.id, @@ -121,7 +121,9 @@ async function signAndBroadcast({ a, t, deviceId, isCancelled, onSigned, onOpera transactionSequenceNumber: (a.operations.length > 0 ? a.operations[0].transactionSequenceNumber : 0) + a.pendingOperations.length, - }) + extra: {}, + } + onOperationBroadcasted(op) } } finally { api.disconnect() @@ -231,6 +233,7 @@ const txToOperation = (account: Account) => ({ recipients: [destination.address], date: new Date(timestamp), transactionSequenceNumber: sequence, + extra: {}, } return op } diff --git a/src/commands/libcoreSignAndBroadcast.js b/src/commands/libcoreSignAndBroadcast.js index 827c15cc..79cdaed5 100644 --- a/src/commands/libcoreSignAndBroadcast.js +++ b/src/commands/libcoreSignAndBroadcast.js @@ -280,7 +280,7 @@ export async function doSignAndBroadcast({ const fee = libcoreAmountToBigNumber(builded.getFees()) // NB we don't check isCancelled() because the broadcast is not cancellable now! - onOperationBroadcasted({ + const op: $Exact = { id: `${xpub}-${txHash}-OUT`, hash: txHash, type: 'OUT', @@ -294,7 +294,9 @@ export async function doSignAndBroadcast({ recipients, accountId, date: new Date().toISOString(), - }) + extra: {}, + } + onOperationBroadcasted(op) } export default cmd diff --git a/src/helpers/libcore.js b/src/helpers/libcore.js index 5fba74a5..b12709bd 100644 --- a/src/helpers/libcore.js +++ b/src/helpers/libcore.js @@ -425,7 +425,7 @@ function buildOperationRaw({ core: *, op: NJSOperation, xpub: string, -}): OperationRaw { +}): $Exact { const bitcoinLikeOperation = op.asBitcoinLikeOperation() const bitcoinLikeTransaction = bitcoinLikeOperation.getTransaction() const hash = bitcoinLikeTransaction.getHash() @@ -459,6 +459,7 @@ function buildOperationRaw({ blockHash: null, accountId: xpub, // FIXME accountId: xpub !? date: op.getDate().toISOString(), + extra: {}, } } diff --git a/yarn.lock b/yarn.lock index 30f856f2..591c55f8 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1753,10 +1753,10 @@ bindings "^1.3.0" nan "^2.6.2" -"@ledgerhq/live-common@4.1.3": - version "4.1.3" - resolved "https://registry.yarnpkg.com/@ledgerhq/live-common/-/live-common-4.1.3.tgz#dbd5be04925b11b4bf646520fe01a8959554c561" - integrity sha512-4FZ6th8ZtpC0B20olsyqF9hb0VUhVkLeiO/QyWzKa+bdn7jt4PgOyUdaKbRuoW2w9UKj2qkXgIgBIaZ+l0AlJA== +"@ledgerhq/live-common@4.3.0": + version "4.3.0" + resolved "https://registry.yarnpkg.com/@ledgerhq/live-common/-/live-common-4.3.0.tgz#f983cb691642f1372d89e6a9320986141ab31045" + integrity sha512-086MHRLvkPB7qxpzBGm2W1bE3yMbUxwCF2JuEMiQzgTK4fNPYV9mz+qR+qhYYcUXuXZQ2fCnCBYDqUlfo1Wb3g== dependencies: "@ledgerhq/hw-app-btc" "^4.24.0" "@ledgerhq/hw-app-eth" "^4.24.0" @@ -1769,7 +1769,7 @@ node-lzw "^0.3.1" numeral "^2.0.6" prando "^3.0.1" - react "^16.4.0" + react "*" react-i18next "^8.0.7" react-redux "^5.0.7" redux "^4.0.0" @@ -13354,15 +13354,15 @@ react-treebeard@^2.1.0: shallowequal "^0.2.2" velocity-react "^1.3.1" -react@^16.2.0, react@^16.4.0, react@^16.4.1: - version "16.4.1" - resolved "https://registry.yarnpkg.com/react/-/react-16.4.1.tgz#de51ba5764b5dbcd1f9079037b862bd26b82fe32" - integrity sha512-3GEs0giKp6E0Oh/Y9ZC60CmYgUPnp7voH9fbjWsvXtYFb4EWtgQub0ADSq0sJR0BbHc4FThLLtzlcFaFXIorwg== +react@*, react@^16.6.1, react@^16.2.0: + version "16.6.1" + resolved "https://registry.yarnpkg.com/react/-/react-16.6.1.tgz#ee2aef4f0a09e494594882029821049772f915fe" + integrity sha512-OtawJThYlvRgm9BXK+xTL7BIlDx8vv21j+fbQDjRRUyok6y7NyjlweGorielTahLZHYIdKUoK2Dp9ByVWuMqxw== dependencies: - fbjs "^0.8.16" loose-envify "^1.1.0" object-assign "^4.1.1" - prop-types "^15.6.0" + prop-types "^15.6.2" + scheduler "^0.11.0" reactcss@^1.2.0: version "1.2.3" @@ -14261,6 +14261,14 @@ sax@^1.2.4, sax@~1.2.1, sax@~1.2.4: resolved "https://registry.yarnpkg.com/sax/-/sax-1.2.4.tgz#2816234e2378bddc4e5354fab5caa895df7100d9" integrity sha512-NqVDv9TpANUjFm0N8uM5GxL36UgKi9/atZw+x7YFnQ8ckwFGKrl4xX4yWtrey3UJm5nP1kUbnYgLopqWNSRhWw== +scheduler@^0.11.0: + version "0.11.0" + resolved "https://registry.yarnpkg.com/scheduler/-/scheduler-0.11.0.tgz#def1f1bfa6550cc57981a87106e65e8aea41a6b5" + integrity sha512-MAYbBfmiEHxF0W+c4CxMpEqMYK+rYF584VP/qMKSiHM6lTkBKKYOJaDiSILpJHla6hBOsVd6GucPL46o2Uq3sg== + dependencies: + loose-envify "^1.1.0" + object-assign "^4.1.1" + schema-utils@^0.3.0: version "0.3.0" resolved "https://registry.yarnpkg.com/schema-utils/-/schema-utils-0.3.0.tgz#f5877222ce3e931edae039f17eb3716e7137f8cf"