-
Notifications
You must be signed in to change notification settings - Fork 0
/
types.ts
161 lines (143 loc) · 3.41 KB
/
types.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
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
// inscribe
// https://github.com/qtumproject/qtumjs-lib/blob/master/src/networks.js
export type Networks = 'qtum' | 'qtum_testnet';
export type NetworksPrefix = 'qc' | 'tq';
export interface qtumAddressInfo {
balance: number
}
export interface IPushBTCpmtRes {
status: number,
id?: string,
message?: string,
}
export interface IUtxoResItem {
transactionId: string,
outputIndex: number,
value: string,
}
export type TUtxoRes = [IUtxoResItem] | [];
export interface IQtumFeeRatesItem {
blocks: number,
feeRate: number,
}
export type TQtumFeeRatesRes = [IQtumFeeRatesItem] | [];
export interface IQtumFeeRates {
custom: string,
economy: string,
normal: string,
}
export type TFeeType = 'economy' | 'custom' | 'normal';
export interface IMintJson {
p: string,
op: string,
tick: string,
amt: string,
}
export interface IDeployJson {
p: string,
op: string,
tick: string,
max: string,
lim: string,
}
export interface IMintOrDeployParams {
scriptObj: IMintJson | IDeployJson,
inscriptionFees: number,
totalFees: number,
rAddress: string,
setModalInfo: Function,
setProgress: Function,
walletConnectFailedCB: () => void,
updateOrder: (orderItem: IOrderItem, opType: 'add' | 'update') => void,
mode: string,
}
export interface ICaclTotalFeesParams {
scriptObj: IMintJson | IDeployJson,
fee: string,
customFee: string,
feeType: string,
setInscriptionFees: Function,
setTotalFees: Function,
}
export interface IProgressInfo {
step: number,
txid: string,
}
// brc20
export type TBrc20Status = 'All' | 'Inprogress' | 'Completed';
export type TBrc20StatusParams = '' | 'in-progress' | 'completed';
export interface IBrc20ListItem {
token_name: string,
deploy_time: string,
progress: string,
holders?: number,
mint_times?: number
}
export type TBrc20List = IBrc20ListItem[] | [];
export type TBrc20BalanceList = IBrc20BalanceListItem[] | [];
export interface IBrc20ListParams {
status?: TBrc20StatusParams,
tick?: string,
page?: number,
}
export interface IBrc20BalanceListItem {
wallet_address: string,
token_name: string,
available: string,
balance?: number,
}
export interface IBrc20BalanceListParams {
address?: string,
}
// inscribe order
export type TOperationType = 'mint' | 'deploy';
export interface IOrderItem {
orderId: string,
tick: string,
quantity: string,
type: TOperationType,
status: string,
inscribeInfo: IMintJson | IDeployJson,
receiveAddress: string,
inscriptionFees: number,
txinfos: Array<{ desp: string, txid: any }>,
createTime: string,
updateTime: string,
}
export type TOrderList = IOrderItem[] | [];
export enum IOrderStatus {
PENDING = 'Pending',
INSCRIBING = 'Inscribing',
SUCCESS = 'Inscribed',
CLOSED = 'Closed',
}
// valid
export interface IValidDeployParams {
protocol: string,
chain_id: string,
ticker: string,
}
export interface IValidMintParams {
protocol: string,
chain_id: string,
ticker: string,
amount: string,
}
export type TValidData = {
is_valid: boolean,
reason: string,
}
export interface IValidResult {
code: number,
msg: string,
data: TValidData,
}
export interface ISendParams {
address: string,
amount: number,
}
export interface IModalInfo {
fundingAddress?: string,
qrImg?: any,
isWalletLoading?: boolean,
}