@dodoex/api 3.0.0-beta.4 → 3.0.0-taiko.2

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.
@@ -1,4 +1,4 @@
1
- export { ChainId, etherTokenAddress, basicTokenMap, contractConfig, } from './chainConfig';
1
+ export { ChainId, etherTokenAddress, basicTokenMap, contractConfig, platformIdMap, } from './chainConfig';
2
2
  export { default as RestApiRequests } from './helper/RestApiRequests';
3
3
  export { default as GraphQLRequests } from './helper/GraphQLRequests';
4
4
  export { default as ContractRequests, ABIName, CONTRACT_QUERY_KEY, } from './helper/ContractRequests';
@@ -9,4 +9,6 @@ export type { PmmModelParams } from './services/pool';
9
9
  export type { PoolType } from './services/pool';
10
10
  export { MiningApi, MiningStatusE } from './services/mining';
11
11
  export { TokenApi } from './services/TokenApi';
12
+ export { SwapApi } from './services/swap/SwapApi';
13
+ export { SystemApi } from './services/system/SystemApi';
12
14
  export declare type ExcludeNone<T> = Exclude<Exclude<T, undefined>, null>;
@@ -1,5 +1,4 @@
1
1
  import RestApiRequest from '../helper/RestApiRequests';
2
- import { ThemeOptions } from '@dodoex/components';
3
2
  interface WidgetConfigBasis {
4
3
  crossChainSupport: boolean;
5
4
  swapSlippage?: string;
@@ -91,7 +90,110 @@ export declare class SwapWidgetApi {
91
90
  }>;
92
91
  convertConfigToSwapWidgetProps(configTokenList: ConfigTokenList): {
93
92
  tokenList: TokenList;
94
- theme: ThemeOptions | undefined;
93
+ theme: {
94
+ palette?: {
95
+ primary?: {
96
+ light?: string | undefined;
97
+ main?: string | undefined;
98
+ dark?: string | undefined;
99
+ contrastText?: string | undefined;
100
+ } | undefined;
101
+ secondary?: {
102
+ light?: string | undefined;
103
+ main?: string | undefined;
104
+ dark?: string | undefined;
105
+ contrastText?: string | undefined;
106
+ } | undefined;
107
+ error?: {
108
+ light?: string | undefined;
109
+ main?: string | undefined;
110
+ dark?: string | undefined;
111
+ contrastText?: string | undefined;
112
+ } | undefined;
113
+ warning?: {
114
+ light?: string | undefined;
115
+ main?: string | undefined;
116
+ dark?: string | undefined;
117
+ contrastText?: string | undefined;
118
+ } | undefined;
119
+ success?: {
120
+ light?: string | undefined;
121
+ main?: string | undefined;
122
+ dark?: string | undefined;
123
+ contrastText?: string | undefined;
124
+ } | undefined;
125
+ purple?: {
126
+ light?: string | undefined;
127
+ main?: string | undefined;
128
+ dark?: string | undefined;
129
+ contrastText?: string | undefined;
130
+ } | undefined;
131
+ mode?: "light" | "dark" | undefined;
132
+ text?: {
133
+ primary?: string | undefined;
134
+ secondary?: string | undefined;
135
+ disabled?: string | undefined;
136
+ placeholder?: string | undefined;
137
+ link?: string | undefined;
138
+ } | undefined;
139
+ border?: {
140
+ main?: string | undefined;
141
+ disabled?: string | undefined;
142
+ light?: string | undefined;
143
+ } | undefined;
144
+ hover?: {
145
+ default?: string | undefined;
146
+ } | undefined;
147
+ background?: {
148
+ default?: string | undefined;
149
+ paper?: string | undefined;
150
+ paperContrast?: string | undefined;
151
+ paperDarkContrast?: string | undefined;
152
+ backdrop?: string | undefined;
153
+ input?: string | undefined;
154
+ tag?: string | undefined;
155
+ } | undefined;
156
+ tabActive?: {
157
+ light?: string | undefined;
158
+ main?: string | undefined;
159
+ dark?: string | undefined;
160
+ contrastText?: string | undefined;
161
+ } | undefined;
162
+ getContrastText?: {} | undefined;
163
+ } | undefined;
164
+ shape?: {
165
+ borderRadius?: string | number | undefined;
166
+ } | undefined;
167
+ breakpoints?: {
168
+ step?: number | undefined;
169
+ unit?: string | undefined;
170
+ keys?: ("mobile" | "tablet" | "laptop" | "desktop" | "largeDesktop" | undefined)[] | undefined;
171
+ values?: {
172
+ mobile?: number | undefined;
173
+ tablet?: number | undefined;
174
+ laptop?: number | undefined;
175
+ desktop?: number | undefined;
176
+ largeDesktop?: number | undefined;
177
+ } | undefined;
178
+ up?: {} | undefined;
179
+ down?: {} | undefined;
180
+ between?: {} | undefined;
181
+ only?: {} | undefined;
182
+ not?: {} | undefined;
183
+ } | undefined;
184
+ direction?: "ltr" | "rtl" | undefined;
185
+ mixins?: {} | undefined;
186
+ shadows?: {} | undefined;
187
+ spacing?: number | readonly (string | number)[] | {} | {} | {} | undefined;
188
+ transitions?: {} | undefined;
189
+ components?: {
190
+ [x: string]: any;
191
+ } | undefined;
192
+ typography?: {} | undefined;
193
+ zIndex?: {
194
+ [x: string]: number | undefined;
195
+ } | undefined;
196
+ } | undefined;
95
197
  rebateAddress: string | null;
96
198
  rebateRatio: number | null;
97
199
  swapSlippage: number | null | undefined;
@@ -108,7 +210,110 @@ export declare class SwapWidgetApi {
108
210
  getConfigSwapWidgetProps(projectId: string, apikey: string): Promise<{
109
211
  swapWidgetProps: {
110
212
  tokenList: TokenList;
111
- theme: ThemeOptions | undefined;
213
+ theme: {
214
+ palette?: {
215
+ primary?: {
216
+ light?: string | undefined;
217
+ main?: string | undefined;
218
+ dark?: string | undefined;
219
+ contrastText?: string | undefined;
220
+ } | undefined;
221
+ secondary?: {
222
+ light?: string | undefined;
223
+ main?: string | undefined;
224
+ dark?: string | undefined;
225
+ contrastText?: string | undefined;
226
+ } | undefined;
227
+ error?: {
228
+ light?: string | undefined;
229
+ main?: string | undefined;
230
+ dark?: string | undefined;
231
+ contrastText?: string | undefined;
232
+ } | undefined;
233
+ warning?: {
234
+ light?: string | undefined;
235
+ main?: string | undefined;
236
+ dark?: string | undefined;
237
+ contrastText?: string | undefined;
238
+ } | undefined;
239
+ success?: {
240
+ light?: string | undefined;
241
+ main?: string | undefined;
242
+ dark?: string | undefined;
243
+ contrastText?: string | undefined;
244
+ } | undefined;
245
+ purple?: {
246
+ light?: string | undefined;
247
+ main?: string | undefined;
248
+ dark?: string | undefined;
249
+ contrastText?: string | undefined;
250
+ } | undefined;
251
+ mode?: "light" | "dark" | undefined;
252
+ text?: {
253
+ primary?: string | undefined;
254
+ secondary?: string | undefined;
255
+ disabled?: string | undefined;
256
+ placeholder?: string | undefined;
257
+ link?: string | undefined;
258
+ } | undefined;
259
+ border?: {
260
+ main?: string | undefined;
261
+ disabled?: string | undefined;
262
+ light?: string | undefined;
263
+ } | undefined;
264
+ hover?: {
265
+ default?: string | undefined;
266
+ } | undefined;
267
+ background?: {
268
+ default?: string | undefined;
269
+ paper?: string | undefined;
270
+ paperContrast?: string | undefined;
271
+ paperDarkContrast?: string | undefined;
272
+ backdrop?: string | undefined;
273
+ input?: string | undefined;
274
+ tag?: string | undefined;
275
+ } | undefined;
276
+ tabActive?: {
277
+ light?: string | undefined;
278
+ main?: string | undefined;
279
+ dark?: string | undefined;
280
+ contrastText?: string | undefined;
281
+ } | undefined;
282
+ getContrastText?: {} | undefined;
283
+ } | undefined;
284
+ shape?: {
285
+ borderRadius?: string | number | undefined;
286
+ } | undefined;
287
+ breakpoints?: {
288
+ step?: number | undefined;
289
+ unit?: string | undefined;
290
+ keys?: ("mobile" | "tablet" | "laptop" | "desktop" | "largeDesktop" | undefined)[] | undefined;
291
+ values?: {
292
+ mobile?: number | undefined;
293
+ tablet?: number | undefined;
294
+ laptop?: number | undefined;
295
+ desktop?: number | undefined;
296
+ largeDesktop?: number | undefined;
297
+ } | undefined;
298
+ up?: {} | undefined;
299
+ down?: {} | undefined;
300
+ between?: {} | undefined;
301
+ only?: {} | undefined;
302
+ not?: {} | undefined;
303
+ } | undefined;
304
+ direction?: "ltr" | "rtl" | undefined;
305
+ mixins?: {} | undefined;
306
+ shadows?: {} | undefined;
307
+ spacing?: number | readonly (string | number)[] | {} | {} | {} | undefined;
308
+ transitions?: {} | undefined;
309
+ components?: {
310
+ [x: string]: any;
311
+ } | undefined;
312
+ typography?: {} | undefined;
313
+ zIndex?: {
314
+ [x: string]: number | undefined;
315
+ } | undefined;
316
+ } | undefined;
112
317
  rebateAddress: string | null;
113
318
  rebateRatio: number | null;
114
319
  swapSlippage: number | null | undefined;
@@ -1,11 +1,15 @@
1
1
  import ContractRequests, { ContractRequestsConfig } from '../../helper/ContractRequests';
2
2
  import BigNumber from 'bignumber.js';
3
+ import { ChainId } from '../../chainConfig';
4
+ import RestApiRequest from '../../helper/RestApiRequests';
3
5
  export interface TokenApiProps {
4
6
  contractRequests?: ContractRequests;
5
7
  contractRequestsConfig?: ContractRequestsConfig;
8
+ restApiRequest?: RestApiRequest;
6
9
  }
7
10
  export declare class TokenApi {
8
11
  contractRequests: ContractRequests;
12
+ restApiRequest: RestApiRequest;
9
13
  constructor(config: TokenApiProps);
10
14
  static utils: {
11
15
  isSameAddress: (tokenAddress1: string, tokenAddress2: string) => boolean;
@@ -13,6 +17,18 @@ export declare class TokenApi {
13
17
  static encode: {
14
18
  approveABI(contractAddress: string, allowance: BigNumber): Promise<string>;
15
19
  };
20
+ getFiatPriceBatch(tokens: Array<{
21
+ chainId: ChainId;
22
+ address: string;
23
+ symbol: string;
24
+ }>, token: string): Promise<{
25
+ response: Response;
26
+ result: {
27
+ code: number;
28
+ msg: string | null;
29
+ data: any;
30
+ };
31
+ }>;
16
32
  getFetchTokenQuery(chainId: number | undefined, address: string | undefined, account: string | undefined, spender?: string): {
17
33
  queryKey: (string | number | undefined)[];
18
34
  enabled: boolean;
@@ -0,0 +1,8 @@
1
+ export declare class SwapApi {
2
+ constructor();
3
+ static graphql: {
4
+ fetchUserSwapOrderHistories: import("../../gql/graphql").TypedDocumentString<import("../../gql/graphql").FetchUserSwapOrderHistoriesQuery, import("../../gql/graphql").Exact<{
5
+ where?: import("../../gql/graphql").InputMaybe<import("../../gql/graphql").User_SwapswapFilter> | undefined;
6
+ }>>;
7
+ };
8
+ }
@@ -0,0 +1,5 @@
1
+ export declare const swapGraphqlQuery: {
2
+ fetchUserSwapOrderHistories: import("../../gql/graphql").TypedDocumentString<import("../../gql/graphql").FetchUserSwapOrderHistoriesQuery, import("../../gql/graphql").Exact<{
3
+ where?: import("../../gql/graphql").InputMaybe<import("../../gql/graphql").User_SwapswapFilter> | undefined;
4
+ }>>;
5
+ };
@@ -0,0 +1,8 @@
1
+ export declare class SystemApi {
2
+ constructor();
3
+ static graphql: {
4
+ fetchNoticeCenterTransactionList: import("../../gql/graphql").TypedDocumentString<import("../../gql/graphql").FetchNoticeCenterTransactionListQuery, import("../../gql/graphql").Exact<{
5
+ where?: import("../../gql/graphql").InputMaybe<import("../../gql/graphql").Notice_CentertransactionListFilter> | undefined;
6
+ }>>;
7
+ };
8
+ }
@@ -0,0 +1,5 @@
1
+ export declare const systemGraphqlQuery: {
2
+ fetchNoticeCenterTransactionList: import("../../gql/graphql").TypedDocumentString<import("../../gql/graphql").FetchNoticeCenterTransactionListQuery, import("../../gql/graphql").Exact<{
3
+ where?: import("../../gql/graphql").InputMaybe<import("../../gql/graphql").Notice_CentertransactionListFilter> | undefined;
4
+ }>>;
5
+ };
package/dist/gql/gql.d.ts CHANGED
@@ -38,3 +38,11 @@ export declare function graphql(source: '\n query FetchPoolSwapList(\n $
38
38
  * The graphql function is used to parse GraphQL queries into a document that can be used by GraphQL clients.
39
39
  */
40
40
  export declare function graphql(source: '\n query FetchLiquidityPositions(\n $id: ID!\n $first: Int\n $skip: Int\n $where: LiquidityPosition_filter\n $miningWhere: LiquidityPosition_filter\n $orderBy: LiquidityPosition_orderBy\n $orderDirection: OrderDirection\n ) {\n balance: liquidityPositions(\n first: $first\n skip: $skip\n where: $where\n orderBy: $orderBy\n orderDirection: $orderDirection\n ) {\n id\n liquidityTokenBalance\n }\n mining: liquidityPositions(\n first: $first\n skip: $skip\n where: $miningWhere\n orderBy: $orderBy\n orderDirection: $orderDirection\n ) {\n id\n liquidityTokenInMining\n }\n pair(id: $id) {\n lastTradePrice\n baseLpToken {\n id\n decimals\n }\n quoteLpToken {\n id\n decimals\n }\n baseToken {\n id\n symbol\n name\n decimals\n }\n quoteToken {\n id\n symbol\n name\n decimals\n }\n }\n }\n '): typeof import('./graphql').FetchLiquidityPositionsDocument;
41
+ /**
42
+ * The graphql function is used to parse GraphQL queries into a document that can be used by GraphQL clients.
43
+ */
44
+ export declare function graphql(source: '\n query FetchUserSwapOrderHistories($where: User_swapswapFilter) {\n user_swap_orderHistories(where: $where) {\n count\n page\n list {\n chainId\n createdAt\n fromAmount\n fromTokenDecimals\n fromTokenPrice\n fromTokenSymbol\n fromTokenAddress\n fromTokenLogoImg\n hash\n status\n toAmount\n toTokenDecimals\n toTokenPrice\n toTokenSymbol\n toTokenAddress\n toTokenLogoImg\n minAmount\n nonce\n extra\n user\n }\n }\n }\n '): typeof import('./graphql').FetchUserSwapOrderHistoriesDocument;
45
+ /**
46
+ * The graphql function is used to parse GraphQL queries into a document that can be used by GraphQL clients.
47
+ */
48
+ export declare function graphql(source: '\n query FetchNoticeCenterTransactionList(\n $where: Notice_centertransactionListFilter\n ) {\n notice_center_transactionList(where: $where) {\n list {\n chainId\n createTime\n extend\n from\n id\n key\n type\n }\n count\n }\n }\n '): typeof import('./graphql').FetchNoticeCenterTransactionListDocument;