-
Notifications
You must be signed in to change notification settings - Fork 295
/
wallets-actions.js
112 lines (106 loc) · 4.16 KB
/
wallets-actions.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
// @flow
import Action from './lib/Action';
import type { WalletExportTypeChoices } from '../types/walletExportTypes';
import type {
TransportDevice,
HardwareWalletExtendedPublicKeyResponse,
} from '../../../common/types/hardware-wallets.types';
import type { CsvFileContent } from '../../../common/types/csv-request.types';
import type { QuitStakePoolRequest } from '../api/staking/types';
import type { WalletSummaryAsset } from '../api/assets/types';
export type WalletImportFromFileParams = {
filePath: string,
walletName: ?string,
spendingPassword: string,
};
// ======= WALLET ACTIONS =======
export default class WalletsActions {
refreshWalletsDataSuccess: Action<any> = new Action();
/* ---------- Create Wallet ---------- */
createWallet: Action<{
name: string,
spendingPassword: string,
}> = new Action();
createWalletBegin: Action<any> = new Action();
createWalletChangeStep: Action<any> = new Action();
createWalletClose: Action<any> = new Action();
createWalletAbort: Action<any> = new Action();
/* ---------- Restore Wallet ---------- */
restoreWalletBegin: Action<any> = new Action();
restoreWalletEnd: Action<any> = new Action();
restoreWalletChangeStep: Action<any> = new Action();
restoreWalletClose: Action<any> = new Action();
restoreWalletCancelClose: Action<any> = new Action();
restoreWalletSetKind: Action<{ param?: string, kind: string }> = new Action();
restoreWalletSetMnemonics: Action<{
mnemonics: Array<string>,
}> = new Action();
restoreWalletSetConfig: Action<{
param: string,
value: string,
}> = new Action();
restoreWallet: Action<any> = new Action();
importWalletFromFile: Action<WalletImportFromFileParams> = new Action();
deleteWallet: Action<{ walletId: string, isLegacy: boolean }> = new Action();
undelegateWallet: Action<QuitStakePoolRequest> = new Action();
setUndelegateWalletSubmissionSuccess: Action<{
result: boolean,
}> = new Action();
sendMoney: Action<{
receiver: string,
amount: string,
passphrase: string,
assets?: Array<WalletSummaryAsset>,
assetsAmounts?: Array<string>,
}> = new Action();
chooseWalletExportType: Action<{
walletExportType: WalletExportTypeChoices,
}> = new Action();
generateCertificate: Action<{ filePath: string }> = new Action();
generateCsv: Action<{
filePath: string,
fileContent: CsvFileContent,
}> = new Action();
generateAddressPDF: Action<{
note: string,
address: string,
filePath: string,
}> = new Action();
generateAddressPDFSuccess: Action<{ walletAddress: string }> = new Action();
saveQRCodeImage: Action<{
address: string,
filePath: string,
}> = new Action();
saveQRCodeImageSuccess: Action<{ walletAddress: string }> = new Action();
getAccountPublicKey: Action<{ spendingPassword: string }> = new Action();
copyPublicKey: Action<{ publicKey: string }> = new Action();
copyAddress: Action<{ address: string }> = new Action();
copyAssetItem: Action<{ assetItem: string, value: string }> = new Action();
updateCertificateStep: Action<any> = new Action();
closeCertificateGeneration: Action<any> = new Action();
closeRewardsCsvGeneration: Action<any> = new Action();
setCertificateTemplate: Action<{ selectedTemplate: string }> = new Action();
finishCertificate: Action<any> = new Action();
finishRewardsCsv: Action<any> = new Action();
/* ---------- Transfer Funds ---------- */
setActiveAssetFingerprint: Action<{
fingerprint: ?string,
}> = new Action();
transferFundsNextStep: Action<any> = new Action();
transferFundsPrevStep: Action<any> = new Action();
transferFundsSetSourceWalletId: Action<{
sourceWalletId: string,
}> = new Action();
transferFundsSetTargetWalletId: Action<{
targetWalletId: string,
}> = new Action();
transferFundsRedeem: Action<any> = new Action();
transferFundsClose: Action<any> = new Action();
transferFundsCalculateFee: Action<{ sourceWalletId: string }> = new Action();
transferFunds: Action<{ spendingPassword: string }> = new Action();
createHardwareWallet: Action<{
walletName: string,
extendedPublicKey: HardwareWalletExtendedPublicKeyResponse,
device: TransportDevice,
}> = new Action();
}