This repository has been archived by the owner on Jul 7, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 16
/
wallet.models.ts
121 lines (115 loc) · 3.77 KB
/
wallet.models.ts
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
113
114
115
116
117
118
119
120
121
import { Coins, Contracts } from "@arkecosystem/platform-sdk";
import { BigNumber } from "@arkecosystem/platform-sdk-support";
import { ExtendedTransactionDataCollection } from "../dto/transaction-collection";
import { DataRepository } from "../repositories/data-repository";
import { SettingRepository } from "../repositories/setting-repository";
import { EntityRegistrationAggregate } from "./aggregates/entity-registration-aggregate";
import { EntityResignationAggregate } from "./aggregates/entity-resignation-aggregate";
import { EntityUpdateAggregate } from "./aggregates/entity-update-aggregate";
import { NetworkData } from "./network";
import { ReadOnlyWallet } from "./read-only-wallet";
import { TransactionService } from "./wallet-transaction-service";
export interface WalletStruct {
id: string;
coin: string | undefined;
coinConfig: {
network: {
crypto: {
slip44: number;
};
currency: {
symbol: string;
ticker: string;
};
explorer: string;
hosts: string[];
id: string;
name: string;
};
};
network: string;
address: string;
publicKey: string | undefined;
data: Record<string, any>;
settings: Record<string, any>;
}
export enum WalletSetting {
Alias = "ALIAS",
Avatar = "AVATAR",
Peer = "PEER",
}
export enum WalletData {
Balance = "BALANCE",
BroadcastedTransactions = "BROADCASTED_TRANSACTIONS",
Delegates = "DELEGATES",
ExchangeRate = "EXCHANGE_RATE",
MultiSignatureParticipants = "MULTI_SIGNATURE_PARTICIPANTS",
Sequence = "SEQUENCE",
SignedTransactions = "SIGNED_TRANSACTIONS",
Votes = "VOTES",
VotesAvailable = "VOTES_AVAILABLE",
VotesUsed = "VOTES_USED",
WaitingForOtherSignatures = "WAITING_FOR_OTHER_SIGNATURES",
WaitingForOurSignature = "WAITING_FOR_OUR_SIGNATURE",
}
export enum WalletFlag {
Ledger = "LEDGER",
Starred = "STARRED",
}
export interface ReadWriteWallet {
setCoin(coin: string, network: string): Promise<ReadWriteWallet>;
setIdentity(mnemonic: string): Promise<ReadWriteWallet>;
setAddress(address: string): Promise<ReadWriteWallet>;
setAvatar(value: string): ReadWriteWallet;
hasSyncedWithNetwork(): boolean;
id(): string;
coin(): Coins.Coin;
network(): NetworkData;
currency(): string;
alias(): string | undefined;
address(): string;
publicKey(): string | undefined;
balance(): BigNumber;
convertedBalance(): BigNumber;
nonce(): BigNumber;
avatar(): string;
data(): DataRepository;
settings(): SettingRepository;
toObject(): WalletStruct;
isDelegate(): boolean;
isResignedDelegate(): boolean;
isKnown(): boolean;
isLedger(): boolean;
isMultiSignature(): boolean;
isSecondSignature(): boolean;
isStarred(): boolean;
toggleStarred(): void;
coinId(): string;
networkId(): string;
manifest(): Coins.Manifest;
config(): Coins.Config;
guard(): Coins.Guard;
client(): Contracts.ClientService;
identity(): Contracts.IdentityService;
ledger(): Contracts.LedgerService;
link(): Contracts.LinkService;
message(): Contracts.MessageService;
peer(): Contracts.PeerService;
transaction(): TransactionService;
transactions(query: Contracts.ClientTransactionsInput): Promise<ExtendedTransactionDataCollection>;
sentTransactions(query: Contracts.ClientTransactionsInput): Promise<ExtendedTransactionDataCollection>;
receivedTransactions(query: Contracts.ClientTransactionsInput): Promise<ExtendedTransactionDataCollection>;
multiSignature(): Contracts.WalletMultiSignature;
multiSignatureParticipants(): ReadOnlyWallet[];
votes(): ReadOnlyWallet[];
votesAvailable(): number;
votesUsed(): number;
explorerLink(): string;
entityRegistrationAggregate(): EntityRegistrationAggregate;
entityResignationAggregate(): EntityResignationAggregate;
entityUpdateAggregate(): EntityUpdateAggregate;
syncIdentity(): Promise<void>;
syncMultiSignature(): Promise<void>;
syncVotes(): Promise<void>;
syncExchangeRate(): Promise<void>;
}