@blockscout/contracts-info-types 0.0.1-beta.820070b

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,306 @@
1
+ export interface Pagination {
2
+ page_token: string;
3
+ page_size: number;
4
+ }
5
+ export interface Pool {
6
+ pool_id: string;
7
+ contract_address: string;
8
+ /** Either just `chain_id` or `chain_id:instance_id` */
9
+ chain_id: string;
10
+ is_contract: boolean;
11
+ base_token_address: string;
12
+ base_token_symbol: string;
13
+ base_token_icon_url?: string | undefined;
14
+ quote_token_address: string;
15
+ quote_token_symbol: string;
16
+ quote_token_icon_url?: string | undefined;
17
+ base_token_fully_diluted_valuation_usd: string;
18
+ base_token_market_cap_usd: string;
19
+ quote_token_fully_diluted_valuation_usd?: string | undefined;
20
+ quote_token_market_cap_usd?: string | undefined;
21
+ fee?: string | undefined;
22
+ liquidity: string;
23
+ dex: Dex | undefined;
24
+ coin_gecko_terminal_url: string;
25
+ }
26
+ export interface Dex {
27
+ id: string;
28
+ name: string;
29
+ }
30
+ export interface GetPoolRequest {
31
+ contract_address: string;
32
+ /** Either just `chain_id` or `chain_id:instance_id` */
33
+ chain_id: string;
34
+ }
35
+ export interface CheckPoolExistsRequest {
36
+ contract_address: string;
37
+ /** Either just `chain_id` or `chain_id:instance_id` */
38
+ chain_id: string;
39
+ }
40
+ export interface CheckPoolExistsResponse {
41
+ base_token_symbol: string;
42
+ quote_token_symbol: string;
43
+ }
44
+ export interface ListPoolsRequest {
45
+ /** Either just `chain_id` or `chain_id:instance_id` */
46
+ chain_id: string;
47
+ query?: string | undefined;
48
+ page_token?: string | undefined;
49
+ page_size?: number | undefined;
50
+ }
51
+ export interface ListPoolsResponse {
52
+ items: Pool[];
53
+ next_page_params: Pagination | undefined;
54
+ }
55
+ export interface ListDexesRequest {
56
+ /** Either just `chain_id` or `chain_id:instance_id` */
57
+ chain_id: string;
58
+ }
59
+ export interface ListDexesResponse {
60
+ items: Dex[];
61
+ }
62
+ export interface ImportPoolsAdminRequest {
63
+ pools: Pool[];
64
+ }
65
+ export interface ImportPoolsAdminResponse {
66
+ /** / List of inserted or updated pools */
67
+ pools: Pool[];
68
+ }
69
+ export interface ImportChainDexesAdminRequest {
70
+ /** Either just `chain_id` or `chain_id:instance_id` */
71
+ chain_id: string;
72
+ dexes: Dex[];
73
+ }
74
+ export interface ImportChainDexesAdminResponse {
75
+ /** / List of inserted or updated dexes */
76
+ dexes: Dex[];
77
+ }
78
+ export interface RefetchNftMetadataAdminRequest {
79
+ /** Either just `chain_id` or `chain_id:instance_id` */
80
+ chain_id: string;
81
+ nft_address: string;
82
+ }
83
+ export interface RefetchNftMetadataAdminResponse {
84
+ }
85
+ export interface TokenInfo {
86
+ /** Ethereum address of the token the info corresponds to, as lowercase hex string */
87
+ token_address: string;
88
+ /**
89
+ * Backward-compatible field name: value is the chain_specifier (`"1"` or `"1:instance_tail"`),
90
+ * not "numeric id only" in general.
91
+ */
92
+ chain_id: string;
93
+ project_name?: string | undefined;
94
+ project_website: string;
95
+ project_email: string;
96
+ icon_url: string;
97
+ project_description: string;
98
+ project_sector?: string | undefined;
99
+ docs?: string | undefined;
100
+ github?: string | undefined;
101
+ telegram?: string | undefined;
102
+ linkedin?: string | undefined;
103
+ discord?: string | undefined;
104
+ slack?: string | undefined;
105
+ twitter?: string | undefined;
106
+ open_sea?: string | undefined;
107
+ facebook?: string | undefined;
108
+ medium?: string | undefined;
109
+ reddit?: string | undefined;
110
+ support?: string | undefined;
111
+ coin_market_cap_ticker?: string | undefined;
112
+ coin_gecko_ticker?: string | undefined;
113
+ defi_llama_ticker?: string | undefined;
114
+ token_name?: string | undefined;
115
+ token_symbol?: string | undefined;
116
+ }
117
+ export interface GetTokenInfoRequest {
118
+ /** The address of the token which token info resource to retrieve. */
119
+ token_address: string;
120
+ /** Either just `chain_id` or `chain_id:instance_id` */
121
+ chain_id: string;
122
+ }
123
+ /**
124
+ * An user id whose token infos should be listed.
125
+ * The JWT token that corresponds to this user id must be provided via metadata.
126
+ * string user_id = 1;
127
+ */
128
+ export interface ListUserTokenInfosRequest {
129
+ /** Either just `chain_id` or `chain_id:instance_id` */
130
+ chain_id: string;
131
+ }
132
+ export interface ListTokenInfosResponse {
133
+ token_infos: TokenInfo[];
134
+ }
135
+ export interface SearchTokenInfosRequest {
136
+ query: string;
137
+ /**
138
+ * If not provided, search will be performed across all chains.
139
+ * Actually it's a list of chain specifiers.
140
+ * A specifier is just `chain_id` or `chain_id:instance_id`
141
+ */
142
+ chain_id: string[];
143
+ page_token?: string | undefined;
144
+ page_size?: number | undefined;
145
+ }
146
+ export interface SearchTokenInfosResponse {
147
+ token_infos: TokenInfo[];
148
+ next_page_params: Pagination | undefined;
149
+ }
150
+ export interface ListTokenInfoChainsRequest {
151
+ }
152
+ export interface ListTokenInfoChainsResponse {
153
+ chains: string[];
154
+ chain_specifiers: string[];
155
+ }
156
+ export interface AddressMetadata {
157
+ token_name?: string | undefined;
158
+ token_symbol?: string | undefined;
159
+ }
160
+ export interface VerifiedAddress {
161
+ user_id: string;
162
+ /** Backward-compatible field name: value is the canonical chain specifier string (same as stored in DB). */
163
+ chain_id: string;
164
+ contract_address: string;
165
+ verified_date: string;
166
+ metadata: AddressMetadata | undefined;
167
+ }
168
+ export interface VerifiedAddressOwner {
169
+ /** Id of the user who owns the contract. */
170
+ user_email: string;
171
+ }
172
+ export interface VerifyAddressRequest {
173
+ /**
174
+ * Id of the chain the verification request is sent from.
175
+ * Due to internal limitations must be not greater than 2^63-1 (9223372036854775807).
176
+ * Either just `chain_id` or `chain_id:instance_id`
177
+ */
178
+ chain_id: string;
179
+ /** Address of the contract being verified */
180
+ contract_address: string;
181
+ /** A message user signed. */
182
+ message: string;
183
+ /** Result of the user signing the message */
184
+ signature: string;
185
+ }
186
+ export interface VerifyAddressResponse {
187
+ status: VerifyAddressResponse_Status;
188
+ result?: VerifyAddressResponse_Success | undefined;
189
+ invalid_signer?: VerifyAddressResponse_InvalidSignerError | undefined;
190
+ }
191
+ export declare enum VerifyAddressResponse_Status {
192
+ UNKNOWN_STATUS = "UNKNOWN_STATUS",
193
+ SUCCESS = "SUCCESS",
194
+ VALIDITY_EXPIRED_ERROR = "VALIDITY_EXPIRED_ERROR",
195
+ INVALID_SIGNATURE_ERROR = "INVALID_SIGNATURE_ERROR",
196
+ INVALID_SIGNER_ERROR = "INVALID_SIGNER_ERROR"
197
+ }
198
+ export interface VerifyAddressResponse_Success {
199
+ verified_address: VerifiedAddress | undefined;
200
+ }
201
+ export interface VerifyAddressResponse_InvalidSignerError {
202
+ signer: string;
203
+ valid_addresses: string[];
204
+ }
205
+ export interface PrepareAddressRequest {
206
+ /**
207
+ * Id of the chain the validation request is sent from.
208
+ * Due to internal limitations must be not greater than 2^63-1 (9223372036854775807).
209
+ * Either just `chain_id` or `chain_id:instance_id`
210
+ */
211
+ chain_id: string;
212
+ /** Address of the contract being validated and prepared */
213
+ contract_address: string;
214
+ }
215
+ export interface PrepareAddressResponse {
216
+ status: PrepareAddressResponse_Status;
217
+ result?: PrepareAddressResponse_Success | undefined;
218
+ }
219
+ export declare enum PrepareAddressResponse_Status {
220
+ UNKNOWN_STATUS = "UNKNOWN_STATUS",
221
+ SUCCESS = "SUCCESS",
222
+ /** IS_OWNER_ERROR - User is already an owner of the address. */
223
+ IS_OWNER_ERROR = "IS_OWNER_ERROR",
224
+ /** OWNERSHIP_VERIFIED_ERROR - Address ownership has been verified by another account. */
225
+ OWNERSHIP_VERIFIED_ERROR = "OWNERSHIP_VERIFIED_ERROR",
226
+ /** SOURCE_CODE_NOT_VERIFIED_ERROR - Contract source code has not been verified. */
227
+ SOURCE_CODE_NOT_VERIFIED_ERROR = "SOURCE_CODE_NOT_VERIFIED_ERROR",
228
+ /** INVALID_ADDRESS_ERROR - Specified address either does not exist or is EOA. */
229
+ INVALID_ADDRESS_ERROR = "INVALID_ADDRESS_ERROR"
230
+ }
231
+ export interface PrepareAddressResponse_Success {
232
+ /** Message, the user have to sign for address verification. */
233
+ signing_message: string;
234
+ /** Address of the contract creator. */
235
+ contract_creator: string;
236
+ /** (optional) Result of the owner() contract method call, if any. */
237
+ contract_owner?: string | undefined;
238
+ }
239
+ export interface ListUserVerifiedAddressesRequest {
240
+ /**
241
+ * Id of the chain the user wants to list verified addresses from.
242
+ * Due to internal limitations must be not greater than 2^63-1 (9223372036854775807).
243
+ * Either just `chain_id` or `chain_id:instance_id`
244
+ */
245
+ chain_id: string;
246
+ }
247
+ export interface ListUserVerifiedAddressesResponse {
248
+ verified_addresses: VerifiedAddress[];
249
+ }
250
+ export interface GetVerifiedAddressOwnerAdminRequest {
251
+ /**
252
+ * Id of the chain the contract is deployed at.
253
+ * Either just `chain_id` or `chain_id:instance_id`
254
+ */
255
+ chain_id: string;
256
+ /** The address of the contract. */
257
+ address: string;
258
+ }
259
+ export interface ImportTokenInfoAdminRequest {
260
+ /** Token info to be imported. */
261
+ token_info: TokenInfo | undefined;
262
+ }
263
+ export interface ContractsInfo {
264
+ /** Returns a specific token info. */
265
+ GetTokenInfo(request: GetTokenInfoRequest): Promise<TokenInfo>;
266
+ /**
267
+ * Returns a list of all token infos submitted by the user.
268
+ * User must be authenticated and can get only those token infos, they submitted.
269
+ */
270
+ ListUserTokenInfos(request: ListUserTokenInfosRequest): Promise<ListTokenInfosResponse>;
271
+ /** Returns a list of token infos matching the search query. */
272
+ SearchTokenInfos(request: SearchTokenInfosRequest): Promise<SearchTokenInfosResponse>;
273
+ /** Returns a list of all chains with at least one token info. */
274
+ ListTokenInfoChains(request: ListTokenInfoChainsRequest): Promise<ListTokenInfoChainsResponse>;
275
+ /** Verifies a new address, belonging to the user. */
276
+ VerifyAddress(request: VerifyAddressRequest): Promise<VerifyAddressResponse>;
277
+ /** Validate and prepare address to being verified. */
278
+ PrepareAddress(request: PrepareAddressRequest): Promise<PrepareAddressResponse>;
279
+ /** Returns a list of all addresses verified by the user. User must be authenticated. */
280
+ ListUserVerifiedAddresses(request: ListUserVerifiedAddressesRequest): Promise<ListUserVerifiedAddressesResponse>;
281
+ /**
282
+ * Adds a new token info into the database, if corresponding contract
283
+ * does not have token info, or updates the existing token info.
284
+ * Returns the newly added token info.
285
+ * Only admin service must have the access to that method.
286
+ */
287
+ ImportTokenInfoAdmin(request: ImportTokenInfoAdminRequest): Promise<TokenInfo>;
288
+ /**
289
+ * Returns an owner of the contract given the contract address if the ownership has been verified.
290
+ * Only admin service must have the access to that method.
291
+ */
292
+ GetVerifiedAddressOwnerAdmin(request: GetVerifiedAddressOwnerAdminRequest): Promise<VerifiedAddressOwner>;
293
+ GetPool(request: GetPoolRequest): Promise<Pool>;
294
+ /**
295
+ * If pool exists returns the symbol values of corresponding tokens,
296
+ * otherwise returns NotFound error.
297
+ * Is supposed not to cause updates on pool real-time values, thus,
298
+ * should provide quicker responses on requests which do not require pool info updates.
299
+ */
300
+ CheckPoolExists(request: CheckPoolExistsRequest): Promise<CheckPoolExistsResponse>;
301
+ ListPools(request: ListPoolsRequest): Promise<ListPoolsResponse>;
302
+ ListDexes(request: ListDexesRequest): Promise<ListDexesResponse>;
303
+ ImportPoolsAdmin(request: ImportPoolsAdminRequest): Promise<ImportPoolsAdminResponse>;
304
+ ImportChainDexesAdmin(request: ImportChainDexesAdminRequest): Promise<ImportChainDexesAdminResponse>;
305
+ RefetchNftMetadataAdmin(request: RefetchNftMetadataAdminRequest): Promise<RefetchNftMetadataAdminResponse>;
306
+ }
@@ -0,0 +1,26 @@
1
+ // Code generated by protoc-gen-ts_proto. DO NOT EDIT.
2
+ // versions:
3
+ // protoc-gen-ts_proto v1.176.2
4
+ // protoc v5.27.0
5
+ // source: contracts_info.proto
6
+ export var VerifyAddressResponse_Status;
7
+ (function (VerifyAddressResponse_Status) {
8
+ VerifyAddressResponse_Status["UNKNOWN_STATUS"] = "UNKNOWN_STATUS";
9
+ VerifyAddressResponse_Status["SUCCESS"] = "SUCCESS";
10
+ VerifyAddressResponse_Status["VALIDITY_EXPIRED_ERROR"] = "VALIDITY_EXPIRED_ERROR";
11
+ VerifyAddressResponse_Status["INVALID_SIGNATURE_ERROR"] = "INVALID_SIGNATURE_ERROR";
12
+ VerifyAddressResponse_Status["INVALID_SIGNER_ERROR"] = "INVALID_SIGNER_ERROR";
13
+ })(VerifyAddressResponse_Status || (VerifyAddressResponse_Status = {}));
14
+ export var PrepareAddressResponse_Status;
15
+ (function (PrepareAddressResponse_Status) {
16
+ PrepareAddressResponse_Status["UNKNOWN_STATUS"] = "UNKNOWN_STATUS";
17
+ PrepareAddressResponse_Status["SUCCESS"] = "SUCCESS";
18
+ /** IS_OWNER_ERROR - User is already an owner of the address. */
19
+ PrepareAddressResponse_Status["IS_OWNER_ERROR"] = "IS_OWNER_ERROR";
20
+ /** OWNERSHIP_VERIFIED_ERROR - Address ownership has been verified by another account. */
21
+ PrepareAddressResponse_Status["OWNERSHIP_VERIFIED_ERROR"] = "OWNERSHIP_VERIFIED_ERROR";
22
+ /** SOURCE_CODE_NOT_VERIFIED_ERROR - Contract source code has not been verified. */
23
+ PrepareAddressResponse_Status["SOURCE_CODE_NOT_VERIFIED_ERROR"] = "SOURCE_CODE_NOT_VERIFIED_ERROR";
24
+ /** INVALID_ADDRESS_ERROR - Specified address either does not exist or is EOA. */
25
+ PrepareAddressResponse_Status["INVALID_ADDRESS_ERROR"] = "INVALID_ADDRESS_ERROR";
26
+ })(PrepareAddressResponse_Status || (PrepareAddressResponse_Status = {}));
@@ -0,0 +1,354 @@
1
+ // Code generated by protoc-gen-ts_proto. DO NOT EDIT.
2
+ // versions:
3
+ // protoc-gen-ts_proto v1.176.2
4
+ // protoc v5.27.0
5
+ // source: contracts_info.proto
6
+
7
+ /* eslint-disable */
8
+
9
+ export interface Pagination {
10
+ page_token: string;
11
+ page_size: number;
12
+ }
13
+
14
+ export interface Pool {
15
+ pool_id: string;
16
+ contract_address: string;
17
+ /** Either just `chain_id` or `chain_id:instance_id` */
18
+ chain_id: string;
19
+ is_contract: boolean;
20
+ base_token_address: string;
21
+ base_token_symbol: string;
22
+ base_token_icon_url?: string | undefined;
23
+ quote_token_address: string;
24
+ quote_token_symbol: string;
25
+ quote_token_icon_url?: string | undefined;
26
+ base_token_fully_diluted_valuation_usd: string;
27
+ base_token_market_cap_usd: string;
28
+ quote_token_fully_diluted_valuation_usd?: string | undefined;
29
+ quote_token_market_cap_usd?: string | undefined;
30
+ fee?: string | undefined;
31
+ liquidity: string;
32
+ dex: Dex | undefined;
33
+ coin_gecko_terminal_url: string;
34
+ }
35
+
36
+ export interface Dex {
37
+ id: string;
38
+ name: string;
39
+ }
40
+
41
+ export interface GetPoolRequest {
42
+ contract_address: string;
43
+ /** Either just `chain_id` or `chain_id:instance_id` */
44
+ chain_id: string;
45
+ }
46
+
47
+ export interface CheckPoolExistsRequest {
48
+ contract_address: string;
49
+ /** Either just `chain_id` or `chain_id:instance_id` */
50
+ chain_id: string;
51
+ }
52
+
53
+ export interface CheckPoolExistsResponse {
54
+ base_token_symbol: string;
55
+ quote_token_symbol: string;
56
+ }
57
+
58
+ export interface ListPoolsRequest {
59
+ /** Either just `chain_id` or `chain_id:instance_id` */
60
+ chain_id: string;
61
+ query?: string | undefined;
62
+ page_token?: string | undefined;
63
+ page_size?: number | undefined;
64
+ }
65
+
66
+ export interface ListPoolsResponse {
67
+ items: Pool[];
68
+ next_page_params: Pagination | undefined;
69
+ }
70
+
71
+ export interface ListDexesRequest {
72
+ /** Either just `chain_id` or `chain_id:instance_id` */
73
+ chain_id: string;
74
+ }
75
+
76
+ export interface ListDexesResponse {
77
+ items: Dex[];
78
+ }
79
+
80
+ export interface ImportPoolsAdminRequest {
81
+ pools: Pool[];
82
+ }
83
+
84
+ export interface ImportPoolsAdminResponse {
85
+ /** / List of inserted or updated pools */
86
+ pools: Pool[];
87
+ }
88
+
89
+ export interface ImportChainDexesAdminRequest {
90
+ /** Either just `chain_id` or `chain_id:instance_id` */
91
+ chain_id: string;
92
+ dexes: Dex[];
93
+ }
94
+
95
+ export interface ImportChainDexesAdminResponse {
96
+ /** / List of inserted or updated dexes */
97
+ dexes: Dex[];
98
+ }
99
+
100
+ export interface RefetchNftMetadataAdminRequest {
101
+ /** Either just `chain_id` or `chain_id:instance_id` */
102
+ chain_id: string;
103
+ nft_address: string;
104
+ }
105
+
106
+ export interface RefetchNftMetadataAdminResponse {
107
+ }
108
+
109
+ export interface TokenInfo {
110
+ /** Ethereum address of the token the info corresponds to, as lowercase hex string */
111
+ token_address: string;
112
+ /**
113
+ * Backward-compatible field name: value is the chain_specifier (`"1"` or `"1:instance_tail"`),
114
+ * not "numeric id only" in general.
115
+ */
116
+ chain_id: string;
117
+ project_name?: string | undefined;
118
+ project_website: string;
119
+ project_email: string;
120
+ icon_url: string;
121
+ project_description: string;
122
+ project_sector?: string | undefined;
123
+ docs?: string | undefined;
124
+ github?: string | undefined;
125
+ telegram?: string | undefined;
126
+ linkedin?: string | undefined;
127
+ discord?: string | undefined;
128
+ slack?: string | undefined;
129
+ twitter?: string | undefined;
130
+ open_sea?: string | undefined;
131
+ facebook?: string | undefined;
132
+ medium?: string | undefined;
133
+ reddit?: string | undefined;
134
+ support?: string | undefined;
135
+ coin_market_cap_ticker?: string | undefined;
136
+ coin_gecko_ticker?: string | undefined;
137
+ defi_llama_ticker?: string | undefined;
138
+ token_name?: string | undefined;
139
+ token_symbol?: string | undefined;
140
+ }
141
+
142
+ export interface GetTokenInfoRequest {
143
+ /** The address of the token which token info resource to retrieve. */
144
+ token_address: string;
145
+ /** Either just `chain_id` or `chain_id:instance_id` */
146
+ chain_id: string;
147
+ }
148
+
149
+ /**
150
+ * An user id whose token infos should be listed.
151
+ * The JWT token that corresponds to this user id must be provided via metadata.
152
+ * string user_id = 1;
153
+ */
154
+ export interface ListUserTokenInfosRequest {
155
+ /** Either just `chain_id` or `chain_id:instance_id` */
156
+ chain_id: string;
157
+ }
158
+
159
+ export interface ListTokenInfosResponse {
160
+ token_infos: TokenInfo[];
161
+ }
162
+
163
+ export interface SearchTokenInfosRequest {
164
+ query: string;
165
+ /**
166
+ * If not provided, search will be performed across all chains.
167
+ * Actually it's a list of chain specifiers.
168
+ * A specifier is just `chain_id` or `chain_id:instance_id`
169
+ */
170
+ chain_id: string[];
171
+ page_token?: string | undefined;
172
+ page_size?: number | undefined;
173
+ }
174
+
175
+ export interface SearchTokenInfosResponse {
176
+ token_infos: TokenInfo[];
177
+ next_page_params: Pagination | undefined;
178
+ }
179
+
180
+ export interface ListTokenInfoChainsRequest {
181
+ }
182
+
183
+ export interface ListTokenInfoChainsResponse {
184
+ chains: string[];
185
+ chain_specifiers: string[];
186
+ }
187
+
188
+ export interface AddressMetadata {
189
+ token_name?: string | undefined;
190
+ token_symbol?: string | undefined;
191
+ }
192
+
193
+ export interface VerifiedAddress {
194
+ user_id: string;
195
+ /** Backward-compatible field name: value is the canonical chain specifier string (same as stored in DB). */
196
+ chain_id: string;
197
+ contract_address: string;
198
+ verified_date: string;
199
+ metadata: AddressMetadata | undefined;
200
+ }
201
+
202
+ export interface VerifiedAddressOwner {
203
+ /** Id of the user who owns the contract. */
204
+ user_email: string;
205
+ }
206
+
207
+ export interface VerifyAddressRequest {
208
+ /**
209
+ * Id of the chain the verification request is sent from.
210
+ * Due to internal limitations must be not greater than 2^63-1 (9223372036854775807).
211
+ * Either just `chain_id` or `chain_id:instance_id`
212
+ */
213
+ chain_id: string;
214
+ /** Address of the contract being verified */
215
+ contract_address: string;
216
+ /** A message user signed. */
217
+ message: string;
218
+ /** Result of the user signing the message */
219
+ signature: string;
220
+ }
221
+
222
+ export interface VerifyAddressResponse {
223
+ status: VerifyAddressResponse_Status;
224
+ result?: VerifyAddressResponse_Success | undefined;
225
+ invalid_signer?: VerifyAddressResponse_InvalidSignerError | undefined;
226
+ }
227
+
228
+ export enum VerifyAddressResponse_Status {
229
+ UNKNOWN_STATUS = "UNKNOWN_STATUS",
230
+ SUCCESS = "SUCCESS",
231
+ VALIDITY_EXPIRED_ERROR = "VALIDITY_EXPIRED_ERROR",
232
+ INVALID_SIGNATURE_ERROR = "INVALID_SIGNATURE_ERROR",
233
+ INVALID_SIGNER_ERROR = "INVALID_SIGNER_ERROR",
234
+ }
235
+
236
+ export interface VerifyAddressResponse_Success {
237
+ verified_address: VerifiedAddress | undefined;
238
+ }
239
+
240
+ export interface VerifyAddressResponse_InvalidSignerError {
241
+ signer: string;
242
+ valid_addresses: string[];
243
+ }
244
+
245
+ export interface PrepareAddressRequest {
246
+ /**
247
+ * Id of the chain the validation request is sent from.
248
+ * Due to internal limitations must be not greater than 2^63-1 (9223372036854775807).
249
+ * Either just `chain_id` or `chain_id:instance_id`
250
+ */
251
+ chain_id: string;
252
+ /** Address of the contract being validated and prepared */
253
+ contract_address: string;
254
+ }
255
+
256
+ export interface PrepareAddressResponse {
257
+ status: PrepareAddressResponse_Status;
258
+ result?: PrepareAddressResponse_Success | undefined;
259
+ }
260
+
261
+ export enum PrepareAddressResponse_Status {
262
+ UNKNOWN_STATUS = "UNKNOWN_STATUS",
263
+ SUCCESS = "SUCCESS",
264
+ /** IS_OWNER_ERROR - User is already an owner of the address. */
265
+ IS_OWNER_ERROR = "IS_OWNER_ERROR",
266
+ /** OWNERSHIP_VERIFIED_ERROR - Address ownership has been verified by another account. */
267
+ OWNERSHIP_VERIFIED_ERROR = "OWNERSHIP_VERIFIED_ERROR",
268
+ /** SOURCE_CODE_NOT_VERIFIED_ERROR - Contract source code has not been verified. */
269
+ SOURCE_CODE_NOT_VERIFIED_ERROR = "SOURCE_CODE_NOT_VERIFIED_ERROR",
270
+ /** INVALID_ADDRESS_ERROR - Specified address either does not exist or is EOA. */
271
+ INVALID_ADDRESS_ERROR = "INVALID_ADDRESS_ERROR",
272
+ }
273
+
274
+ export interface PrepareAddressResponse_Success {
275
+ /** Message, the user have to sign for address verification. */
276
+ signing_message: string;
277
+ /** Address of the contract creator. */
278
+ contract_creator: string;
279
+ /** (optional) Result of the owner() contract method call, if any. */
280
+ contract_owner?: string | undefined;
281
+ }
282
+
283
+ export interface ListUserVerifiedAddressesRequest {
284
+ /**
285
+ * Id of the chain the user wants to list verified addresses from.
286
+ * Due to internal limitations must be not greater than 2^63-1 (9223372036854775807).
287
+ * Either just `chain_id` or `chain_id:instance_id`
288
+ */
289
+ chain_id: string;
290
+ }
291
+
292
+ export interface ListUserVerifiedAddressesResponse {
293
+ verified_addresses: VerifiedAddress[];
294
+ }
295
+
296
+ export interface GetVerifiedAddressOwnerAdminRequest {
297
+ /**
298
+ * Id of the chain the contract is deployed at.
299
+ * Either just `chain_id` or `chain_id:instance_id`
300
+ */
301
+ chain_id: string;
302
+ /** The address of the contract. */
303
+ address: string;
304
+ }
305
+
306
+ export interface ImportTokenInfoAdminRequest {
307
+ /** Token info to be imported. */
308
+ token_info: TokenInfo | undefined;
309
+ }
310
+
311
+ export interface ContractsInfo {
312
+ /** Returns a specific token info. */
313
+ GetTokenInfo(request: GetTokenInfoRequest): Promise<TokenInfo>;
314
+ /**
315
+ * Returns a list of all token infos submitted by the user.
316
+ * User must be authenticated and can get only those token infos, they submitted.
317
+ */
318
+ ListUserTokenInfos(request: ListUserTokenInfosRequest): Promise<ListTokenInfosResponse>;
319
+ /** Returns a list of token infos matching the search query. */
320
+ SearchTokenInfos(request: SearchTokenInfosRequest): Promise<SearchTokenInfosResponse>;
321
+ /** Returns a list of all chains with at least one token info. */
322
+ ListTokenInfoChains(request: ListTokenInfoChainsRequest): Promise<ListTokenInfoChainsResponse>;
323
+ /** Verifies a new address, belonging to the user. */
324
+ VerifyAddress(request: VerifyAddressRequest): Promise<VerifyAddressResponse>;
325
+ /** Validate and prepare address to being verified. */
326
+ PrepareAddress(request: PrepareAddressRequest): Promise<PrepareAddressResponse>;
327
+ /** Returns a list of all addresses verified by the user. User must be authenticated. */
328
+ ListUserVerifiedAddresses(request: ListUserVerifiedAddressesRequest): Promise<ListUserVerifiedAddressesResponse>;
329
+ /**
330
+ * Adds a new token info into the database, if corresponding contract
331
+ * does not have token info, or updates the existing token info.
332
+ * Returns the newly added token info.
333
+ * Only admin service must have the access to that method.
334
+ */
335
+ ImportTokenInfoAdmin(request: ImportTokenInfoAdminRequest): Promise<TokenInfo>;
336
+ /**
337
+ * Returns an owner of the contract given the contract address if the ownership has been verified.
338
+ * Only admin service must have the access to that method.
339
+ */
340
+ GetVerifiedAddressOwnerAdmin(request: GetVerifiedAddressOwnerAdminRequest): Promise<VerifiedAddressOwner>;
341
+ GetPool(request: GetPoolRequest): Promise<Pool>;
342
+ /**
343
+ * If pool exists returns the symbol values of corresponding tokens,
344
+ * otherwise returns NotFound error.
345
+ * Is supposed not to cause updates on pool real-time values, thus,
346
+ * should provide quicker responses on requests which do not require pool info updates.
347
+ */
348
+ CheckPoolExists(request: CheckPoolExistsRequest): Promise<CheckPoolExistsResponse>;
349
+ ListPools(request: ListPoolsRequest): Promise<ListPoolsResponse>;
350
+ ListDexes(request: ListDexesRequest): Promise<ListDexesResponse>;
351
+ ImportPoolsAdmin(request: ImportPoolsAdminRequest): Promise<ImportPoolsAdminResponse>;
352
+ ImportChainDexesAdmin(request: ImportChainDexesAdminRequest): Promise<ImportChainDexesAdminResponse>;
353
+ RefetchNftMetadataAdmin(request: RefetchNftMetadataAdminRequest): Promise<RefetchNftMetadataAdminResponse>;
354
+ }