@one_deploy/sdk 1.0.0
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.
- package/.turbo/turbo-build.log +0 -0
- package/.turbo/turbo-type-check.log +0 -0
- package/dist/config/index.d.mts +74 -0
- package/dist/config/index.d.ts +74 -0
- package/dist/config/index.js +242 -0
- package/dist/config/index.js.map +1 -0
- package/dist/config/index.mjs +224 -0
- package/dist/config/index.mjs.map +1 -0
- package/dist/engine-5ndtBaCr.d.ts +1039 -0
- package/dist/engine-CrlhH0nw.d.mts +1039 -0
- package/dist/hooks/index.d.mts +56 -0
- package/dist/hooks/index.d.ts +56 -0
- package/dist/hooks/index.js +1360 -0
- package/dist/hooks/index.js.map +1 -0
- package/dist/hooks/index.mjs +1356 -0
- package/dist/hooks/index.mjs.map +1 -0
- package/dist/index.d.mts +356 -0
- package/dist/index.d.ts +356 -0
- package/dist/index.js +5068 -0
- package/dist/index.js.map +1 -0
- package/dist/index.mjs +4949 -0
- package/dist/index.mjs.map +1 -0
- package/dist/price-CgqXPnT3.d.ts +13 -0
- package/dist/price-ClbLHHjv.d.mts +13 -0
- package/dist/providers/index.d.mts +121 -0
- package/dist/providers/index.d.ts +121 -0
- package/dist/providers/index.js +1642 -0
- package/dist/providers/index.js.map +1 -0
- package/dist/providers/index.mjs +1600 -0
- package/dist/providers/index.mjs.map +1 -0
- package/dist/react-native.d.mts +120 -0
- package/dist/react-native.d.ts +120 -0
- package/dist/react-native.js +1792 -0
- package/dist/react-native.js.map +1 -0
- package/dist/react-native.mjs +1755 -0
- package/dist/react-native.mjs.map +1 -0
- package/dist/services/index.d.mts +85 -0
- package/dist/services/index.d.ts +85 -0
- package/dist/services/index.js +1466 -0
- package/dist/services/index.js.map +1 -0
- package/dist/services/index.mjs +1458 -0
- package/dist/services/index.mjs.map +1 -0
- package/dist/types/index.d.mts +759 -0
- package/dist/types/index.d.ts +759 -0
- package/dist/types/index.js +4 -0
- package/dist/types/index.js.map +1 -0
- package/dist/types/index.mjs +3 -0
- package/dist/types/index.mjs.map +1 -0
- package/dist/utils/index.d.mts +36 -0
- package/dist/utils/index.d.ts +36 -0
- package/dist/utils/index.js +164 -0
- package/dist/utils/index.js.map +1 -0
- package/dist/utils/index.mjs +142 -0
- package/dist/utils/index.mjs.map +1 -0
- package/package.json +101 -0
- package/src/components/OneConnectButton.tsx +143 -0
- package/src/components/OneNFTGallery.tsx +324 -0
- package/src/components/OneOfframpWidget.tsx +660 -0
- package/src/components/OneOnrampWidget.tsx +596 -0
- package/src/components/OnePayWidget.tsx +160 -0
- package/src/components/OneReceiveWidget.tsx +272 -0
- package/src/components/OneSendWidget.tsx +248 -0
- package/src/components/OneSwapWidget.tsx +715 -0
- package/src/components/OneTransactionButton.tsx +150 -0
- package/src/components/OneWalletBalance.tsx +354 -0
- package/src/components/index.ts +24 -0
- package/src/config/index.ts +299 -0
- package/src/hooks/index.ts +2 -0
- package/src/hooks/useTokenPrice.ts +162 -0
- package/src/hooks/useWalletBalance.ts +98 -0
- package/src/index.ts +193 -0
- package/src/providers/OneProvider.tsx +452 -0
- package/src/providers/ThirdwebProvider.tsx +203 -0
- package/src/providers/index.ts +26 -0
- package/src/react-native.ts +378 -0
- package/src/services/engine.ts +1854 -0
- package/src/services/index.ts +30 -0
- package/src/services/price.ts +164 -0
- package/src/services/supabase.ts +180 -0
- package/src/types/index.ts +887 -0
- package/src/utils/index.ts +200 -0
- package/tsconfig.json +22 -0
- package/tsup.config.ts +25 -0
|
@@ -0,0 +1,759 @@
|
|
|
1
|
+
interface User {
|
|
2
|
+
id: string;
|
|
3
|
+
email: string;
|
|
4
|
+
walletAddress: string | null;
|
|
5
|
+
smartAccountAddress: string | null;
|
|
6
|
+
kycStatus: KycStatus;
|
|
7
|
+
kycLevel: KycLevel;
|
|
8
|
+
membershipTier: MembershipTier;
|
|
9
|
+
createdAt: string;
|
|
10
|
+
}
|
|
11
|
+
type KycStatus = 'none' | 'pending' | 'verified' | 'rejected';
|
|
12
|
+
type KycLevel = 0 | 1 | 2 | 3;
|
|
13
|
+
type MembershipTier = 'basic' | 'premium' | 'pro';
|
|
14
|
+
interface UserProfile {
|
|
15
|
+
id: string;
|
|
16
|
+
userId: string;
|
|
17
|
+
displayName: string | null;
|
|
18
|
+
avatarUrl: string | null;
|
|
19
|
+
phoneNumber: string | null;
|
|
20
|
+
country: string | null;
|
|
21
|
+
kycStatus: KycStatus;
|
|
22
|
+
kycLevel: KycLevel;
|
|
23
|
+
membershipTier: MembershipTier;
|
|
24
|
+
}
|
|
25
|
+
interface UserSettings {
|
|
26
|
+
userId: string;
|
|
27
|
+
language: string;
|
|
28
|
+
currency: string;
|
|
29
|
+
theme: 'light' | 'dark' | 'system';
|
|
30
|
+
notifications: NotificationSettings;
|
|
31
|
+
}
|
|
32
|
+
interface NotificationSettings {
|
|
33
|
+
push: boolean;
|
|
34
|
+
email: boolean;
|
|
35
|
+
sms: boolean;
|
|
36
|
+
transactions: boolean;
|
|
37
|
+
marketing: boolean;
|
|
38
|
+
}
|
|
39
|
+
interface Token {
|
|
40
|
+
id: string;
|
|
41
|
+
symbol: string;
|
|
42
|
+
name: string;
|
|
43
|
+
icon: string;
|
|
44
|
+
balance: number;
|
|
45
|
+
balanceUsd?: number;
|
|
46
|
+
price: number;
|
|
47
|
+
value: number;
|
|
48
|
+
change24h: number;
|
|
49
|
+
priceChange24h?: number;
|
|
50
|
+
chainId?: number;
|
|
51
|
+
chain: string;
|
|
52
|
+
chainName?: string;
|
|
53
|
+
chainIcon?: string;
|
|
54
|
+
contractAddress?: string;
|
|
55
|
+
address?: string;
|
|
56
|
+
decimals?: number;
|
|
57
|
+
}
|
|
58
|
+
interface WalletBalance {
|
|
59
|
+
totalUsd: number;
|
|
60
|
+
change24h: number;
|
|
61
|
+
changePercent24h: number;
|
|
62
|
+
tokens: Token[];
|
|
63
|
+
}
|
|
64
|
+
interface OnChainBalance {
|
|
65
|
+
tokenAddress: string | null;
|
|
66
|
+
tokenSymbol: string;
|
|
67
|
+
tokenDecimals: number;
|
|
68
|
+
balance: string;
|
|
69
|
+
balanceFormatted: string;
|
|
70
|
+
chain: string;
|
|
71
|
+
chainId: number;
|
|
72
|
+
}
|
|
73
|
+
interface TokenPrice {
|
|
74
|
+
symbol: string;
|
|
75
|
+
price: number;
|
|
76
|
+
change24h: number;
|
|
77
|
+
changePercent24h: number;
|
|
78
|
+
priceChange24h?: number;
|
|
79
|
+
marketCap?: number;
|
|
80
|
+
volume24h?: number;
|
|
81
|
+
updatedAt?: string;
|
|
82
|
+
}
|
|
83
|
+
type TransactionType = 'send' | 'receive' | 'swap' | 'buy' | 'sell' | 'deposit' | 'withdraw' | 'bridge';
|
|
84
|
+
type TransactionStatus = 'pending' | 'confirmed' | 'failed' | 'completed';
|
|
85
|
+
interface Transaction {
|
|
86
|
+
id: string;
|
|
87
|
+
type: TransactionType;
|
|
88
|
+
status: TransactionStatus;
|
|
89
|
+
amount: number;
|
|
90
|
+
symbol?: string;
|
|
91
|
+
tokenSymbol?: string;
|
|
92
|
+
tokenName?: string;
|
|
93
|
+
amountUsd?: number;
|
|
94
|
+
from?: string;
|
|
95
|
+
to?: string;
|
|
96
|
+
fromAddress?: string;
|
|
97
|
+
toAddress?: string;
|
|
98
|
+
txHash?: string | null;
|
|
99
|
+
chainId?: number;
|
|
100
|
+
chain?: string;
|
|
101
|
+
timestamp: string;
|
|
102
|
+
fee?: number;
|
|
103
|
+
note?: string | null;
|
|
104
|
+
}
|
|
105
|
+
type StrategyCategory = 'conservative' | 'balanced' | 'aggressive' | 'hedge' | 'arbitrage' | 'trend' | 'grid' | 'dca';
|
|
106
|
+
type AIOrderStatus = 'pending' | 'active' | 'paused' | 'completed' | 'cancelled' | 'pending_redemption' | 'redeemed';
|
|
107
|
+
type TradeAction = 'buy' | 'sell' | 'long' | 'short' | 'close_long' | 'close_short';
|
|
108
|
+
type RiskLevel = 'conservative' | 'moderate' | 'aggressive';
|
|
109
|
+
interface AIStrategy {
|
|
110
|
+
id: string;
|
|
111
|
+
name: string;
|
|
112
|
+
description: string | null;
|
|
113
|
+
category: StrategyCategory;
|
|
114
|
+
riskLevel: number;
|
|
115
|
+
minInvestment: number;
|
|
116
|
+
maxInvestment: number | null;
|
|
117
|
+
lockPeriodDays: number;
|
|
118
|
+
expectedApyMin: number | null;
|
|
119
|
+
expectedApyMax: number | null;
|
|
120
|
+
managementFeeRate: number;
|
|
121
|
+
performanceFeeRate: number;
|
|
122
|
+
supportedPairs: string[];
|
|
123
|
+
supportedChains: string[];
|
|
124
|
+
leverageMin: number;
|
|
125
|
+
leverageMax: number;
|
|
126
|
+
isActive: boolean;
|
|
127
|
+
tvl: number;
|
|
128
|
+
totalUsers: number;
|
|
129
|
+
totalTrades: number;
|
|
130
|
+
winRate: number;
|
|
131
|
+
maxDrawdown: number;
|
|
132
|
+
sharpeRatio: number;
|
|
133
|
+
currentNav: number;
|
|
134
|
+
createdAt: string;
|
|
135
|
+
metadata?: Record<string, unknown>;
|
|
136
|
+
}
|
|
137
|
+
interface AIOrder {
|
|
138
|
+
id: string;
|
|
139
|
+
userId: string;
|
|
140
|
+
strategyId: string;
|
|
141
|
+
strategyName?: string;
|
|
142
|
+
amount: number;
|
|
143
|
+
currency: string;
|
|
144
|
+
chain: string;
|
|
145
|
+
status: AIOrderStatus;
|
|
146
|
+
startDate: string;
|
|
147
|
+
lockEndDate: string;
|
|
148
|
+
lockPeriodDays: number;
|
|
149
|
+
pauseCount: number;
|
|
150
|
+
totalPauseDays: number;
|
|
151
|
+
currentPauseStart: string | null;
|
|
152
|
+
realizedProfit: number;
|
|
153
|
+
unrealizedProfit: number;
|
|
154
|
+
totalFeesPaid: number;
|
|
155
|
+
currentNav: number | null;
|
|
156
|
+
shareRatio: number;
|
|
157
|
+
shares: number;
|
|
158
|
+
redemptionRequestedAt: string | null;
|
|
159
|
+
redemptionAmount: number | null;
|
|
160
|
+
earlyWithdrawalPenaltyRate: number | null;
|
|
161
|
+
penaltyAmount: number;
|
|
162
|
+
txHashDeposit: string | null;
|
|
163
|
+
txHashRedemption: string | null;
|
|
164
|
+
createdAt: string;
|
|
165
|
+
updatedAt: string;
|
|
166
|
+
}
|
|
167
|
+
interface AITradeExecution {
|
|
168
|
+
id: string;
|
|
169
|
+
batchId: string;
|
|
170
|
+
strategyId: string;
|
|
171
|
+
tradeSeq: number;
|
|
172
|
+
action: TradeAction;
|
|
173
|
+
pair: string;
|
|
174
|
+
entryPrice: number;
|
|
175
|
+
exitPrice: number | null;
|
|
176
|
+
amount: number;
|
|
177
|
+
leverage: number;
|
|
178
|
+
pnl: number;
|
|
179
|
+
pnlPct: number;
|
|
180
|
+
fee: number;
|
|
181
|
+
status: 'open' | 'closed' | 'liquidated' | 'cancelled';
|
|
182
|
+
openedAt: string;
|
|
183
|
+
closedAt: string | null;
|
|
184
|
+
aiConfidence: number | null;
|
|
185
|
+
aiReasoning: string | null;
|
|
186
|
+
externalOrderId: string | null;
|
|
187
|
+
metadata?: Record<string, unknown>;
|
|
188
|
+
}
|
|
189
|
+
interface AITradeAllocation {
|
|
190
|
+
id: string;
|
|
191
|
+
executionId: string;
|
|
192
|
+
orderId: string;
|
|
193
|
+
userId: string;
|
|
194
|
+
allocatedAmount: number;
|
|
195
|
+
allocatedPnl: number;
|
|
196
|
+
allocatedFee: number;
|
|
197
|
+
shareRatio: number;
|
|
198
|
+
createdAt: string;
|
|
199
|
+
}
|
|
200
|
+
interface AINavSnapshot {
|
|
201
|
+
id: string;
|
|
202
|
+
strategyId: string;
|
|
203
|
+
snapshotDate: string;
|
|
204
|
+
nav: number;
|
|
205
|
+
dailyPnl: number;
|
|
206
|
+
dailyPnlPct: number;
|
|
207
|
+
cumulativePnl: number;
|
|
208
|
+
cumulativePnlPct: number;
|
|
209
|
+
totalAum: number;
|
|
210
|
+
createdAt: string;
|
|
211
|
+
}
|
|
212
|
+
interface AIPortfolioSummary {
|
|
213
|
+
userId: string;
|
|
214
|
+
totalInvested: number;
|
|
215
|
+
currentValue: number;
|
|
216
|
+
totalPnl: number;
|
|
217
|
+
totalPnlPct: number;
|
|
218
|
+
realizedPnl: number;
|
|
219
|
+
unrealizedPnl: number;
|
|
220
|
+
totalFeesPaid: number;
|
|
221
|
+
activeOrders: number;
|
|
222
|
+
strategies: Array<{
|
|
223
|
+
strategyId: string;
|
|
224
|
+
strategyName: string;
|
|
225
|
+
invested: number;
|
|
226
|
+
currentValue: number;
|
|
227
|
+
pnl: number;
|
|
228
|
+
pnlPct: number;
|
|
229
|
+
}>;
|
|
230
|
+
}
|
|
231
|
+
interface AIRedemptionResult {
|
|
232
|
+
success: boolean;
|
|
233
|
+
redemptionAmount: number;
|
|
234
|
+
penaltyRate: number;
|
|
235
|
+
penaltyAmount: number;
|
|
236
|
+
completionRate: number;
|
|
237
|
+
finalAmount: number;
|
|
238
|
+
}
|
|
239
|
+
interface AIMarketData {
|
|
240
|
+
symbol: string;
|
|
241
|
+
price: number;
|
|
242
|
+
change24h: number;
|
|
243
|
+
volume24h: number;
|
|
244
|
+
high24h: number;
|
|
245
|
+
low24h: number;
|
|
246
|
+
}
|
|
247
|
+
interface CreateAIOrderRequest {
|
|
248
|
+
strategyId: string;
|
|
249
|
+
amount: number;
|
|
250
|
+
currency?: string;
|
|
251
|
+
chain?: string;
|
|
252
|
+
lockPeriodDays?: number;
|
|
253
|
+
txHashDeposit?: string;
|
|
254
|
+
}
|
|
255
|
+
interface Position {
|
|
256
|
+
id: string;
|
|
257
|
+
strategyId: string;
|
|
258
|
+
strategyName: string;
|
|
259
|
+
status: 'active' | 'paused' | 'closed' | 'pending';
|
|
260
|
+
investedAmount: number;
|
|
261
|
+
currentValue: number;
|
|
262
|
+
pnl: number;
|
|
263
|
+
pnlPercent: number;
|
|
264
|
+
entryDate: string;
|
|
265
|
+
exitDate?: string;
|
|
266
|
+
}
|
|
267
|
+
type CardStatus = 'pending' | 'active' | 'frozen' | 'cancelled';
|
|
268
|
+
type CardTier = 'standard' | 'gold' | 'platinum' | 'black';
|
|
269
|
+
interface Card {
|
|
270
|
+
id: string;
|
|
271
|
+
tier: CardTier;
|
|
272
|
+
status: CardStatus;
|
|
273
|
+
lastFour: string;
|
|
274
|
+
expiryDate: string;
|
|
275
|
+
balance?: number;
|
|
276
|
+
spendLimit: number;
|
|
277
|
+
spentThisMonth: number;
|
|
278
|
+
cardNumber?: string;
|
|
279
|
+
}
|
|
280
|
+
interface CardTransaction {
|
|
281
|
+
id: string;
|
|
282
|
+
cardId: string;
|
|
283
|
+
merchant: string;
|
|
284
|
+
category: string;
|
|
285
|
+
amount: number;
|
|
286
|
+
currency: string;
|
|
287
|
+
timestamp: string;
|
|
288
|
+
status: 'pending' | 'completed' | 'declined';
|
|
289
|
+
}
|
|
290
|
+
interface Notification {
|
|
291
|
+
id: string;
|
|
292
|
+
type: 'transaction' | 'security' | 'promotion' | 'system';
|
|
293
|
+
title: string;
|
|
294
|
+
message: string;
|
|
295
|
+
read: boolean;
|
|
296
|
+
timestamp: string;
|
|
297
|
+
actionUrl?: string;
|
|
298
|
+
}
|
|
299
|
+
interface ApiResponse<T> {
|
|
300
|
+
success: boolean;
|
|
301
|
+
data?: T;
|
|
302
|
+
error?: {
|
|
303
|
+
code: string;
|
|
304
|
+
message: string;
|
|
305
|
+
};
|
|
306
|
+
}
|
|
307
|
+
interface ChainConfig {
|
|
308
|
+
id: number;
|
|
309
|
+
name: string;
|
|
310
|
+
shortName: string;
|
|
311
|
+
icon: string;
|
|
312
|
+
nativeCurrency: {
|
|
313
|
+
name: string;
|
|
314
|
+
symbol: string;
|
|
315
|
+
decimals: number;
|
|
316
|
+
};
|
|
317
|
+
rpcUrls: string[];
|
|
318
|
+
blockExplorerUrls: string[];
|
|
319
|
+
testnet: boolean;
|
|
320
|
+
}
|
|
321
|
+
interface NFT {
|
|
322
|
+
id: string;
|
|
323
|
+
tokenId: string;
|
|
324
|
+
contractAddress: string;
|
|
325
|
+
chainId: number;
|
|
326
|
+
chain: string;
|
|
327
|
+
name: string;
|
|
328
|
+
description?: string;
|
|
329
|
+
image?: string;
|
|
330
|
+
imageUrl?: string;
|
|
331
|
+
thumbnailUrl?: string;
|
|
332
|
+
animationUrl?: string;
|
|
333
|
+
tokenType: 'ERC721' | 'ERC1155';
|
|
334
|
+
metadata?: Record<string, any>;
|
|
335
|
+
attributes?: NFTAttribute[];
|
|
336
|
+
owner: string;
|
|
337
|
+
collection?: NFTCollection;
|
|
338
|
+
floorPrice?: number;
|
|
339
|
+
lastPrice?: number;
|
|
340
|
+
}
|
|
341
|
+
interface NFTAttribute {
|
|
342
|
+
traitType: string;
|
|
343
|
+
value: string | number;
|
|
344
|
+
displayType?: string;
|
|
345
|
+
maxValue?: number;
|
|
346
|
+
}
|
|
347
|
+
interface NFTCollection {
|
|
348
|
+
address: string;
|
|
349
|
+
name: string;
|
|
350
|
+
symbol?: string;
|
|
351
|
+
description?: string;
|
|
352
|
+
image?: string;
|
|
353
|
+
bannerImage?: string;
|
|
354
|
+
chainId: number;
|
|
355
|
+
totalSupply?: number;
|
|
356
|
+
floorPrice?: number;
|
|
357
|
+
verified?: boolean;
|
|
358
|
+
}
|
|
359
|
+
interface NFTTransfer {
|
|
360
|
+
id: string;
|
|
361
|
+
type: 'mint' | 'transfer' | 'sale' | 'burn';
|
|
362
|
+
from: string;
|
|
363
|
+
to: string;
|
|
364
|
+
tokenId: string;
|
|
365
|
+
contractAddress: string;
|
|
366
|
+
transactionHash: string;
|
|
367
|
+
timestamp: string;
|
|
368
|
+
price?: number;
|
|
369
|
+
currency?: string;
|
|
370
|
+
}
|
|
371
|
+
interface Contract {
|
|
372
|
+
id: string;
|
|
373
|
+
address: string;
|
|
374
|
+
chainId: number;
|
|
375
|
+
name: string;
|
|
376
|
+
symbol?: string;
|
|
377
|
+
contractType: ContractType;
|
|
378
|
+
abi?: any[];
|
|
379
|
+
verified?: boolean;
|
|
380
|
+
deployedAt?: string;
|
|
381
|
+
deployer?: string;
|
|
382
|
+
}
|
|
383
|
+
type ContractType = 'erc20' | 'erc721' | 'erc1155' | 'custom' | 'marketplace' | 'staking' | 'governance';
|
|
384
|
+
interface ContractReadParams {
|
|
385
|
+
contractAddress: string;
|
|
386
|
+
chainId: number;
|
|
387
|
+
functionName: string;
|
|
388
|
+
args?: any[];
|
|
389
|
+
}
|
|
390
|
+
interface ContractWriteParams {
|
|
391
|
+
contractAddress: string;
|
|
392
|
+
chainId: number;
|
|
393
|
+
functionName: string;
|
|
394
|
+
args?: any[];
|
|
395
|
+
value?: string;
|
|
396
|
+
gasLimit?: string;
|
|
397
|
+
}
|
|
398
|
+
interface ContractDeployParams {
|
|
399
|
+
chainId: number;
|
|
400
|
+
contractType: string;
|
|
401
|
+
name: string;
|
|
402
|
+
symbol?: string;
|
|
403
|
+
constructorArgs?: any[];
|
|
404
|
+
metadata?: Record<string, any>;
|
|
405
|
+
}
|
|
406
|
+
interface BillProvider {
|
|
407
|
+
id: string;
|
|
408
|
+
name: string;
|
|
409
|
+
category: BillCategory;
|
|
410
|
+
icon?: string;
|
|
411
|
+
countries: string[];
|
|
412
|
+
minAmount: number;
|
|
413
|
+
maxAmount: number;
|
|
414
|
+
fees: number;
|
|
415
|
+
}
|
|
416
|
+
type BillCategory = 'electricity' | 'water' | 'gas' | 'internet' | 'phone' | 'tv' | 'insurance' | 'tax' | 'other';
|
|
417
|
+
interface BillPayment {
|
|
418
|
+
id: string;
|
|
419
|
+
providerId: string;
|
|
420
|
+
providerName: string;
|
|
421
|
+
category: BillCategory;
|
|
422
|
+
accountNumber: string;
|
|
423
|
+
amount: number;
|
|
424
|
+
currency: string;
|
|
425
|
+
status: 'pending' | 'processing' | 'completed' | 'failed';
|
|
426
|
+
reference?: string;
|
|
427
|
+
createdAt: string;
|
|
428
|
+
completedAt?: string;
|
|
429
|
+
}
|
|
430
|
+
interface OfframpQuote {
|
|
431
|
+
provider: string;
|
|
432
|
+
cryptoCurrency: string;
|
|
433
|
+
cryptoAmount: number;
|
|
434
|
+
fiatCurrency: string;
|
|
435
|
+
fiatAmount: number;
|
|
436
|
+
rate: number;
|
|
437
|
+
fees: {
|
|
438
|
+
network: number;
|
|
439
|
+
provider: number;
|
|
440
|
+
total: number;
|
|
441
|
+
};
|
|
442
|
+
payoutMethod: string;
|
|
443
|
+
estimatedTime: string;
|
|
444
|
+
}
|
|
445
|
+
interface OfframpRequest {
|
|
446
|
+
cryptoCurrency: string;
|
|
447
|
+
cryptoAmount: number;
|
|
448
|
+
fiatCurrency: string;
|
|
449
|
+
payoutMethod: string;
|
|
450
|
+
payoutDetails: Record<string, string>;
|
|
451
|
+
}
|
|
452
|
+
interface OfframpTransaction {
|
|
453
|
+
id: string;
|
|
454
|
+
status: 'pending' | 'processing' | 'completed' | 'failed';
|
|
455
|
+
cryptoAmount: number;
|
|
456
|
+
cryptoCurrency: string;
|
|
457
|
+
fiatAmount: number;
|
|
458
|
+
fiatCurrency: string;
|
|
459
|
+
txHash?: string;
|
|
460
|
+
payoutReference?: string;
|
|
461
|
+
createdAt: string;
|
|
462
|
+
completedAt?: string;
|
|
463
|
+
}
|
|
464
|
+
interface StakingPool {
|
|
465
|
+
id: string;
|
|
466
|
+
name: string;
|
|
467
|
+
token: string;
|
|
468
|
+
rewardToken: string;
|
|
469
|
+
chainId: number;
|
|
470
|
+
apy: number;
|
|
471
|
+
totalStaked: number;
|
|
472
|
+
minStake: number;
|
|
473
|
+
lockPeriod: number;
|
|
474
|
+
status: 'active' | 'paused' | 'ended';
|
|
475
|
+
}
|
|
476
|
+
interface StakingPosition {
|
|
477
|
+
id: string;
|
|
478
|
+
poolId: string;
|
|
479
|
+
poolName: string;
|
|
480
|
+
stakedAmount: number;
|
|
481
|
+
rewardsEarned: number;
|
|
482
|
+
startDate: string;
|
|
483
|
+
unlockDate?: string;
|
|
484
|
+
status: 'active' | 'unlocked' | 'withdrawn';
|
|
485
|
+
}
|
|
486
|
+
interface ReferralInfo {
|
|
487
|
+
code: string;
|
|
488
|
+
link: string;
|
|
489
|
+
totalReferrals: number;
|
|
490
|
+
totalEarnings: number;
|
|
491
|
+
pendingEarnings: number;
|
|
492
|
+
tier: 'bronze' | 'silver' | 'gold' | 'platinum';
|
|
493
|
+
}
|
|
494
|
+
interface Referral {
|
|
495
|
+
id: string;
|
|
496
|
+
referredUserId: string;
|
|
497
|
+
status: 'pending' | 'active' | 'rewarded';
|
|
498
|
+
earnings: number;
|
|
499
|
+
createdAt: string;
|
|
500
|
+
}
|
|
501
|
+
interface BridgeQuote {
|
|
502
|
+
quoteId: string;
|
|
503
|
+
fromChainId: number;
|
|
504
|
+
toChainId: number;
|
|
505
|
+
fromToken: string;
|
|
506
|
+
toToken: string;
|
|
507
|
+
fromAmount: string;
|
|
508
|
+
toAmount: string;
|
|
509
|
+
estimatedTime: string;
|
|
510
|
+
fees: {
|
|
511
|
+
bridge: number;
|
|
512
|
+
gas: number;
|
|
513
|
+
total: number;
|
|
514
|
+
};
|
|
515
|
+
route: BridgeRoute[];
|
|
516
|
+
expiresAt: string;
|
|
517
|
+
}
|
|
518
|
+
interface BridgeRoute {
|
|
519
|
+
protocol: string;
|
|
520
|
+
fromChain: string;
|
|
521
|
+
toChain: string;
|
|
522
|
+
estimatedTime: string;
|
|
523
|
+
}
|
|
524
|
+
interface BridgeTransaction {
|
|
525
|
+
id: string;
|
|
526
|
+
status: 'pending' | 'source_confirmed' | 'bridging' | 'completed' | 'failed';
|
|
527
|
+
fromChainId: number;
|
|
528
|
+
toChainId: number;
|
|
529
|
+
fromAmount: string;
|
|
530
|
+
toAmount?: string;
|
|
531
|
+
sourceTxHash?: string;
|
|
532
|
+
destinationTxHash?: string;
|
|
533
|
+
createdAt: string;
|
|
534
|
+
completedAt?: string;
|
|
535
|
+
}
|
|
536
|
+
interface GasEstimate {
|
|
537
|
+
gasLimit: string;
|
|
538
|
+
gasPrice: string;
|
|
539
|
+
maxFeePerGas?: string;
|
|
540
|
+
maxPriorityFeePerGas?: string;
|
|
541
|
+
estimatedCostWei: string;
|
|
542
|
+
estimatedCostUsd: number;
|
|
543
|
+
}
|
|
544
|
+
interface GasPrice {
|
|
545
|
+
chainId: number;
|
|
546
|
+
slow: {
|
|
547
|
+
gasPrice: string;
|
|
548
|
+
estimatedTime: string;
|
|
549
|
+
};
|
|
550
|
+
standard: {
|
|
551
|
+
gasPrice: string;
|
|
552
|
+
estimatedTime: string;
|
|
553
|
+
};
|
|
554
|
+
fast: {
|
|
555
|
+
gasPrice: string;
|
|
556
|
+
estimatedTime: string;
|
|
557
|
+
};
|
|
558
|
+
baseFee?: string;
|
|
559
|
+
}
|
|
560
|
+
interface WalletExport {
|
|
561
|
+
address: string;
|
|
562
|
+
encryptedPrivateKey?: string;
|
|
563
|
+
mnemonic?: string;
|
|
564
|
+
publicKey: string;
|
|
565
|
+
chainId: number;
|
|
566
|
+
type: 'eoa' | 'smart' | 'imported';
|
|
567
|
+
}
|
|
568
|
+
interface WalletImportRequest {
|
|
569
|
+
privateKey?: string;
|
|
570
|
+
mnemonic?: string;
|
|
571
|
+
chainId?: number;
|
|
572
|
+
label?: string;
|
|
573
|
+
}
|
|
574
|
+
interface Session {
|
|
575
|
+
userId: string;
|
|
576
|
+
accessToken: string;
|
|
577
|
+
refreshToken: string;
|
|
578
|
+
expiresAt: string;
|
|
579
|
+
deviceId?: string;
|
|
580
|
+
}
|
|
581
|
+
interface PortfolioHistory {
|
|
582
|
+
date: string;
|
|
583
|
+
totalValue: number;
|
|
584
|
+
change: number;
|
|
585
|
+
changePercent: number;
|
|
586
|
+
}
|
|
587
|
+
interface AssetAllocation {
|
|
588
|
+
category: string;
|
|
589
|
+
value: number;
|
|
590
|
+
percentage: number;
|
|
591
|
+
tokens: {
|
|
592
|
+
symbol: string;
|
|
593
|
+
value: number;
|
|
594
|
+
percentage: number;
|
|
595
|
+
}[];
|
|
596
|
+
}
|
|
597
|
+
interface PortfolioAnalytics {
|
|
598
|
+
totalValue: number;
|
|
599
|
+
allTimeProfit: number;
|
|
600
|
+
allTimeProfitPercent: number;
|
|
601
|
+
bestPerformer: {
|
|
602
|
+
symbol: string;
|
|
603
|
+
change: number;
|
|
604
|
+
};
|
|
605
|
+
worstPerformer: {
|
|
606
|
+
symbol: string;
|
|
607
|
+
change: number;
|
|
608
|
+
};
|
|
609
|
+
history: PortfolioHistory[];
|
|
610
|
+
allocation: AssetAllocation[];
|
|
611
|
+
}
|
|
612
|
+
interface TradingCondition {
|
|
613
|
+
type: 'stop_loss' | 'take_profit' | 'trailing_stop';
|
|
614
|
+
triggerPrice: number;
|
|
615
|
+
triggerPercent?: number;
|
|
616
|
+
action: 'sell' | 'notify';
|
|
617
|
+
}
|
|
618
|
+
interface LimitOrder {
|
|
619
|
+
id: string;
|
|
620
|
+
type: 'buy' | 'sell';
|
|
621
|
+
tokenSymbol: string;
|
|
622
|
+
amount: number;
|
|
623
|
+
limitPrice: number;
|
|
624
|
+
status: 'pending' | 'filled' | 'cancelled' | 'expired';
|
|
625
|
+
conditions?: TradingCondition[];
|
|
626
|
+
createdAt: string;
|
|
627
|
+
expiresAt?: string;
|
|
628
|
+
}
|
|
629
|
+
type SDKEventType = 'auth:login' | 'auth:logout' | 'wallet:connected' | 'wallet:disconnected' | 'transaction:pending' | 'transaction:confirmed' | 'transaction:failed' | 'balance:updated' | 'price:updated' | 'notification:received';
|
|
630
|
+
interface SDKEvent {
|
|
631
|
+
type: SDKEventType;
|
|
632
|
+
payload: any;
|
|
633
|
+
timestamp: string;
|
|
634
|
+
}
|
|
635
|
+
type Permission = 'wallet:read' | 'wallet:write' | 'wallet:sign' | 'trade:read' | 'trade:execute' | 'profile:read' | 'profile:write' | 'admin:all';
|
|
636
|
+
interface PermissionScope {
|
|
637
|
+
permissions: Permission[];
|
|
638
|
+
expiresAt?: string;
|
|
639
|
+
}
|
|
640
|
+
type WebhookEventType = 'user.created' | 'user.updated' | 'wallet.created' | 'transaction.pending' | 'transaction.confirmed' | 'transaction.failed' | 'payment.created' | 'payment.paid' | 'payment.failed' | 'position.opened' | 'position.closed' | 'order.filled' | 'strategy.signal';
|
|
641
|
+
interface Webhook {
|
|
642
|
+
id: string;
|
|
643
|
+
projectId: string;
|
|
644
|
+
url: string;
|
|
645
|
+
events: WebhookEventType[];
|
|
646
|
+
secret?: string;
|
|
647
|
+
isActive: boolean;
|
|
648
|
+
metadata?: Record<string, unknown>;
|
|
649
|
+
createdAt: string;
|
|
650
|
+
updatedAt: string;
|
|
651
|
+
}
|
|
652
|
+
interface WebhookDelivery {
|
|
653
|
+
id: string;
|
|
654
|
+
webhookId: string;
|
|
655
|
+
event: WebhookEventType;
|
|
656
|
+
payload: unknown;
|
|
657
|
+
status: 'pending' | 'success' | 'failed';
|
|
658
|
+
statusCode?: number;
|
|
659
|
+
responseTime?: number;
|
|
660
|
+
error?: string;
|
|
661
|
+
attempts: number;
|
|
662
|
+
createdAt: string;
|
|
663
|
+
deliveredAt?: string;
|
|
664
|
+
}
|
|
665
|
+
interface CreateWebhookInput {
|
|
666
|
+
url: string;
|
|
667
|
+
events: WebhookEventType[];
|
|
668
|
+
secret?: string;
|
|
669
|
+
isActive?: boolean;
|
|
670
|
+
metadata?: Record<string, unknown>;
|
|
671
|
+
}
|
|
672
|
+
interface UpdateWebhookInput {
|
|
673
|
+
url?: string;
|
|
674
|
+
events?: WebhookEventType[];
|
|
675
|
+
secret?: string;
|
|
676
|
+
isActive?: boolean;
|
|
677
|
+
metadata?: Record<string, unknown>;
|
|
678
|
+
}
|
|
679
|
+
interface AdminUser {
|
|
680
|
+
id: string;
|
|
681
|
+
email?: string;
|
|
682
|
+
phone?: string;
|
|
683
|
+
role: 'user' | 'admin';
|
|
684
|
+
kycStatus: 'none' | 'pending' | 'verified' | 'rejected';
|
|
685
|
+
isActive: boolean;
|
|
686
|
+
walletCount: number;
|
|
687
|
+
createdAt: string;
|
|
688
|
+
lastActiveAt?: string;
|
|
689
|
+
}
|
|
690
|
+
interface AdminProject {
|
|
691
|
+
id: string;
|
|
692
|
+
name: string;
|
|
693
|
+
slug: string;
|
|
694
|
+
ownerId: string;
|
|
695
|
+
ownerEmail?: string;
|
|
696
|
+
apiKey: string;
|
|
697
|
+
isActive: boolean;
|
|
698
|
+
settings: Record<string, unknown>;
|
|
699
|
+
createdAt: string;
|
|
700
|
+
updatedAt: string;
|
|
701
|
+
}
|
|
702
|
+
interface SystemStats {
|
|
703
|
+
overview: {
|
|
704
|
+
totalUsers: number;
|
|
705
|
+
newUsers: number;
|
|
706
|
+
totalWallets: number;
|
|
707
|
+
totalTransactions: number;
|
|
708
|
+
totalProjects: number;
|
|
709
|
+
totalStrategies: number;
|
|
710
|
+
activePositions: number;
|
|
711
|
+
totalPayments: number;
|
|
712
|
+
fiatVolume: number;
|
|
713
|
+
};
|
|
714
|
+
userGrowth: Array<{
|
|
715
|
+
date: string;
|
|
716
|
+
count: number;
|
|
717
|
+
}>;
|
|
718
|
+
chainVolume: Array<{
|
|
719
|
+
chainId: number;
|
|
720
|
+
count: number;
|
|
721
|
+
}>;
|
|
722
|
+
kycBreakdown: Record<string, number>;
|
|
723
|
+
period: {
|
|
724
|
+
days: number;
|
|
725
|
+
startDate: string;
|
|
726
|
+
endDate: string;
|
|
727
|
+
};
|
|
728
|
+
}
|
|
729
|
+
interface PaginatedResult<T> {
|
|
730
|
+
data: T[];
|
|
731
|
+
total: number;
|
|
732
|
+
page: number;
|
|
733
|
+
limit: number;
|
|
734
|
+
totalPages: number;
|
|
735
|
+
}
|
|
736
|
+
interface AdminListOptions {
|
|
737
|
+
page?: number;
|
|
738
|
+
limit?: number;
|
|
739
|
+
search?: string;
|
|
740
|
+
sortBy?: string;
|
|
741
|
+
sortOrder?: 'asc' | 'desc';
|
|
742
|
+
}
|
|
743
|
+
interface SystemLog {
|
|
744
|
+
id: string;
|
|
745
|
+
level: 'info' | 'warn' | 'error';
|
|
746
|
+
service: string;
|
|
747
|
+
message: string;
|
|
748
|
+
metadata?: Record<string, unknown>;
|
|
749
|
+
createdAt: string;
|
|
750
|
+
}
|
|
751
|
+
interface RateLimitInfo {
|
|
752
|
+
identifier: string;
|
|
753
|
+
endpoint: string;
|
|
754
|
+
count: number;
|
|
755
|
+
windowStart: string;
|
|
756
|
+
windowEnd: string;
|
|
757
|
+
}
|
|
758
|
+
|
|
759
|
+
export type { AIMarketData, AINavSnapshot, AIOrder, AIOrderStatus, AIPortfolioSummary, AIRedemptionResult, AIStrategy, AITradeAllocation, AITradeExecution, AdminListOptions, AdminProject, AdminUser, ApiResponse, AssetAllocation, BillCategory, BillPayment, BillProvider, BridgeQuote, BridgeRoute, BridgeTransaction, Card, CardStatus, CardTier, CardTransaction, ChainConfig, Contract, ContractDeployParams, ContractReadParams, ContractType, ContractWriteParams, CreateAIOrderRequest, CreateWebhookInput, GasEstimate, GasPrice, KycLevel, KycStatus, LimitOrder, MembershipTier, NFT, NFTAttribute, NFTCollection, NFTTransfer, Notification, NotificationSettings, OfframpQuote, OfframpRequest, OfframpTransaction, OnChainBalance, PaginatedResult, Permission, PermissionScope, PortfolioAnalytics, PortfolioHistory, Position, RateLimitInfo, Referral, ReferralInfo, RiskLevel, SDKEvent, SDKEventType, Session, StakingPool, StakingPosition, StrategyCategory, SystemLog, SystemStats, Token, TokenPrice, TradeAction, TradingCondition, Transaction, TransactionStatus, TransactionType, UpdateWebhookInput, User, UserProfile, UserSettings, WalletBalance, WalletExport, WalletImportRequest, Webhook, WebhookDelivery, WebhookEventType };
|