Merge remote-tracking branch 'origin/master' into redux-encryption-flow

This commit is contained in:
Shawn Khameneh 2018-07-18 14:09:52 -04:00
commit 188ff62724
4 changed files with 132 additions and 376 deletions

481
dist/bundle.js vendored
View file

@ -46,19 +46,34 @@ return /******/ (function(modules) { // webpackBootstrap
/******/ // define getter function for harmony exports
/******/ __webpack_require__.d = function(exports, name, getter) {
/******/ if(!__webpack_require__.o(exports, name)) {
/******/ Object.defineProperty(exports, name, {
/******/ configurable: false,
/******/ enumerable: true,
/******/ get: getter
/******/ });
/******/ Object.defineProperty(exports, name, { enumerable: true, get: getter });
/******/ }
/******/ };
/******/
/******/ // define __esModule on exports
/******/ __webpack_require__.r = function(exports) {
/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
/******/ }
/******/ Object.defineProperty(exports, '__esModule', { value: true });
/******/ };
/******/
/******/ // create a fake namespace object
/******/ // mode & 1: value is a module id, require it
/******/ // mode & 2: merge all properties of value into the ns
/******/ // mode & 4: return value when already ns object
/******/ // mode & 8|1: behave like require
/******/ __webpack_require__.t = function(value, mode) {
/******/ if(mode & 1) value = __webpack_require__(value);
/******/ if(mode & 8) return value;
/******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;
/******/ var ns = Object.create(null);
/******/ __webpack_require__.r(ns);
/******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value });
/******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));
/******/ return ns;
/******/ };
/******/
/******/ // getDefaultExport function for compatibility with non-harmony modules
/******/ __webpack_require__.n = function(module) {
/******/ var getter = module && module.__esModule ?
@ -89,8 +104,8 @@ return /******/ (function(modules) { // webpackBootstrap
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.selectWalletUnlockSucceeded = exports.selectWalletUnlockPending = exports.selectWalletDecryptSucceeded = exports.selectWalletDecryptPending = exports.selectWalletEncryptSucceeded = exports.selectWalletEncryptPending = exports.selectWalletState = exports.selectWalletIsEncrypted = exports.selectBlocks = exports.selectDraftTransactionError = exports.selectDraftTransactionAddress = exports.selectDraftTransactionAmount = exports.selectDraftTransaction = exports.selectGettingNewAddress = exports.selectReceiveAddress = exports.selectIsSendingSupport = exports.selectIsFetchingTransactions = exports.selectHasTransactions = exports.selectRecentTransactions = exports.selectTransactionItems = exports.selectTransactionsById = exports.selectBalance = exports.makeSelectBlockDate = exports.selectSearchBarFocused = exports.selectWunderBarAddress = exports.selectSearchUrisByQuery = exports.selectIsSearching = exports.selectSearchValue = exports.selectSearchQuery = exports.makeSelectSearchUris = exports.selectSearchState = exports.selectNavLinks = exports.selectActiveHistoryEntry = exports.selectHistoryStack = exports.selectHistoryIndex = exports.selectIsForwardDisabled = exports.selectIsBackDisabled = exports.selectPathAfterAuth = exports.selectPageTitle = exports.selectHeaderLinks = exports.selectCurrentParams = exports.selectCurrentPage = exports.selectCurrentPath = exports.makeSelectCurrentParam = exports.computePageFromPath = exports.selectSearchDownloadUris = exports.selectTotalDownloadProgress = exports.selectDownloadingFileInfos = exports.selectFileInfosDownloaded = exports.selectUrisLoading = exports.selectDownloadingByOutpoint = exports.selectIsFetchingFileListDownloadedOrPublished = exports.selectIsFetchingFileList = exports.selectFileInfosByOutpoint = exports.makeSelectLoadingForUri = exports.makeSelectDownloadingForUri = exports.makeSelectFileInfoForUri = exports.selectFetchingCostInfo = exports.selectCostForCurrentPageUri = exports.selectAllCostInfoByUri = exports.makeSelectCostInfoForUri = exports.makeSelectFetchingCostInfoForUri = exports.selectRewardContentClaimIds = exports.selectChannelClaimCounts = exports.selectPlayingUri = undefined;
exports.selectFetchingTrendingUris = exports.selectTrendingUris = exports.selectFetchingFeaturedUris = exports.selectFeaturedUris = exports.selectResolvingUris = exports.selectMyChannelClaims = exports.selectFetchingMyChannels = exports.selectMyClaimsOutpoints = exports.selectAllMyClaimsByOutpoint = exports.selectMyClaimsWithoutChannels = exports.selectMyClaims = exports.selectPendingClaims = exports.selectIsFetchingClaimListMine = exports.selectAllFetchingChannelClaims = exports.selectMyActiveClaims = exports.selectAbandoningIds = exports.selectMyClaimsRaw = exports.selectAllClaimsByChannel = exports.selectClaimsByUri = exports.selectClaimsById = exports.makeSelectNsfwCountForChannel = exports.makeSelectNsfwCountFromUris = exports.makeSelectTotalPagesForChannel = exports.makeSelectTotalItemsForChannel = exports.makeSelectIsUriResolving = exports.makeSelectContentTypeForUri = exports.makeSelectTitleForUri = exports.makeSelectMetadataForUri = exports.makeSelectClaimsInChannelForPage = exports.makeSelectClaimsInChannelForCurrentPage = exports.makeSelectFetchingChannelClaims = exports.makeSelectClaimIsMine = exports.makeSelectClaimForUri = exports.selectSnack = exports.selectNotificationProps = exports.selectNotification = exports.selectBlackListedOutpoints = exports.blacklistReducer = exports.walletReducer = exports.searchReducer = exports.notificationsReducer = exports.fileInfoReducer = exports.costInfoReducer = exports.claimsReducer = exports.formatFullPrice = exports.formatCredits = exports.toQueryString = exports.parseQueryParams = exports.batchActions = exports.doWalletStatus = exports.doWalletUnlock = exports.doWalletDecrypt = exports.doWalletEncrypt = exports.doSendSupport = exports.doSetDraftTransactionAddress = exports.doSetDraftTransactionAmount = exports.doSendDraftTransaction = exports.doCheckAddressIsMine = exports.doGetNewAddress = exports.doFetchBlock = exports.doFetchTransactions = exports.doBalanceSubscribe = exports.doUpdateBalance = exports.doBlackListedOutpointsSubscribe = exports.doBlurSearchInput = exports.doFocusSearchInput = exports.doUpdateSearchQuery = exports.doSearch = exports.doFetchFileInfosAndPublishedClaims = exports.doFileList = exports.doFetchFileInfo = exports.doFetchCostInfoForUri = exports.doFetchRewardedContent = exports.doFetchTrendingUris = exports.doFetchFeaturedUris = exports.doResolveUri = exports.doResolveUris = exports.doAbandonClaim = exports.doFetchClaimListMine = exports.doFetchClaimCountByChannel = exports.doFetchClaimsByChannel = exports.doHideNotification = exports.doNotify = exports.convertToShareLink = exports.isNameValid = exports.isURIClaimable = exports.isURIValid = exports.normalizeURI = exports.buildURI = exports.parseURI = exports.regexAddress = exports.regexInvalidURI = exports.Lbryapi = exports.Lbry = exports.SETTINGS = exports.SEARCH_TYPES = exports.THUMBNAIL_STATUSES = exports.MODALS = exports.ACTIONS = exports.Notification = undefined;
exports.selectBlocks = exports.selectDraftTransactionError = exports.selectDraftTransactionAddress = exports.selectDraftTransactionAmount = exports.selectDraftTransaction = exports.selectGettingNewAddress = exports.selectReceiveAddress = exports.selectIsSendingSupport = exports.selectIsFetchingTransactions = exports.selectHasTransactions = exports.selectRecentTransactions = exports.selectTransactionItems = exports.selectTransactionsById = exports.selectBalance = exports.makeSelectBlockDate = exports.selectSearchBarFocused = exports.selectWunderBarAddress = exports.selectSearchUrisByQuery = exports.selectIsSearching = exports.selectSearchValue = exports.selectSearchQuery = exports.makeSelectSearchUris = exports.selectSearchState = exports.selectNavLinks = exports.selectActiveHistoryEntry = exports.selectHistoryStack = exports.selectHistoryIndex = exports.selectIsForwardDisabled = exports.selectIsBackDisabled = exports.selectPathAfterAuth = exports.selectPageTitle = exports.selectHeaderLinks = exports.selectCurrentParams = exports.selectCurrentPage = exports.selectCurrentPath = exports.makeSelectCurrentParam = exports.computePageFromPath = exports.selectSearchDownloadUris = exports.selectTotalDownloadProgress = exports.selectDownloadingFileInfos = exports.selectFileInfosDownloaded = exports.selectUrisLoading = exports.selectDownloadingByOutpoint = exports.selectIsFetchingFileListDownloadedOrPublished = exports.selectIsFetchingFileList = exports.selectFileInfosByOutpoint = exports.makeSelectLoadingForUri = exports.makeSelectDownloadingForUri = exports.makeSelectFileInfoForUri = exports.selectFetchingCostInfo = exports.selectCostForCurrentPageUri = exports.selectAllCostInfoByUri = exports.makeSelectCostInfoForUri = exports.makeSelectFetchingCostInfoForUri = undefined;
exports.selectRewardContentClaimIds = exports.selectChannelClaimCounts = exports.selectPlayingUri = exports.selectFetchingTrendingUris = exports.selectTrendingUris = exports.selectFetchingFeaturedUris = exports.selectFeaturedUris = exports.selectResolvingUris = exports.selectMyChannelClaims = exports.selectFetchingMyChannels = exports.selectMyClaimsOutpoints = exports.selectAllMyClaimsByOutpoint = exports.selectMyClaimsWithoutChannels = exports.selectMyClaims = exports.selectPendingClaims = exports.selectIsFetchingClaimListMine = exports.selectAllFetchingChannelClaims = exports.selectMyActiveClaims = exports.selectAbandoningIds = exports.selectMyClaimsRaw = exports.selectAllClaimsByChannel = exports.selectClaimsByUri = exports.selectClaimsById = exports.makeSelectNsfwCountForChannel = exports.makeSelectNsfwCountFromUris = exports.makeSelectTotalPagesForChannel = exports.makeSelectTotalItemsForChannel = exports.makeSelectIsUriResolving = exports.makeSelectContentTypeForUri = exports.makeSelectTitleForUri = exports.makeSelectMetadataForUri = exports.makeSelectClaimsInChannelForPage = exports.makeSelectClaimsInChannelForCurrentPage = exports.makeSelectFetchingChannelClaims = exports.makeSelectClaimIsMine = exports.makeSelectClaimForUri = exports.selectSnack = exports.selectNotificationProps = exports.selectNotification = exports.selectBlackListedOutpoints = exports.blacklistReducer = exports.walletReducer = exports.searchReducer = exports.notificationsReducer = exports.fileInfoReducer = exports.costInfoReducer = exports.claimsReducer = exports.formatFullPrice = exports.formatCredits = exports.toQueryString = exports.parseQueryParams = exports.batchActions = exports.doSendSupport = exports.doSetDraftTransactionAddress = exports.doSetDraftTransactionAmount = exports.doSendDraftTransaction = exports.doCheckAddressIsMine = exports.doGetNewAddress = exports.doFetchBlock = exports.doFetchTransactions = exports.doBalanceSubscribe = exports.doUpdateBalance = exports.doBlackListedOutpointsSubscribe = exports.doBlurSearchInput = exports.doFocusSearchInput = exports.doUpdateSearchQuery = exports.doSearch = exports.doFetchFileInfosAndPublishedClaims = exports.doFileList = exports.doFetchFileInfo = exports.doFetchCostInfoForUri = exports.doFetchRewardedContent = exports.doFetchTrendingUris = exports.doFetchFeaturedUris = exports.doResolveUri = exports.doResolveUris = exports.doAbandonClaim = exports.doFetchClaimListMine = exports.doFetchClaimCountByChannel = exports.doFetchClaimsByChannel = exports.doHideNotification = exports.doNotify = exports.convertToShareLink = exports.isNameValid = exports.isURIClaimable = exports.isURIValid = exports.normalizeURI = exports.buildURI = exports.parseURI = exports.regexAddress = exports.regexInvalidURI = exports.Lbryapi = exports.Lbry = exports.TRANSACTIONS = exports.SETTINGS = exports.SEARCH_TYPES = exports.THUMBNAIL_STATUSES = exports.MODALS = exports.ACTIONS = exports.Notification = undefined;
var _Notification = __webpack_require__(1);
@ -358,30 +373,6 @@ Object.defineProperty(exports, 'doSendSupport', {
return _wallet.doSendSupport;
}
});
Object.defineProperty(exports, 'doWalletEncrypt', {
enumerable: true,
get: function get() {
return _wallet.doWalletEncrypt;
}
});
Object.defineProperty(exports, 'doWalletDecrypt', {
enumerable: true,
get: function get() {
return _wallet.doWalletDecrypt;
}
});
Object.defineProperty(exports, 'doWalletUnlock', {
enumerable: true,
get: function get() {
return _wallet.doWalletUnlock;
}
});
Object.defineProperty(exports, 'doWalletStatus', {
enumerable: true,
get: function get() {
return _wallet.doWalletStatus;
}
});
var _batchActions = __webpack_require__(19);
@ -407,7 +398,7 @@ Object.defineProperty(exports, 'toQueryString', {
}
});
var _formatCredits = __webpack_require__(30);
var _formatCredits = __webpack_require__(31);
Object.defineProperty(exports, 'formatCredits', {
enumerable: true,
@ -422,7 +413,7 @@ Object.defineProperty(exports, 'formatFullPrice', {
}
});
var _claims2 = __webpack_require__(31);
var _claims2 = __webpack_require__(32);
Object.defineProperty(exports, 'claimsReducer', {
enumerable: true,
@ -431,7 +422,7 @@ Object.defineProperty(exports, 'claimsReducer', {
}
});
var _cost_info2 = __webpack_require__(32);
var _cost_info2 = __webpack_require__(33);
Object.defineProperty(exports, 'costInfoReducer', {
enumerable: true,
@ -440,7 +431,7 @@ Object.defineProperty(exports, 'costInfoReducer', {
}
});
var _file_info2 = __webpack_require__(33);
var _file_info2 = __webpack_require__(34);
Object.defineProperty(exports, 'fileInfoReducer', {
enumerable: true,
@ -449,7 +440,7 @@ Object.defineProperty(exports, 'fileInfoReducer', {
}
});
var _notifications2 = __webpack_require__(34);
var _notifications2 = __webpack_require__(35);
Object.defineProperty(exports, 'notificationsReducer', {
enumerable: true,
@ -458,7 +449,7 @@ Object.defineProperty(exports, 'notificationsReducer', {
}
});
var _search2 = __webpack_require__(36);
var _search2 = __webpack_require__(37);
Object.defineProperty(exports, 'searchReducer', {
enumerable: true,
@ -467,7 +458,7 @@ Object.defineProperty(exports, 'searchReducer', {
}
});
var _wallet2 = __webpack_require__(38);
var _wallet2 = __webpack_require__(39);
Object.defineProperty(exports, 'walletReducer', {
enumerable: true,
@ -476,7 +467,7 @@ Object.defineProperty(exports, 'walletReducer', {
}
});
var _blacklist2 = __webpack_require__(39);
var _blacklist2 = __webpack_require__(40);
Object.defineProperty(exports, 'blacklistReducer', {
enumerable: true,
@ -485,7 +476,7 @@ Object.defineProperty(exports, 'blacklistReducer', {
}
});
var _blacklist3 = __webpack_require__(40);
var _blacklist3 = __webpack_require__(41);
Object.defineProperty(exports, 'selectBlackListedOutpoints', {
enumerable: true,
@ -494,7 +485,7 @@ Object.defineProperty(exports, 'selectBlackListedOutpoints', {
}
});
var _notifications3 = __webpack_require__(41);
var _notifications3 = __webpack_require__(42);
Object.defineProperty(exports, 'selectNotification', {
enumerable: true,
@ -734,7 +725,7 @@ Object.defineProperty(exports, 'selectRewardContentClaimIds', {
}
});
var _cost_info3 = __webpack_require__(42);
var _cost_info3 = __webpack_require__(43);
Object.defineProperty(exports, 'makeSelectFetchingCostInfoForUri', {
enumerable: true,
@ -1066,64 +1057,16 @@ Object.defineProperty(exports, 'selectBlocks', {
return _wallet3.selectBlocks;
}
});
Object.defineProperty(exports, 'selectWalletIsEncrypted', {
enumerable: true,
get: function get() {
return _wallet3.selectWalletIsEncrypted;
}
});
Object.defineProperty(exports, 'selectWalletState', {
enumerable: true,
get: function get() {
return _wallet3.selectWalletState;
}
});
Object.defineProperty(exports, 'selectWalletEncryptPending', {
enumerable: true,
get: function get() {
return _wallet3.selectWalletEncryptPending;
}
});
Object.defineProperty(exports, 'selectWalletEncryptSucceeded', {
enumerable: true,
get: function get() {
return _wallet3.selectWalletEncryptSucceeded;
}
});
Object.defineProperty(exports, 'selectWalletDecryptPending', {
enumerable: true,
get: function get() {
return _wallet3.selectWalletDecryptPending;
}
});
Object.defineProperty(exports, 'selectWalletDecryptSucceeded', {
enumerable: true,
get: function get() {
return _wallet3.selectWalletDecryptSucceeded;
}
});
Object.defineProperty(exports, 'selectWalletUnlockPending', {
enumerable: true,
get: function get() {
return _wallet3.selectWalletUnlockPending;
}
});
Object.defineProperty(exports, 'selectWalletUnlockSucceeded', {
enumerable: true,
get: function get() {
return _wallet3.selectWalletUnlockSucceeded;
}
});
var _action_types = __webpack_require__(4);
var ACTIONS = _interopRequireWildcard(_action_types);
var _modal_types = __webpack_require__(35);
var _modal_types = __webpack_require__(36);
var MODALS = _interopRequireWildcard(_modal_types);
var _thumbnail_upload_statuses = __webpack_require__(43);
var _thumbnail_upload_statuses = __webpack_require__(44);
var THUMBNAIL_STATUSES = _interopRequireWildcard(_thumbnail_upload_statuses);
@ -1131,10 +1074,14 @@ var _search4 = __webpack_require__(24);
var SEARCH_TYPES = _interopRequireWildcard(_search4);
var _settings = __webpack_require__(44);
var _settings = __webpack_require__(45);
var SETTINGS = _interopRequireWildcard(_settings);
var _transaction_types = __webpack_require__(30);
var TRANSACTIONS = _interopRequireWildcard(_transaction_types);
var _lbry = __webpack_require__(6);
var _lbry2 = _interopRequireDefault(_lbry);
@ -1153,6 +1100,7 @@ exports.MODALS = MODALS;
exports.THUMBNAIL_STATUSES = THUMBNAIL_STATUSES;
exports.SEARCH_TYPES = SEARCH_TYPES;
exports.SETTINGS = SETTINGS;
exports.TRANSACTIONS = TRANSACTIONS;
// common
@ -1537,18 +1485,6 @@ var FETCH_BLOCK_SUCCESS = exports.FETCH_BLOCK_SUCCESS = 'FETCH_BLOCK_SUCCESS';
var SUPPORT_TRANSACTION_STARTED = exports.SUPPORT_TRANSACTION_STARTED = 'SUPPORT_TRANSACTION_STARTED';
var SUPPORT_TRANSACTION_COMPLETED = exports.SUPPORT_TRANSACTION_COMPLETED = 'SUPPORT_TRANSACTION_COMPLETED';
var SUPPORT_TRANSACTION_FAILED = exports.SUPPORT_TRANSACTION_FAILED = 'SUPPORT_TRANSACTION_FAILED';
var WALLET_ENCRYPT_START = exports.WALLET_ENCRYPT_START = 'WALLET_ENCRYPT_START';
var WALLET_ENCRYPT_COMPLETED = exports.WALLET_ENCRYPT_COMPLETED = 'WALLET_ENCRYPT_COMPLETED';
var WALLET_UNLOCK_START = exports.WALLET_UNLOCK_START = 'WALLET_UNLOCK_START';
var WALLET_UNLOCK_COMPLETED = exports.WALLET_UNLOCK_COMPLETED = 'WALLET_UNLOCK_COMPLETED';
var WALLET_UNLOCK_FAILED = exports.WALLET_UNLOCK_FAILED = 'WALLET_UNLOCK_FAILED';
var WALLET_DECRYPT_START = exports.WALLET_DECRYPT_START = 'WALLET_DECRYPT_START';
var WALLET_DECRYPT_COMPLETED = exports.WALLET_DECRYPT_COMPLETED = 'WALLET_DECRYPT_COMPLETED';
var WALLET_LOCK_START = exports.WALLET_LOCK_START = 'WALLET_LOCK_START';
var WALLET_LOCK_COMPLETED = exports.WALLET_LOCK_COMPLETED = 'WALLET_LOCK_COMPLETED';
var WALLET_STATUS_START = exports.WALLET_STATUS_START = 'WALLET_STATUS_START';
var WALLET_STATUS_COMPLETED = exports.WALLET_STATUS_COMPLETED = 'WALLET_STATUS_COMPLETED';
var WALLET_STATUS_FAILED = exports.WALLET_STATUS_FAILED = 'WALLET_STATUS_FAILED';
// Claims
var FETCH_FEATURED_CONTENT_STARTED = exports.FETCH_FEATURED_CONTENT_STARTED = 'FETCH_FEATURED_CONTENT_STARTED';
@ -2140,9 +2076,6 @@ Lbry.wallet_unlock = function () {
var params = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
return daemonCallWithResult('wallet_unlock', params);
};
Lbry.wallet_lock = function () {
return daemonCallWithResult('wallet_lock', {});
};
// transactions
Lbry.transaction_list = function () {
@ -2446,26 +2379,26 @@ exports.default = lbryProxy;
/* 8 */
/***/ (function(module, exports) {
var g;
// This works in non-strict mode
g = (function() {
return this;
})();
try {
// This works if eval is allowed (see CSP)
g = g || Function("return this")() || (1, eval)("this");
} catch (e) {
// This works if the window reference is available
if (typeof window === "object") g = window;
}
// g can still be undefined, but nothing to do about it...
// We return undefined, instead of nothing here, so it's
// easier to handle this case. if(!global) { ...}
module.exports = g;
var g;
// This works in non-strict mode
g = (function() {
return this;
})();
try {
// This works if eval is allowed (see CSP)
g = g || Function("return this")() || (1, eval)("this");
} catch (e) {
// This works if the window reference is available
if (typeof window === "object") g = window;
}
// g can still be undefined, but nothing to do about it...
// We return undefined, instead of nothing here, so it's
// easier to handle this case. if(!global) { ...}
module.exports = g;
/***/ }),
@ -4449,11 +4382,6 @@ exports.doSendDraftTransaction = doSendDraftTransaction;
exports.doSetDraftTransactionAmount = doSetDraftTransactionAmount;
exports.doSetDraftTransactionAddress = doSetDraftTransactionAddress;
exports.doSendSupport = doSendSupport;
exports.doWalletEncrypt = doWalletEncrypt;
exports.doWalletUnlock = doWalletUnlock;
exports.doWalletLock = doWalletLock;
exports.doWalletDecrypt = doWalletDecrypt;
exports.doWalletStatus = doWalletStatus;
var _action_types = __webpack_require__(4);
@ -4699,108 +4627,6 @@ function doSendSupport(amount, claimId, uri, successCallback, errorCallback) {
};
}
function doWalletEncrypt(newPassword) {
return function (dispatch) {
dispatch({
type: ACTIONS.WALLET_ENCRYPT_START
});
_lbry2.default.wallet_encrypt({ new_password: newPassword }).then(function (result) {
if (result === true) {
dispatch({
type: ACTIONS.WALLET_ENCRYPT_COMPLETED,
result: result
});
} else {
dispatch({
type: ACTIONS.WALLET_ENCRYPT_FAILED,
result: result
});
}
});
};
}
function doWalletUnlock(password) {
return function (dispatch) {
dispatch({
type: ACTIONS.WALLET_UNLOCK_START
});
_lbry2.default.wallet_unlock({ password: password }).then(function (result) {
if (result === true) {
dispatch({
type: ACTIONS.WALLET_UNLOCK_COMPLETED,
result: result
});
} else {
dispatch({
type: ACTIONS.WALLET_UNLOCK_FAILED,
result: result
});
}
});
};
}
function doWalletLock() {
return function (dispatch) {
dispatch({
type: ACTIONS.WALLET_LOCK_START
});
_lbry2.default.wallet_lock().then(function (result) {
dispatch({
type: ACTIONS.WALLET_LOCK_COMPLETED
});
});
};
}
function doWalletDecrypt() {
return function (dispatch) {
dispatch({
type: ACTIONS.WALLET_DECRYPT_START
});
_lbry2.default.wallet_decrypt().then(function (result) {
if (result === true) {
dispatch({
type: ACTIONS.WALLET_DECRYPT_COMPLETED,
result: result
});
} else {
dispatch({
type: ACTIONS.WALLET_DECRYPT_FAILED,
result: result
});
}
});
};
}
function doWalletStatus() {
return function (dispatch) {
dispatch({
type: ACTIONS.WALLET_STATUS_START
});
_lbry2.default.status().then(function (result) {
if (result && !result.error) {
dispatch({
type: ACTIONS.WALLET_STATUS_COMPLETED,
result: result
});
} else {
dispatch({
type: ACTIONS.WALLET_STATUS_FAILED,
result: result
});
}
});
};
}
/***/ }),
/* 29 */
/***/ (function(module, exports, __webpack_require__) {
@ -4811,46 +4637,22 @@ function doWalletStatus() {
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.makeSelectBlockDate = exports.selectBlocks = exports.selectDraftTransactionError = exports.selectDraftTransactionAddress = exports.selectDraftTransactionAmount = exports.selectDraftTransaction = exports.selectGettingNewAddress = exports.selectReceiveAddress = exports.selectIsSendingSupport = exports.selectIsFetchingTransactions = exports.selectHasTransactions = exports.selectRecentTransactions = exports.selectTransactionItems = exports.selectTransactionsById = exports.selectBalance = exports.selectWalletUnlockSucceeded = exports.selectWalletUnlockPending = exports.selectWalletDecryptSucceeded = exports.selectWalletDecryptPending = exports.selectWalletEncryptSucceeded = exports.selectWalletEncryptPending = exports.selectWalletIsEncrypted = exports.selectWalletState = exports.selectState = undefined;
exports.makeSelectBlockDate = exports.selectBlocks = exports.selectDraftTransactionError = exports.selectDraftTransactionAddress = exports.selectDraftTransactionAmount = exports.selectDraftTransaction = exports.selectGettingNewAddress = exports.selectReceiveAddress = exports.selectIsSendingSupport = exports.selectIsFetchingTransactions = exports.selectHasTransactions = exports.selectRecentTransactions = exports.selectTransactionItems = exports.selectTransactionsById = exports.selectBalance = exports.selectState = undefined;
var _reselect = __webpack_require__(16);
var _transaction_types = __webpack_require__(30);
var TRANSACTIONS = _interopRequireWildcard(_transaction_types);
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }
function _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } else { return Array.from(arr); } }
var selectState = exports.selectState = function selectState(state) {
return state.wallet || {};
};
var selectWalletState = exports.selectWalletState = selectState;
var selectWalletIsEncrypted = exports.selectWalletIsEncrypted = function selectWalletIsEncrypted(state) {
return selectWalletState(state).walletIsEncrypted === true;
};
var selectWalletEncryptPending = exports.selectWalletEncryptPending = (0, _reselect.createSelector)(selectState, function (state) {
return state.walletEncryptPending;
});
var selectWalletEncryptSucceeded = exports.selectWalletEncryptSucceeded = (0, _reselect.createSelector)(selectState, function (state) {
return state.walletEncryptSucceded;
});
var selectWalletDecryptPending = exports.selectWalletDecryptPending = (0, _reselect.createSelector)(selectState, function (state) {
return state.walletDecryptPending;
});
var selectWalletDecryptSucceeded = exports.selectWalletDecryptSucceeded = (0, _reselect.createSelector)(selectState, function (state) {
return state.walletDecryptSucceded;
});
var selectWalletUnlockPending = exports.selectWalletUnlockPending = (0, _reselect.createSelector)(selectState, function (state) {
return state.walletUnlockPending;
});
var selectWalletUnlockSucceeded = exports.selectWalletUnlockSucceeded = (0, _reselect.createSelector)(selectState, function (state) {
return state.walletUnlockSucceded;
});
var selectBalance = exports.selectBalance = (0, _reselect.createSelector)(selectState, function (state) {
return state.balance;
});
@ -4875,24 +4677,24 @@ var selectTransactionItems = exports.selectTransactionItems = (0, _reselect.crea
append.push.apply(append, _toConsumableArray(tx.claim_info.map(function (item) {
return Object.assign({}, tx, item, {
type: item.claim_name[0] === '@' ? 'channel' : 'publish'
type: item.claim_name[0] === '@' ? TRANSACTIONS.CHANNEL : TRANSACTIONS.PUBLISH
});
})));
append.push.apply(append, _toConsumableArray(tx.support_info.map(function (item) {
return Object.assign({}, tx, item, {
type: !item.is_tip ? 'support' : 'tip'
type: !item.is_tip ? TRANSACTIONS.SUPPORT : TRANSACTIONS.TIP
});
})));
append.push.apply(append, _toConsumableArray(tx.update_info.map(function (item) {
return Object.assign({}, tx, item, { type: 'update' });
return Object.assign({}, tx, item, { type: TRANSACTIONS.UPDATE });
})));
append.push.apply(append, _toConsumableArray(tx.abandon_info.map(function (item) {
return Object.assign({}, tx, item, { type: 'abandon' });
return Object.assign({}, tx, item, { type: TRANSACTIONS.ABANDON });
})));
if (!append.length) {
append.push(Object.assign({}, tx, {
type: tx.value < 0 ? 'spend' : 'receive'
type: tx.value < 0 ? TRANSACTIONS.SPEND : TRANSACTIONS.RECEIVE
}));
}
@ -4908,7 +4710,7 @@ var selectTransactionItems = exports.selectTransactionItems = (0, _reselect.crea
fee: amount < 0 ? -1 * tx.fee / append.length : 0,
claim_id: item.claim_id,
claim_name: item.claim_name,
type: item.type || 'send',
type: item.type || TRANSACTIONS.SPEND,
nout: item.nout
};
})));
@ -4977,6 +4779,26 @@ var makeSelectBlockDate = exports.makeSelectBlockDate = function makeSelectBlock
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
// eslint-disable-next-line import/prefer-default-export
var SPEND = exports.SPEND = 'spend';
var RECEIVE = exports.RECEIVE = 'receive';
var PUBLISH = exports.PUBLISH = 'publish';
var CHANNEL = exports.CHANNEL = 'channel';
var TIP = exports.TIP = 'tip';
var SUPPORT = exports.SUPPORT = 'support';
var UPDATE = exports.UPDATE = 'update';
var ABANDON = exports.ABANDON = 'abandon';
/***/ }),
/* 31 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
@ -5009,7 +4831,7 @@ function formatFullPrice(amount) {
}
/***/ }),
/* 31 */
/* 32 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
@ -5336,7 +5158,7 @@ function claimsReducer() {
}
/***/ }),
/* 32 */
/* 33 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
@ -5394,7 +5216,7 @@ function costInfoReducer() {
}
/***/ }),
/* 33 */
/* 34 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
@ -5591,7 +5413,7 @@ function fileInfoReducer() {
}
/***/ }),
/* 34 */
/* 35 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
@ -5606,7 +5428,7 @@ var _action_types = __webpack_require__(4);
var ACTIONS = _interopRequireWildcard(_action_types);
var _modal_types = __webpack_require__(35);
var _modal_types = __webpack_require__(36);
var MODALS = _interopRequireWildcard(_modal_types);
@ -5677,7 +5499,7 @@ function notificationsReducer() {
}
/***/ }),
/* 35 */
/* 36 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
@ -5711,12 +5533,9 @@ var PUBLISH = exports.PUBLISH = 'publish';
var SEARCH = exports.SEARCH = 'search';
var CONFIRM_TRANSACTION = exports.CONFIRM_TRANSACTION = 'confirm_transaction';
var CONFIRM_THUMBNAIL_UPLOAD = exports.CONFIRM_THUMBNAIL_UPLOAD = 'confirm_thumbnail_upload';
var WALLET_ENCRYPT = exports.WALLET_ENCRYPT = 'wallet_encrypt';
var WALLET_DECRYPT = exports.WALLET_DECRYPT = 'wallet_decrypt';
var WALLET_UNLOCK = exports.WALLET_UNLOCK = 'wallet_unlock';
/***/ }),
/* 36 */
/* 37 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
@ -5736,7 +5555,7 @@ var _action_types = __webpack_require__(4);
var ACTIONS = _interopRequireWildcard(_action_types);
var _reduxUtils = __webpack_require__(37);
var _reduxUtils = __webpack_require__(38);
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }
@ -5840,7 +5659,7 @@ var searchReducer = exports.searchReducer = (0, _reduxUtils.handleActions)((_han
}), _handleActions), defaultState);
/***/ }),
/* 37 */
/* 38 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
@ -5873,7 +5692,7 @@ var handleActions = exports.handleActions = function handleActions(actionMap, de
};
/***/ }),
/* 38 */
/* 39 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
@ -5905,14 +5724,7 @@ var defaultState = {
fetchingTransactions: false,
gettingNewAddress: false,
draftTransaction: buildDraftTransaction(),
sendingSupport: false,
walletIsEncrypted: false,
walletEncryptPending: false,
walletEncryptSucceded: null,
walletDecryptPending: false,
walletDecryptSucceded: null,
walletUnlockPending: false,
walletUnlockSucceded: null
sendingSupport: false
};
reducers[ACTIONS.FETCH_TRANSACTIONS_STARTED] = function (state) {
@ -6052,75 +5864,6 @@ reducers[ACTIONS.FETCH_BLOCK_SUCCESS] = function (state, action) {
return Object.assign({}, state, { blocks: blocks });
};
reducers[ACTIONS.WALLET_STATUS_COMPLETED] = function (state, action) {
return Object.assign({}, state, {
walletIsEncrypted: !!action.result.wallet_is_encrypted
});
};
reducers[ACTIONS.WALLET_ENCRYPT_START] = function (state, action) {
return Object.assign({}, state, {
walletEncryptPending: true,
walletEncryptSucceded: null
});
};
reducers[ACTIONS.WALLET_ENCRYPT_COMPLETED] = function (state, action) {
return Object.assign({}, state, {
walletEncryptPending: false,
walletEncryptSucceded: true
});
};
reducers[ACTIONS.WALLET_ENCRYPT_FAILED] = function (state, action) {
return Object.assign({}, state, {
walletEncryptPending: false,
walletEncryptSucceded: false
});
};
reducers[ACTIONS.WALLET_DECRYPT_START] = function (state, action) {
return Object.assign({}, state, {
walletDecryptPending: true,
walletDecryptSucceded: null
});
};
reducers[ACTIONS.WALLET_DECRYPT_COMPLETED] = function (state, action) {
return Object.assign({}, state, {
walletDecryptPending: false,
walletDecryptSucceded: true
});
};
reducers[ACTIONS.WALLET_DECRYPT_FAILED] = function (state, action) {
return Object.assign({}, state, {
walletDecryptPending: false,
walletDecryptSucceded: false
});
};
reducers[ACTIONS.WALLET_UNLOCK_START] = function (state, action) {
return Object.assign({}, state, {
walletUnlockPending: true,
walletUnlockSucceded: null
});
};
reducers[ACTIONS.WALLET_UNLOCK_COMPLETED] = function (state, action) {
return Object.assign({}, state, {
walletUnlockPending: false,
walletUnlockSucceded: true
});
};
reducers[ACTIONS.WALLET_UNLOCK_FAILED] = function (state, action) {
return Object.assign({}, state, {
walletUnlockPending: false,
walletUnlockSucceded: false
});
};
function walletReducer() {
var state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : defaultState;
var action = arguments[1];
@ -6131,7 +5874,7 @@ function walletReducer() {
}
/***/ }),
/* 39 */
/* 40 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
@ -6150,7 +5893,7 @@ var _action_types = __webpack_require__(4);
var ACTIONS = _interopRequireWildcard(_action_types);
var _reduxUtils = __webpack_require__(37);
var _reduxUtils = __webpack_require__(38);
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }
@ -6190,7 +5933,7 @@ var blacklistReducer = exports.blacklistReducer = (0, _reduxUtils.handleActions)
}), _handleActions), defaultState);
/***/ }),
/* 40 */
/* 41 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
@ -6212,7 +5955,7 @@ var selectBlackListedOutpoints = exports.selectBlackListedOutpoints = (0, _resel
});
/***/ }),
/* 41 */
/* 42 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
@ -6252,7 +5995,7 @@ selectNotification, function (notification) {
});
/***/ }),
/* 42 */
/* 43 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
@ -6296,7 +6039,7 @@ var makeSelectFetchingCostInfoForUri = exports.makeSelectFetchingCostInfoForUri
};
/***/ }),
/* 43 */
/* 44 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
@ -6312,7 +6055,7 @@ var COMPLETE = exports.COMPLETE = 'complete';
var MANUAL = exports.MANUAL = 'manual';
/***/ }),
/* 44 */
/* 45 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";

View file

@ -1,2 +1,9 @@
// eslint-disable-next-line import/prefer-default-export
export const SPEND = 'spend';
export const RECEIVE = 'receive';
export const PUBLISH = 'publish';
export const CHANNEL = 'channel';
export const TIP = 'tip';
export const SUPPORT = 'support';
export const UPDATE = 'update';
export const ABANDON = 'abandon';

View file

@ -3,6 +3,7 @@ import * as MODALS from 'constants/modal_types';
import * as THUMBNAIL_STATUSES from 'constants/thumbnail_upload_statuses';
import * as SEARCH_TYPES from 'constants/search';
import * as SETTINGS from 'constants/settings';
import * as TRANSACTIONS from 'constants/transaction_types';
import Lbry from 'lbry';
import Lbryapi from 'lbryapi';
import { selectState as selectSearchState } from 'redux/selectors/search';
@ -11,7 +12,7 @@ import { selectState as selectSearchState } from 'redux/selectors/search';
export { Notification } from 'types/Notification';
// constants
export { ACTIONS, MODALS, THUMBNAIL_STATUSES, SEARCH_TYPES, SETTINGS };
export { ACTIONS, MODALS, THUMBNAIL_STATUSES, SEARCH_TYPES, SETTINGS, TRANSACTIONS };
// common
export { Lbry, Lbryapi };

View file

@ -1,4 +1,5 @@
import { createSelector } from 'reselect';
import * as TRANSACTIONS from 'constants/transaction_types';
export const selectState = state => state.wallet || {};
@ -63,24 +64,28 @@ export const selectTransactionItems = createSelector(selectTransactionsById, byI
append.push(
...tx.claim_info.map(item =>
Object.assign({}, tx, item, {
type: item.claim_name[0] === '@' ? 'channel' : 'publish',
type: item.claim_name[0] === '@' ? TRANSACTIONS.CHANNEL : TRANSACTIONS.PUBLISH,
})
)
);
append.push(
...tx.support_info.map(item =>
Object.assign({}, tx, item, {
type: !item.is_tip ? 'support' : 'tip',
type: !item.is_tip ? TRANSACTIONS.SUPPORT : TRANSACTIONS.TIP,
})
)
);
append.push(...tx.update_info.map(item => Object.assign({}, tx, item, { type: 'update' })));
append.push(...tx.abandon_info.map(item => Object.assign({}, tx, item, { type: 'abandon' })));
append.push(
...tx.update_info.map(item => Object.assign({}, tx, item, { type: TRANSACTIONS.UPDATE }))
);
append.push(
...tx.abandon_info.map(item => Object.assign({}, tx, item, { type: TRANSACTIONS.ABANDON }))
);
if (!append.length) {
append.push(
Object.assign({}, tx, {
type: tx.value < 0 ? 'spend' : 'receive',
type: tx.value < 0 ? TRANSACTIONS.SPEND : TRANSACTIONS.RECEIVE,
})
);
}
@ -98,7 +103,7 @@ export const selectTransactionItems = createSelector(selectTransactionsById, byI
fee: amount < 0 ? -1 * tx.fee / append.length : 0,
claim_id: item.claim_id,
claim_name: item.claim_name,
type: item.type || 'send',
type: item.type || TRANSACTIONS.SPEND,
nout: item.nout,
};
})