/
rewardsExtensions.d.ts
151 lines (134 loc) · 3.06 KB
/
rewardsExtensions.d.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
declare namespace RewardsExtension {
interface State {
currentGrant?: GrantInfo
currentNotification?: string
enabledAC: boolean
enabledMain: boolean
notifications: Record<string, Notification>
publishers: Record<string, Publisher>
report: Report
grants?: GrantInfo[]
pendingContributionTotal: number
walletCorrupted: boolean
walletCreated: boolean
walletCreating: boolean
walletCreateFailed: boolean
walletProperties: WalletProperties
recurringTips: Record<string, number>[]
tipAmounts: Record<string, number[]>
}
interface ApplicationState {
rewardsPanelData: State | undefined
}
interface ComponentProps {
actions: any
rewardsPanelData: State
}
interface Publisher {
excluded?: boolean
favicon_url?: string
publisher_key?: string
name?: string
percentage?: number
provider?: string
tabId?: number
tabUrl?: string
url?: string
verified?: boolean
}
export interface Grant {
altcurrency: string
probi: string
expiryTime: number
type: string
}
export type GrantStatus = 'wrongPosition' | 'grantGone' | 'generalError' | 'grantAlreadyClaimed' | number | null
export interface GrantInfo {
promotionId?: string
altcurrency?: string
probi: string
expiryTime: number
captcha?: string
hint?: string
status?: GrantStatus
type?: string
}
export interface GrantResponse {
promotionId?: string
status?: number
type?: string
}
export interface GrantFinish {
result: Result,
statusCode: number,
expiryTime: number
}
export const enum Result {
LEDGER_OK = 0,
LEDGER_ERROR = 1,
NO_PUBLISHER_STATE = 2,
NO_LEDGER_STATE = 3,
INVALID_PUBLISHER_STATE = 4,
INVALID_LEDGER_STATE = 5,
CAPTCHA_FAILED = 6,
NO_PUBLISHER_LIST = 7,
TOO_MANY_RESULTS = 8,
NOT_FOUND = 9,
REGISTRATION_VERIFICATION_FAILED = 10,
BAD_REGISTRATION_RESPONSE = 11,
WALLET_CREATED = 12,
GRANT_NOT_FOUND = 13,
WALLET_CORRUPT = 17
}
export interface Captcha {
image: string
hint: string
}
export interface WalletProperties {
balance: number
probi: string
rates: Record<string, number>
grants?: Grant[]
}
export interface Report {
ads: string
closing: string
contribute: string
deposit: string
donation: string
grant: string
tips: string
opening: string
total: string
}
export interface Notification {
id: string
type: number
timestamp: number
args: string[]
}
interface PublisherNormalized {
publisher_key: string
percentage: number
verified: boolean
}
interface ExcludedSitesChanged {
publisher_key: string
excluded: boolean
}
interface RecurringTips {
recurringTips: Record<string, number>[]
}
interface PublisherBanner {
publisherKey: string
name: string
title: string
description: string
background: string
logo: string
amounts: number[],
provider: string
social: Record<string, string>
verified: boolean
}
}