Skip to content

Commit 106fc21

Browse files
committed
fixes
1 parent 6953800 commit 106fc21

File tree

2 files changed

+20
-21
lines changed

2 files changed

+20
-21
lines changed

packages/sui-agent/src/protocols/aftermath/PoolTransactionTool.ts

Lines changed: 1 addition & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -4,32 +4,12 @@ import { SuiClient } from '@mysten/sui/client';
44
import { handleError } from '../../utils';
55
import { initSuiClient } from '../../transactions/Transaction';
66
import PoolTool from './PoolTool';
7+
import { AftermathTransaction, RankingMetric, RankedPool } from './types';
78

89
// Initialize Aftermath SDK for mainnet
910
const af = new Aftermath('MAINNET');
1011
const pools = af.Pools();
1112

12-
type RankingMetric = 'apr' | 'tvl' | 'fees' | 'volume';
13-
14-
// Type definitions for Aftermath SDK responses
15-
interface AftermathTransaction {
16-
target: `${string}::${string}::${string}`;
17-
arguments: (string | number | boolean | bigint)[];
18-
typeArguments: string[];
19-
}
20-
21-
interface PoolMetrics {
22-
apr: string;
23-
tvl: string;
24-
fee: string;
25-
volume: string;
26-
}
27-
28-
interface RankedPool {
29-
id: string;
30-
metrics: PoolMetrics;
31-
}
32-
3313
/**
3414
* Converts an Aftermath transaction to our internal format.
3515
* @param tx - Raw transaction from Aftermath SDK.

packages/sui-agent/src/protocols/aftermath/types.ts

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,3 +90,22 @@ export interface SDKPool {
9090
};
9191
stats?: SDKPoolStats;
9292
}
93+
94+
// Type definitions for Aftermath SDK responses
95+
export interface AftermathTransaction {
96+
target: `${string}::${string}::${string}`;
97+
arguments: (string | number | boolean | bigint)[];
98+
typeArguments: string[];
99+
}
100+
101+
export interface PoolMetrics {
102+
apr: string;
103+
tvl: string;
104+
fee: string;
105+
volume: string;
106+
}
107+
108+
export interface RankedPool {
109+
id: string;
110+
metrics: PoolMetrics;
111+
}

0 commit comments

Comments
 (0)