atfi 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/README.md +453 -0
- package/dist/index.d.mts +1757 -0
- package/dist/index.d.ts +1757 -0
- package/dist/index.js +1410 -0
- package/dist/index.mjs +1369 -0
- package/package.json +36 -0
package/dist/index.d.mts
ADDED
|
@@ -0,0 +1,1757 @@
|
|
|
1
|
+
import { Address, Hash, PublicClient, WalletClient } from 'viem';
|
|
2
|
+
|
|
3
|
+
declare const CHAIN_ID = 8453;
|
|
4
|
+
declare const CONTRACTS: {
|
|
5
|
+
readonly FACTORY: Address;
|
|
6
|
+
readonly MORPHO_VAULT: Address;
|
|
7
|
+
};
|
|
8
|
+
declare const TOKENS: {
|
|
9
|
+
readonly USDC: {
|
|
10
|
+
readonly address: Address;
|
|
11
|
+
readonly decimals: 6;
|
|
12
|
+
readonly symbol: "USDC";
|
|
13
|
+
readonly supportsYield: true;
|
|
14
|
+
};
|
|
15
|
+
readonly IDRX: {
|
|
16
|
+
readonly address: Address;
|
|
17
|
+
readonly decimals: 2;
|
|
18
|
+
readonly symbol: "IDRX";
|
|
19
|
+
readonly supportsYield: false;
|
|
20
|
+
};
|
|
21
|
+
};
|
|
22
|
+
type TokenSymbol = keyof typeof TOKENS;
|
|
23
|
+
declare const getTokenByAddress: (address: Address) => {
|
|
24
|
+
symbol: TokenSymbol;
|
|
25
|
+
address: Address;
|
|
26
|
+
decimals: 6;
|
|
27
|
+
supportsYield: true;
|
|
28
|
+
} | {
|
|
29
|
+
symbol: TokenSymbol;
|
|
30
|
+
address: Address;
|
|
31
|
+
decimals: 2;
|
|
32
|
+
supportsYield: false;
|
|
33
|
+
} | null;
|
|
34
|
+
declare const getTokenBySymbol: (symbol: TokenSymbol) => {
|
|
35
|
+
readonly address: Address;
|
|
36
|
+
readonly decimals: 6;
|
|
37
|
+
readonly symbol: "USDC";
|
|
38
|
+
readonly supportsYield: true;
|
|
39
|
+
} | {
|
|
40
|
+
readonly address: Address;
|
|
41
|
+
readonly decimals: 2;
|
|
42
|
+
readonly symbol: "IDRX";
|
|
43
|
+
readonly supportsYield: false;
|
|
44
|
+
};
|
|
45
|
+
|
|
46
|
+
declare enum ParticipantStatus {
|
|
47
|
+
NOT_STAKED = 0,
|
|
48
|
+
STAKED = 1,
|
|
49
|
+
VERIFIED = 2,
|
|
50
|
+
CLAIMED = 3
|
|
51
|
+
}
|
|
52
|
+
declare enum EventStatus {
|
|
53
|
+
OPEN = "OPEN",
|
|
54
|
+
STARTED = "STARTED",
|
|
55
|
+
SETTLED = "SETTLED"
|
|
56
|
+
}
|
|
57
|
+
/**
|
|
58
|
+
* Callbacks for transaction lifecycle - use these to show loading states in UI
|
|
59
|
+
*
|
|
60
|
+
* @example
|
|
61
|
+
* ```ts
|
|
62
|
+
* const result = await action.execute({
|
|
63
|
+
* onApproving: () => setStatus('Approving token...'),
|
|
64
|
+
* onApproved: (hash) => setStatus('Token approved!'),
|
|
65
|
+
* onSubmitting: () => setStatus('Submitting transaction...'),
|
|
66
|
+
* onSubmitted: (hash) => setStatus(`TX submitted: ${hash}`),
|
|
67
|
+
* onConfirming: () => setStatus('Waiting for confirmation...'),
|
|
68
|
+
* });
|
|
69
|
+
* ```
|
|
70
|
+
*/
|
|
71
|
+
interface TransactionCallbacks {
|
|
72
|
+
/** Called when starting token approval (if needed) */
|
|
73
|
+
onApproving?: () => void;
|
|
74
|
+
/** Called when approval transaction is submitted */
|
|
75
|
+
onApproved?: (txHash: Hash) => void;
|
|
76
|
+
/** Called when submitting the main transaction */
|
|
77
|
+
onSubmitting?: () => void;
|
|
78
|
+
/** Called when main transaction is submitted to network */
|
|
79
|
+
onSubmitted?: (txHash: Hash) => void;
|
|
80
|
+
/** Called when waiting for transaction confirmation */
|
|
81
|
+
onConfirming?: () => void;
|
|
82
|
+
}
|
|
83
|
+
/** Event with user's participation status */
|
|
84
|
+
interface UserEventInfo extends EventInfo {
|
|
85
|
+
/** User's participation in this event */
|
|
86
|
+
userStatus: {
|
|
87
|
+
isOwner: boolean;
|
|
88
|
+
hasStaked: boolean;
|
|
89
|
+
isVerified: boolean;
|
|
90
|
+
hasClaimed: boolean;
|
|
91
|
+
claimableAmount: string;
|
|
92
|
+
};
|
|
93
|
+
}
|
|
94
|
+
interface CreateEventParams {
|
|
95
|
+
/** Stake amount in human readable format (e.g., "10" for 10 USDC) */
|
|
96
|
+
stakeAmount: string;
|
|
97
|
+
/** Maximum number of participants */
|
|
98
|
+
maxParticipants: number;
|
|
99
|
+
/** Enable Morpho yield (USDC only) */
|
|
100
|
+
useYield?: boolean;
|
|
101
|
+
/** Token to use: 'USDC' or 'IDRX'. Default: 'USDC' */
|
|
102
|
+
token?: 'USDC' | 'IDRX';
|
|
103
|
+
}
|
|
104
|
+
interface CreateEventResult {
|
|
105
|
+
vaultId: bigint;
|
|
106
|
+
vaultAddress: Address;
|
|
107
|
+
txHash: Hash;
|
|
108
|
+
}
|
|
109
|
+
interface RegisterParams {
|
|
110
|
+
vaultAddress: Address;
|
|
111
|
+
}
|
|
112
|
+
interface RegisterResult {
|
|
113
|
+
txHash: Hash;
|
|
114
|
+
stakeAmount: string;
|
|
115
|
+
}
|
|
116
|
+
interface StartEventParams {
|
|
117
|
+
vaultAddress: Address;
|
|
118
|
+
}
|
|
119
|
+
interface StartEventResult {
|
|
120
|
+
txHash: Hash;
|
|
121
|
+
totalStaked: string;
|
|
122
|
+
hasYield: boolean;
|
|
123
|
+
sharesReceived?: string;
|
|
124
|
+
}
|
|
125
|
+
interface VerifyParticipantParams {
|
|
126
|
+
vaultAddress: Address;
|
|
127
|
+
participants: Address[];
|
|
128
|
+
}
|
|
129
|
+
interface VerifyParticipantResult {
|
|
130
|
+
txHash: Hash;
|
|
131
|
+
verifiedCount: number;
|
|
132
|
+
totalVerified: number;
|
|
133
|
+
}
|
|
134
|
+
interface SettleEventParams {
|
|
135
|
+
vaultAddress: Address;
|
|
136
|
+
}
|
|
137
|
+
interface SettleEventResult {
|
|
138
|
+
txHash: Hash;
|
|
139
|
+
totalYieldEarned: string;
|
|
140
|
+
protocolFees: string;
|
|
141
|
+
noShowFees: string;
|
|
142
|
+
}
|
|
143
|
+
interface ClaimParams {
|
|
144
|
+
vaultAddress: Address;
|
|
145
|
+
}
|
|
146
|
+
interface ClaimResult {
|
|
147
|
+
txHash: Hash;
|
|
148
|
+
amountClaimed: string;
|
|
149
|
+
}
|
|
150
|
+
interface EventInfo {
|
|
151
|
+
vaultId: bigint;
|
|
152
|
+
vaultAddress: Address;
|
|
153
|
+
owner: Address;
|
|
154
|
+
assetToken: Address;
|
|
155
|
+
tokenSymbol: string;
|
|
156
|
+
tokenDecimals: number;
|
|
157
|
+
stakeAmount: string;
|
|
158
|
+
maxParticipants: number;
|
|
159
|
+
currentParticipants: number;
|
|
160
|
+
verifiedCount: number;
|
|
161
|
+
stakingOpen: boolean;
|
|
162
|
+
eventStarted: boolean;
|
|
163
|
+
settled: boolean;
|
|
164
|
+
hasYield: boolean;
|
|
165
|
+
totalStaked: string;
|
|
166
|
+
yieldInfo?: {
|
|
167
|
+
currentBalance: string;
|
|
168
|
+
deposited: string;
|
|
169
|
+
estimatedYield: string;
|
|
170
|
+
};
|
|
171
|
+
}
|
|
172
|
+
interface ParticipantInfo {
|
|
173
|
+
address: Address;
|
|
174
|
+
hasStaked: boolean;
|
|
175
|
+
isVerified: boolean;
|
|
176
|
+
hasClaimed: boolean;
|
|
177
|
+
claimableAmount: string;
|
|
178
|
+
status: ParticipantStatus;
|
|
179
|
+
}
|
|
180
|
+
interface EventSummary {
|
|
181
|
+
vaultId: bigint;
|
|
182
|
+
vaultAddress: Address;
|
|
183
|
+
owner: Address;
|
|
184
|
+
assetToken: Address;
|
|
185
|
+
stakeAmount: string;
|
|
186
|
+
maxParticipants: number;
|
|
187
|
+
currentParticipants: number;
|
|
188
|
+
status: EventStatus;
|
|
189
|
+
}
|
|
190
|
+
interface ATFiSDKConfig {
|
|
191
|
+
/** Custom factory address (optional, defaults to mainnet) */
|
|
192
|
+
factoryAddress?: Address;
|
|
193
|
+
}
|
|
194
|
+
interface SimulationBase {
|
|
195
|
+
/** Whether the simulation succeeded */
|
|
196
|
+
success: boolean;
|
|
197
|
+
/** Error if simulation failed */
|
|
198
|
+
error?: {
|
|
199
|
+
code: string;
|
|
200
|
+
message: string;
|
|
201
|
+
};
|
|
202
|
+
/** Estimated gas for the transaction */
|
|
203
|
+
gasEstimate?: bigint;
|
|
204
|
+
}
|
|
205
|
+
interface SimulateCreateEventResult extends SimulationBase {
|
|
206
|
+
/** Expected vault ID (next vault ID from factory) */
|
|
207
|
+
expectedVaultId?: bigint;
|
|
208
|
+
/** Token being used */
|
|
209
|
+
token?: {
|
|
210
|
+
address: Address;
|
|
211
|
+
symbol: string;
|
|
212
|
+
decimals: number;
|
|
213
|
+
};
|
|
214
|
+
/** Stake amount in human readable format */
|
|
215
|
+
stakeAmount?: string;
|
|
216
|
+
/** Max participants */
|
|
217
|
+
maxParticipants?: number;
|
|
218
|
+
/** Whether yield is enabled */
|
|
219
|
+
useYield?: boolean;
|
|
220
|
+
}
|
|
221
|
+
interface SimulateRegisterResult extends SimulationBase {
|
|
222
|
+
/** Stake amount required */
|
|
223
|
+
stakeAmount?: string;
|
|
224
|
+
/** Token symbol */
|
|
225
|
+
tokenSymbol?: string;
|
|
226
|
+
/** Current user balance */
|
|
227
|
+
userBalance?: string;
|
|
228
|
+
/** Current allowance */
|
|
229
|
+
currentAllowance?: string;
|
|
230
|
+
/** Whether approval is needed */
|
|
231
|
+
needsApproval?: boolean;
|
|
232
|
+
/** Current participant count */
|
|
233
|
+
currentParticipants?: number;
|
|
234
|
+
/** Max participants */
|
|
235
|
+
maxParticipants?: number;
|
|
236
|
+
}
|
|
237
|
+
interface SimulateStartEventResult extends SimulationBase {
|
|
238
|
+
/** Total amount that will be deposited */
|
|
239
|
+
totalStaked?: string;
|
|
240
|
+
/** Whether vault has yield enabled */
|
|
241
|
+
hasYield?: boolean;
|
|
242
|
+
/** Number of participants */
|
|
243
|
+
participantCount?: number;
|
|
244
|
+
/** Expected shares to receive (if yield enabled) */
|
|
245
|
+
expectedShares?: string;
|
|
246
|
+
}
|
|
247
|
+
interface SimulateVerifyResult extends SimulationBase {
|
|
248
|
+
/** Addresses that will be verified */
|
|
249
|
+
toVerify?: Address[];
|
|
250
|
+
/** Addresses already verified (will be skipped) */
|
|
251
|
+
alreadyVerified?: Address[];
|
|
252
|
+
/** Addresses not staked (will fail) */
|
|
253
|
+
notStaked?: Address[];
|
|
254
|
+
/** Current verified count */
|
|
255
|
+
currentVerified?: number;
|
|
256
|
+
/** New verified count after operation */
|
|
257
|
+
newVerifiedCount?: number;
|
|
258
|
+
}
|
|
259
|
+
interface SimulateSettleResult extends SimulationBase {
|
|
260
|
+
/** Total staked amount */
|
|
261
|
+
totalStaked?: string;
|
|
262
|
+
/** Number of verified participants */
|
|
263
|
+
verifiedCount?: number;
|
|
264
|
+
/** Number of no-shows */
|
|
265
|
+
noShowCount?: number;
|
|
266
|
+
/** Estimated yield earned (if yield enabled) */
|
|
267
|
+
estimatedYield?: string;
|
|
268
|
+
/** Estimated protocol fees */
|
|
269
|
+
estimatedProtocolFees?: string;
|
|
270
|
+
/** Estimated no-show fees */
|
|
271
|
+
estimatedNoShowFees?: string;
|
|
272
|
+
/** Estimated reward per verified participant */
|
|
273
|
+
estimatedRewardPerParticipant?: string;
|
|
274
|
+
}
|
|
275
|
+
interface SimulateClaimResult extends SimulationBase {
|
|
276
|
+
/** Amount that will be claimed */
|
|
277
|
+
claimableAmount?: string;
|
|
278
|
+
/** Token symbol */
|
|
279
|
+
tokenSymbol?: string;
|
|
280
|
+
/** User's stake amount */
|
|
281
|
+
stakeAmount?: string;
|
|
282
|
+
/** User's bonus share */
|
|
283
|
+
bonusShare?: string;
|
|
284
|
+
}
|
|
285
|
+
/**
|
|
286
|
+
* Action result - contains simulation data and execute function
|
|
287
|
+
* One function call gives you everything you need
|
|
288
|
+
*
|
|
289
|
+
* @example
|
|
290
|
+
* ```ts
|
|
291
|
+
* const action = await sdk.register({ vaultAddress });
|
|
292
|
+
*
|
|
293
|
+
* // Check simulation result
|
|
294
|
+
* if (!action.simulation.success) {
|
|
295
|
+
* console.error(action.simulation.error.message);
|
|
296
|
+
* return;
|
|
297
|
+
* }
|
|
298
|
+
*
|
|
299
|
+
* // Show user what will happen
|
|
300
|
+
* console.log(`Stake ${action.simulation.stakeAmount} ${action.simulation.tokenSymbol}?`);
|
|
301
|
+
*
|
|
302
|
+
* // User confirms, execute with loading callbacks
|
|
303
|
+
* const result = await action.execute({
|
|
304
|
+
* onApproving: () => setStatus('Approving...'),
|
|
305
|
+
* onSubmitted: (hash) => setStatus(`TX: ${hash}`),
|
|
306
|
+
* onConfirming: () => setStatus('Confirming...'),
|
|
307
|
+
* });
|
|
308
|
+
* console.log('Done!', result.txHash);
|
|
309
|
+
* ```
|
|
310
|
+
*/
|
|
311
|
+
interface ActionResult<TSimulation, TExecuteResult> {
|
|
312
|
+
/** Simulation result - check this before calling execute() */
|
|
313
|
+
simulation: TSimulation;
|
|
314
|
+
/** Execute the transaction. Only call if simulation.success is true */
|
|
315
|
+
execute: (callbacks?: TransactionCallbacks) => Promise<TExecuteResult>;
|
|
316
|
+
}
|
|
317
|
+
/** Result from sdk.createEvent() */
|
|
318
|
+
type CreateEventAction = ActionResult<SimulateCreateEventResult, CreateEventResult>;
|
|
319
|
+
/** Result from sdk.register() */
|
|
320
|
+
type RegisterAction = ActionResult<SimulateRegisterResult, RegisterResult>;
|
|
321
|
+
/** Result from sdk.startEvent() */
|
|
322
|
+
type StartEventAction = ActionResult<SimulateStartEventResult, StartEventResult>;
|
|
323
|
+
/** Result from sdk.verifyParticipant() */
|
|
324
|
+
type VerifyAction = ActionResult<SimulateVerifyResult, VerifyParticipantResult>;
|
|
325
|
+
/** Result from sdk.settleEvent() */
|
|
326
|
+
type SettleAction = ActionResult<SimulateSettleResult, SettleEventResult>;
|
|
327
|
+
/** Result from sdk.claimReward() */
|
|
328
|
+
type ClaimAction = ActionResult<SimulateClaimResult, ClaimResult>;
|
|
329
|
+
/** Callbacks for watching vault events in real-time */
|
|
330
|
+
interface VaultWatchCallbacks {
|
|
331
|
+
/** Called when a new participant stakes */
|
|
332
|
+
onParticipantJoined?: (participant: Address, totalParticipants: number) => void;
|
|
333
|
+
/** Called when a participant is verified */
|
|
334
|
+
onParticipantVerified?: (participant: Address, totalVerified: number) => void;
|
|
335
|
+
/** Called when the event is settled */
|
|
336
|
+
onSettled?: (totalYield: string, protocolFee: string) => void;
|
|
337
|
+
/** Called when a participant claims their reward */
|
|
338
|
+
onClaimed?: (participant: Address, amount: string) => void;
|
|
339
|
+
/** Called when staking is opened/closed */
|
|
340
|
+
onStakingStatusChanged?: (isOpen: boolean) => void;
|
|
341
|
+
/** Called on any error */
|
|
342
|
+
onError?: (error: Error) => void;
|
|
343
|
+
}
|
|
344
|
+
/** Function to stop watching events */
|
|
345
|
+
type UnwatchFn = () => void;
|
|
346
|
+
|
|
347
|
+
/**
|
|
348
|
+
* ATFi SDK - TypeScript SDK for interacting with ATFi Protocol
|
|
349
|
+
*
|
|
350
|
+
* Features:
|
|
351
|
+
* - Built-in simulation before every write operation
|
|
352
|
+
* - Transaction callbacks for loading states
|
|
353
|
+
* - Read-only mode (no wallet required)
|
|
354
|
+
* - Token balance helpers
|
|
355
|
+
* - User-centric queries (my events, my registrations)
|
|
356
|
+
* - Real-time event watching
|
|
357
|
+
*
|
|
358
|
+
* @example
|
|
359
|
+
* ```ts
|
|
360
|
+
* // Full mode (with wallet)
|
|
361
|
+
* const sdk = new ATFiSDK(publicClient, walletClient);
|
|
362
|
+
*
|
|
363
|
+
* // Read-only mode (no wallet needed)
|
|
364
|
+
* const sdk = ATFiSDK.readOnly(publicClient);
|
|
365
|
+
*
|
|
366
|
+
* // Register with loading callbacks
|
|
367
|
+
* const action = await sdk.register({ vaultAddress: '0x...' });
|
|
368
|
+
* if (action.simulation.success) {
|
|
369
|
+
* const result = await action.execute({
|
|
370
|
+
* onApproving: () => setStatus('Approving...'),
|
|
371
|
+
* onSubmitted: (hash) => setStatus('Submitted!'),
|
|
372
|
+
* });
|
|
373
|
+
* }
|
|
374
|
+
* ```
|
|
375
|
+
*/
|
|
376
|
+
declare class ATFiSDK {
|
|
377
|
+
private publicClient;
|
|
378
|
+
private walletClient;
|
|
379
|
+
private factoryAddress;
|
|
380
|
+
private _isReadOnly;
|
|
381
|
+
constructor(publicClient: PublicClient, walletClient?: WalletClient | null, config?: ATFiSDKConfig);
|
|
382
|
+
/**
|
|
383
|
+
* Create a read-only SDK instance (no wallet required)
|
|
384
|
+
* Use this to show event data before user connects wallet
|
|
385
|
+
*
|
|
386
|
+
* @example
|
|
387
|
+
* ```ts
|
|
388
|
+
* const sdk = ATFiSDK.readOnly(publicClient);
|
|
389
|
+
* const events = await sdk.getAllEvents();
|
|
390
|
+
* const info = await sdk.getEventInfo(vaultAddress);
|
|
391
|
+
* ```
|
|
392
|
+
*/
|
|
393
|
+
static readOnly(publicClient: PublicClient, config?: ATFiSDKConfig): ATFiSDK;
|
|
394
|
+
/** Check if SDK is in read-only mode */
|
|
395
|
+
get isReadOnly(): boolean;
|
|
396
|
+
/** Get connected wallet address (null if read-only) */
|
|
397
|
+
get address(): Address | null;
|
|
398
|
+
/**
|
|
399
|
+
* Get token balance for connected wallet or any address
|
|
400
|
+
*
|
|
401
|
+
* @example
|
|
402
|
+
* ```ts
|
|
403
|
+
* const myBalance = await sdk.getTokenBalance('USDC');
|
|
404
|
+
* const otherBalance = await sdk.getTokenBalance('USDC', '0xOther...');
|
|
405
|
+
* ```
|
|
406
|
+
*/
|
|
407
|
+
getTokenBalance(token: TokenSymbol, address?: Address): Promise<string>;
|
|
408
|
+
/**
|
|
409
|
+
* Get all supported token balances for an address
|
|
410
|
+
*/
|
|
411
|
+
getAllTokenBalances(address?: Address): Promise<Record<TokenSymbol, string>>;
|
|
412
|
+
/**
|
|
413
|
+
* Get all events created by an address
|
|
414
|
+
*
|
|
415
|
+
* @example
|
|
416
|
+
* ```ts
|
|
417
|
+
* const myEvents = await sdk.getEventsByOwner(myAddress);
|
|
418
|
+
* ```
|
|
419
|
+
*/
|
|
420
|
+
getEventsByOwner(ownerAddress: Address): Promise<EventInfo[]>;
|
|
421
|
+
/**
|
|
422
|
+
* Get all events where user has registered (staked)
|
|
423
|
+
*
|
|
424
|
+
* @example
|
|
425
|
+
* ```ts
|
|
426
|
+
* const myRegistrations = await sdk.getRegisteredEvents(myAddress);
|
|
427
|
+
* ```
|
|
428
|
+
*/
|
|
429
|
+
getRegisteredEvents(participantAddress: Address): Promise<UserEventInfo[]>;
|
|
430
|
+
/**
|
|
431
|
+
* Get all events where user can claim rewards
|
|
432
|
+
*
|
|
433
|
+
* @example
|
|
434
|
+
* ```ts
|
|
435
|
+
* const claimable = await sdk.getClaimableEvents(myAddress);
|
|
436
|
+
* for (const event of claimable) {
|
|
437
|
+
* console.log(`Can claim ${event.userStatus.claimableAmount} from ${event.vaultAddress}`);
|
|
438
|
+
* }
|
|
439
|
+
* ```
|
|
440
|
+
*/
|
|
441
|
+
getClaimableEvents(participantAddress: Address): Promise<UserEventInfo[]>;
|
|
442
|
+
/**
|
|
443
|
+
* Get user's complete dashboard data in one call
|
|
444
|
+
*
|
|
445
|
+
* @example
|
|
446
|
+
* ```ts
|
|
447
|
+
* const dashboard = await sdk.getUserDashboard(myAddress);
|
|
448
|
+
* console.log('Created:', dashboard.createdEvents.length);
|
|
449
|
+
* console.log('Registered:', dashboard.registeredEvents.length);
|
|
450
|
+
* console.log('Claimable:', dashboard.claimableEvents.length);
|
|
451
|
+
* ```
|
|
452
|
+
*/
|
|
453
|
+
getUserDashboard(userAddress: Address): Promise<{
|
|
454
|
+
createdEvents: EventInfo[];
|
|
455
|
+
registeredEvents: UserEventInfo[];
|
|
456
|
+
claimableEvents: UserEventInfo[];
|
|
457
|
+
totalClaimable: string;
|
|
458
|
+
tokenBalances: Record<TokenSymbol, string>;
|
|
459
|
+
}>;
|
|
460
|
+
/**
|
|
461
|
+
* Watch a vault for real-time updates
|
|
462
|
+
*
|
|
463
|
+
* @example
|
|
464
|
+
* ```ts
|
|
465
|
+
* const unwatch = sdk.watchVault(vaultAddress, {
|
|
466
|
+
* onParticipantJoined: (addr, total) => {
|
|
467
|
+
* console.log(`${addr} joined! Total: ${total}`);
|
|
468
|
+
* refetchParticipants();
|
|
469
|
+
* },
|
|
470
|
+
* onSettled: (yield, fee) => {
|
|
471
|
+
* showClaimButton();
|
|
472
|
+
* },
|
|
473
|
+
* });
|
|
474
|
+
*
|
|
475
|
+
* // Later: stop watching
|
|
476
|
+
* unwatch();
|
|
477
|
+
* ```
|
|
478
|
+
*/
|
|
479
|
+
watchVault(vaultAddress: Address, callbacks: VaultWatchCallbacks): UnwatchFn;
|
|
480
|
+
private ensureWallet;
|
|
481
|
+
/**
|
|
482
|
+
* Create a new event (commitment vault)
|
|
483
|
+
*/
|
|
484
|
+
createEvent(params: CreateEventParams): Promise<CreateEventAction>;
|
|
485
|
+
/**
|
|
486
|
+
* Register for an event (stake tokens)
|
|
487
|
+
*/
|
|
488
|
+
register(params: RegisterParams): Promise<RegisterAction>;
|
|
489
|
+
/**
|
|
490
|
+
* Start an event (deposit to yield if enabled)
|
|
491
|
+
*/
|
|
492
|
+
startEvent(params: StartEventParams): Promise<StartEventAction>;
|
|
493
|
+
/**
|
|
494
|
+
* Verify participants (mark attendance)
|
|
495
|
+
*/
|
|
496
|
+
verifyParticipant(params: VerifyParticipantParams): Promise<VerifyAction>;
|
|
497
|
+
/**
|
|
498
|
+
* Settle an event (distribute rewards)
|
|
499
|
+
*/
|
|
500
|
+
settleEvent(params: SettleEventParams): Promise<SettleAction>;
|
|
501
|
+
/**
|
|
502
|
+
* Claim rewards after event settlement
|
|
503
|
+
*/
|
|
504
|
+
claim(params: ClaimParams): Promise<ClaimAction>;
|
|
505
|
+
/**
|
|
506
|
+
* Get detailed event information
|
|
507
|
+
*/
|
|
508
|
+
getEventInfo(vaultAddress: Address): Promise<EventInfo>;
|
|
509
|
+
/**
|
|
510
|
+
* Get participant status
|
|
511
|
+
*/
|
|
512
|
+
getParticipantStatus(vaultAddress: Address, participantAddress: Address): Promise<ParticipantInfo>;
|
|
513
|
+
/**
|
|
514
|
+
* Get all events (vaults) created - uses batched calls for efficiency
|
|
515
|
+
*/
|
|
516
|
+
getAllEvents(): Promise<EventSummary[]>;
|
|
517
|
+
/**
|
|
518
|
+
* Get vault address by ID
|
|
519
|
+
*/
|
|
520
|
+
getVaultAddress(vaultId: number): Promise<Address | null>;
|
|
521
|
+
/**
|
|
522
|
+
* Get total vault count
|
|
523
|
+
*/
|
|
524
|
+
getVaultCount(): Promise<number>;
|
|
525
|
+
private _simulateCreateEvent;
|
|
526
|
+
private _simulateRegister;
|
|
527
|
+
private _simulateStartEvent;
|
|
528
|
+
private _simulateVerifyParticipant;
|
|
529
|
+
private _simulateSettleEvent;
|
|
530
|
+
private _simulateClaim;
|
|
531
|
+
private _executeCreateEvent;
|
|
532
|
+
private _executeRegister;
|
|
533
|
+
private _executeStartEvent;
|
|
534
|
+
private _executeVerifyParticipant;
|
|
535
|
+
private _executeSettleEvent;
|
|
536
|
+
private _executeClaim;
|
|
537
|
+
}
|
|
538
|
+
|
|
539
|
+
/**
|
|
540
|
+
* Convert human readable amount to token units
|
|
541
|
+
* @param amount Human readable amount (e.g., "10.5")
|
|
542
|
+
* @param decimals Token decimals (e.g., 6 for USDC, 2 for IDRX)
|
|
543
|
+
* @returns BigInt in token's smallest unit
|
|
544
|
+
*/
|
|
545
|
+
declare function toTokenUnits(amount: string, decimals: number): bigint;
|
|
546
|
+
/**
|
|
547
|
+
* Convert token units to human readable amount
|
|
548
|
+
* @param amount BigInt in token's smallest unit
|
|
549
|
+
* @param decimals Token decimals
|
|
550
|
+
* @returns Human readable string
|
|
551
|
+
*/
|
|
552
|
+
declare function fromTokenUnits(amount: bigint, decimals: number): string;
|
|
553
|
+
/**
|
|
554
|
+
* Format amount for display with proper decimal places
|
|
555
|
+
* @param amount Human readable amount string
|
|
556
|
+
* @param decimals Number of decimal places to show
|
|
557
|
+
* @returns Formatted string
|
|
558
|
+
*/
|
|
559
|
+
declare function formatAmount(amount: string, decimals?: number): string;
|
|
560
|
+
|
|
561
|
+
declare enum ATFiErrorCode {
|
|
562
|
+
INVALID_AMOUNT = "INVALID_AMOUNT",
|
|
563
|
+
INVALID_ADDRESS = "INVALID_ADDRESS",
|
|
564
|
+
TOKEN_NOT_SUPPORTED = "TOKEN_NOT_SUPPORTED",
|
|
565
|
+
YIELD_ONLY_USDC = "YIELD_ONLY_USDC",
|
|
566
|
+
STAKING_CLOSED = "STAKING_CLOSED",
|
|
567
|
+
EVENT_ALREADY_STARTED = "EVENT_ALREADY_STARTED",
|
|
568
|
+
EVENT_NOT_STARTED = "EVENT_NOT_STARTED",
|
|
569
|
+
ALREADY_STAKED = "ALREADY_STAKED",
|
|
570
|
+
NOT_STAKED = "NOT_STAKED",
|
|
571
|
+
ALREADY_VERIFIED = "ALREADY_VERIFIED",
|
|
572
|
+
NOT_VERIFIED = "NOT_VERIFIED",
|
|
573
|
+
VAULT_NOT_SETTLED = "VAULT_NOT_SETTLED",
|
|
574
|
+
VAULT_ALREADY_SETTLED = "VAULT_ALREADY_SETTLED",
|
|
575
|
+
ALREADY_CLAIMED = "ALREADY_CLAIMED",
|
|
576
|
+
NOTHING_TO_CLAIM = "NOTHING_TO_CLAIM",
|
|
577
|
+
MAX_PARTICIPANTS_REACHED = "MAX_PARTICIPANTS_REACHED",
|
|
578
|
+
NOT_OWNER = "NOT_OWNER",
|
|
579
|
+
INSUFFICIENT_BALANCE = "INSUFFICIENT_BALANCE",
|
|
580
|
+
INSUFFICIENT_ALLOWANCE = "INSUFFICIENT_ALLOWANCE",
|
|
581
|
+
TRANSACTION_FAILED = "TRANSACTION_FAILED",
|
|
582
|
+
CONTRACT_ERROR = "CONTRACT_ERROR",
|
|
583
|
+
VAULT_NOT_FOUND = "VAULT_NOT_FOUND"
|
|
584
|
+
}
|
|
585
|
+
declare class ATFiError extends Error {
|
|
586
|
+
code: ATFiErrorCode;
|
|
587
|
+
details?: unknown | undefined;
|
|
588
|
+
constructor(message: string, code: ATFiErrorCode, details?: unknown | undefined);
|
|
589
|
+
}
|
|
590
|
+
/**
|
|
591
|
+
* Parse contract error and return ATFiError
|
|
592
|
+
*/
|
|
593
|
+
declare function parseContractError(error: unknown): ATFiError;
|
|
594
|
+
|
|
595
|
+
declare const FactoryATFiABI: readonly [{
|
|
596
|
+
readonly inputs: readonly [{
|
|
597
|
+
readonly internalType: "address";
|
|
598
|
+
readonly name: "_treasury";
|
|
599
|
+
readonly type: "address";
|
|
600
|
+
}, {
|
|
601
|
+
readonly internalType: "address";
|
|
602
|
+
readonly name: "_morphoVault";
|
|
603
|
+
readonly type: "address";
|
|
604
|
+
}, {
|
|
605
|
+
readonly internalType: "address";
|
|
606
|
+
readonly name: "_usdcToken";
|
|
607
|
+
readonly type: "address";
|
|
608
|
+
}];
|
|
609
|
+
readonly stateMutability: "nonpayable";
|
|
610
|
+
readonly type: "constructor";
|
|
611
|
+
}, {
|
|
612
|
+
readonly inputs: readonly [];
|
|
613
|
+
readonly name: "EnforcedPause";
|
|
614
|
+
readonly type: "error";
|
|
615
|
+
}, {
|
|
616
|
+
readonly inputs: readonly [];
|
|
617
|
+
readonly name: "ExceedsMaxParticipants";
|
|
618
|
+
readonly type: "error";
|
|
619
|
+
}, {
|
|
620
|
+
readonly inputs: readonly [];
|
|
621
|
+
readonly name: "ExpectedPause";
|
|
622
|
+
readonly type: "error";
|
|
623
|
+
}, {
|
|
624
|
+
readonly inputs: readonly [];
|
|
625
|
+
readonly name: "InvalidStakeAmount";
|
|
626
|
+
readonly type: "error";
|
|
627
|
+
}, {
|
|
628
|
+
readonly inputs: readonly [];
|
|
629
|
+
readonly name: "InvalidTokenAddress";
|
|
630
|
+
readonly type: "error";
|
|
631
|
+
}, {
|
|
632
|
+
readonly inputs: readonly [{
|
|
633
|
+
readonly internalType: "address";
|
|
634
|
+
readonly name: "owner";
|
|
635
|
+
readonly type: "address";
|
|
636
|
+
}];
|
|
637
|
+
readonly name: "OwnableInvalidOwner";
|
|
638
|
+
readonly type: "error";
|
|
639
|
+
}, {
|
|
640
|
+
readonly inputs: readonly [{
|
|
641
|
+
readonly internalType: "address";
|
|
642
|
+
readonly name: "account";
|
|
643
|
+
readonly type: "address";
|
|
644
|
+
}];
|
|
645
|
+
readonly name: "OwnableUnauthorizedAccount";
|
|
646
|
+
readonly type: "error";
|
|
647
|
+
}, {
|
|
648
|
+
readonly inputs: readonly [];
|
|
649
|
+
readonly name: "ReentrancyGuardReentrantCall";
|
|
650
|
+
readonly type: "error";
|
|
651
|
+
}, {
|
|
652
|
+
readonly inputs: readonly [];
|
|
653
|
+
readonly name: "TokenNotSupported";
|
|
654
|
+
readonly type: "error";
|
|
655
|
+
}, {
|
|
656
|
+
readonly inputs: readonly [];
|
|
657
|
+
readonly name: "YieldOnlySupportsUSDC";
|
|
658
|
+
readonly type: "error";
|
|
659
|
+
}, {
|
|
660
|
+
readonly anonymous: false;
|
|
661
|
+
readonly inputs: readonly [{
|
|
662
|
+
readonly indexed: true;
|
|
663
|
+
readonly internalType: "address";
|
|
664
|
+
readonly name: "token";
|
|
665
|
+
readonly type: "address";
|
|
666
|
+
}, {
|
|
667
|
+
readonly indexed: false;
|
|
668
|
+
readonly internalType: "bool";
|
|
669
|
+
readonly name: "status";
|
|
670
|
+
readonly type: "bool";
|
|
671
|
+
}];
|
|
672
|
+
readonly name: "AssetTokenRegistered";
|
|
673
|
+
readonly type: "event";
|
|
674
|
+
}, {
|
|
675
|
+
readonly anonymous: false;
|
|
676
|
+
readonly inputs: readonly [{
|
|
677
|
+
readonly indexed: true;
|
|
678
|
+
readonly internalType: "address";
|
|
679
|
+
readonly name: "previousOwner";
|
|
680
|
+
readonly type: "address";
|
|
681
|
+
}, {
|
|
682
|
+
readonly indexed: true;
|
|
683
|
+
readonly internalType: "address";
|
|
684
|
+
readonly name: "newOwner";
|
|
685
|
+
readonly type: "address";
|
|
686
|
+
}];
|
|
687
|
+
readonly name: "OwnershipTransferred";
|
|
688
|
+
readonly type: "event";
|
|
689
|
+
}, {
|
|
690
|
+
readonly anonymous: false;
|
|
691
|
+
readonly inputs: readonly [{
|
|
692
|
+
readonly indexed: false;
|
|
693
|
+
readonly internalType: "address";
|
|
694
|
+
readonly name: "account";
|
|
695
|
+
readonly type: "address";
|
|
696
|
+
}];
|
|
697
|
+
readonly name: "Paused";
|
|
698
|
+
readonly type: "event";
|
|
699
|
+
}, {
|
|
700
|
+
readonly anonymous: false;
|
|
701
|
+
readonly inputs: readonly [{
|
|
702
|
+
readonly indexed: false;
|
|
703
|
+
readonly internalType: "address";
|
|
704
|
+
readonly name: "account";
|
|
705
|
+
readonly type: "address";
|
|
706
|
+
}];
|
|
707
|
+
readonly name: "Unpaused";
|
|
708
|
+
readonly type: "event";
|
|
709
|
+
}, {
|
|
710
|
+
readonly anonymous: false;
|
|
711
|
+
readonly inputs: readonly [{
|
|
712
|
+
readonly indexed: true;
|
|
713
|
+
readonly internalType: "uint256";
|
|
714
|
+
readonly name: "vaultId";
|
|
715
|
+
readonly type: "uint256";
|
|
716
|
+
}, {
|
|
717
|
+
readonly indexed: true;
|
|
718
|
+
readonly internalType: "address";
|
|
719
|
+
readonly name: "vault";
|
|
720
|
+
readonly type: "address";
|
|
721
|
+
}, {
|
|
722
|
+
readonly indexed: true;
|
|
723
|
+
readonly internalType: "address";
|
|
724
|
+
readonly name: "owner";
|
|
725
|
+
readonly type: "address";
|
|
726
|
+
}, {
|
|
727
|
+
readonly indexed: false;
|
|
728
|
+
readonly internalType: "address";
|
|
729
|
+
readonly name: "assetToken";
|
|
730
|
+
readonly type: "address";
|
|
731
|
+
}, {
|
|
732
|
+
readonly indexed: false;
|
|
733
|
+
readonly internalType: "uint256";
|
|
734
|
+
readonly name: "stakeAmount";
|
|
735
|
+
readonly type: "uint256";
|
|
736
|
+
}, {
|
|
737
|
+
readonly indexed: false;
|
|
738
|
+
readonly internalType: "uint256";
|
|
739
|
+
readonly name: "maxParticipants";
|
|
740
|
+
readonly type: "uint256";
|
|
741
|
+
}, {
|
|
742
|
+
readonly indexed: false;
|
|
743
|
+
readonly internalType: "address";
|
|
744
|
+
readonly name: "yieldVault";
|
|
745
|
+
readonly type: "address";
|
|
746
|
+
}, {
|
|
747
|
+
readonly indexed: false;
|
|
748
|
+
readonly internalType: "uint256";
|
|
749
|
+
readonly name: "timestamp";
|
|
750
|
+
readonly type: "uint256";
|
|
751
|
+
}];
|
|
752
|
+
readonly name: "VaultCreated";
|
|
753
|
+
readonly type: "event";
|
|
754
|
+
}, {
|
|
755
|
+
readonly inputs: readonly [{
|
|
756
|
+
readonly internalType: "address";
|
|
757
|
+
readonly name: "assetToken";
|
|
758
|
+
readonly type: "address";
|
|
759
|
+
}, {
|
|
760
|
+
readonly internalType: "uint256";
|
|
761
|
+
readonly name: "stakeAmount";
|
|
762
|
+
readonly type: "uint256";
|
|
763
|
+
}, {
|
|
764
|
+
readonly internalType: "uint256";
|
|
765
|
+
readonly name: "maxParticipants";
|
|
766
|
+
readonly type: "uint256";
|
|
767
|
+
}];
|
|
768
|
+
readonly name: "createVault";
|
|
769
|
+
readonly outputs: readonly [{
|
|
770
|
+
readonly internalType: "uint256";
|
|
771
|
+
readonly name: "vaultId";
|
|
772
|
+
readonly type: "uint256";
|
|
773
|
+
}];
|
|
774
|
+
readonly stateMutability: "nonpayable";
|
|
775
|
+
readonly type: "function";
|
|
776
|
+
}, {
|
|
777
|
+
readonly inputs: readonly [{
|
|
778
|
+
readonly internalType: "address";
|
|
779
|
+
readonly name: "assetToken";
|
|
780
|
+
readonly type: "address";
|
|
781
|
+
}, {
|
|
782
|
+
readonly internalType: "uint256";
|
|
783
|
+
readonly name: "stakeAmount";
|
|
784
|
+
readonly type: "uint256";
|
|
785
|
+
}, {
|
|
786
|
+
readonly internalType: "uint256";
|
|
787
|
+
readonly name: "maxParticipants";
|
|
788
|
+
readonly type: "uint256";
|
|
789
|
+
}];
|
|
790
|
+
readonly name: "createVaultNoYield";
|
|
791
|
+
readonly outputs: readonly [{
|
|
792
|
+
readonly internalType: "uint256";
|
|
793
|
+
readonly name: "vaultId";
|
|
794
|
+
readonly type: "uint256";
|
|
795
|
+
}];
|
|
796
|
+
readonly stateMutability: "nonpayable";
|
|
797
|
+
readonly type: "function";
|
|
798
|
+
}, {
|
|
799
|
+
readonly inputs: readonly [{
|
|
800
|
+
readonly internalType: "uint256";
|
|
801
|
+
readonly name: "vaultId";
|
|
802
|
+
readonly type: "uint256";
|
|
803
|
+
}];
|
|
804
|
+
readonly name: "getVault";
|
|
805
|
+
readonly outputs: readonly [{
|
|
806
|
+
readonly internalType: "address";
|
|
807
|
+
readonly name: "";
|
|
808
|
+
readonly type: "address";
|
|
809
|
+
}];
|
|
810
|
+
readonly stateMutability: "view";
|
|
811
|
+
readonly type: "function";
|
|
812
|
+
}, {
|
|
813
|
+
readonly inputs: readonly [];
|
|
814
|
+
readonly name: "getVaultCount";
|
|
815
|
+
readonly outputs: readonly [{
|
|
816
|
+
readonly internalType: "uint256";
|
|
817
|
+
readonly name: "";
|
|
818
|
+
readonly type: "uint256";
|
|
819
|
+
}];
|
|
820
|
+
readonly stateMutability: "view";
|
|
821
|
+
readonly type: "function";
|
|
822
|
+
}, {
|
|
823
|
+
readonly inputs: readonly [{
|
|
824
|
+
readonly internalType: "address";
|
|
825
|
+
readonly name: "token";
|
|
826
|
+
readonly type: "address";
|
|
827
|
+
}];
|
|
828
|
+
readonly name: "isTokenSupported";
|
|
829
|
+
readonly outputs: readonly [{
|
|
830
|
+
readonly internalType: "bool";
|
|
831
|
+
readonly name: "";
|
|
832
|
+
readonly type: "bool";
|
|
833
|
+
}];
|
|
834
|
+
readonly stateMutability: "view";
|
|
835
|
+
readonly type: "function";
|
|
836
|
+
}, {
|
|
837
|
+
readonly inputs: readonly [{
|
|
838
|
+
readonly internalType: "address";
|
|
839
|
+
readonly name: "vault";
|
|
840
|
+
readonly type: "address";
|
|
841
|
+
}];
|
|
842
|
+
readonly name: "isValidVault";
|
|
843
|
+
readonly outputs: readonly [{
|
|
844
|
+
readonly internalType: "bool";
|
|
845
|
+
readonly name: "";
|
|
846
|
+
readonly type: "bool";
|
|
847
|
+
}];
|
|
848
|
+
readonly stateMutability: "view";
|
|
849
|
+
readonly type: "function";
|
|
850
|
+
}, {
|
|
851
|
+
readonly inputs: readonly [{
|
|
852
|
+
readonly internalType: "address";
|
|
853
|
+
readonly name: "";
|
|
854
|
+
readonly type: "address";
|
|
855
|
+
}];
|
|
856
|
+
readonly name: "isVault";
|
|
857
|
+
readonly outputs: readonly [{
|
|
858
|
+
readonly internalType: "bool";
|
|
859
|
+
readonly name: "";
|
|
860
|
+
readonly type: "bool";
|
|
861
|
+
}];
|
|
862
|
+
readonly stateMutability: "view";
|
|
863
|
+
readonly type: "function";
|
|
864
|
+
}, {
|
|
865
|
+
readonly inputs: readonly [];
|
|
866
|
+
readonly name: "morphoVault";
|
|
867
|
+
readonly outputs: readonly [{
|
|
868
|
+
readonly internalType: "address";
|
|
869
|
+
readonly name: "";
|
|
870
|
+
readonly type: "address";
|
|
871
|
+
}];
|
|
872
|
+
readonly stateMutability: "view";
|
|
873
|
+
readonly type: "function";
|
|
874
|
+
}, {
|
|
875
|
+
readonly inputs: readonly [];
|
|
876
|
+
readonly name: "owner";
|
|
877
|
+
readonly outputs: readonly [{
|
|
878
|
+
readonly internalType: "address";
|
|
879
|
+
readonly name: "";
|
|
880
|
+
readonly type: "address";
|
|
881
|
+
}];
|
|
882
|
+
readonly stateMutability: "view";
|
|
883
|
+
readonly type: "function";
|
|
884
|
+
}, {
|
|
885
|
+
readonly inputs: readonly [];
|
|
886
|
+
readonly name: "pause";
|
|
887
|
+
readonly outputs: readonly [];
|
|
888
|
+
readonly stateMutability: "nonpayable";
|
|
889
|
+
readonly type: "function";
|
|
890
|
+
}, {
|
|
891
|
+
readonly inputs: readonly [];
|
|
892
|
+
readonly name: "paused";
|
|
893
|
+
readonly outputs: readonly [{
|
|
894
|
+
readonly internalType: "bool";
|
|
895
|
+
readonly name: "";
|
|
896
|
+
readonly type: "bool";
|
|
897
|
+
}];
|
|
898
|
+
readonly stateMutability: "view";
|
|
899
|
+
readonly type: "function";
|
|
900
|
+
}, {
|
|
901
|
+
readonly inputs: readonly [{
|
|
902
|
+
readonly internalType: "address";
|
|
903
|
+
readonly name: "token";
|
|
904
|
+
readonly type: "address";
|
|
905
|
+
}, {
|
|
906
|
+
readonly internalType: "bool";
|
|
907
|
+
readonly name: "supported";
|
|
908
|
+
readonly type: "bool";
|
|
909
|
+
}];
|
|
910
|
+
readonly name: "registerAssetToken";
|
|
911
|
+
readonly outputs: readonly [];
|
|
912
|
+
readonly stateMutability: "nonpayable";
|
|
913
|
+
readonly type: "function";
|
|
914
|
+
}, {
|
|
915
|
+
readonly inputs: readonly [];
|
|
916
|
+
readonly name: "renounceOwnership";
|
|
917
|
+
readonly outputs: readonly [];
|
|
918
|
+
readonly stateMutability: "nonpayable";
|
|
919
|
+
readonly type: "function";
|
|
920
|
+
}, {
|
|
921
|
+
readonly inputs: readonly [{
|
|
922
|
+
readonly internalType: "address";
|
|
923
|
+
readonly name: "_morphoVault";
|
|
924
|
+
readonly type: "address";
|
|
925
|
+
}];
|
|
926
|
+
readonly name: "setMorphoVault";
|
|
927
|
+
readonly outputs: readonly [];
|
|
928
|
+
readonly stateMutability: "nonpayable";
|
|
929
|
+
readonly type: "function";
|
|
930
|
+
}, {
|
|
931
|
+
readonly inputs: readonly [{
|
|
932
|
+
readonly internalType: "address";
|
|
933
|
+
readonly name: "";
|
|
934
|
+
readonly type: "address";
|
|
935
|
+
}];
|
|
936
|
+
readonly name: "supportedAssetTokens";
|
|
937
|
+
readonly outputs: readonly [{
|
|
938
|
+
readonly internalType: "bool";
|
|
939
|
+
readonly name: "";
|
|
940
|
+
readonly type: "bool";
|
|
941
|
+
}];
|
|
942
|
+
readonly stateMutability: "view";
|
|
943
|
+
readonly type: "function";
|
|
944
|
+
}, {
|
|
945
|
+
readonly inputs: readonly [{
|
|
946
|
+
readonly internalType: "address";
|
|
947
|
+
readonly name: "newOwner";
|
|
948
|
+
readonly type: "address";
|
|
949
|
+
}];
|
|
950
|
+
readonly name: "transferOwnership";
|
|
951
|
+
readonly outputs: readonly [];
|
|
952
|
+
readonly stateMutability: "nonpayable";
|
|
953
|
+
readonly type: "function";
|
|
954
|
+
}, {
|
|
955
|
+
readonly inputs: readonly [];
|
|
956
|
+
readonly name: "treasury";
|
|
957
|
+
readonly outputs: readonly [{
|
|
958
|
+
readonly internalType: "address";
|
|
959
|
+
readonly name: "";
|
|
960
|
+
readonly type: "address";
|
|
961
|
+
}];
|
|
962
|
+
readonly stateMutability: "view";
|
|
963
|
+
readonly type: "function";
|
|
964
|
+
}, {
|
|
965
|
+
readonly inputs: readonly [];
|
|
966
|
+
readonly name: "unpause";
|
|
967
|
+
readonly outputs: readonly [];
|
|
968
|
+
readonly stateMutability: "nonpayable";
|
|
969
|
+
readonly type: "function";
|
|
970
|
+
}, {
|
|
971
|
+
readonly inputs: readonly [];
|
|
972
|
+
readonly name: "usdcToken";
|
|
973
|
+
readonly outputs: readonly [{
|
|
974
|
+
readonly internalType: "address";
|
|
975
|
+
readonly name: "";
|
|
976
|
+
readonly type: "address";
|
|
977
|
+
}];
|
|
978
|
+
readonly stateMutability: "view";
|
|
979
|
+
readonly type: "function";
|
|
980
|
+
}, {
|
|
981
|
+
readonly inputs: readonly [];
|
|
982
|
+
readonly name: "vaultIdCounter";
|
|
983
|
+
readonly outputs: readonly [{
|
|
984
|
+
readonly internalType: "uint256";
|
|
985
|
+
readonly name: "";
|
|
986
|
+
readonly type: "uint256";
|
|
987
|
+
}];
|
|
988
|
+
readonly stateMutability: "view";
|
|
989
|
+
readonly type: "function";
|
|
990
|
+
}, {
|
|
991
|
+
readonly inputs: readonly [{
|
|
992
|
+
readonly internalType: "uint256";
|
|
993
|
+
readonly name: "";
|
|
994
|
+
readonly type: "uint256";
|
|
995
|
+
}];
|
|
996
|
+
readonly name: "vaults";
|
|
997
|
+
readonly outputs: readonly [{
|
|
998
|
+
readonly internalType: "address";
|
|
999
|
+
readonly name: "";
|
|
1000
|
+
readonly type: "address";
|
|
1001
|
+
}];
|
|
1002
|
+
readonly stateMutability: "view";
|
|
1003
|
+
readonly type: "function";
|
|
1004
|
+
}];
|
|
1005
|
+
|
|
1006
|
+
declare const VaultATFiABI: readonly [{
|
|
1007
|
+
readonly inputs: readonly [{
|
|
1008
|
+
readonly internalType: "uint256";
|
|
1009
|
+
readonly name: "_vaultId";
|
|
1010
|
+
readonly type: "uint256";
|
|
1011
|
+
}, {
|
|
1012
|
+
readonly internalType: "address";
|
|
1013
|
+
readonly name: "_owner";
|
|
1014
|
+
readonly type: "address";
|
|
1015
|
+
}, {
|
|
1016
|
+
readonly internalType: "address";
|
|
1017
|
+
readonly name: "_factory";
|
|
1018
|
+
readonly type: "address";
|
|
1019
|
+
}, {
|
|
1020
|
+
readonly internalType: "address";
|
|
1021
|
+
readonly name: "_assetToken";
|
|
1022
|
+
readonly type: "address";
|
|
1023
|
+
}, {
|
|
1024
|
+
readonly internalType: "uint256";
|
|
1025
|
+
readonly name: "_stakeAmount";
|
|
1026
|
+
readonly type: "uint256";
|
|
1027
|
+
}, {
|
|
1028
|
+
readonly internalType: "uint256";
|
|
1029
|
+
readonly name: "_maxParticipants";
|
|
1030
|
+
readonly type: "uint256";
|
|
1031
|
+
}, {
|
|
1032
|
+
readonly internalType: "address";
|
|
1033
|
+
readonly name: "_treasury";
|
|
1034
|
+
readonly type: "address";
|
|
1035
|
+
}, {
|
|
1036
|
+
readonly internalType: "address";
|
|
1037
|
+
readonly name: "_yieldVault";
|
|
1038
|
+
readonly type: "address";
|
|
1039
|
+
}];
|
|
1040
|
+
readonly stateMutability: "nonpayable";
|
|
1041
|
+
readonly type: "constructor";
|
|
1042
|
+
}, {
|
|
1043
|
+
readonly inputs: readonly [];
|
|
1044
|
+
readonly name: "AlreadyClaimed";
|
|
1045
|
+
readonly type: "error";
|
|
1046
|
+
}, {
|
|
1047
|
+
readonly inputs: readonly [];
|
|
1048
|
+
readonly name: "AlreadyStaked";
|
|
1049
|
+
readonly type: "error";
|
|
1050
|
+
}, {
|
|
1051
|
+
readonly inputs: readonly [];
|
|
1052
|
+
readonly name: "AlreadyVerified";
|
|
1053
|
+
readonly type: "error";
|
|
1054
|
+
}, {
|
|
1055
|
+
readonly inputs: readonly [];
|
|
1056
|
+
readonly name: "EventAlreadyStarted";
|
|
1057
|
+
readonly type: "error";
|
|
1058
|
+
}, {
|
|
1059
|
+
readonly inputs: readonly [];
|
|
1060
|
+
readonly name: "InvalidAddress";
|
|
1061
|
+
readonly type: "error";
|
|
1062
|
+
}, {
|
|
1063
|
+
readonly inputs: readonly [];
|
|
1064
|
+
readonly name: "InvalidMaxParticipants";
|
|
1065
|
+
readonly type: "error";
|
|
1066
|
+
}, {
|
|
1067
|
+
readonly inputs: readonly [];
|
|
1068
|
+
readonly name: "InvalidStakeAmount";
|
|
1069
|
+
readonly type: "error";
|
|
1070
|
+
}, {
|
|
1071
|
+
readonly inputs: readonly [];
|
|
1072
|
+
readonly name: "InvalidYieldVault";
|
|
1073
|
+
readonly type: "error";
|
|
1074
|
+
}, {
|
|
1075
|
+
readonly inputs: readonly [];
|
|
1076
|
+
readonly name: "MaxParticipantsReached";
|
|
1077
|
+
readonly type: "error";
|
|
1078
|
+
}, {
|
|
1079
|
+
readonly inputs: readonly [];
|
|
1080
|
+
readonly name: "NoAssetsToDeposit";
|
|
1081
|
+
readonly type: "error";
|
|
1082
|
+
}, {
|
|
1083
|
+
readonly inputs: readonly [];
|
|
1084
|
+
readonly name: "NoParticipants";
|
|
1085
|
+
readonly type: "error";
|
|
1086
|
+
}, {
|
|
1087
|
+
readonly inputs: readonly [];
|
|
1088
|
+
readonly name: "NotStaked";
|
|
1089
|
+
readonly type: "error";
|
|
1090
|
+
}, {
|
|
1091
|
+
readonly inputs: readonly [];
|
|
1092
|
+
readonly name: "NotVerified";
|
|
1093
|
+
readonly type: "error";
|
|
1094
|
+
}, {
|
|
1095
|
+
readonly inputs: readonly [];
|
|
1096
|
+
readonly name: "NothingToClaim";
|
|
1097
|
+
readonly type: "error";
|
|
1098
|
+
}, {
|
|
1099
|
+
readonly inputs: readonly [{
|
|
1100
|
+
readonly internalType: "address";
|
|
1101
|
+
readonly name: "owner";
|
|
1102
|
+
readonly type: "address";
|
|
1103
|
+
}];
|
|
1104
|
+
readonly name: "OwnableInvalidOwner";
|
|
1105
|
+
readonly type: "error";
|
|
1106
|
+
}, {
|
|
1107
|
+
readonly inputs: readonly [{
|
|
1108
|
+
readonly internalType: "address";
|
|
1109
|
+
readonly name: "account";
|
|
1110
|
+
readonly type: "address";
|
|
1111
|
+
}];
|
|
1112
|
+
readonly name: "OwnableUnauthorizedAccount";
|
|
1113
|
+
readonly type: "error";
|
|
1114
|
+
}, {
|
|
1115
|
+
readonly inputs: readonly [];
|
|
1116
|
+
readonly name: "ReentrancyGuardReentrantCall";
|
|
1117
|
+
readonly type: "error";
|
|
1118
|
+
}, {
|
|
1119
|
+
readonly inputs: readonly [{
|
|
1120
|
+
readonly internalType: "address";
|
|
1121
|
+
readonly name: "token";
|
|
1122
|
+
readonly type: "address";
|
|
1123
|
+
}];
|
|
1124
|
+
readonly name: "SafeERC20FailedOperation";
|
|
1125
|
+
readonly type: "error";
|
|
1126
|
+
}, {
|
|
1127
|
+
readonly inputs: readonly [];
|
|
1128
|
+
readonly name: "StakingClosedError";
|
|
1129
|
+
readonly type: "error";
|
|
1130
|
+
}, {
|
|
1131
|
+
readonly inputs: readonly [];
|
|
1132
|
+
readonly name: "VaultAlreadySettled";
|
|
1133
|
+
readonly type: "error";
|
|
1134
|
+
}, {
|
|
1135
|
+
readonly inputs: readonly [];
|
|
1136
|
+
readonly name: "VaultNotSettled";
|
|
1137
|
+
readonly type: "error";
|
|
1138
|
+
}, {
|
|
1139
|
+
readonly anonymous: false;
|
|
1140
|
+
readonly inputs: readonly [{
|
|
1141
|
+
readonly indexed: true;
|
|
1142
|
+
readonly internalType: "address";
|
|
1143
|
+
readonly name: "participant";
|
|
1144
|
+
readonly type: "address";
|
|
1145
|
+
}, {
|
|
1146
|
+
readonly indexed: false;
|
|
1147
|
+
readonly internalType: "uint256";
|
|
1148
|
+
readonly name: "amount";
|
|
1149
|
+
readonly type: "uint256";
|
|
1150
|
+
}];
|
|
1151
|
+
readonly name: "Claimed";
|
|
1152
|
+
readonly type: "event";
|
|
1153
|
+
}, {
|
|
1154
|
+
readonly anonymous: false;
|
|
1155
|
+
readonly inputs: readonly [{
|
|
1156
|
+
readonly indexed: false;
|
|
1157
|
+
readonly internalType: "uint256";
|
|
1158
|
+
readonly name: "amount";
|
|
1159
|
+
readonly type: "uint256";
|
|
1160
|
+
}, {
|
|
1161
|
+
readonly indexed: false;
|
|
1162
|
+
readonly internalType: "uint256";
|
|
1163
|
+
readonly name: "shares";
|
|
1164
|
+
readonly type: "uint256";
|
|
1165
|
+
}];
|
|
1166
|
+
readonly name: "DepositedToYield";
|
|
1167
|
+
readonly type: "event";
|
|
1168
|
+
}, {
|
|
1169
|
+
readonly anonymous: false;
|
|
1170
|
+
readonly inputs: readonly [{
|
|
1171
|
+
readonly indexed: false;
|
|
1172
|
+
readonly internalType: "uint256";
|
|
1173
|
+
readonly name: "totalStaked";
|
|
1174
|
+
readonly type: "uint256";
|
|
1175
|
+
}];
|
|
1176
|
+
readonly name: "EventStarted";
|
|
1177
|
+
readonly type: "event";
|
|
1178
|
+
}, {
|
|
1179
|
+
readonly anonymous: false;
|
|
1180
|
+
readonly inputs: readonly [{
|
|
1181
|
+
readonly indexed: true;
|
|
1182
|
+
readonly internalType: "address";
|
|
1183
|
+
readonly name: "previousOwner";
|
|
1184
|
+
readonly type: "address";
|
|
1185
|
+
}, {
|
|
1186
|
+
readonly indexed: true;
|
|
1187
|
+
readonly internalType: "address";
|
|
1188
|
+
readonly name: "newOwner";
|
|
1189
|
+
readonly type: "address";
|
|
1190
|
+
}];
|
|
1191
|
+
readonly name: "OwnershipTransferred";
|
|
1192
|
+
readonly type: "event";
|
|
1193
|
+
}, {
|
|
1194
|
+
readonly anonymous: false;
|
|
1195
|
+
readonly inputs: readonly [{
|
|
1196
|
+
readonly indexed: false;
|
|
1197
|
+
readonly internalType: "uint256";
|
|
1198
|
+
readonly name: "totalYield";
|
|
1199
|
+
readonly type: "uint256";
|
|
1200
|
+
}, {
|
|
1201
|
+
readonly indexed: false;
|
|
1202
|
+
readonly internalType: "uint256";
|
|
1203
|
+
readonly name: "protocolFee";
|
|
1204
|
+
readonly type: "uint256";
|
|
1205
|
+
}, {
|
|
1206
|
+
readonly indexed: false;
|
|
1207
|
+
readonly internalType: "uint256";
|
|
1208
|
+
readonly name: "noShowFee";
|
|
1209
|
+
readonly type: "uint256";
|
|
1210
|
+
}];
|
|
1211
|
+
readonly name: "Settled";
|
|
1212
|
+
readonly type: "event";
|
|
1213
|
+
}, {
|
|
1214
|
+
readonly anonymous: false;
|
|
1215
|
+
readonly inputs: readonly [{
|
|
1216
|
+
readonly indexed: true;
|
|
1217
|
+
readonly internalType: "address";
|
|
1218
|
+
readonly name: "participant";
|
|
1219
|
+
readonly type: "address";
|
|
1220
|
+
}, {
|
|
1221
|
+
readonly indexed: false;
|
|
1222
|
+
readonly internalType: "uint256";
|
|
1223
|
+
readonly name: "amount";
|
|
1224
|
+
readonly type: "uint256";
|
|
1225
|
+
}];
|
|
1226
|
+
readonly name: "Staked";
|
|
1227
|
+
readonly type: "event";
|
|
1228
|
+
}, {
|
|
1229
|
+
readonly anonymous: false;
|
|
1230
|
+
readonly inputs: readonly [];
|
|
1231
|
+
readonly name: "StakingClosed";
|
|
1232
|
+
readonly type: "event";
|
|
1233
|
+
}, {
|
|
1234
|
+
readonly anonymous: false;
|
|
1235
|
+
readonly inputs: readonly [];
|
|
1236
|
+
readonly name: "StakingOpened";
|
|
1237
|
+
readonly type: "event";
|
|
1238
|
+
}, {
|
|
1239
|
+
readonly anonymous: false;
|
|
1240
|
+
readonly inputs: readonly [{
|
|
1241
|
+
readonly indexed: true;
|
|
1242
|
+
readonly internalType: "address";
|
|
1243
|
+
readonly name: "participant";
|
|
1244
|
+
readonly type: "address";
|
|
1245
|
+
}];
|
|
1246
|
+
readonly name: "Verified";
|
|
1247
|
+
readonly type: "event";
|
|
1248
|
+
}, {
|
|
1249
|
+
readonly inputs: readonly [];
|
|
1250
|
+
readonly name: "assetToken";
|
|
1251
|
+
readonly outputs: readonly [{
|
|
1252
|
+
readonly internalType: "contract IERC20";
|
|
1253
|
+
readonly name: "";
|
|
1254
|
+
readonly type: "address";
|
|
1255
|
+
}];
|
|
1256
|
+
readonly stateMutability: "view";
|
|
1257
|
+
readonly type: "function";
|
|
1258
|
+
}, {
|
|
1259
|
+
readonly inputs: readonly [];
|
|
1260
|
+
readonly name: "claim";
|
|
1261
|
+
readonly outputs: readonly [];
|
|
1262
|
+
readonly stateMutability: "nonpayable";
|
|
1263
|
+
readonly type: "function";
|
|
1264
|
+
}, {
|
|
1265
|
+
readonly inputs: readonly [];
|
|
1266
|
+
readonly name: "closeStaking";
|
|
1267
|
+
readonly outputs: readonly [];
|
|
1268
|
+
readonly stateMutability: "nonpayable";
|
|
1269
|
+
readonly type: "function";
|
|
1270
|
+
}, {
|
|
1271
|
+
readonly inputs: readonly [];
|
|
1272
|
+
readonly name: "depositToYield";
|
|
1273
|
+
readonly outputs: readonly [];
|
|
1274
|
+
readonly stateMutability: "nonpayable";
|
|
1275
|
+
readonly type: "function";
|
|
1276
|
+
}, {
|
|
1277
|
+
readonly inputs: readonly [];
|
|
1278
|
+
readonly name: "depositedAmount";
|
|
1279
|
+
readonly outputs: readonly [{
|
|
1280
|
+
readonly internalType: "uint256";
|
|
1281
|
+
readonly name: "";
|
|
1282
|
+
readonly type: "uint256";
|
|
1283
|
+
}];
|
|
1284
|
+
readonly stateMutability: "view";
|
|
1285
|
+
readonly type: "function";
|
|
1286
|
+
}, {
|
|
1287
|
+
readonly inputs: readonly [];
|
|
1288
|
+
readonly name: "eventStarted";
|
|
1289
|
+
readonly outputs: readonly [{
|
|
1290
|
+
readonly internalType: "bool";
|
|
1291
|
+
readonly name: "";
|
|
1292
|
+
readonly type: "bool";
|
|
1293
|
+
}];
|
|
1294
|
+
readonly stateMutability: "view";
|
|
1295
|
+
readonly type: "function";
|
|
1296
|
+
}, {
|
|
1297
|
+
readonly inputs: readonly [];
|
|
1298
|
+
readonly name: "factory";
|
|
1299
|
+
readonly outputs: readonly [{
|
|
1300
|
+
readonly internalType: "address";
|
|
1301
|
+
readonly name: "";
|
|
1302
|
+
readonly type: "address";
|
|
1303
|
+
}];
|
|
1304
|
+
readonly stateMutability: "view";
|
|
1305
|
+
readonly type: "function";
|
|
1306
|
+
}, {
|
|
1307
|
+
readonly inputs: readonly [{
|
|
1308
|
+
readonly internalType: "address";
|
|
1309
|
+
readonly name: "participant";
|
|
1310
|
+
readonly type: "address";
|
|
1311
|
+
}];
|
|
1312
|
+
readonly name: "getClaimable";
|
|
1313
|
+
readonly outputs: readonly [{
|
|
1314
|
+
readonly internalType: "uint256";
|
|
1315
|
+
readonly name: "";
|
|
1316
|
+
readonly type: "uint256";
|
|
1317
|
+
}];
|
|
1318
|
+
readonly stateMutability: "view";
|
|
1319
|
+
readonly type: "function";
|
|
1320
|
+
}, {
|
|
1321
|
+
readonly inputs: readonly [];
|
|
1322
|
+
readonly name: "getCurrentBalance";
|
|
1323
|
+
readonly outputs: readonly [{
|
|
1324
|
+
readonly internalType: "uint256";
|
|
1325
|
+
readonly name: "";
|
|
1326
|
+
readonly type: "uint256";
|
|
1327
|
+
}];
|
|
1328
|
+
readonly stateMutability: "view";
|
|
1329
|
+
readonly type: "function";
|
|
1330
|
+
}, {
|
|
1331
|
+
readonly inputs: readonly [];
|
|
1332
|
+
readonly name: "getParticipantCount";
|
|
1333
|
+
readonly outputs: readonly [{
|
|
1334
|
+
readonly internalType: "uint256";
|
|
1335
|
+
readonly name: "";
|
|
1336
|
+
readonly type: "uint256";
|
|
1337
|
+
}];
|
|
1338
|
+
readonly stateMutability: "view";
|
|
1339
|
+
readonly type: "function";
|
|
1340
|
+
}, {
|
|
1341
|
+
readonly inputs: readonly [];
|
|
1342
|
+
readonly name: "getProtocolFees";
|
|
1343
|
+
readonly outputs: readonly [{
|
|
1344
|
+
readonly internalType: "uint256";
|
|
1345
|
+
readonly name: "";
|
|
1346
|
+
readonly type: "uint256";
|
|
1347
|
+
}, {
|
|
1348
|
+
readonly internalType: "uint256";
|
|
1349
|
+
readonly name: "";
|
|
1350
|
+
readonly type: "uint256";
|
|
1351
|
+
}];
|
|
1352
|
+
readonly stateMutability: "view";
|
|
1353
|
+
readonly type: "function";
|
|
1354
|
+
}, {
|
|
1355
|
+
readonly inputs: readonly [{
|
|
1356
|
+
readonly internalType: "address";
|
|
1357
|
+
readonly name: "participant";
|
|
1358
|
+
readonly type: "address";
|
|
1359
|
+
}];
|
|
1360
|
+
readonly name: "getStatus";
|
|
1361
|
+
readonly outputs: readonly [{
|
|
1362
|
+
readonly internalType: "enum ICommitmentVault.Status";
|
|
1363
|
+
readonly name: "";
|
|
1364
|
+
readonly type: "uint8";
|
|
1365
|
+
}];
|
|
1366
|
+
readonly stateMutability: "view";
|
|
1367
|
+
readonly type: "function";
|
|
1368
|
+
}, {
|
|
1369
|
+
readonly inputs: readonly [];
|
|
1370
|
+
readonly name: "getVaultInfo";
|
|
1371
|
+
readonly outputs: readonly [{
|
|
1372
|
+
readonly internalType: "address";
|
|
1373
|
+
readonly name: "_assetToken";
|
|
1374
|
+
readonly type: "address";
|
|
1375
|
+
}, {
|
|
1376
|
+
readonly internalType: "uint256";
|
|
1377
|
+
readonly name: "_stakeAmount";
|
|
1378
|
+
readonly type: "uint256";
|
|
1379
|
+
}, {
|
|
1380
|
+
readonly internalType: "uint256";
|
|
1381
|
+
readonly name: "_maxParticipants";
|
|
1382
|
+
readonly type: "uint256";
|
|
1383
|
+
}, {
|
|
1384
|
+
readonly internalType: "uint256";
|
|
1385
|
+
readonly name: "_currentParticipants";
|
|
1386
|
+
readonly type: "uint256";
|
|
1387
|
+
}, {
|
|
1388
|
+
readonly internalType: "bool";
|
|
1389
|
+
readonly name: "_stakingOpen";
|
|
1390
|
+
readonly type: "bool";
|
|
1391
|
+
}, {
|
|
1392
|
+
readonly internalType: "bool";
|
|
1393
|
+
readonly name: "_eventStarted";
|
|
1394
|
+
readonly type: "bool";
|
|
1395
|
+
}, {
|
|
1396
|
+
readonly internalType: "bool";
|
|
1397
|
+
readonly name: "_settled";
|
|
1398
|
+
readonly type: "bool";
|
|
1399
|
+
}];
|
|
1400
|
+
readonly stateMutability: "view";
|
|
1401
|
+
readonly type: "function";
|
|
1402
|
+
}, {
|
|
1403
|
+
readonly inputs: readonly [];
|
|
1404
|
+
readonly name: "getVerifiedCount";
|
|
1405
|
+
readonly outputs: readonly [{
|
|
1406
|
+
readonly internalType: "uint256";
|
|
1407
|
+
readonly name: "";
|
|
1408
|
+
readonly type: "uint256";
|
|
1409
|
+
}];
|
|
1410
|
+
readonly stateMutability: "view";
|
|
1411
|
+
readonly type: "function";
|
|
1412
|
+
}, {
|
|
1413
|
+
readonly inputs: readonly [];
|
|
1414
|
+
readonly name: "getYieldInfo";
|
|
1415
|
+
readonly outputs: readonly [{
|
|
1416
|
+
readonly internalType: "bool";
|
|
1417
|
+
readonly name: "_hasYield";
|
|
1418
|
+
readonly type: "bool";
|
|
1419
|
+
}, {
|
|
1420
|
+
readonly internalType: "uint256";
|
|
1421
|
+
readonly name: "currentBalance";
|
|
1422
|
+
readonly type: "uint256";
|
|
1423
|
+
}, {
|
|
1424
|
+
readonly internalType: "uint256";
|
|
1425
|
+
readonly name: "deposited";
|
|
1426
|
+
readonly type: "uint256";
|
|
1427
|
+
}, {
|
|
1428
|
+
readonly internalType: "uint256";
|
|
1429
|
+
readonly name: "estimatedYield";
|
|
1430
|
+
readonly type: "uint256";
|
|
1431
|
+
}];
|
|
1432
|
+
readonly stateMutability: "view";
|
|
1433
|
+
readonly type: "function";
|
|
1434
|
+
}, {
|
|
1435
|
+
readonly inputs: readonly [];
|
|
1436
|
+
readonly name: "hasYield";
|
|
1437
|
+
readonly outputs: readonly [{
|
|
1438
|
+
readonly internalType: "bool";
|
|
1439
|
+
readonly name: "";
|
|
1440
|
+
readonly type: "bool";
|
|
1441
|
+
}];
|
|
1442
|
+
readonly stateMutability: "view";
|
|
1443
|
+
readonly type: "function";
|
|
1444
|
+
}, {
|
|
1445
|
+
readonly inputs: readonly [];
|
|
1446
|
+
readonly name: "isEventStarted";
|
|
1447
|
+
readonly outputs: readonly [{
|
|
1448
|
+
readonly internalType: "bool";
|
|
1449
|
+
readonly name: "";
|
|
1450
|
+
readonly type: "bool";
|
|
1451
|
+
}];
|
|
1452
|
+
readonly stateMutability: "view";
|
|
1453
|
+
readonly type: "function";
|
|
1454
|
+
}, {
|
|
1455
|
+
readonly inputs: readonly [];
|
|
1456
|
+
readonly name: "isSettled";
|
|
1457
|
+
readonly outputs: readonly [{
|
|
1458
|
+
readonly internalType: "bool";
|
|
1459
|
+
readonly name: "";
|
|
1460
|
+
readonly type: "bool";
|
|
1461
|
+
}];
|
|
1462
|
+
readonly stateMutability: "view";
|
|
1463
|
+
readonly type: "function";
|
|
1464
|
+
}, {
|
|
1465
|
+
readonly inputs: readonly [];
|
|
1466
|
+
readonly name: "isStakingClosed";
|
|
1467
|
+
readonly outputs: readonly [{
|
|
1468
|
+
readonly internalType: "bool";
|
|
1469
|
+
readonly name: "";
|
|
1470
|
+
readonly type: "bool";
|
|
1471
|
+
}];
|
|
1472
|
+
readonly stateMutability: "view";
|
|
1473
|
+
readonly type: "function";
|
|
1474
|
+
}, {
|
|
1475
|
+
readonly inputs: readonly [];
|
|
1476
|
+
readonly name: "maxParticipants";
|
|
1477
|
+
readonly outputs: readonly [{
|
|
1478
|
+
readonly internalType: "uint256";
|
|
1479
|
+
readonly name: "";
|
|
1480
|
+
readonly type: "uint256";
|
|
1481
|
+
}];
|
|
1482
|
+
readonly stateMutability: "view";
|
|
1483
|
+
readonly type: "function";
|
|
1484
|
+
}, {
|
|
1485
|
+
readonly inputs: readonly [];
|
|
1486
|
+
readonly name: "openStaking";
|
|
1487
|
+
readonly outputs: readonly [];
|
|
1488
|
+
readonly stateMutability: "nonpayable";
|
|
1489
|
+
readonly type: "function";
|
|
1490
|
+
}, {
|
|
1491
|
+
readonly inputs: readonly [];
|
|
1492
|
+
readonly name: "owner";
|
|
1493
|
+
readonly outputs: readonly [{
|
|
1494
|
+
readonly internalType: "address";
|
|
1495
|
+
readonly name: "";
|
|
1496
|
+
readonly type: "address";
|
|
1497
|
+
}];
|
|
1498
|
+
readonly stateMutability: "view";
|
|
1499
|
+
readonly type: "function";
|
|
1500
|
+
}, {
|
|
1501
|
+
readonly inputs: readonly [{
|
|
1502
|
+
readonly internalType: "uint256";
|
|
1503
|
+
readonly name: "";
|
|
1504
|
+
readonly type: "uint256";
|
|
1505
|
+
}];
|
|
1506
|
+
readonly name: "participantList";
|
|
1507
|
+
readonly outputs: readonly [{
|
|
1508
|
+
readonly internalType: "address";
|
|
1509
|
+
readonly name: "";
|
|
1510
|
+
readonly type: "address";
|
|
1511
|
+
}];
|
|
1512
|
+
readonly stateMutability: "view";
|
|
1513
|
+
readonly type: "function";
|
|
1514
|
+
}, {
|
|
1515
|
+
readonly inputs: readonly [{
|
|
1516
|
+
readonly internalType: "address";
|
|
1517
|
+
readonly name: "";
|
|
1518
|
+
readonly type: "address";
|
|
1519
|
+
}];
|
|
1520
|
+
readonly name: "participants";
|
|
1521
|
+
readonly outputs: readonly [{
|
|
1522
|
+
readonly internalType: "bool";
|
|
1523
|
+
readonly name: "hasStaked";
|
|
1524
|
+
readonly type: "bool";
|
|
1525
|
+
}, {
|
|
1526
|
+
readonly internalType: "bool";
|
|
1527
|
+
readonly name: "isVerified";
|
|
1528
|
+
readonly type: "bool";
|
|
1529
|
+
}, {
|
|
1530
|
+
readonly internalType: "bool";
|
|
1531
|
+
readonly name: "hasClaimed";
|
|
1532
|
+
readonly type: "bool";
|
|
1533
|
+
}, {
|
|
1534
|
+
readonly internalType: "uint256";
|
|
1535
|
+
readonly name: "claimableAmount";
|
|
1536
|
+
readonly type: "uint256";
|
|
1537
|
+
}];
|
|
1538
|
+
readonly stateMutability: "view";
|
|
1539
|
+
readonly type: "function";
|
|
1540
|
+
}, {
|
|
1541
|
+
readonly inputs: readonly [];
|
|
1542
|
+
readonly name: "renounceOwnership";
|
|
1543
|
+
readonly outputs: readonly [];
|
|
1544
|
+
readonly stateMutability: "nonpayable";
|
|
1545
|
+
readonly type: "function";
|
|
1546
|
+
}, {
|
|
1547
|
+
readonly inputs: readonly [];
|
|
1548
|
+
readonly name: "settle";
|
|
1549
|
+
readonly outputs: readonly [];
|
|
1550
|
+
readonly stateMutability: "nonpayable";
|
|
1551
|
+
readonly type: "function";
|
|
1552
|
+
}, {
|
|
1553
|
+
readonly inputs: readonly [];
|
|
1554
|
+
readonly name: "settled";
|
|
1555
|
+
readonly outputs: readonly [{
|
|
1556
|
+
readonly internalType: "bool";
|
|
1557
|
+
readonly name: "";
|
|
1558
|
+
readonly type: "bool";
|
|
1559
|
+
}];
|
|
1560
|
+
readonly stateMutability: "view";
|
|
1561
|
+
readonly type: "function";
|
|
1562
|
+
}, {
|
|
1563
|
+
readonly inputs: readonly [];
|
|
1564
|
+
readonly name: "sharesHeld";
|
|
1565
|
+
readonly outputs: readonly [{
|
|
1566
|
+
readonly internalType: "uint256";
|
|
1567
|
+
readonly name: "";
|
|
1568
|
+
readonly type: "uint256";
|
|
1569
|
+
}];
|
|
1570
|
+
readonly stateMutability: "view";
|
|
1571
|
+
readonly type: "function";
|
|
1572
|
+
}, {
|
|
1573
|
+
readonly inputs: readonly [];
|
|
1574
|
+
readonly name: "stake";
|
|
1575
|
+
readonly outputs: readonly [];
|
|
1576
|
+
readonly stateMutability: "nonpayable";
|
|
1577
|
+
readonly type: "function";
|
|
1578
|
+
}, {
|
|
1579
|
+
readonly inputs: readonly [];
|
|
1580
|
+
readonly name: "stakeAmount";
|
|
1581
|
+
readonly outputs: readonly [{
|
|
1582
|
+
readonly internalType: "uint256";
|
|
1583
|
+
readonly name: "";
|
|
1584
|
+
readonly type: "uint256";
|
|
1585
|
+
}];
|
|
1586
|
+
readonly stateMutability: "view";
|
|
1587
|
+
readonly type: "function";
|
|
1588
|
+
}, {
|
|
1589
|
+
readonly inputs: readonly [];
|
|
1590
|
+
readonly name: "stakingOpen";
|
|
1591
|
+
readonly outputs: readonly [{
|
|
1592
|
+
readonly internalType: "bool";
|
|
1593
|
+
readonly name: "";
|
|
1594
|
+
readonly type: "bool";
|
|
1595
|
+
}];
|
|
1596
|
+
readonly stateMutability: "view";
|
|
1597
|
+
readonly type: "function";
|
|
1598
|
+
}, {
|
|
1599
|
+
readonly inputs: readonly [];
|
|
1600
|
+
readonly name: "totalProtocolFees";
|
|
1601
|
+
readonly outputs: readonly [{
|
|
1602
|
+
readonly internalType: "uint256";
|
|
1603
|
+
readonly name: "";
|
|
1604
|
+
readonly type: "uint256";
|
|
1605
|
+
}];
|
|
1606
|
+
readonly stateMutability: "view";
|
|
1607
|
+
readonly type: "function";
|
|
1608
|
+
}, {
|
|
1609
|
+
readonly inputs: readonly [];
|
|
1610
|
+
readonly name: "totalStaked";
|
|
1611
|
+
readonly outputs: readonly [{
|
|
1612
|
+
readonly internalType: "uint256";
|
|
1613
|
+
readonly name: "";
|
|
1614
|
+
readonly type: "uint256";
|
|
1615
|
+
}];
|
|
1616
|
+
readonly stateMutability: "view";
|
|
1617
|
+
readonly type: "function";
|
|
1618
|
+
}, {
|
|
1619
|
+
readonly inputs: readonly [];
|
|
1620
|
+
readonly name: "totalYieldEarned";
|
|
1621
|
+
readonly outputs: readonly [{
|
|
1622
|
+
readonly internalType: "uint256";
|
|
1623
|
+
readonly name: "";
|
|
1624
|
+
readonly type: "uint256";
|
|
1625
|
+
}];
|
|
1626
|
+
readonly stateMutability: "view";
|
|
1627
|
+
readonly type: "function";
|
|
1628
|
+
}, {
|
|
1629
|
+
readonly inputs: readonly [{
|
|
1630
|
+
readonly internalType: "address";
|
|
1631
|
+
readonly name: "newOwner";
|
|
1632
|
+
readonly type: "address";
|
|
1633
|
+
}];
|
|
1634
|
+
readonly name: "transferOwnership";
|
|
1635
|
+
readonly outputs: readonly [];
|
|
1636
|
+
readonly stateMutability: "nonpayable";
|
|
1637
|
+
readonly type: "function";
|
|
1638
|
+
}, {
|
|
1639
|
+
readonly inputs: readonly [];
|
|
1640
|
+
readonly name: "treasury";
|
|
1641
|
+
readonly outputs: readonly [{
|
|
1642
|
+
readonly internalType: "address";
|
|
1643
|
+
readonly name: "";
|
|
1644
|
+
readonly type: "address";
|
|
1645
|
+
}];
|
|
1646
|
+
readonly stateMutability: "view";
|
|
1647
|
+
readonly type: "function";
|
|
1648
|
+
}, {
|
|
1649
|
+
readonly inputs: readonly [];
|
|
1650
|
+
readonly name: "vaultId";
|
|
1651
|
+
readonly outputs: readonly [{
|
|
1652
|
+
readonly internalType: "uint256";
|
|
1653
|
+
readonly name: "";
|
|
1654
|
+
readonly type: "uint256";
|
|
1655
|
+
}];
|
|
1656
|
+
readonly stateMutability: "view";
|
|
1657
|
+
readonly type: "function";
|
|
1658
|
+
}, {
|
|
1659
|
+
readonly inputs: readonly [];
|
|
1660
|
+
readonly name: "verifiedCount";
|
|
1661
|
+
readonly outputs: readonly [{
|
|
1662
|
+
readonly internalType: "uint256";
|
|
1663
|
+
readonly name: "";
|
|
1664
|
+
readonly type: "uint256";
|
|
1665
|
+
}];
|
|
1666
|
+
readonly stateMutability: "view";
|
|
1667
|
+
readonly type: "function";
|
|
1668
|
+
}, {
|
|
1669
|
+
readonly inputs: readonly [{
|
|
1670
|
+
readonly internalType: "address";
|
|
1671
|
+
readonly name: "participant";
|
|
1672
|
+
readonly type: "address";
|
|
1673
|
+
}];
|
|
1674
|
+
readonly name: "verify";
|
|
1675
|
+
readonly outputs: readonly [];
|
|
1676
|
+
readonly stateMutability: "nonpayable";
|
|
1677
|
+
readonly type: "function";
|
|
1678
|
+
}, {
|
|
1679
|
+
readonly inputs: readonly [{
|
|
1680
|
+
readonly internalType: "address[]";
|
|
1681
|
+
readonly name: "_participants";
|
|
1682
|
+
readonly type: "address[]";
|
|
1683
|
+
}];
|
|
1684
|
+
readonly name: "verifyBatch";
|
|
1685
|
+
readonly outputs: readonly [];
|
|
1686
|
+
readonly stateMutability: "nonpayable";
|
|
1687
|
+
readonly type: "function";
|
|
1688
|
+
}, {
|
|
1689
|
+
readonly inputs: readonly [];
|
|
1690
|
+
readonly name: "yieldVault";
|
|
1691
|
+
readonly outputs: readonly [{
|
|
1692
|
+
readonly internalType: "contract IERC4626";
|
|
1693
|
+
readonly name: "";
|
|
1694
|
+
readonly type: "address";
|
|
1695
|
+
}];
|
|
1696
|
+
readonly stateMutability: "view";
|
|
1697
|
+
readonly type: "function";
|
|
1698
|
+
}];
|
|
1699
|
+
|
|
1700
|
+
declare const ERC20ABI: readonly [{
|
|
1701
|
+
readonly type: "function";
|
|
1702
|
+
readonly name: "approve";
|
|
1703
|
+
readonly inputs: readonly [{
|
|
1704
|
+
readonly name: "spender";
|
|
1705
|
+
readonly type: "address";
|
|
1706
|
+
}, {
|
|
1707
|
+
readonly name: "amount";
|
|
1708
|
+
readonly type: "uint256";
|
|
1709
|
+
}];
|
|
1710
|
+
readonly outputs: readonly [{
|
|
1711
|
+
readonly type: "bool";
|
|
1712
|
+
}];
|
|
1713
|
+
readonly stateMutability: "nonpayable";
|
|
1714
|
+
}, {
|
|
1715
|
+
readonly type: "function";
|
|
1716
|
+
readonly name: "allowance";
|
|
1717
|
+
readonly inputs: readonly [{
|
|
1718
|
+
readonly name: "owner";
|
|
1719
|
+
readonly type: "address";
|
|
1720
|
+
}, {
|
|
1721
|
+
readonly name: "spender";
|
|
1722
|
+
readonly type: "address";
|
|
1723
|
+
}];
|
|
1724
|
+
readonly outputs: readonly [{
|
|
1725
|
+
readonly type: "uint256";
|
|
1726
|
+
}];
|
|
1727
|
+
readonly stateMutability: "view";
|
|
1728
|
+
}, {
|
|
1729
|
+
readonly type: "function";
|
|
1730
|
+
readonly name: "balanceOf";
|
|
1731
|
+
readonly inputs: readonly [{
|
|
1732
|
+
readonly name: "account";
|
|
1733
|
+
readonly type: "address";
|
|
1734
|
+
}];
|
|
1735
|
+
readonly outputs: readonly [{
|
|
1736
|
+
readonly type: "uint256";
|
|
1737
|
+
}];
|
|
1738
|
+
readonly stateMutability: "view";
|
|
1739
|
+
}, {
|
|
1740
|
+
readonly type: "function";
|
|
1741
|
+
readonly name: "decimals";
|
|
1742
|
+
readonly inputs: readonly [];
|
|
1743
|
+
readonly outputs: readonly [{
|
|
1744
|
+
readonly type: "uint8";
|
|
1745
|
+
}];
|
|
1746
|
+
readonly stateMutability: "view";
|
|
1747
|
+
}, {
|
|
1748
|
+
readonly type: "function";
|
|
1749
|
+
readonly name: "symbol";
|
|
1750
|
+
readonly inputs: readonly [];
|
|
1751
|
+
readonly outputs: readonly [{
|
|
1752
|
+
readonly type: "string";
|
|
1753
|
+
}];
|
|
1754
|
+
readonly stateMutability: "view";
|
|
1755
|
+
}];
|
|
1756
|
+
|
|
1757
|
+
export { ATFiError, ATFiErrorCode, ATFiSDK, type ATFiSDKConfig, type ActionResult, CHAIN_ID, CONTRACTS, type ClaimAction, type ClaimParams, type ClaimResult, type CreateEventAction, type CreateEventParams, type CreateEventResult, ERC20ABI, type EventInfo, EventStatus, type EventSummary, FactoryATFiABI, type ParticipantInfo, ParticipantStatus, type RegisterAction, type RegisterParams, type RegisterResult, type SettleAction, type SettleEventParams, type SettleEventResult, type SimulateClaimResult, type SimulateCreateEventResult, type SimulateRegisterResult, type SimulateSettleResult, type SimulateStartEventResult, type SimulateVerifyResult, type SimulationBase, type StartEventAction, type StartEventParams, type StartEventResult, TOKENS, type TokenSymbol, type TransactionCallbacks, type UnwatchFn, type UserEventInfo, VaultATFiABI, type VaultWatchCallbacks, type VerifyAction, type VerifyParticipantParams, type VerifyParticipantResult, formatAmount, fromTokenUnits, getTokenByAddress, getTokenBySymbol, parseContractError, toTokenUnits };
|