parent
2c89cd722e
commit
7058dc4ee3
After Width: | Height: | Size: 2.2 KiB |
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -0,0 +1,84 @@ |
|||||||
|
{ |
||||||
|
"metamask": { |
||||||
|
"isInitialized": true, |
||||||
|
"isUnlocked": true, |
||||||
|
"currentDomain": "example.com", |
||||||
|
"rpcTarget": "https://rawtestrpc.metamask.io/", |
||||||
|
"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": "0x01", |
||||||
|
"nonce": "0x0", |
||||||
|
"address": "0x0dcd5d886577d5081b0c52e242ef29e70be3e7bc" |
||||||
|
}, |
||||||
|
"0xec1adf982415d2ef5ec55899b9bfb8bc0f29251b": { |
||||||
|
"code": "0x", |
||||||
|
"nonce": "0x0", |
||||||
|
"balance": "0x01", |
||||||
|
"address": "0xec1adf982415d2ef5ec55899b9bfb8bc0f29251b" |
||||||
|
}, |
||||||
|
"0xeb9e64b93097bc15f01f13eae97015c57ab64823": { |
||||||
|
"code": "0x", |
||||||
|
"nonce": "0x0", |
||||||
|
"balance": "0x01", |
||||||
|
"address": "0xeb9e64b93097bc15f01f13eae97015c57ab64823" |
||||||
|
}, |
||||||
|
"0x704107d04affddd9b66ab9de3dd7b095852e9b69": { |
||||||
|
"code": "0x", |
||||||
|
"balance": "0x0", |
||||||
|
"nonce": "0x0", |
||||||
|
"address": "0x704107d04affddd9b66ab9de3dd7b095852e9b69" |
||||||
|
} |
||||||
|
}, |
||||||
|
"transactions": [], |
||||||
|
"selectedAddress": "0x0dcd5d886577d5081b0c52e242ef29e70be3e7bc", |
||||||
|
"network": "2", |
||||||
|
"seedWords": null, |
||||||
|
"isConfirmed": true, |
||||||
|
"unconfMsgs": {}, |
||||||
|
"messages": [], |
||||||
|
"provider": { |
||||||
|
"type": "testnet" |
||||||
|
}, |
||||||
|
"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": {} |
||||||
|
} |
File diff suppressed because one or more lines are too long
@ -0,0 +1,105 @@ |
|||||||
|
const inherits = require('util').inherits |
||||||
|
const Component = require('react').Component |
||||||
|
const h = require('react-hyperscript') |
||||||
|
const Identicon = require('./identicon') |
||||||
|
const formatBalance = require('../util').formatBalance |
||||||
|
const TransactionIcon = require('./transaction-list-item-icon') |
||||||
|
|
||||||
|
module.exports = AccountPanel |
||||||
|
|
||||||
|
|
||||||
|
inherits(AccountPanel, Component) |
||||||
|
function AccountPanel () { |
||||||
|
Component.call(this) |
||||||
|
} |
||||||
|
|
||||||
|
AccountPanel.prototype.render = function () { |
||||||
|
var props = this.props |
||||||
|
var picOrder = props.picOrder || 'left' |
||||||
|
var isFauceting = props.isFauceting |
||||||
|
const { attrs, imageSeed } = props |
||||||
|
|
||||||
|
return ( |
||||||
|
|
||||||
|
h('.identity-panel.flex-row.flex-left', { |
||||||
|
style: { |
||||||
|
cursor: props.onClick ? 'pointer' : undefined, |
||||||
|
}, |
||||||
|
onClick: props.onClick, |
||||||
|
}, [ |
||||||
|
|
||||||
|
this.genIcon(imageSeed, picOrder), |
||||||
|
|
||||||
|
h('div.flex-column.flex-justify-center', { |
||||||
|
style: { |
||||||
|
lineHeight: '15px', |
||||||
|
order: 2, |
||||||
|
display: 'flex', |
||||||
|
alignItems: picOrder === 'left' ? 'flex-begin' : 'flex-end', |
||||||
|
}, |
||||||
|
}, [ |
||||||
|
|
||||||
|
props.attrs.map((attr) => { |
||||||
|
return h('span.font-small', { |
||||||
|
key: `mini-${attr}`, |
||||||
|
style: { |
||||||
|
fontFamily: 'Montserrat UltraLight, Montserrat Light, Montserrat', |
||||||
|
}, |
||||||
|
}, attr) |
||||||
|
}), |
||||||
|
|
||||||
|
]), |
||||||
|
|
||||||
|
]) |
||||||
|
) |
||||||
|
} |
||||||
|
|
||||||
|
AccountPanel.prototype.genIcon= function(seed, picOrder) { |
||||||
|
const props = this.props |
||||||
|
|
||||||
|
// When there is no seed value, this is a contract creation.
|
||||||
|
// We then show the contract icon.
|
||||||
|
if (!seed) { |
||||||
|
return h('.identicon-wrapper.flex-column.select-none', { |
||||||
|
style: { |
||||||
|
order: picOrder === 'left' ? 1 : 3, |
||||||
|
}, |
||||||
|
}, [ |
||||||
|
h('i.fa.fa-file-text-o.fa-lg', { |
||||||
|
style: { |
||||||
|
fontSize: '42px', |
||||||
|
transform: 'translate(0px, -16px)', |
||||||
|
}, |
||||||
|
}) |
||||||
|
]) |
||||||
|
} |
||||||
|
|
||||||
|
// If there was a seed, we return an identicon for that address.
|
||||||
|
return h('.identicon-wrapper.flex-column.select-none', { |
||||||
|
style: { |
||||||
|
order: picOrder === 'left' ? 1 : 3, |
||||||
|
}, |
||||||
|
}, [ |
||||||
|
h(Identicon, { |
||||||
|
address: seed, |
||||||
|
imageify: props.imageifyIdenticons, |
||||||
|
}), |
||||||
|
]) |
||||||
|
} |
||||||
|
|
||||||
|
function balanceOrFaucetingIndication (account, isFauceting) { |
||||||
|
// Temporarily deactivating isFauceting indication
|
||||||
|
// because it shows fauceting for empty restored accounts.
|
||||||
|
if (/* isFauceting*/ false) { |
||||||
|
return { |
||||||
|
key: 'Account is auto-funding.', |
||||||
|
value: 'Please wait.', |
||||||
|
} |
||||||
|
} else { |
||||||
|
return { |
||||||
|
key: 'BALANCE', |
||||||
|
value: formatBalance(account.balance), |
||||||
|
} |
||||||
|
} |
||||||
|
} |
||||||
|
|
@ -0,0 +1,17 @@ |
|||||||
|
/* CONTRACT NAMER |
||||||
|
* |
||||||
|
* Takes an address, |
||||||
|
* Returns a nicname if we have one stored, |
||||||
|
* otherwise returns null. |
||||||
|
*/ |
||||||
|
|
||||||
|
const nicknames = {} |
||||||
|
|
||||||
|
module.exports = function(address) { |
||||||
|
|
||||||
|
if (address in nicknames) { |
||||||
|
return nicknames[address] |
||||||
|
} |
||||||
|
|
||||||
|
return null |
||||||
|
} |
Loading…
Reference in new issue