commit
6e1000f361
File diff suppressed because one or more lines are too long
@ -0,0 +1,163 @@ |
||||
{ |
||||
"metamask": { |
||||
"currentFiat": "USD", |
||||
"conversionRate": 11.06608791, |
||||
"conversionDate": 1470421024, |
||||
"isInitialized": true, |
||||
"isUnlocked": true, |
||||
"currentDomain": "example.com", |
||||
"rpcTarget": "https://rawtestrpc.metamask.io/", |
||||
"shapeShiftTxList":[ |
||||
{ |
||||
"depositAddress": "1L8BJCR6KHkCiVceDqibt7zJscqPpH7pFw", |
||||
"depositType": "BTC", |
||||
"key": "shapeshift", |
||||
"time": 1471564825772, |
||||
"response": { |
||||
"status": "complete", |
||||
"outgoingCoin": "100.00", |
||||
"incomingCoin": "1.000", |
||||
"transaction": "0x3701e0ac344a12a1fc5417cf251109a7c41f3edab922310202630d9c012414c8" |
||||
} |
||||
}, |
||||
{ |
||||
"depositAddress": "1L8BJCR6KHkCiVceDqibt7zJscqPpH7pFw", |
||||
"depositType": "BTC", |
||||
"key": "shapeshift", |
||||
"time": 1471566579224, |
||||
"response": { |
||||
"status": "no_deposits", |
||||
"depositAddress": "1L8BJCR6KHkCiVceDqibt7zJscqPpH7pFw" |
||||
} |
||||
}, |
||||
{ |
||||
"depositAddress": "1L8BJCR6KHkCiVceDqibt7zJscqPpH7pFw", |
||||
"depositType": "BTC", |
||||
"key": "shapeshift", |
||||
"time": 1471566565378, |
||||
"response": { |
||||
"status": "received", |
||||
"depositAddress": "1L8BJCR6KHkCiVceDqibt7zJscqPpH7pFw" |
||||
} |
||||
} |
||||
], |
||||
"transactions": [ { |
||||
"id": 1467921503489592, |
||||
"txParams": { |
||||
"from": "0x0dcd5d886577d5081b0c52e242ef29e70be3e7bc", |
||||
"to": "0x18a3462427bcc9133bb46e88bcbe39cd7ef0e761", |
||||
"value": "0x66c899104aa57038000", |
||||
"origin": "thelongestdomainnameintheworldandthensomeandthensomemoreandmore.com", |
||||
"metamaskId": 1467921503489592, |
||||
"metamaskNetworkId": "2" |
||||
}, |
||||
"time": 1467921503489, |
||||
"status": "rejected", |
||||
"containsDelegateCall": false |
||||
}, |
||||
{ |
||||
"id": 1467923203344608, |
||||
"txParams": { |
||||
"from": "0x0dcd5d886577d5081b0c52e242ef29e70be3e7bc", |
||||
"to": "0x18a3462427bcc9133bb46e88bcbe39cd7ef0e761", |
||||
"value": "0x0", |
||||
"origin": "thelongestdomainnameintheworldandthensomeandthensomemoreandmore.com", |
||||
"metamaskId": 1467923203344608, |
||||
"metamaskNetworkId": "2" |
||||
}, |
||||
"time": 1467923203344, |
||||
"status": "confirmed", |
||||
"containsDelegateCall": false, |
||||
"hash": "0x957bbba51e2732a86c10c5e7e8a484a093795a06f2e2c38ad02da1b20aeca620" |
||||
}, |
||||
{ |
||||
"id": 1467921503489592, |
||||
"txParams": { |
||||
"from": "0x0dcd5d886577d5081b0c52e242ef29e70be3e7bc", |
||||
"to": "0x18a3462427bcc9133bb46e88bcbe39cd7ef0e761", |
||||
"value": "0x66c899104aa57038000", |
||||
"origin": "thelongestdomainnameintheworldandthensomeandthensomemoreandmore.com", |
||||
"metamaskId": 1467921503489592, |
||||
"metamaskNetworkId": "2" |
||||
}, |
||||
"time": 1467921503489, |
||||
"status": "confirmed", |
||||
"containsDelegateCall": false |
||||
}], |
||||
"identities": { |
||||
"0x0dcd5d886577d5081b0c52e242ef29e70be3e7bc": { |
||||
"name": "Wallet 1", |
||||
"address": "0x0dcd5d886577d5081b0c52e242ef29e70be3e7bc", |
||||
"mayBeFauceting": false |
||||
}, |
||||
"0xec1adf982415d2ef5ec55899b9bfb8bc0f29251b": { |
||||
"name": "Wallet 2", |
||||
"address": "0xec1adf982415d2ef5ec55899b9bfb8bc0f29251b", |
||||
"mayBeFauceting": false |
||||
}, |
||||
"0xeb9e64b93097bc15f01f13eae97015c57ab64823": { |
||||
"name": "Wallet 3", |
||||
"address": "0xeb9e64b93097bc15f01f13eae97015c57ab64823", |
||||
"mayBeFauceting": false |
||||
}, |
||||
"0x704107d04affddd9b66ab9de3dd7b095852e9b69": { |
||||
"name": "Wallet 4", |
||||
"address": "0x704107d04affddd9b66ab9de3dd7b095852e9b69", |
||||
"mayBeFauceting": false |
||||
} |
||||
}, |
||||
"unconfTxs": {}, |
||||
"accounts": { |
||||
"0x0dcd5d886577d5081b0c52e242ef29e70be3e7bc": { |
||||
"code": "0x", |
||||
"balance": "0x0", |
||||
"nonce": "0x0", |
||||
"address": "0x0dcd5d886577d5081b0c52e242ef29e70be3e7bc" |
||||
}, |
||||
"0xec1adf982415d2ef5ec55899b9bfb8bc0f29251b": { |
||||
"code": "0x", |
||||
"nonce": "0x0", |
||||
"balance": "0x0", |
||||
"address": "0xec1adf982415d2ef5ec55899b9bfb8bc0f29251b" |
||||
}, |
||||
"0xeb9e64b93097bc15f01f13eae97015c57ab64823": { |
||||
"code": "0x", |
||||
"nonce": "0x0", |
||||
"balance": "0x0", |
||||
"address": "0xeb9e64b93097bc15f01f13eae97015c57ab64823" |
||||
}, |
||||
"0x704107d04affddd9b66ab9de3dd7b095852e9b69": { |
||||
"code": "0x", |
||||
"balance": "0x0", |
||||
"nonce": "0x0", |
||||
"address": "0x704107d04affddd9b66ab9de3dd7b095852e9b69" |
||||
} |
||||
}, |
||||
"selectedAddress": "0x0dcd5d886577d5081b0c52e242ef29e70be3e7bc", |
||||
"network": "1", |
||||
"seedWords": null, |
||||
"isConfirmed": true, |
||||
"unconfMsgs": {}, |
||||
"messages": [], |
||||
"provider": { |
||||
"type": "mainnet" |
||||
}, |
||||
"selectedAccount": "0x0dcd5d886577d5081b0c52e242ef29e70be3e7bc" |
||||
}, |
||||
"appState": { |
||||
"menuOpen": false, |
||||
"currentView": { |
||||
"name": "accountDetail", |
||||
"detailView": null, |
||||
"context": "0x0dcd5d886577d5081b0c52e242ef29e70be3e7bc" |
||||
}, |
||||
"accountDetail": { |
||||
"subview": "transactions" |
||||
}, |
||||
"currentDomain": "127.0.0.1:9966", |
||||
"transForward": true, |
||||
"isLoading": false, |
||||
"warning": null |
||||
}, |
||||
"identities": {} |
||||
} |
@ -0,0 +1,202 @@ |
||||
const inherits = require('util').inherits |
||||
const Component = require('react').Component |
||||
const h = require('react-hyperscript') |
||||
const connect = require('react-redux').connect |
||||
const vreme = new (require('vreme')) |
||||
const explorerLink = require('../../lib/explorer-link') |
||||
const extension = require('../../../app/scripts/lib/extension') |
||||
const actions = require('../actions') |
||||
const addressSummary = require('../util').addressSummary |
||||
|
||||
const CopyButton = require('./copyButton') |
||||
const EtherBalance = require('./eth-balance') |
||||
const Tooltip = require('./tooltip') |
||||
|
||||
|
||||
module.exports = connect(mapStateToProps)(ShiftListItem) |
||||
|
||||
function mapStateToProps (state) { |
||||
return {} |
||||
} |
||||
|
||||
inherits(ShiftListItem, Component) |
||||
|
||||
function ShiftListItem () { |
||||
Component.call(this) |
||||
} |
||||
|
||||
ShiftListItem.prototype.render = function () { |
||||
return ( |
||||
h('.transaction-list-item.flex-row', { |
||||
style: { |
||||
paddingTop: '20px', |
||||
paddingBottom: '20px', |
||||
justifyContent: 'space-around', |
||||
alignItems: 'center', |
||||
}, |
||||
}, [ |
||||
h('div', { |
||||
style: { |
||||
width: '0px', |
||||
position: 'relative', |
||||
bottom: '19px', |
||||
}, |
||||
}, [ |
||||
h('img', { |
||||
src: 'https://info.shapeshift.io/sites/default/files/logo.png', |
||||
style: { |
||||
height: '35px', |
||||
width: '132px', |
||||
position: 'absolute', |
||||
clip: 'rect(0px,23px,34px,0px)', |
||||
}, |
||||
}), |
||||
]), |
||||
|
||||
this.renderInfo(), |
||||
this.renderUtilComponents(), |
||||
]) |
||||
) |
||||
} |
||||
|
||||
function formatDate (date) { |
||||
return vreme.format(new Date(date), 'March 16 2014 14:30') |
||||
} |
||||
|
||||
ShiftListItem.prototype.renderUtilComponents = function () { |
||||
var props = this.props |
||||
|
||||
switch (props.response.status) { |
||||
case 'no_deposits': |
||||
return h('.flex-row', [ |
||||
h(CopyButton, { |
||||
value: this.props.depositAddress, |
||||
}), |
||||
h(Tooltip, { |
||||
title: 'QR Code', |
||||
}, [ |
||||
h('i.fa.fa-qrcode.pointer.pop-hover', { |
||||
onClick: () => props.dispatch(actions.reshowQrCode(props.depositAddress, props.depositType)), |
||||
style: { |
||||
margin: '5px', |
||||
marginLeft: '23px', |
||||
marginRight: '12px', |
||||
fontSize: '20px', |
||||
color: '#F7861C', |
||||
}, |
||||
}), |
||||
]), |
||||
]) |
||||
case 'received': |
||||
return h('.flex-row') |
||||
|
||||
case 'complete': |
||||
return h('.flex-row', [ |
||||
h(CopyButton, { |
||||
value: this.props.response.transaction, |
||||
}), |
||||
h(EtherBalance, { |
||||
value: `${props.response.outgoingCoin}`, |
||||
width: '55px', |
||||
shorten: true, |
||||
needsParse: false, |
||||
incoming: true, |
||||
style: { |
||||
fontSize: '15px', |
||||
color: '#01888C', |
||||
}, |
||||
}), |
||||
]) |
||||
|
||||
case 'failed': |
||||
return '' |
||||
default: |
||||
return '' |
||||
} |
||||
|
||||
} |
||||
|
||||
ShiftListItem.prototype.renderInfo = function () { |
||||
var props = this.props |
||||
switch (props.response.status) { |
||||
case 'no_deposits': |
||||
return h('.flex-column', { |
||||
style: { |
||||
width: '200px', |
||||
overflow: 'hidden', |
||||
}, |
||||
}, [ |
||||
h('div', { |
||||
style: { |
||||
fontSize: 'x-small', |
||||
color: '#ABA9AA', |
||||
width: '100%', |
||||
}, |
||||
}, `${props.depositType} to ETH via ShapeShift`), |
||||
h('div', 'No deposits received'), |
||||
h('div', { |
||||
style: { |
||||
fontSize: 'x-small', |
||||
color: '#ABA9AA', |
||||
width: '100%', |
||||
}, |
||||
}, formatDate(props.time)), |
||||
]) |
||||
case 'received': |
||||
return h('.flex-column', { |
||||
style: { |
||||
width: '200px', |
||||
overflow: 'hidden', |
||||
}, |
||||
}, [ |
||||
h('div', { |
||||
style: { |
||||
fontSize: 'x-small', |
||||
color: '#ABA9AA', |
||||
width: '100%', |
||||
}, |
||||
}, `${props.depositType} to ETH via ShapeShift`), |
||||
h('div', 'Conversion in progress'), |
||||
h('div', { |
||||
style: { |
||||
fontSize: 'x-small', |
||||
color: '#ABA9AA', |
||||
width: '100%', |
||||
}, |
||||
}, formatDate(props.time)), |
||||
]) |
||||
case 'complete': |
||||
var url = explorerLink(props.response.transaction, parseInt('1')) |
||||
|
||||
return h('.flex-column.pointer', { |
||||
style: { |
||||
width: '200px', |
||||
overflow: 'hidden', |
||||
}, |
||||
onClick: () => extension.tabs.create({ |
||||
url, |
||||
}), |
||||
}, [ |
||||
h('div', { |
||||
style: { |
||||
fontSize: 'x-small', |
||||
color: '#ABA9AA', |
||||
width: '100%', |
||||
}, |
||||
}, 'From ShapeShift'), |
||||
h('div', formatDate(props.time)), |
||||
h('div', { |
||||
style: { |
||||
fontSize: 'x-small', |
||||
color: '#ABA9AA', |
||||
width: '100%', |
||||
}, |
||||
}, addressSummary(props.response.transaction)), |
||||
]) |
||||
|
||||
case 'failed': |
||||
return h('span.error', '(Failed)') |
||||
default: |
||||
return '' |
||||
} |
||||
} |
Loading…
Reference in new issue