Merge pull request #224 from lbryio/sdk-wallet-calls
change account_* sdk calls to wallet_*
This commit is contained in:
commit
b09e1699eb
5 changed files with 38 additions and 70 deletions
16
dist/bundle.es.js
vendored
16
dist/bundle.es.js
vendored
|
@ -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,
|
||||
|
|
38
dist/flow-typed/Lbry.js
vendored
38
dist/flow-typed/Lbry.js
vendored
|
@ -129,37 +129,21 @@ declare type TxListResponse = Array<Transaction>;
|
|||
|
||||
declare type BlobListResponse = Array<string>;
|
||||
|
||||
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<CommentCreateResponse>,
|
||||
// Wallet utilities
|
||||
wallet_balance: (params: {}) => Promise<BalanceResponse>,
|
||||
account_decrypt: (prams: {}) => Promise<boolean>,
|
||||
account_encrypt: (params: {}) => Promise<boolean>,
|
||||
account_unlock: (params: {}) => Promise<boolean>,
|
||||
account_list: (params: {}) => Promise<AccountListResponse>,
|
||||
wallet_decrypt: (prams: {}) => Promise<boolean>,
|
||||
wallet_encrypt: (params: {}) => Promise<boolean>,
|
||||
wallet_unlock: (params: {}) => Promise<boolean>,
|
||||
wallet_list: (params: {}) => Promise<WalletListResponse>,
|
||||
wallet_send: (params: {}) => Promise<GenericTxResponse>,
|
||||
account_set: (params: {}) => Promise<AccountSetResponse>,
|
||||
wallet_status: (params: {}) => Promise<WalletStatusResponse>,
|
||||
address_is_mine: (params: {}) => Promise<boolean>,
|
||||
address_unused: (params: {}) => Promise<string>, // New address
|
||||
address_list: (params: {}) => Promise<string>,
|
||||
|
|
38
flow-typed/Lbry.js
vendored
38
flow-typed/Lbry.js
vendored
|
@ -129,37 +129,21 @@ declare type TxListResponse = Array<Transaction>;
|
|||
|
||||
declare type BlobListResponse = Array<string>;
|
||||
|
||||
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<CommentCreateResponse>,
|
||||
// Wallet utilities
|
||||
wallet_balance: (params: {}) => Promise<BalanceResponse>,
|
||||
account_decrypt: (prams: {}) => Promise<boolean>,
|
||||
account_encrypt: (params: {}) => Promise<boolean>,
|
||||
account_unlock: (params: {}) => Promise<boolean>,
|
||||
account_list: (params: {}) => Promise<AccountListResponse>,
|
||||
wallet_decrypt: (prams: {}) => Promise<boolean>,
|
||||
wallet_encrypt: (params: {}) => Promise<boolean>,
|
||||
wallet_unlock: (params: {}) => Promise<boolean>,
|
||||
wallet_list: (params: {}) => Promise<WalletListResponse>,
|
||||
wallet_send: (params: {}) => Promise<GenericTxResponse>,
|
||||
account_set: (params: {}) => Promise<AccountSetResponse>,
|
||||
wallet_status: (params: {}) => Promise<WalletStatusResponse>,
|
||||
address_is_mine: (params: {}) => Promise<boolean>,
|
||||
address_unused: (params: {}) => Promise<string>, // New address
|
||||
address_list: (params: {}) => Promise<string>,
|
||||
|
|
10
src/lbry.js
10
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),
|
||||
|
|
|
@ -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,
|
||||
|
|
Loading…
Reference in a new issue