From 98723e0c3cc48340d5a1c7100700fcae69298a2e Mon Sep 17 00:00:00 2001 From: Akinwale Ariwodola Date: Tue, 15 Oct 2019 23:11:03 +0100 Subject: [PATCH] change account_* sdk calls to wallet_* --- dist/bundle.es.js | 16 ++++++++-------- dist/flow-typed/Lbry.js | 38 +++++++++++-------------------------- flow-typed/Lbry.js | 38 +++++++++++-------------------------- src/lbry.js | 10 +++++----- src/redux/actions/wallet.js | 6 +++--- 5 files changed, 38 insertions(+), 70 deletions(-) diff --git a/dist/bundle.es.js b/dist/bundle.es.js index ee9fc34..bc8a50a 100644 --- a/dist/bundle.es.js +++ b/dist/bundle.es.js @@ -764,12 +764,12 @@ const Lbry = { // Wallet utilities wallet_balance: (params = {}) => daemonCallWithResult('wallet_balance', params), - account_decrypt: () => daemonCallWithResult('account_decrypt', {}), - account_encrypt: (params = {}) => daemonCallWithResult('account_encrypt', params), - account_unlock: (params = {}) => daemonCallWithResult('account_unlock', params), - account_list: (params = {}) => daemonCallWithResult('account_list', params), + wallet_decrypt: () => daemonCallWithResult('wallet_decrypt', {}), + wallet_encrypt: (params = {}) => daemonCallWithResult('wallet_encrypt', params), + wallet_unlock: (params = {}) => daemonCallWithResult('wallet_unlock', params), + wallet_list: (params = {}) => daemonCallWithResult('wallet_list', params), wallet_send: (params = {}) => daemonCallWithResult('wallet_send', params), - account_set: (params = {}) => daemonCallWithResult('account_set', params), + wallet_status: (params = {}) => daemonCallWithResult('wallet_status', params), address_is_mine: (params = {}) => daemonCallWithResult('address_is_mine', params), address_unused: (params = {}) => daemonCallWithResult('address_unused', params), address_list: (params = {}) => daemonCallWithResult('address_list', params), @@ -2390,7 +2390,7 @@ function doWalletEncrypt(newPassword) { type: WALLET_ENCRYPT_START }); - lbryProxy.account_encrypt({ new_password: newPassword }).then(result => { + lbryProxy.wallet_encrypt({ new_password: newPassword }).then(result => { if (result === true) { dispatch({ type: WALLET_ENCRYPT_COMPLETED, @@ -2412,7 +2412,7 @@ function doWalletUnlock(password) { type: WALLET_UNLOCK_START }); - lbryProxy.account_unlock({ password }).then(result => { + lbryProxy.wallet_unlock({ password }).then(result => { if (result === true) { dispatch({ type: WALLET_UNLOCK_COMPLETED, @@ -2434,7 +2434,7 @@ function doWalletDecrypt() { type: WALLET_DECRYPT_START }); - lbryProxy.account_decrypt().then(result => { + lbryProxy.wallet_decrypt().then(result => { if (result === true) { dispatch({ type: WALLET_DECRYPT_COMPLETED, diff --git a/dist/flow-typed/Lbry.js b/dist/flow-typed/Lbry.js index 1db0dc8..200acce 100644 --- a/dist/flow-typed/Lbry.js +++ b/dist/flow-typed/Lbry.js @@ -129,37 +129,21 @@ declare type TxListResponse = Array; declare type BlobListResponse = Array; -declare type AccountListResponse = Array<{ +declare type WalletListResponse = Array<{ id: string, - is_default: string, - ledger: string, name: string, - seed: string, - encrypted: string, - private_key: string, - public_key: string, - address_generator: string, - modified_on: string, }>; +declare type WalletStatusResponse = { + is_encrypted: boolean, + is_locked: boolean, +}; + declare type SyncApplyResponse = { hash: string, data: string, }; -declare type AccountSetResponse = Array<{ - id: string, - is_default: string, - ledger: string, - name: string, - seed: string, - encrypted: string, - private_key: string, - public_key: string, - address_generator: string, - modified_on: string, -}>; - declare type SupportAbandonResponse = GenericTxResponse; // @@ -211,12 +195,12 @@ declare type LbryTypes = { comment_create: (params: {}) => Promise, // Wallet utilities wallet_balance: (params: {}) => Promise, - account_decrypt: (prams: {}) => Promise, - account_encrypt: (params: {}) => Promise, - account_unlock: (params: {}) => Promise, - account_list: (params: {}) => Promise, + wallet_decrypt: (prams: {}) => Promise, + wallet_encrypt: (params: {}) => Promise, + wallet_unlock: (params: {}) => Promise, + wallet_list: (params: {}) => Promise, wallet_send: (params: {}) => Promise, - account_set: (params: {}) => Promise, + wallet_status: (params: {}) => Promise, address_is_mine: (params: {}) => Promise, address_unused: (params: {}) => Promise, // New address address_list: (params: {}) => Promise, diff --git a/flow-typed/Lbry.js b/flow-typed/Lbry.js index 1db0dc8..200acce 100644 --- a/flow-typed/Lbry.js +++ b/flow-typed/Lbry.js @@ -129,37 +129,21 @@ declare type TxListResponse = Array; declare type BlobListResponse = Array; -declare type AccountListResponse = Array<{ +declare type WalletListResponse = Array<{ id: string, - is_default: string, - ledger: string, name: string, - seed: string, - encrypted: string, - private_key: string, - public_key: string, - address_generator: string, - modified_on: string, }>; +declare type WalletStatusResponse = { + is_encrypted: boolean, + is_locked: boolean, +}; + declare type SyncApplyResponse = { hash: string, data: string, }; -declare type AccountSetResponse = Array<{ - id: string, - is_default: string, - ledger: string, - name: string, - seed: string, - encrypted: string, - private_key: string, - public_key: string, - address_generator: string, - modified_on: string, -}>; - declare type SupportAbandonResponse = GenericTxResponse; // @@ -211,12 +195,12 @@ declare type LbryTypes = { comment_create: (params: {}) => Promise, // Wallet utilities wallet_balance: (params: {}) => Promise, - account_decrypt: (prams: {}) => Promise, - account_encrypt: (params: {}) => Promise, - account_unlock: (params: {}) => Promise, - account_list: (params: {}) => Promise, + wallet_decrypt: (prams: {}) => Promise, + wallet_encrypt: (params: {}) => Promise, + wallet_unlock: (params: {}) => Promise, + wallet_list: (params: {}) => Promise, wallet_send: (params: {}) => Promise, - account_set: (params: {}) => Promise, + wallet_status: (params: {}) => Promise, address_is_mine: (params: {}) => Promise, address_unused: (params: {}) => Promise, // New address address_list: (params: {}) => Promise, diff --git a/src/lbry.js b/src/lbry.js index f13e945..8761c72 100644 --- a/src/lbry.js +++ b/src/lbry.js @@ -94,12 +94,12 @@ const Lbry: LbryTypes = { // Wallet utilities wallet_balance: (params = {}) => daemonCallWithResult('wallet_balance', params), - account_decrypt: () => daemonCallWithResult('account_decrypt', {}), - account_encrypt: (params = {}) => daemonCallWithResult('account_encrypt', params), - account_unlock: (params = {}) => daemonCallWithResult('account_unlock', params), - account_list: (params = {}) => daemonCallWithResult('account_list', params), + wallet_decrypt: () => daemonCallWithResult('wallet_decrypt', {}), + wallet_encrypt: (params = {}) => daemonCallWithResult('wallet_encrypt', params), + wallet_unlock: (params = {}) => daemonCallWithResult('wallet_unlock', params), + wallet_list: (params = {}) => daemonCallWithResult('wallet_list', params), wallet_send: (params = {}) => daemonCallWithResult('wallet_send', params), - account_set: (params = {}) => daemonCallWithResult('account_set', params), + wallet_status: (params = {}) => daemonCallWithResult('wallet_status', params), address_is_mine: (params = {}) => daemonCallWithResult('address_is_mine', params), address_unused: (params = {}) => daemonCallWithResult('address_unused', params), address_list: (params = {}) => daemonCallWithResult('address_list', params), diff --git a/src/redux/actions/wallet.js b/src/redux/actions/wallet.js index 4078649..2f4f87b 100644 --- a/src/redux/actions/wallet.js +++ b/src/redux/actions/wallet.js @@ -264,7 +264,7 @@ export function doWalletEncrypt(newPassword) { type: ACTIONS.WALLET_ENCRYPT_START, }); - Lbry.account_encrypt({ new_password: newPassword }).then(result => { + Lbry.wallet_encrypt({ new_password: newPassword }).then(result => { if (result === true) { dispatch({ type: ACTIONS.WALLET_ENCRYPT_COMPLETED, @@ -286,7 +286,7 @@ export function doWalletUnlock(password) { type: ACTIONS.WALLET_UNLOCK_START, }); - Lbry.account_unlock({ password }).then(result => { + Lbry.wallet_unlock({ password }).then(result => { if (result === true) { dispatch({ type: ACTIONS.WALLET_UNLOCK_COMPLETED, @@ -330,7 +330,7 @@ export function doWalletDecrypt() { type: ACTIONS.WALLET_DECRYPT_START, }); - Lbry.account_decrypt().then(result => { + Lbry.wallet_decrypt().then(result => { if (result === true) { dispatch({ type: ACTIONS.WALLET_DECRYPT_COMPLETED,