Merge pull request #3050 from MetaMask/uat
[EPIC] Merge UAT into masterfeature/default_network_editable
@ -0,0 +1,10 @@ |
||||
app/ |
||||
development/ |
||||
dist/ |
||||
docs/ |
||||
fonts/ |
||||
images/ |
||||
mascara/ |
||||
node_modules/ |
||||
notices/ |
||||
test/ |
@ -0,0 +1,50 @@ |
||||
{ |
||||
"extends": "stylelint-config-standard", |
||||
"rules": { |
||||
"color-named": "never", |
||||
"font-family-name-quotes": "always-where-recommended", |
||||
"font-weight-notation": "numeric", |
||||
"function-url-quotes": "always", |
||||
"number-leading-zero": "never", |
||||
"value-no-vendor-prefix": true, |
||||
"value-list-comma-newline-before": "never-multi-line", |
||||
"custom-property-empty-line-before": "never", |
||||
"property-no-unknown": [ |
||||
true, |
||||
{ |
||||
"ignoreProperties": [ |
||||
"composes", |
||||
"all", |
||||
"-webkit-appearance" |
||||
] |
||||
} |
||||
], |
||||
"declaration-block-semicolon-newline-after": "always", |
||||
"block-opening-brace-newline-after": "always", |
||||
"selector-attribute-quotes": "always", |
||||
"selector-max-specificity": "0,5,2", |
||||
"selector-pseudo-class-no-unknown": [ |
||||
true, |
||||
{ |
||||
"ignorePseudoClasses": ["local", "global"] |
||||
} |
||||
], |
||||
"at-rule-empty-line-before": [ |
||||
"always", |
||||
{ |
||||
"ignore": [ |
||||
"after-comment", |
||||
] |
||||
} |
||||
], |
||||
"indentation": [ |
||||
2, |
||||
{ |
||||
"indentInsideParens": "once-at-root-twice-in-block" |
||||
} |
||||
], |
||||
"max-nesting-depth": 3, |
||||
"no-duplicate-selectors": true, |
||||
"no-unknown-animations": true |
||||
} |
||||
} |
@ -0,0 +1,93 @@ |
||||
Copyright (c) 2010-2014 by tyPoland Lukasz Dziedzic (team@latofonts.com) with Reserved Font Name "Lato" |
||||
|
||||
This Font Software is licensed under the SIL Open Font License, Version 1.1. |
||||
This license is copied below, and is also available with a FAQ at: |
||||
http://scripts.sil.org/OFL |
||||
|
||||
|
||||
----------------------------------------------------------- |
||||
SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007 |
||||
----------------------------------------------------------- |
||||
|
||||
PREAMBLE |
||||
The goals of the Open Font License (OFL) are to stimulate worldwide |
||||
development of collaborative font projects, to support the font creation |
||||
efforts of academic and linguistic communities, and to provide a free and |
||||
open framework in which fonts may be shared and improved in partnership |
||||
with others. |
||||
|
||||
The OFL allows the licensed fonts to be used, studied, modified and |
||||
redistributed freely as long as they are not sold by themselves. The |
||||
fonts, including any derivative works, can be bundled, embedded, |
||||
redistributed and/or sold with any software provided that any reserved |
||||
names are not used by derivative works. The fonts and derivatives, |
||||
however, cannot be released under any other type of license. The |
||||
requirement for fonts to remain under this license does not apply |
||||
to any document created using the fonts or their derivatives. |
||||
|
||||
DEFINITIONS |
||||
"Font Software" refers to the set of files released by the Copyright |
||||
Holder(s) under this license and clearly marked as such. This may |
||||
include source files, build scripts and documentation. |
||||
|
||||
"Reserved Font Name" refers to any names specified as such after the |
||||
copyright statement(s). |
||||
|
||||
"Original Version" refers to the collection of Font Software components as |
||||
distributed by the Copyright Holder(s). |
||||
|
||||
"Modified Version" refers to any derivative made by adding to, deleting, |
||||
or substituting -- in part or in whole -- any of the components of the |
||||
Original Version, by changing formats or by porting the Font Software to a |
||||
new environment. |
||||
|
||||
"Author" refers to any designer, engineer, programmer, technical |
||||
writer or other person who contributed to the Font Software. |
||||
|
||||
PERMISSION & CONDITIONS |
||||
Permission is hereby granted, free of charge, to any person obtaining |
||||
a copy of the Font Software, to use, study, copy, merge, embed, modify, |
||||
redistribute, and sell modified and unmodified copies of the Font |
||||
Software, subject to the following conditions: |
||||
|
||||
1) Neither the Font Software nor any of its individual components, |
||||
in Original or Modified Versions, may be sold by itself. |
||||
|
||||
2) Original or Modified Versions of the Font Software may be bundled, |
||||
redistributed and/or sold with any software, provided that each copy |
||||
contains the above copyright notice and this license. These can be |
||||
included either as stand-alone text files, human-readable headers or |
||||
in the appropriate machine-readable metadata fields within text or |
||||
binary files as long as those fields can be easily viewed by the user. |
||||
|
||||
3) No Modified Version of the Font Software may use the Reserved Font |
||||
Name(s) unless explicit written permission is granted by the corresponding |
||||
Copyright Holder. This restriction only applies to the primary font name as |
||||
presented to the users. |
||||
|
||||
4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font |
||||
Software shall not be used to promote, endorse or advertise any |
||||
Modified Version, except to acknowledge the contribution(s) of the |
||||
Copyright Holder(s) and the Author(s) or with their explicit written |
||||
permission. |
||||
|
||||
5) The Font Software, modified or unmodified, in part or in whole, |
||||
must be distributed entirely under this license, and must not be |
||||
distributed under any other license. The requirement for fonts to |
||||
remain under this license does not apply to any document created |
||||
using the Font Software. |
||||
|
||||
TERMINATION |
||||
This license becomes null and void if any of the above conditions are |
||||
not met. |
||||
|
||||
DISCLAIMER |
||||
THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, |
||||
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF |
||||
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT |
||||
OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE |
||||
COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, |
||||
INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL |
||||
DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING |
||||
FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM |
||||
OTHER DEALINGS IN THE FONT SOFTWARE. |
After Width: | Height: | Size: 872 B |
After Width: | Height: | Size: 9.5 KiB |
After Width: | Height: | Size: 854 B |
After Width: | Height: | Size: 1.1 KiB |
After Width: | Height: | Size: 32 KiB |
After Width: | Height: | Size: 8.6 KiB |
After Width: | Height: | Size: 732 B |
After Width: | Height: | Size: 689 B |
After Width: | Height: | Size: 1.0 KiB |
After Width: | Height: | Size: 1.1 KiB |
After Width: | Height: | Size: 1.9 KiB |
Before Width: | Height: | Size: 2.3 KiB After Width: | Height: | Size: 3.2 KiB |
After Width: | Height: | Size: 17 KiB |
@ -0,0 +1,10 @@ |
||||
module.exports = function environmentType () { |
||||
const url = window.location.href |
||||
if (url.match(/popup.html$/)) { |
||||
return 'popup' |
||||
} else if (url.match(/home.html$/)) { |
||||
return 'responsive' |
||||
} else { |
||||
return 'notification' |
||||
} |
||||
} |
@ -0,0 +1,26 @@ |
||||
module.exports = { |
||||
"confirm sig requests": { |
||||
signMessage: (msgData, cb) => { |
||||
const stateUpdate = { |
||||
unapprovedMsgs: {}, |
||||
unapprovedMsgCount: 0, |
||||
} |
||||
return cb(null, stateUpdate) |
||||
}, |
||||
signPersonalMessage: (msgData, cb) => { |
||||
const stateUpdate = { |
||||
unapprovedPersonalMsgs: {}, |
||||
unapprovedPersonalMsgsCount: 0, |
||||
} |
||||
return cb(null, stateUpdate) |
||||
}, |
||||
signTypedMessage: (msgData, cb) => { |
||||
const stateUpdate = { |
||||
unapprovedTypedMessages: {}, |
||||
unapprovedTypedMessagesCount: 0, |
||||
} |
||||
return cb(null, stateUpdate) |
||||
}, |
||||
}, |
||||
} |
||||
|
@ -0,0 +1,132 @@ |
||||
{ |
||||
"metamask": { |
||||
"isInitialized": true, |
||||
"isUnlocked": true, |
||||
"featureFlags": {"betaUI": true}, |
||||
"rpcTarget": "https://rawtestrpc.metamask.io/", |
||||
"identities": { |
||||
"0xfdea65c8e26263f6d9a1b5de9555d2931a33b825": { |
||||
"address": "0xfdea65c8e26263f6d9a1b5de9555d2931a33b825", |
||||
"name": "Send Account 1" |
||||
}, |
||||
"0xc5b8dbac4c1d3f152cdeb400e2313f309c410acb": { |
||||
"address": "0xc5b8dbac4c1d3f152cdeb400e2313f309c410acb", |
||||
"name": "Send Account 2" |
||||
}, |
||||
"0x2f8d4a878cfa04a6e60d46362f5644deab66572d": { |
||||
"address": "0x2f8d4a878cfa04a6e60d46362f5644deab66572d", |
||||
"name": "Send Account 3" |
||||
}, |
||||
"0xd85a4b6a394794842887b8284293d69163007bbb": { |
||||
"address": "0xd85a4b6a394794842887b8284293d69163007bbb", |
||||
"name": "Send Account 4" |
||||
} |
||||
}, |
||||
"unapprovedTxs": {}, |
||||
"conversionRate": 1200.88200327, |
||||
"conversionDate": 1489013762, |
||||
"noActiveNotices": true, |
||||
"frequentRpcList": [], |
||||
"network": "3", |
||||
"accounts": { |
||||
"0xfdea65c8e26263f6d9a1b5de9555d2931a33b825": { |
||||
"code": "0x", |
||||
"balance": "0x47c9d71831c76efe", |
||||
"nonce": "0x1b", |
||||
"address": "0xfdea65c8e26263f6d9a1b5de9555d2931a33b825" |
||||
}, |
||||
"0xc5b8dbac4c1d3f152cdeb400e2313f309c410acb": { |
||||
"code": "0x", |
||||
"balance": "0x37452b1315889f80", |
||||
"nonce": "0xa", |
||||
"address": "0xc5b8dbac4c1d3f152cdeb400e2313f309c410acb" |
||||
}, |
||||
"0x2f8d4a878cfa04a6e60d46362f5644deab66572d": { |
||||
"code": "0x", |
||||
"balance": "0x30c9d71831c76efe", |
||||
"nonce": "0x1c", |
||||
"address": "0x2f8d4a878cfa04a6e60d46362f5644deab66572d" |
||||
}, |
||||
"0xd85a4b6a394794842887b8284293d69163007bbb": { |
||||
"code": "0x", |
||||
"balance": "0x0", |
||||
"nonce": "0x0", |
||||
"address": "0xd85a4b6a394794842887b8284293d69163007bbb" |
||||
} |
||||
}, |
||||
"addressBook": [ |
||||
{ |
||||
"address": "0x06195827297c7a80a443b6894d3bdb8824b43896", |
||||
"name": "Address Book Account 1" |
||||
} |
||||
], |
||||
"tokens": [], |
||||
"transactions": {}, |
||||
"selectedAddressTxList": [], |
||||
"unapprovedMsgs": {}, |
||||
"unapprovedMsgCount": 0, |
||||
"unapprovedPersonalMsgs": {}, |
||||
"unapprovedPersonalMsgCount": 0, |
||||
"keyringTypes": [ |
||||
"Simple Key Pair", |
||||
"HD Key Tree" |
||||
], |
||||
"keyrings": [ |
||||
{ |
||||
"type": "HD Key Tree", |
||||
"accounts": [ |
||||
"fdea65c8e26263f6d9a1b5de9555d2931a33b825", |
||||
"c5b8dbac4c1d3f152cdeb400e2313f309c410acb", |
||||
"2f8d4a878cfa04a6e60d46362f5644deab66572d" |
||||
] |
||||
}, |
||||
{ |
||||
"type": "Simple Key Pair", |
||||
"accounts": [ |
||||
"0xd85a4b6a394794842887b8284293d69163007bbb" |
||||
] |
||||
} |
||||
], |
||||
"selectedAddress": "0xd85a4b6a394794842887b8284293d69163007bbb", |
||||
"currentCurrency": "USD", |
||||
"provider": { |
||||
"type": "testnet" |
||||
}, |
||||
"shapeShiftTxList": [], |
||||
"lostAccounts": [], |
||||
"send": { |
||||
"gasLimit": null, |
||||
"gasPrice": null, |
||||
"gasTotal": "0xb451dc41b578", |
||||
"tokenBalance": null, |
||||
"from": "", |
||||
"to": "", |
||||
"amount": "0x0", |
||||
"memo": "", |
||||
"errors": {}, |
||||
"maxModeOn": false, |
||||
"editingTransactionId": null |
||||
} |
||||
}, |
||||
"appState": { |
||||
"menuOpen": false, |
||||
"currentView": { |
||||
"name": "accountDetail", |
||||
"detailView": null, |
||||
"context": "0x0dcd5d886577d5081b0c52e242ef29e70be3e7bc" |
||||
}, |
||||
"accountDetail": { |
||||
"subview": "transactions" |
||||
}, |
||||
"modal": { |
||||
"modalState": {}, |
||||
"previousModalState": {} |
||||
}, |
||||
"transForward": true, |
||||
"isLoading": false, |
||||
"warning": null, |
||||
"scrollToBottom": false, |
||||
"forgottenPassword": null |
||||
}, |
||||
"identities": {} |
||||
} |
@ -0,0 +1,154 @@ |
||||
{ |
||||
"metamask": { |
||||
"isInitialized": true, |
||||
"isUnlocked": true, |
||||
"featureFlags": {"betaUI": true}, |
||||
"rpcTarget": "https://rawtestrpc.metamask.io/", |
||||
"identities": { |
||||
"0xfdea65c8e26263f6d9a1b5de9555d2931a33b825": { |
||||
"address": "0xfdea65c8e26263f6d9a1b5de9555d2931a33b825", |
||||
"name": "Send Account 1" |
||||
}, |
||||
"0xc5b8dbac4c1d3f152cdeb400e2313f309c410acb": { |
||||
"address": "0xc5b8dbac4c1d3f152cdeb400e2313f309c410acb", |
||||
"name": "Send Account 2" |
||||
}, |
||||
"0x2f8d4a878cfa04a6e60d46362f5644deab66572d": { |
||||
"address": "0x2f8d4a878cfa04a6e60d46362f5644deab66572d", |
||||
"name": "Send Account 3" |
||||
}, |
||||
"0xd85a4b6a394794842887b8284293d69163007bbb": { |
||||
"address": "0xd85a4b6a394794842887b8284293d69163007bbb", |
||||
"name": "Send Account 4" |
||||
} |
||||
}, |
||||
"unapprovedTxs": {}, |
||||
"currentCurrency": "USD", |
||||
"conversionRate": 1200.88200327, |
||||
"conversionDate": 1489013762, |
||||
"noActiveNotices": true, |
||||
"frequentRpcList": [], |
||||
"network": "3", |
||||
"accounts": { |
||||
"0xfdea65c8e26263f6d9a1b5de9555d2931a33b825": { |
||||
"code": "0x", |
||||
"balance": "0x47c9d71831c76efe", |
||||
"nonce": "0x1b", |
||||
"address": "0xfdea65c8e26263f6d9a1b5de9555d2931a33b825" |
||||
}, |
||||
"0xc5b8dbac4c1d3f152cdeb400e2313f309c410acb": { |
||||
"code": "0x", |
||||
"balance": "0x37452b1315889f80", |
||||
"nonce": "0xa", |
||||
"address": "0xc5b8dbac4c1d3f152cdeb400e2313f309c410acb" |
||||
}, |
||||
"0x2f8d4a878cfa04a6e60d46362f5644deab66572d": { |
||||
"code": "0x", |
||||
"balance": "0x30c9d71831c76efe", |
||||
"nonce": "0x1c", |
||||
"address": "0x2f8d4a878cfa04a6e60d46362f5644deab66572d" |
||||
}, |
||||
"0xd85a4b6a394794842887b8284293d69163007bbb": { |
||||
"code": "0x", |
||||
"balance": "0x0", |
||||
"nonce": "0x0", |
||||
"address": "0xd85a4b6a394794842887b8284293d69163007bbb" |
||||
} |
||||
}, |
||||
"addressBook": [ |
||||
{ |
||||
"address": "0x06195827297c7a80a443b6894d3bdb8824b43896", |
||||
"name": "Address Book Account 1" |
||||
} |
||||
], |
||||
"tokens": [], |
||||
"transactions": {}, |
||||
"selectedAddressTxList": [], |
||||
"unapprovedTxs": { |
||||
"4768706228115573": { |
||||
"id": 4768706228115573, |
||||
"time": 1487363153561, |
||||
"status": "unapproved", |
||||
"gasMultiplier": 1, |
||||
"metamaskNetworkId": "3", |
||||
"txParams": { |
||||
"from": "0xc5b8dbac4c1d3f152cdeb400e2313f309c410acb", |
||||
"to": "0x2f8d4a878cfa04a6e60d46362f5644deab66572d", |
||||
"value": "0x1bc16d674ec80000", |
||||
"metamaskId": 4768706228115573, |
||||
"metamaskNetworkId": "3", |
||||
"gas": "0xea60", |
||||
"gasPrice": "0xba43b7400" |
||||
} |
||||
} |
||||
}, |
||||
"unapprovedMsgs": {}, |
||||
"unapprovedMsgCount": 0, |
||||
"unapprovedPersonalMsgs": {}, |
||||
"unapprovedPersonalMsgCount": 0, |
||||
"keyringTypes": [ |
||||
"Simple Key Pair", |
||||
"HD Key Tree" |
||||
], |
||||
"keyrings": [ |
||||
{ |
||||
"type": "HD Key Tree", |
||||
"accounts": [ |
||||
"fdea65c8e26263f6d9a1b5de9555d2931a33b825", |
||||
"c5b8dbac4c1d3f152cdeb400e2313f309c410acb", |
||||
"2f8d4a878cfa04a6e60d46362f5644deab66572d" |
||||
] |
||||
}, |
||||
{ |
||||
"type": "Simple Key Pair", |
||||
"accounts": [ |
||||
"0xd85a4b6a394794842887b8284293d69163007bbb" |
||||
] |
||||
} |
||||
], |
||||
"selectedAddress": "0xd85a4b6a394794842887b8284293d69163007bbb", |
||||
"currentCurrency": "USD", |
||||
"provider": { |
||||
"type": "testnet" |
||||
}, |
||||
"shapeShiftTxList": [], |
||||
"lostAccounts": [], |
||||
"send": { |
||||
"gasLimit": "0xea60", |
||||
"gasPrice": "0xba43b7400", |
||||
"gasTotal": "0xb451dc41b578", |
||||
"tokenBalance": null, |
||||
"from": { |
||||
"address": "0xc5b8dbac4c1d3f152cdeb400e2313f309c410acb", |
||||
"balance": "0x37452b1315889f80" |
||||
}, |
||||
"to": "0x2f8d4a878cfa04a6e60d46362f5644deab66572d", |
||||
"amount": "0x1bc16d674ec80000", |
||||
"memo": "", |
||||
"errors": {}, |
||||
"maxModeOn": false, |
||||
"editingTransactionId": null |
||||
} |
||||
}, |
||||
"appState": { |
||||
"menuOpen": false, |
||||
"currentView": { |
||||
"name": "confTx", |
||||
"detailView": null, |
||||
"context": 0 |
||||
}, |
||||
"accountDetail": { |
||||
"subview": "transactions" |
||||
}, |
||||
"modal": { |
||||
"modalState": {}, |
||||
"previousModalState": {} |
||||
}, |
||||
"transForward": true, |
||||
"isLoading": false, |
||||
"warning": null, |
||||
"scrollToBottom": false, |
||||
"forgottenPassword": null |
||||
}, |
||||
"identities": {} |
||||
} |
@ -0,0 +1,154 @@ |
||||
{ |
||||
"metamask": { |
||||
"isInitialized": true, |
||||
"isUnlocked": true, |
||||
"featureFlags": {"betaUI": true}, |
||||
"rpcTarget": "https://rawtestrpc.metamask.io/", |
||||
"identities": { |
||||
"0xfdea65c8e26263f6d9a1b5de9555d2931a33b825": { |
||||
"address": "0xfdea65c8e26263f6d9a1b5de9555d2931a33b825", |
||||
"name": "Send Account 1" |
||||
}, |
||||
"0xc5b8dbac4c1d3f152cdeb400e2313f309c410acb": { |
||||
"address": "0xc5b8dbac4c1d3f152cdeb400e2313f309c410acb", |
||||
"name": "Send Account 2" |
||||
}, |
||||
"0x2f8d4a878cfa04a6e60d46362f5644deab66572d": { |
||||
"address": "0x2f8d4a878cfa04a6e60d46362f5644deab66572d", |
||||
"name": "Send Account 3" |
||||
}, |
||||
"0xd85a4b6a394794842887b8284293d69163007bbb": { |
||||
"address": "0xd85a4b6a394794842887b8284293d69163007bbb", |
||||
"name": "Send Account 4" |
||||
} |
||||
}, |
||||
"unapprovedTxs": {}, |
||||
"currentCurrency": "USD", |
||||
"conversionRate": 1200.88200327, |
||||
"conversionDate": 1489013762, |
||||
"noActiveNotices": true, |
||||
"frequentRpcList": [], |
||||
"network": "3", |
||||
"accounts": { |
||||
"0xfdea65c8e26263f6d9a1b5de9555d2931a33b825": { |
||||
"code": "0x", |
||||
"balance": "0x47c9d71831c76efe", |
||||
"nonce": "0x1b", |
||||
"address": "0xfdea65c8e26263f6d9a1b5de9555d2931a33b825" |
||||
}, |
||||
"0xc5b8dbac4c1d3f152cdeb400e2313f309c410acb": { |
||||
"code": "0x", |
||||
"balance": "0x37452b1315889f80", |
||||
"nonce": "0xa", |
||||
"address": "0xc5b8dbac4c1d3f152cdeb400e2313f309c410acb" |
||||
}, |
||||
"0x2f8d4a878cfa04a6e60d46362f5644deab66572d": { |
||||
"code": "0x", |
||||
"balance": "0x30c9d71831c76efe", |
||||
"nonce": "0x1c", |
||||
"address": "0x2f8d4a878cfa04a6e60d46362f5644deab66572d" |
||||
}, |
||||
"0xd85a4b6a394794842887b8284293d69163007bbb": { |
||||
"code": "0x", |
||||
"balance": "0x0", |
||||
"nonce": "0x0", |
||||
"address": "0xd85a4b6a394794842887b8284293d69163007bbb" |
||||
} |
||||
}, |
||||
"addressBook": [ |
||||
{ |
||||
"address": "0x06195827297c7a80a443b6894d3bdb8824b43896", |
||||
"name": "Address Book Account 1" |
||||
} |
||||
], |
||||
"tokens": [], |
||||
"transactions": {}, |
||||
"selectedAddressTxList": [], |
||||
"unapprovedTxs": { |
||||
"4768706228115573": { |
||||
"id": 4768706228115573, |
||||
"time": 1487363153561, |
||||
"status": "unapproved", |
||||
"gasMultiplier": 1, |
||||
"metamaskNetworkId": "3", |
||||
"txParams": { |
||||
"from": "0xc5b8dbac4c1d3f152cdeb400e2313f309c410acb", |
||||
"to": "0x2f8d4a878cfa04a6e60d46362f5644deab66572d", |
||||
"value": "0x1bc16d674ec80000", |
||||
"metamaskId": 4768706228115573, |
||||
"metamaskNetworkId": "3", |
||||
"gas": "0xea60", |
||||
"gasPrice": "0xba43b7400" |
||||
} |
||||
} |
||||
}, |
||||
"unapprovedMsgs": {}, |
||||
"unapprovedMsgCount": 0, |
||||
"unapprovedPersonalMsgs": {}, |
||||
"unapprovedPersonalMsgCount": 0, |
||||
"keyringTypes": [ |
||||
"Simple Key Pair", |
||||
"HD Key Tree" |
||||
], |
||||
"keyrings": [ |
||||
{ |
||||
"type": "HD Key Tree", |
||||
"accounts": [ |
||||
"fdea65c8e26263f6d9a1b5de9555d2931a33b825", |
||||
"c5b8dbac4c1d3f152cdeb400e2313f309c410acb", |
||||
"2f8d4a878cfa04a6e60d46362f5644deab66572d" |
||||
] |
||||
}, |
||||
{ |
||||
"type": "Simple Key Pair", |
||||
"accounts": [ |
||||
"0xd85a4b6a394794842887b8284293d69163007bbb" |
||||
] |
||||
} |
||||
], |
||||
"selectedAddress": "0xd85a4b6a394794842887b8284293d69163007bbb", |
||||
"currentCurrency": "USD", |
||||
"provider": { |
||||
"type": "testnet" |
||||
}, |
||||
"shapeShiftTxList": [], |
||||
"lostAccounts": [], |
||||
"send": { |
||||
"gasLimit": "0xea60", |
||||
"gasPrice": "0xba43b7400", |
||||
"gasTotal": "0xb451dc41b578", |
||||
"tokenBalance": null, |
||||
"from": { |
||||
"address": "0xc5b8dbac4c1d3f152cdeb400e2313f309c410acb", |
||||
"balance": "0x37452b1315889f80" |
||||
}, |
||||
"to": "0x2f8d4a878cfa04a6e60d46362f5644deab66572d", |
||||
"amount": "0x1bc16d674ec80000", |
||||
"memo": "", |
||||
"errors": {}, |
||||
"maxModeOn": false, |
||||
"editingTransactionId": null |
||||
} |
||||
}, |
||||
"appState": { |
||||
"menuOpen": false, |
||||
"currentView": { |
||||
"name": "confTx", |
||||
"detailView": null, |
||||
"context": 0 |
||||
}, |
||||
"accountDetail": { |
||||
"subview": "transactions" |
||||
}, |
||||
"modal": { |
||||
"modalState": {}, |
||||
"previousModalState": {} |
||||
}, |
||||
"transForward": true, |
||||
"isLoading": false, |
||||
"warning": null, |
||||
"scrollToBottom": false, |
||||
"forgottenPassword": null |
||||
}, |
||||
"identities": {} |
||||
} |
@ -0,0 +1,133 @@ |
||||
{ |
||||
"metamask": { |
||||
"isInitialized": true, |
||||
"isUnlocked": true, |
||||
"featureFlags": {"betaUI": true}, |
||||
"rpcTarget": "https://rawtestrpc.metamask.io/", |
||||
"identities": { |
||||
"0xfdea65c8e26263f6d9a1b5de9555d2931a33b825": { |
||||
"address": "0xfdea65c8e26263f6d9a1b5de9555d2931a33b825", |
||||
"name": "Send Account 1" |
||||
}, |
||||
"0xc5b8dbac4c1d3f152cdeb400e2313f309c410acb": { |
||||
"address": "0xc5b8dbac4c1d3f152cdeb400e2313f309c410acb", |
||||
"name": "Send Account 2" |
||||
}, |
||||
"0x2f8d4a878cfa04a6e60d46362f5644deab66572d": { |
||||
"address": "0x2f8d4a878cfa04a6e60d46362f5644deab66572d", |
||||
"name": "Send Account 3" |
||||
}, |
||||
"0xd85a4b6a394794842887b8284293d69163007bbb": { |
||||
"address": "0xd85a4b6a394794842887b8284293d69163007bbb", |
||||
"name": "Send Account 4" |
||||
} |
||||
}, |
||||
"unapprovedTxs": {}, |
||||
"currentCurrency": "USD", |
||||
"conversionRate": 1200.88200327, |
||||
"conversionDate": 1489013762, |
||||
"noActiveNotices": true, |
||||
"frequentRpcList": [], |
||||
"network": "3", |
||||
"accounts": { |
||||
"0xfdea65c8e26263f6d9a1b5de9555d2931a33b825": { |
||||
"code": "0x", |
||||
"balance": "0x47c9d71831c76efe", |
||||
"nonce": "0x1b", |
||||
"address": "0xfdea65c8e26263f6d9a1b5de9555d2931a33b825" |
||||
}, |
||||
"0xc5b8dbac4c1d3f152cdeb400e2313f309c410acb": { |
||||
"code": "0x", |
||||
"balance": "0x37452b1315889f80", |
||||
"nonce": "0xa", |
||||
"address": "0xc5b8dbac4c1d3f152cdeb400e2313f309c410acb" |
||||
}, |
||||
"0x2f8d4a878cfa04a6e60d46362f5644deab66572d": { |
||||
"code": "0x", |
||||
"balance": "0x30c9d71831c76efe", |
||||
"nonce": "0x1c", |
||||
"address": "0x2f8d4a878cfa04a6e60d46362f5644deab66572d" |
||||
}, |
||||
"0xd85a4b6a394794842887b8284293d69163007bbb": { |
||||
"code": "0x", |
||||
"balance": "0x0", |
||||
"nonce": "0x0", |
||||
"address": "0xd85a4b6a394794842887b8284293d69163007bbb" |
||||
} |
||||
}, |
||||
"addressBook": [ |
||||
{ |
||||
"address": "0x06195827297c7a80a443b6894d3bdb8824b43896", |
||||
"name": "Address Book Account 1" |
||||
} |
||||
], |
||||
"tokens": [], |
||||
"transactions": {}, |
||||
"selectedAddressTxList": [], |
||||
"unapprovedMsgs": {}, |
||||
"unapprovedMsgCount": 0, |
||||
"unapprovedPersonalMsgs": {}, |
||||
"unapprovedPersonalMsgCount": 0, |
||||
"keyringTypes": [ |
||||
"Simple Key Pair", |
||||
"HD Key Tree" |
||||
], |
||||
"keyrings": [ |
||||
{ |
||||
"type": "HD Key Tree", |
||||
"accounts": [ |
||||
"fdea65c8e26263f6d9a1b5de9555d2931a33b825", |
||||
"c5b8dbac4c1d3f152cdeb400e2313f309c410acb", |
||||
"2f8d4a878cfa04a6e60d46362f5644deab66572d" |
||||
] |
||||
}, |
||||
{ |
||||
"type": "Simple Key Pair", |
||||
"accounts": [ |
||||
"0xd85a4b6a394794842887b8284293d69163007bbb" |
||||
] |
||||
} |
||||
], |
||||
"selectedAddress": "0xd85a4b6a394794842887b8284293d69163007bbb", |
||||
"currentCurrency": "USD", |
||||
"provider": { |
||||
"type": "testnet" |
||||
}, |
||||
"shapeShiftTxList": [], |
||||
"lostAccounts": [], |
||||
"send": { |
||||
"gasLimit": null, |
||||
"gasPrice": null, |
||||
"gasTotal": "0xb451dc41b578", |
||||
"tokenBalance": null, |
||||
"from": "", |
||||
"to": "", |
||||
"amount": "0x0", |
||||
"memo": "", |
||||
"errors": {}, |
||||
"maxModeOn": false, |
||||
"editingTransactionId": null |
||||
} |
||||
}, |
||||
"appState": { |
||||
"menuOpen": false, |
||||
"currentView": { |
||||
"name": "accountDetail", |
||||
"detailView": null, |
||||
"context": "0x0dcd5d886577d5081b0c52e242ef29e70be3e7bc" |
||||
}, |
||||
"accountDetail": { |
||||
"subview": "transactions" |
||||
}, |
||||
"modal": { |
||||
"modalState": {}, |
||||
"previousModalState": {} |
||||
}, |
||||
"transForward": true, |
||||
"isLoading": false, |
||||
"warning": null, |
||||
"scrollToBottom": false, |
||||
"forgottenPassword": null |
||||
}, |
||||
"identities": {} |
||||
} |
@ -0,0 +1,198 @@ |
||||
import React, { Component } from 'react' |
||||
import PropTypes from 'prop-types' |
||||
import classnames from 'classnames' |
||||
import {connect} from 'react-redux' |
||||
import {qrcode} from 'qrcode-npm' |
||||
import copyToClipboard from 'copy-to-clipboard' |
||||
import ShapeShiftForm from '../shapeshift-form' |
||||
import {buyEth, showAccountDetail} from '../../../../ui/app/actions' |
||||
|
||||
const OPTION_VALUES = { |
||||
COINBASE: 'coinbase', |
||||
SHAPESHIFT: 'shapeshift', |
||||
QR_CODE: 'qr_code', |
||||
} |
||||
|
||||
const OPTIONS = [ |
||||
{ |
||||
name: 'Direct Deposit', |
||||
value: OPTION_VALUES.QR_CODE, |
||||
}, |
||||
{ |
||||
name: 'Buy with Dollars', |
||||
value: OPTION_VALUES.COINBASE, |
||||
}, |
||||
{ |
||||
name: 'Buy with Cryptos', |
||||
value: OPTION_VALUES.SHAPESHIFT, |
||||
}, |
||||
] |
||||
|
||||
class BuyEtherWidget extends Component { |
||||
|
||||
static propTypes = { |
||||
address: PropTypes.string, |
||||
skipText: PropTypes.string, |
||||
className: PropTypes.string, |
||||
onSkip: PropTypes.func, |
||||
goToCoinbase: PropTypes.func, |
||||
showAccountDetail: PropTypes.func, |
||||
}; |
||||
|
||||
state = { |
||||
selectedOption: OPTION_VALUES.QR_CODE, |
||||
}; |
||||
|
||||
|
||||
copyToClipboard = () => { |
||||
const { address } = this.props |
||||
|
||||
this.setState({ justCopied: true }, () => copyToClipboard(address)) |
||||
|
||||
setTimeout(() => this.setState({ justCopied: false }), 1000) |
||||
} |
||||
|
||||
renderSkip () { |
||||
const {showAccountDetail, address, skipText, onSkip} = this.props |
||||
|
||||
return ( |
||||
<div |
||||
className="buy-ether__do-it-later" |
||||
onClick={() => { |
||||
if (onSkip) return onSkip() |
||||
showAccountDetail(address) |
||||
}} |
||||
> |
||||
{skipText || 'Do it later'} |
||||
</div> |
||||
) |
||||
} |
||||
|
||||
renderCoinbaseLogo () { |
||||
return ( |
||||
<svg width="140px" height="49px" viewBox="0 0 579 126" version="1.1"> |
||||
<g id="Page-1" stroke="none" strokeWidth={1} fill="none" fillRule="evenodd"> |
||||
<g id="Imported-Layers" fill="#0081C9"> |
||||
<path d="M37.752,125.873 C18.824,125.873 0.369,112.307 0.369,81.549 C0.369,50.79 18.824,37.382 37.752,37.382 C47.059,37.382 54.315,39.749 59.52,43.219 L53.841,55.68 C50.371,53.156 45.166,51.579 39.961,51.579 C28.604,51.579 18.193,60.57 18.193,81.391 C18.193,102.212 28.919,111.361 39.961,111.361 C45.166,111.361 50.371,109.783 53.841,107.26 L59.52,120.036 C54.157,123.664 47.059,125.873 37.752,125.873" id="Fill-1" /> |
||||
<path d="M102.898,125.873 C78.765,125.873 65.515,106.786 65.515,81.549 C65.515,56.311 78.765,37.382 102.898,37.382 C127.032,37.382 140.282,56.311 140.282,81.549 C140.282,106.786 127.032,125.873 102.898,125.873 L102.898,125.873 Z M102.898,51.105 C89.491,51.105 82.866,63.093 82.866,81.391 C82.866,99.688 89.491,111.834 102.898,111.834 C116.306,111.834 122.931,99.688 122.931,81.391 C122.931,63.093 116.306,51.105 102.898,51.105 L102.898,51.105 Z" id="Fill-2" /> |
||||
<path d="M163.468,23.659 C157.79,23.659 153.215,19.243 153.215,13.88 C153.215,8.517 157.79,4.1 163.468,4.1 C169.146,4.1 173.721,8.517 173.721,13.88 C173.721,19.243 169.146,23.659 163.468,23.659 L163.468,23.659 Z M154.793,39.118 L172.144,39.118 L172.144,124.138 L154.793,124.138 L154.793,39.118 Z" id="Fill-3" /> |
||||
<path d="M240.443,124.137 L240.443,67.352 C240.443,57.415 234.449,51.263 222.619,51.263 C216.31,51.263 210.473,52.367 207.003,53.787 L207.003,124.137 L189.81,124.137 L189.81,43.376 C198.328,39.906 209.212,37.382 222.461,37.382 C246.28,37.382 257.794,47.793 257.794,65.775 L257.794,124.137 L240.443,124.137" id="Fill-4" /> |
||||
<path d="M303.536,125.873 C292.494,125.873 281.611,123.191 274.986,119.879 L274.986,0.314 L292.179,0.314 L292.179,41.326 C296.28,39.433 302.905,37.856 308.741,37.856 C330.667,37.856 345.494,53.629 345.494,79.656 C345.494,111.676 328.931,125.873 303.536,125.873 L303.536,125.873 Z M305.744,51.263 C301.012,51.263 295.491,52.367 292.179,54.103 L292.179,109.941 C294.703,111.045 299.593,112.149 304.482,112.149 C318.205,112.149 328.301,102.685 328.301,80.918 C328.301,62.305 319.467,51.263 305.744,51.263 L305.744,51.263 Z" id="Fill-5" /> |
||||
<path d="M392.341,125.873 C367.892,125.873 355.589,115.935 355.589,99.215 C355.589,75.555 380.826,71.296 406.537,69.876 L406.537,64.513 C406.537,53.787 399.439,50.001 388.555,50.001 C380.511,50.001 370.731,52.525 365.053,55.207 L360.636,43.376 C367.419,40.379 378.933,37.382 390.29,37.382 C410.638,37.382 422.942,45.269 422.942,66.248 L422.942,119.879 C416.79,123.191 404.329,125.873 392.341,125.873 L392.341,125.873 Z M406.537,81.391 C389.186,82.337 371.835,83.757 371.835,98.9 C371.835,107.89 378.776,113.411 391.868,113.411 C397.389,113.411 403.856,112.465 406.537,111.203 L406.537,81.391 L406.537,81.391 Z" id="Fill-6" /> |
||||
<path d="M461.743,125.873 C451.806,125.873 441.395,123.191 435.244,119.879 L441.08,106.629 C445.496,109.31 454.803,112.149 461.27,112.149 C470.576,112.149 476.728,107.575 476.728,100.477 C476.728,92.748 470.261,89.751 461.586,86.596 C450.228,82.337 437.452,77.132 437.452,61.201 C437.452,47.162 448.336,37.382 467.264,37.382 C477.517,37.382 486.035,39.906 492.029,43.376 L486.665,55.364 C482.88,52.998 475.309,50.317 469.157,50.317 C460.166,50.317 455.118,55.049 455.118,61.201 C455.118,68.93 461.428,71.611 469.788,74.766 C481.618,79.183 494.71,84.072 494.71,100.635 C494.71,115.935 483.038,125.873 461.743,125.873" id="Fill-7" /> |
||||
<path d="M578.625,81.233 L522.155,89.12 C523.89,104.42 533.828,112.149 548.182,112.149 C556.699,112.149 565.848,110.099 571.684,106.944 L576.732,119.879 C570.107,123.349 558.75,125.873 547.078,125.873 C520.262,125.873 505.277,108.679 505.277,81.549 C505.277,55.522 519.789,37.382 543.607,37.382 C565.69,37.382 578.782,51.894 578.782,74.766 C578.782,76.816 578.782,79.025 578.625,81.233 L578.625,81.233 Z M543.292,50.001 C530.042,50.001 521.367,60.097 521.051,77.763 L562.22,72.084 C562.062,57.257 554.649,50.001 543.292,50.001 L543.292,50.001 Z" id="Fill-8" /> |
||||
</g> |
||||
</g> |
||||
</svg> |
||||
) |
||||
} |
||||
|
||||
renderCoinbaseForm () { |
||||
const {goToCoinbase, address} = this.props |
||||
|
||||
return ( |
||||
<div className="buy-ether__action-content-wrapper"> |
||||
<div>{this.renderCoinbaseLogo()}</div> |
||||
<div className="buy-ether__body-text">Coinbase is the world’s most popular way to buy and sell bitcoin, ethereum, and litecoin.</div> |
||||
<a className="first-time-flow__link buy-ether__faq-link">What is Ethereum?</a> |
||||
<div className="buy-ether__buttons"> |
||||
<button |
||||
className="first-time-flow__button" |
||||
onClick={() => goToCoinbase(address)} |
||||
> |
||||
Buy |
||||
</button> |
||||
</div> |
||||
</div> |
||||
) |
||||
} |
||||
|
||||
renderContent () { |
||||
const { address } = this.props |
||||
const { justCopied } = this.state |
||||
const qrImage = qrcode(4, 'M') |
||||
qrImage.addData(address) |
||||
qrImage.make() |
||||
|
||||
switch (this.state.selectedOption) { |
||||
case OPTION_VALUES.COINBASE: |
||||
return this.renderCoinbaseForm() |
||||
case OPTION_VALUES.SHAPESHIFT: |
||||
return ( |
||||
<div className="buy-ether__action-content-wrapper"> |
||||
<div className="shapeshift-logo" /> |
||||
<div className="buy-ether__body-text"> |
||||
Trade any leading blockchain asset for any other. Protection by Design. No Account Needed. |
||||
</div> |
||||
<ShapeShiftForm btnClass="first-time-flow__button" /> |
||||
</div> |
||||
) |
||||
case OPTION_VALUES.QR_CODE: |
||||
return ( |
||||
<div className="buy-ether__action-content-wrapper"> |
||||
<div dangerouslySetInnerHTML={{ __html: qrImage.createTableTag(4) }} /> |
||||
<div className="buy-ether__body-text">Deposit Ether directly into your account.</div> |
||||
<div className="buy-ether__small-body-text">(This is the account address that MetaMask created for you to recieve funds.)</div> |
||||
<div className="buy-ether__buttons"> |
||||
<button |
||||
className="first-time-flow__button" |
||||
onClick={this.copyToClipboard} |
||||
disabled={justCopied} |
||||
> |
||||
{ justCopied ? 'Copied' : 'Copy' } |
||||
</button> |
||||
</div> |
||||
</div> |
||||
) |
||||
default: |
||||
return null |
||||
} |
||||
} |
||||
|
||||
render () { |
||||
const { className = '' } = this.props |
||||
const { selectedOption } = this.state |
||||
|
||||
return ( |
||||
<div className={`${className} buy-ether__content-wrapper`}> |
||||
<div className="buy-ether__content-headline-wrapper"> |
||||
<div className="buy-ether__content-headline">Deposit Options</div> |
||||
{this.renderSkip()} |
||||
</div> |
||||
<div className="buy-ether__content"> |
||||
<div className="buy-ether__side-panel"> |
||||
{OPTIONS.map(({ name, value }) => ( |
||||
<div |
||||
key={value} |
||||
className={classnames('buy-ether__side-panel-item', { |
||||
'buy-ether__side-panel-item--selected': value === selectedOption, |
||||
})} |
||||
onClick={() => this.setState({ selectedOption: value })} |
||||
> |
||||
<div className="buy-ether__side-panel-item-name">{name}</div> |
||||
{value === selectedOption && ( |
||||
<svg viewBox="0 0 574 1024" id="si-ant-right" width="15px" height="15px"> |
||||
<path d="M10 9Q0 19 0 32t10 23l482 457L10 969Q0 979 0 992t10 23q10 9 24 9t24-9l506-480q10-10 10-23t-10-23L58 9Q48 0 34 0T10 9z" /> |
||||
</svg> |
||||
)} |
||||
</div> |
||||
))} |
||||
</div> |
||||
<div className="buy-ether__action-content"> |
||||
{this.renderContent()} |
||||
</div> |
||||
</div> |
||||
</div> |
||||
) |
||||
} |
||||
} |
||||
|
||||
export default connect( |
||||
({ metamask: { selectedAddress } }) => ({ |
||||
address: selectedAddress, |
||||
}), |
||||
dispatch => ({ |
||||
goToCoinbase: address => dispatch(buyEth({ network: '1', address, amount: 0 })), |
||||
showAccountDetail: address => dispatch(showAccountDetail(address)), |
||||
}) |
||||
)(BuyEtherWidget) |