@steerprotocol/sdk 1.25.0 → 1.27.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 +105 -61
- package/dist/cjs/base/FeeManagerClient.js +72 -0
- package/dist/cjs/const/abis/index.js +1 -0
- package/dist/cjs/const/abis/vaultFees.js +43 -0
- package/dist/cjs/const/capabilities.js +68 -0
- package/dist/cjs/const/index.js +1 -0
- package/dist/esm/base/FeeManagerClient.js +72 -0
- package/dist/esm/const/abis/index.js +1 -0
- package/dist/esm/const/abis/vaultFees.js +40 -0
- package/dist/esm/const/capabilities.js +63 -0
- package/dist/esm/const/index.js +1 -0
- package/dist/types/base/FeeManagerClient.d.ts +20 -0
- package/dist/types/base/FeeManagerClient.d.ts.map +1 -1
- package/dist/types/const/abis/index.d.ts +1 -0
- package/dist/types/const/abis/index.d.ts.map +1 -1
- package/dist/types/const/abis/vaultFees.d.ts +30 -0
- package/dist/types/const/abis/vaultFees.d.ts.map +1 -0
- package/dist/types/const/capabilities.d.ts +36 -0
- package/dist/types/const/capabilities.d.ts.map +1 -0
- package/dist/types/const/index.d.ts +1 -0
- package/dist/types/const/index.d.ts.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -22,12 +22,12 @@ import { VaultClient, StakingClient } from '@steerprotocol/sdk';
|
|
|
22
22
|
// Create viem clients
|
|
23
23
|
const publicClient = createPublicClient({
|
|
24
24
|
chain: mainnet,
|
|
25
|
-
transport: http()
|
|
25
|
+
transport: http(),
|
|
26
26
|
});
|
|
27
27
|
|
|
28
28
|
const walletClient = createWalletClient({
|
|
29
29
|
chain: mainnet,
|
|
30
|
-
transport: http()
|
|
30
|
+
transport: http(),
|
|
31
31
|
});
|
|
32
32
|
|
|
33
33
|
// Initialize clients
|
|
@@ -41,6 +41,39 @@ const vaults = await vaultClient.getVaults({ chainId: 1 });
|
|
|
41
41
|
const pools = await stakingClient.getStakingPools();
|
|
42
42
|
```
|
|
43
43
|
|
|
44
|
+
## Supported Chains, Subgraphs, and Protocols
|
|
45
|
+
|
|
46
|
+
The SDK exposes a capabilities registry so integrators can discover supported chains and the relevant configuration (subgraph URLs, protocol availability, deployments) without enumerating enums.
|
|
47
|
+
|
|
48
|
+
```ts
|
|
49
|
+
import { getSupportedChains, getSupportedChainIds } from '@steerprotocol/sdk';
|
|
50
|
+
|
|
51
|
+
// Most lightweight: chains that have Steer subgraph config
|
|
52
|
+
const supportedChainIds = getSupportedChainIds();
|
|
53
|
+
|
|
54
|
+
// Opt in to additional details (deployments, protocol subgraphs, etc)
|
|
55
|
+
const supported = getSupportedChains({
|
|
56
|
+
include: {
|
|
57
|
+
subgraph: true,
|
|
58
|
+
deployments: true,
|
|
59
|
+
protocols: true,
|
|
60
|
+
singleAssetDeposit: true,
|
|
61
|
+
},
|
|
62
|
+
// Used for protocol-specific subgraph discovery (The Graph / Studio)
|
|
63
|
+
theGraphApiKey: process.env.SUBGRAPH_STUDIO_KEY ?? '',
|
|
64
|
+
});
|
|
65
|
+
|
|
66
|
+
for (const chain of supported) {
|
|
67
|
+
console.log({
|
|
68
|
+
chainId: chain.chainId,
|
|
69
|
+
chain: chain.chain,
|
|
70
|
+
subgraphUrl: chain.subgraphUrl,
|
|
71
|
+
protocolCount: chain.protocols?.length ?? 0,
|
|
72
|
+
features: chain.features,
|
|
73
|
+
});
|
|
74
|
+
}
|
|
75
|
+
```
|
|
76
|
+
|
|
44
77
|
### Available Features
|
|
45
78
|
|
|
46
79
|
- **Vault Operations**: Traditional vault deposits, withdrawals, and balance checking
|
|
@@ -77,7 +110,7 @@ const polygonPools = await stakingClient.getStakingPools(137); // Polygon chain
|
|
|
77
110
|
// Stake tokens
|
|
78
111
|
await stakingClient.stake({
|
|
79
112
|
stakingPool: '0x...', // staking pool address
|
|
80
|
-
amount: 1000000000000000000n // amount in wei
|
|
113
|
+
amount: 1000000000000000000n, // amount in wei
|
|
81
114
|
});
|
|
82
115
|
|
|
83
116
|
// Check earned rewards
|
|
@@ -85,11 +118,7 @@ const earned = await stakingClient.earned('0x...', '0x...'); // pool address, ac
|
|
|
85
118
|
console.log('Earned rewards:', earned.data);
|
|
86
119
|
|
|
87
120
|
// Calculate APR
|
|
88
|
-
const apr = stakingClient.calculateAPR(
|
|
89
|
-
pool,
|
|
90
|
-
rewardTokenPriceUSD,
|
|
91
|
-
totalStakedUSD
|
|
92
|
-
);
|
|
121
|
+
const apr = stakingClient.calculateAPR(pool, rewardTokenPriceUSD, totalStakedUSD);
|
|
93
122
|
```
|
|
94
123
|
|
|
95
124
|
### Available Methods
|
|
@@ -137,35 +166,38 @@ import { mainnet } from 'viem/chains';
|
|
|
137
166
|
// Setup clients
|
|
138
167
|
const publicClient = createPublicClient({
|
|
139
168
|
chain: mainnet,
|
|
140
|
-
transport: http()
|
|
169
|
+
transport: http(),
|
|
141
170
|
});
|
|
142
171
|
|
|
143
172
|
const walletClient = createWalletClient({
|
|
144
173
|
chain: mainnet,
|
|
145
|
-
transport: http()
|
|
174
|
+
transport: http(),
|
|
146
175
|
});
|
|
147
176
|
|
|
148
177
|
// Initialize vault client
|
|
149
178
|
const vaultClient = new VaultClient(publicClient, walletClient, 'production');
|
|
150
179
|
|
|
151
180
|
// Preview single-asset deposit
|
|
152
|
-
const preview = await vaultClient.previewSingleAssetDeposit(
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
181
|
+
const preview = await vaultClient.previewSingleAssetDeposit(
|
|
182
|
+
{
|
|
183
|
+
assets: parseEther('100'), // 100 tokens to deposit
|
|
184
|
+
receiver: userAddress, // Address to receive LP tokens
|
|
185
|
+
vault: vaultAddress, // Vault contract address
|
|
186
|
+
isToken0: true, // Depositing token0
|
|
187
|
+
depositSlippagePercent: 5n, // 5% max slippage for deposit
|
|
188
|
+
swapSlippageBP: 500, // 5% slippage for internal swap (in basis points)
|
|
189
|
+
ammType: AMMType.UniswapV3, // AMM type
|
|
190
|
+
singleAssetDepositContract: contractAddress, // Single-asset deposit contract
|
|
191
|
+
},
|
|
192
|
+
poolAddress
|
|
193
|
+
);
|
|
162
194
|
|
|
163
195
|
if (preview.success) {
|
|
164
196
|
console.log('Expected LP tokens:', preview.data.lpEstimation.lpTokens);
|
|
165
197
|
console.log('Amount to be swapped:', preview.data.swapAmount);
|
|
166
198
|
console.log('Final token0 amount:', preview.data.lpEstimation.finalAmount0);
|
|
167
199
|
console.log('Final token1 amount:', preview.data.lpEstimation.finalAmount1);
|
|
168
|
-
|
|
200
|
+
|
|
169
201
|
// Execute the deposit
|
|
170
202
|
const result = await vaultClient.singleAssetDeposit({
|
|
171
203
|
assets: parseEther('100'),
|
|
@@ -175,9 +207,9 @@ if (preview.success) {
|
|
|
175
207
|
depositSlippagePercent: 5n,
|
|
176
208
|
swapSlippageBP: 500,
|
|
177
209
|
ammType: AMMType.UniswapV3,
|
|
178
|
-
singleAssetDepositContract: contractAddress
|
|
210
|
+
singleAssetDepositContract: contractAddress,
|
|
179
211
|
});
|
|
180
|
-
|
|
212
|
+
|
|
181
213
|
if (result.success) {
|
|
182
214
|
console.log('Transaction hash:', result.data);
|
|
183
215
|
}
|
|
@@ -191,12 +223,12 @@ if (preview.success) {
|
|
|
191
223
|
Each step can be used independently for testing or custom implementations:
|
|
192
224
|
|
|
193
225
|
```typescript
|
|
194
|
-
import {
|
|
195
|
-
calculateSwapAmount,
|
|
196
|
-
calculateLimitPrice,
|
|
197
|
-
simulateSwap,
|
|
226
|
+
import {
|
|
227
|
+
calculateSwapAmount,
|
|
228
|
+
calculateLimitPrice,
|
|
229
|
+
simulateSwap,
|
|
198
230
|
estimateLpTokens,
|
|
199
|
-
AMMType
|
|
231
|
+
AMMType,
|
|
200
232
|
} from '@steerprotocol/sdk';
|
|
201
233
|
|
|
202
234
|
// Step 1: Calculate swap amount
|
|
@@ -206,7 +238,7 @@ const swapResult = await calculateSwapAmount(publicClient, {
|
|
|
206
238
|
vault: vaultAddress,
|
|
207
239
|
pool: poolAddress,
|
|
208
240
|
ammType: AMMType.UniswapV3,
|
|
209
|
-
singleAssetDepositContract: contractAddress
|
|
241
|
+
singleAssetDepositContract: contractAddress,
|
|
210
242
|
});
|
|
211
243
|
|
|
212
244
|
// Step 2: Calculate price limit for slippage protection
|
|
@@ -214,21 +246,25 @@ const limitPrice = await calculateLimitPrice(publicClient, {
|
|
|
214
246
|
pool: poolAddress,
|
|
215
247
|
slippageBP: 500,
|
|
216
248
|
zeroForOne: true,
|
|
217
|
-
ammType: AMMType.UniswapV3
|
|
249
|
+
ammType: AMMType.UniswapV3,
|
|
218
250
|
});
|
|
219
251
|
|
|
220
252
|
// Step 3: Simulate the swap
|
|
221
|
-
const simulation = await simulateSwap(
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
253
|
+
const simulation = await simulateSwap(
|
|
254
|
+
publicClient,
|
|
255
|
+
{
|
|
256
|
+
pool: poolAddress,
|
|
257
|
+
recipient: userAddress,
|
|
258
|
+
zeroForOne: true,
|
|
259
|
+
amountSpecified: parseEther('10'),
|
|
260
|
+
sqrtPriceLimitX96: limitPrice,
|
|
261
|
+
ammType: AMMType.UniswapV3,
|
|
262
|
+
tokenIn: '0x...', // Token being swapped from
|
|
263
|
+
tokenOut: '0x...', // Token being swapped to
|
|
264
|
+
fee: 3000, // Pool fee in basis points
|
|
265
|
+
},
|
|
266
|
+
137
|
|
267
|
+
); // Chain ID (e.g., 137 for Polygon)
|
|
232
268
|
|
|
233
269
|
// Step 4: Estimate LP tokens
|
|
234
270
|
const estimation = await estimateLpTokens(publicClient, {
|
|
@@ -236,7 +272,7 @@ const estimation = await estimateLpTokens(publicClient, {
|
|
|
236
272
|
originalAssets: parseEther('100'),
|
|
237
273
|
swapAmount: swapResult.data.swapAmount,
|
|
238
274
|
swapResult: simulation.data,
|
|
239
|
-
isToken0: true
|
|
275
|
+
isToken0: true,
|
|
240
276
|
});
|
|
241
277
|
```
|
|
242
278
|
|
|
@@ -261,11 +297,11 @@ client.validateDepositParams(params);
|
|
|
261
297
|
|
|
262
298
|
```typescript
|
|
263
299
|
enum AMMType {
|
|
264
|
-
UniswapV3 = 0,
|
|
265
|
-
Algebra = 1,
|
|
266
|
-
AlgebraDirectional = 2, // 🚧 Planned
|
|
267
|
-
AlgebraVE33 = 3,
|
|
268
|
-
AlgebraIntegral = 4
|
|
300
|
+
UniswapV3 = 0, // ✅ Fully implemented
|
|
301
|
+
Algebra = 1, // 🚧 Planned
|
|
302
|
+
AlgebraDirectional = 2, // 🚧 Planned
|
|
303
|
+
AlgebraVE33 = 3, // 🚧 Planned
|
|
304
|
+
AlgebraIntegral = 4, // 🚧 Planned
|
|
269
305
|
}
|
|
270
306
|
```
|
|
271
307
|
|
|
@@ -317,9 +353,9 @@ describe('Single-Asset Deposit', () => {
|
|
|
317
353
|
vault: vaultAddress,
|
|
318
354
|
pool: poolAddress,
|
|
319
355
|
ammType: AMMType.UniswapV3,
|
|
320
|
-
singleAssetDepositContract: contractAddress
|
|
356
|
+
singleAssetDepositContract: contractAddress,
|
|
321
357
|
});
|
|
322
|
-
|
|
358
|
+
|
|
323
359
|
expect(result.success).toBe(true);
|
|
324
360
|
expect(result.data.swapAmount).toBeGreaterThan(0n);
|
|
325
361
|
});
|
|
@@ -328,16 +364,16 @@ describe('Single-Asset Deposit', () => {
|
|
|
328
364
|
|
|
329
365
|
### Configuration Parameters
|
|
330
366
|
|
|
331
|
-
| Parameter
|
|
332
|
-
|
|
333
|
-
| `assets`
|
|
334
|
-
| `receiver`
|
|
335
|
-
| `vault`
|
|
336
|
-
| `isToken0`
|
|
337
|
-
| `depositSlippagePercent`
|
|
338
|
-
| `swapSlippageBP`
|
|
339
|
-
| `ammType`
|
|
340
|
-
| `singleAssetDepositContract` | `Address` | Single-asset deposit contract address
|
|
367
|
+
| Parameter | Type | Description |
|
|
368
|
+
| ---------------------------- | --------- | ----------------------------------------- |
|
|
369
|
+
| `assets` | `bigint` | Amount of input token to deposit |
|
|
370
|
+
| `receiver` | `Address` | Address to receive LP tokens |
|
|
371
|
+
| `vault` | `Address` | Vault contract address |
|
|
372
|
+
| `isToken0` | `boolean` | `true` for token0, `false` for token1 |
|
|
373
|
+
| `depositSlippagePercent` | `bigint` | Max slippage for deposit (in %) |
|
|
374
|
+
| `swapSlippageBP` | `number` | Slippage for internal swap (basis points) |
|
|
375
|
+
| `ammType` | `AMMType` | Type of AMM (currently UniswapV3) |
|
|
376
|
+
| `singleAssetDepositContract` | `Address` | Single-asset deposit contract address |
|
|
341
377
|
|
|
342
378
|
### Architecture
|
|
343
379
|
|
|
@@ -348,13 +384,14 @@ src/base/vault/single-asset/
|
|
|
348
384
|
├── types.ts # TypeScript interfaces and enums
|
|
349
385
|
├── calculateSwapAmount.ts # Step 1: Calculate swap amount
|
|
350
386
|
├── calculateLimitPrice.ts # Step 2: Calculate slippage protection
|
|
351
|
-
├── simulateSwap.ts # Step 3: Simulate swap execution
|
|
387
|
+
├── simulateSwap.ts # Step 3: Simulate swap execution
|
|
352
388
|
├── estimateLpTokens.ts # Step 4: Estimate LP token output
|
|
353
389
|
├── singleAssetDeposit.ts # Main orchestrator client
|
|
354
390
|
└── index.ts # Exports everything
|
|
355
391
|
```
|
|
356
392
|
|
|
357
393
|
This design allows for:
|
|
394
|
+
|
|
358
395
|
- **Individual Testing**: Each function can be unit tested separately
|
|
359
396
|
- **Reusability**: Functions can be used in different contexts
|
|
360
397
|
- **Maintainability**: Easy to update or extend individual components
|
|
@@ -368,26 +405,31 @@ This design allows for:
|
|
|
368
405
|
## Development
|
|
369
406
|
|
|
370
407
|
1. Install dependencies:
|
|
408
|
+
|
|
371
409
|
```bash
|
|
372
410
|
npm install
|
|
373
411
|
```
|
|
374
412
|
|
|
375
413
|
2. Build the package:
|
|
414
|
+
|
|
376
415
|
```bash
|
|
377
416
|
npm run build
|
|
378
417
|
```
|
|
379
418
|
|
|
380
419
|
3. Run tests:
|
|
420
|
+
|
|
381
421
|
```bash
|
|
382
422
|
npm test
|
|
383
423
|
```
|
|
384
424
|
|
|
385
425
|
4. Format code:
|
|
426
|
+
|
|
386
427
|
```bash
|
|
387
428
|
npm run format
|
|
388
429
|
```
|
|
389
430
|
|
|
390
431
|
5. Lint code:
|
|
432
|
+
|
|
391
433
|
```bash
|
|
392
434
|
npm run lint
|
|
393
435
|
```
|
|
@@ -397,6 +439,7 @@ npm run lint
|
|
|
397
439
|
### CommonJS/ESM Import Issues
|
|
398
440
|
|
|
399
441
|
If you encounter the following error:
|
|
442
|
+
|
|
400
443
|
```typescript
|
|
401
444
|
import { SteerClient } from "@steerprotocol/sdk";
|
|
402
445
|
^^^^^^^^^^^
|
|
@@ -404,6 +447,7 @@ SyntaxError: Named export 'SteerClient' not found. The requested module '@steerp
|
|
|
404
447
|
```
|
|
405
448
|
|
|
406
449
|
Add the following to your `tsconfig.json`:
|
|
450
|
+
|
|
407
451
|
```json
|
|
408
452
|
{
|
|
409
453
|
"compilerOptions": {
|
|
@@ -415,4 +459,4 @@ Add the following to your `tsconfig.json`:
|
|
|
415
459
|
|
|
416
460
|
## License
|
|
417
461
|
|
|
418
|
-
MIT
|
|
462
|
+
MIT
|
|
@@ -3,6 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.FeeManagerClient = void 0;
|
|
4
4
|
const viem_1 = require("viem");
|
|
5
5
|
const feeManager_js_1 = require("../const/abis/feeManager.js");
|
|
6
|
+
const vaultFees_js_1 = require("../const/abis/vaultFees.js");
|
|
6
7
|
const SubgraphClient_js_1 = require("./SubgraphClient.js");
|
|
7
8
|
class FeeManagerClient extends SubgraphClient_js_1.SubgraphClient {
|
|
8
9
|
constructor(feeManagerAddress, publicClient, walletClient) {
|
|
@@ -522,5 +523,76 @@ class FeeManagerClient extends SubgraphClient_js_1.SubgraphClient {
|
|
|
522
523
|
};
|
|
523
524
|
}
|
|
524
525
|
}
|
|
526
|
+
/**
|
|
527
|
+
* Gets the accrued revenue for a specific fee identifier in a vault
|
|
528
|
+
* @param vault The vault address
|
|
529
|
+
* @param feeIdentifier The fee identifier (e.g., 'STEER_FEES', 'STRATEGIST_FEES')
|
|
530
|
+
* @returns Promise resolving to the accrued amounts for token0 and token1
|
|
531
|
+
*/
|
|
532
|
+
async getAccruedRevenue(vault, feeIdentifier) {
|
|
533
|
+
try {
|
|
534
|
+
const [amount0, amount1] = await Promise.all([
|
|
535
|
+
this.publicClient.readContract({
|
|
536
|
+
address: vault,
|
|
537
|
+
abi: vaultFees_js_1.VAULT_FEES_ABI,
|
|
538
|
+
functionName: 'accruedFees0',
|
|
539
|
+
args: [feeIdentifier],
|
|
540
|
+
}),
|
|
541
|
+
this.publicClient.readContract({
|
|
542
|
+
address: vault,
|
|
543
|
+
abi: vaultFees_js_1.VAULT_FEES_ABI,
|
|
544
|
+
functionName: 'accruedFees1',
|
|
545
|
+
args: [feeIdentifier],
|
|
546
|
+
}),
|
|
547
|
+
]);
|
|
548
|
+
return {
|
|
549
|
+
data: { amount0, amount1 },
|
|
550
|
+
status: 200,
|
|
551
|
+
success: true,
|
|
552
|
+
};
|
|
553
|
+
}
|
|
554
|
+
catch (error) {
|
|
555
|
+
return {
|
|
556
|
+
data: null,
|
|
557
|
+
status: 500,
|
|
558
|
+
success: false,
|
|
559
|
+
error: error instanceof Error ? error.message : 'Unknown error occurred',
|
|
560
|
+
};
|
|
561
|
+
}
|
|
562
|
+
}
|
|
563
|
+
/**
|
|
564
|
+
* Gets a summary of accrued revenue for all configured fee identifiers in a vault
|
|
565
|
+
* @param vault The vault address
|
|
566
|
+
* @returns Promise resolving to a list of fee identifiers and their accrued amounts
|
|
567
|
+
*/
|
|
568
|
+
async getVaultRevenueSummary(vault) {
|
|
569
|
+
try {
|
|
570
|
+
const feesResponse = await this.getFees(vault);
|
|
571
|
+
if (!feesResponse.success || !feesResponse.data) {
|
|
572
|
+
throw new Error(feesResponse.error || 'Failed to fetch vault fees configuration');
|
|
573
|
+
}
|
|
574
|
+
const summary = await Promise.all(feesResponse.data.map(async (fee) => {
|
|
575
|
+
const revenue = await this.getAccruedRevenue(vault, fee.feeIdentifier);
|
|
576
|
+
return {
|
|
577
|
+
feeIdentifier: fee.feeIdentifier,
|
|
578
|
+
amount0: revenue.data?.amount0 ?? 0n,
|
|
579
|
+
amount1: revenue.data?.amount1 ?? 0n,
|
|
580
|
+
};
|
|
581
|
+
}));
|
|
582
|
+
return {
|
|
583
|
+
data: summary,
|
|
584
|
+
status: 200,
|
|
585
|
+
success: true,
|
|
586
|
+
};
|
|
587
|
+
}
|
|
588
|
+
catch (error) {
|
|
589
|
+
return {
|
|
590
|
+
data: null,
|
|
591
|
+
status: 500,
|
|
592
|
+
success: false,
|
|
593
|
+
error: error instanceof Error ? error.message : 'Unknown error occurred',
|
|
594
|
+
};
|
|
595
|
+
}
|
|
596
|
+
}
|
|
525
597
|
}
|
|
526
598
|
exports.FeeManagerClient = FeeManagerClient;
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.VAULT_FEES_ABI = void 0;
|
|
4
|
+
exports.VAULT_FEES_ABI = [
|
|
5
|
+
{
|
|
6
|
+
inputs: [
|
|
7
|
+
{
|
|
8
|
+
internalType: 'string',
|
|
9
|
+
name: 'feeIdentifier',
|
|
10
|
+
type: 'string',
|
|
11
|
+
},
|
|
12
|
+
],
|
|
13
|
+
name: 'accruedFees0',
|
|
14
|
+
outputs: [
|
|
15
|
+
{
|
|
16
|
+
internalType: 'uint256',
|
|
17
|
+
name: '',
|
|
18
|
+
type: 'uint256',
|
|
19
|
+
},
|
|
20
|
+
],
|
|
21
|
+
stateMutability: 'view',
|
|
22
|
+
type: 'function',
|
|
23
|
+
},
|
|
24
|
+
{
|
|
25
|
+
inputs: [
|
|
26
|
+
{
|
|
27
|
+
internalType: 'string',
|
|
28
|
+
name: 'feeIdentifier',
|
|
29
|
+
type: 'string',
|
|
30
|
+
},
|
|
31
|
+
],
|
|
32
|
+
name: 'accruedFees1',
|
|
33
|
+
outputs: [
|
|
34
|
+
{
|
|
35
|
+
internalType: 'uint256',
|
|
36
|
+
name: '',
|
|
37
|
+
type: 'uint256',
|
|
38
|
+
},
|
|
39
|
+
],
|
|
40
|
+
stateMutability: 'view',
|
|
41
|
+
type: 'function',
|
|
42
|
+
},
|
|
43
|
+
];
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getSupportedChains = getSupportedChains;
|
|
4
|
+
exports.getSupportedChainIds = getSupportedChainIds;
|
|
5
|
+
exports.getSupportedChainByChainId = getSupportedChainByChainId;
|
|
6
|
+
const chain_js_1 = require("./chain.js");
|
|
7
|
+
const subgraph_js_1 = require("./subgraph.js");
|
|
8
|
+
const network_js_1 = require("./network.js");
|
|
9
|
+
const protocol_js_1 = require("./amm/utils/protocol.js");
|
|
10
|
+
function getChainId(chain) {
|
|
11
|
+
return chain_js_1.ChainId[chain];
|
|
12
|
+
}
|
|
13
|
+
function defaultInclude(include) {
|
|
14
|
+
return {
|
|
15
|
+
subgraph: include?.subgraph ?? true,
|
|
16
|
+
deployments: include?.deployments ?? false,
|
|
17
|
+
protocols: include?.protocols ?? false,
|
|
18
|
+
singleAssetDeposit: include?.singleAssetDeposit ?? false,
|
|
19
|
+
};
|
|
20
|
+
}
|
|
21
|
+
function getSupportedChains(options = {}) {
|
|
22
|
+
const include = defaultInclude(options.include);
|
|
23
|
+
const chains = Object.values(chain_js_1.Chain)
|
|
24
|
+
.filter((chain) => Boolean(subgraph_js_1.steerSubgraphConfig[chain]))
|
|
25
|
+
.map((chain) => {
|
|
26
|
+
const chainId = getChainId(chain);
|
|
27
|
+
const subgraphUrl = include.subgraph ? (0, subgraph_js_1.getSubgraphUrlByChainId)(chainId) : undefined;
|
|
28
|
+
const deployments = include.deployments ? network_js_1.networks[chain] : undefined;
|
|
29
|
+
const protocols = include.protocols
|
|
30
|
+
? (0, protocol_js_1.getProtocolInfoByChainId)(chainId, options.theGraphApiKey ?? '')
|
|
31
|
+
: undefined;
|
|
32
|
+
const singleAssetDeposit = include.singleAssetDeposit
|
|
33
|
+
? (0, network_js_1.isSingleAssetDepositSupported)(chainId)
|
|
34
|
+
: false;
|
|
35
|
+
const features = {
|
|
36
|
+
subgraph: Boolean(subgraphUrl),
|
|
37
|
+
deployments: Boolean(deployments),
|
|
38
|
+
protocols: Boolean(protocols && protocols.length > 0),
|
|
39
|
+
singleAssetDeposit,
|
|
40
|
+
};
|
|
41
|
+
const supportedChain = {
|
|
42
|
+
schemaVersion: 1,
|
|
43
|
+
chain,
|
|
44
|
+
chainId,
|
|
45
|
+
features,
|
|
46
|
+
};
|
|
47
|
+
if (include.subgraph)
|
|
48
|
+
supportedChain.subgraphUrl = subgraphUrl;
|
|
49
|
+
if (include.deployments)
|
|
50
|
+
supportedChain.deployments = deployments;
|
|
51
|
+
if (include.protocols)
|
|
52
|
+
supportedChain.protocols = protocols;
|
|
53
|
+
return supportedChain;
|
|
54
|
+
});
|
|
55
|
+
const featureFilter = options.filter?.feature;
|
|
56
|
+
if (!featureFilter)
|
|
57
|
+
return chains;
|
|
58
|
+
return chains.filter((c) => c.features[featureFilter]);
|
|
59
|
+
}
|
|
60
|
+
function getSupportedChainIds(options = {}) {
|
|
61
|
+
return getSupportedChains(options).map((c) => c.chainId);
|
|
62
|
+
}
|
|
63
|
+
function getSupportedChainByChainId(chainId, options = {}) {
|
|
64
|
+
const chainName = Object.values(chain_js_1.Chain).find((chain) => getChainId(chain) === chainId);
|
|
65
|
+
if (!chainName)
|
|
66
|
+
return undefined;
|
|
67
|
+
return getSupportedChains({ ...options }).find((c) => c.chainId === chainId);
|
|
68
|
+
}
|
package/dist/cjs/const/index.js
CHANGED
|
@@ -23,5 +23,6 @@ __exportStar(require("./api.js"), exports);
|
|
|
23
23
|
__exportStar(require("./abis/index.js"), exports);
|
|
24
24
|
__exportStar(require("./amm/index.js"), exports);
|
|
25
25
|
__exportStar(require("./deployments/index.js"), exports);
|
|
26
|
+
__exportStar(require("./capabilities.js"), exports);
|
|
26
27
|
__exportStar(require("./quoter.js"), exports);
|
|
27
28
|
__exportStar(require("./stabilityVaults/index.js"), exports);
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { isAddressEqual, } from 'viem';
|
|
2
2
|
import { FEE_MANAGER_ABI } from '../const/abis/feeManager.js';
|
|
3
|
+
import { VAULT_FEES_ABI } from '../const/abis/vaultFees.js';
|
|
3
4
|
import { SubgraphClient } from './SubgraphClient.js';
|
|
4
5
|
export class FeeManagerClient extends SubgraphClient {
|
|
5
6
|
constructor(feeManagerAddress, publicClient, walletClient) {
|
|
@@ -519,4 +520,75 @@ export class FeeManagerClient extends SubgraphClient {
|
|
|
519
520
|
};
|
|
520
521
|
}
|
|
521
522
|
}
|
|
523
|
+
/**
|
|
524
|
+
* Gets the accrued revenue for a specific fee identifier in a vault
|
|
525
|
+
* @param vault The vault address
|
|
526
|
+
* @param feeIdentifier The fee identifier (e.g., 'STEER_FEES', 'STRATEGIST_FEES')
|
|
527
|
+
* @returns Promise resolving to the accrued amounts for token0 and token1
|
|
528
|
+
*/
|
|
529
|
+
async getAccruedRevenue(vault, feeIdentifier) {
|
|
530
|
+
try {
|
|
531
|
+
const [amount0, amount1] = await Promise.all([
|
|
532
|
+
this.publicClient.readContract({
|
|
533
|
+
address: vault,
|
|
534
|
+
abi: VAULT_FEES_ABI,
|
|
535
|
+
functionName: 'accruedFees0',
|
|
536
|
+
args: [feeIdentifier],
|
|
537
|
+
}),
|
|
538
|
+
this.publicClient.readContract({
|
|
539
|
+
address: vault,
|
|
540
|
+
abi: VAULT_FEES_ABI,
|
|
541
|
+
functionName: 'accruedFees1',
|
|
542
|
+
args: [feeIdentifier],
|
|
543
|
+
}),
|
|
544
|
+
]);
|
|
545
|
+
return {
|
|
546
|
+
data: { amount0, amount1 },
|
|
547
|
+
status: 200,
|
|
548
|
+
success: true,
|
|
549
|
+
};
|
|
550
|
+
}
|
|
551
|
+
catch (error) {
|
|
552
|
+
return {
|
|
553
|
+
data: null,
|
|
554
|
+
status: 500,
|
|
555
|
+
success: false,
|
|
556
|
+
error: error instanceof Error ? error.message : 'Unknown error occurred',
|
|
557
|
+
};
|
|
558
|
+
}
|
|
559
|
+
}
|
|
560
|
+
/**
|
|
561
|
+
* Gets a summary of accrued revenue for all configured fee identifiers in a vault
|
|
562
|
+
* @param vault The vault address
|
|
563
|
+
* @returns Promise resolving to a list of fee identifiers and their accrued amounts
|
|
564
|
+
*/
|
|
565
|
+
async getVaultRevenueSummary(vault) {
|
|
566
|
+
try {
|
|
567
|
+
const feesResponse = await this.getFees(vault);
|
|
568
|
+
if (!feesResponse.success || !feesResponse.data) {
|
|
569
|
+
throw new Error(feesResponse.error || 'Failed to fetch vault fees configuration');
|
|
570
|
+
}
|
|
571
|
+
const summary = await Promise.all(feesResponse.data.map(async (fee) => {
|
|
572
|
+
const revenue = await this.getAccruedRevenue(vault, fee.feeIdentifier);
|
|
573
|
+
return {
|
|
574
|
+
feeIdentifier: fee.feeIdentifier,
|
|
575
|
+
amount0: revenue.data?.amount0 ?? 0n,
|
|
576
|
+
amount1: revenue.data?.amount1 ?? 0n,
|
|
577
|
+
};
|
|
578
|
+
}));
|
|
579
|
+
return {
|
|
580
|
+
data: summary,
|
|
581
|
+
status: 200,
|
|
582
|
+
success: true,
|
|
583
|
+
};
|
|
584
|
+
}
|
|
585
|
+
catch (error) {
|
|
586
|
+
return {
|
|
587
|
+
data: null,
|
|
588
|
+
status: 500,
|
|
589
|
+
success: false,
|
|
590
|
+
error: error instanceof Error ? error.message : 'Unknown error occurred',
|
|
591
|
+
};
|
|
592
|
+
}
|
|
593
|
+
}
|
|
522
594
|
}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
export const VAULT_FEES_ABI = [
|
|
2
|
+
{
|
|
3
|
+
inputs: [
|
|
4
|
+
{
|
|
5
|
+
internalType: 'string',
|
|
6
|
+
name: 'feeIdentifier',
|
|
7
|
+
type: 'string',
|
|
8
|
+
},
|
|
9
|
+
],
|
|
10
|
+
name: 'accruedFees0',
|
|
11
|
+
outputs: [
|
|
12
|
+
{
|
|
13
|
+
internalType: 'uint256',
|
|
14
|
+
name: '',
|
|
15
|
+
type: 'uint256',
|
|
16
|
+
},
|
|
17
|
+
],
|
|
18
|
+
stateMutability: 'view',
|
|
19
|
+
type: 'function',
|
|
20
|
+
},
|
|
21
|
+
{
|
|
22
|
+
inputs: [
|
|
23
|
+
{
|
|
24
|
+
internalType: 'string',
|
|
25
|
+
name: 'feeIdentifier',
|
|
26
|
+
type: 'string',
|
|
27
|
+
},
|
|
28
|
+
],
|
|
29
|
+
name: 'accruedFees1',
|
|
30
|
+
outputs: [
|
|
31
|
+
{
|
|
32
|
+
internalType: 'uint256',
|
|
33
|
+
name: '',
|
|
34
|
+
type: 'uint256',
|
|
35
|
+
},
|
|
36
|
+
],
|
|
37
|
+
stateMutability: 'view',
|
|
38
|
+
type: 'function',
|
|
39
|
+
},
|
|
40
|
+
];
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import { Chain, ChainId } from './chain.js';
|
|
2
|
+
import { getSubgraphUrlByChainId, steerSubgraphConfig } from './subgraph.js';
|
|
3
|
+
import { isSingleAssetDepositSupported, networks } from './network.js';
|
|
4
|
+
import { getProtocolInfoByChainId } from './amm/utils/protocol.js';
|
|
5
|
+
function getChainId(chain) {
|
|
6
|
+
return ChainId[chain];
|
|
7
|
+
}
|
|
8
|
+
function defaultInclude(include) {
|
|
9
|
+
return {
|
|
10
|
+
subgraph: include?.subgraph ?? true,
|
|
11
|
+
deployments: include?.deployments ?? false,
|
|
12
|
+
protocols: include?.protocols ?? false,
|
|
13
|
+
singleAssetDeposit: include?.singleAssetDeposit ?? false,
|
|
14
|
+
};
|
|
15
|
+
}
|
|
16
|
+
export function getSupportedChains(options = {}) {
|
|
17
|
+
const include = defaultInclude(options.include);
|
|
18
|
+
const chains = Object.values(Chain)
|
|
19
|
+
.filter((chain) => Boolean(steerSubgraphConfig[chain]))
|
|
20
|
+
.map((chain) => {
|
|
21
|
+
const chainId = getChainId(chain);
|
|
22
|
+
const subgraphUrl = include.subgraph ? getSubgraphUrlByChainId(chainId) : undefined;
|
|
23
|
+
const deployments = include.deployments ? networks[chain] : undefined;
|
|
24
|
+
const protocols = include.protocols
|
|
25
|
+
? getProtocolInfoByChainId(chainId, options.theGraphApiKey ?? '')
|
|
26
|
+
: undefined;
|
|
27
|
+
const singleAssetDeposit = include.singleAssetDeposit
|
|
28
|
+
? isSingleAssetDepositSupported(chainId)
|
|
29
|
+
: false;
|
|
30
|
+
const features = {
|
|
31
|
+
subgraph: Boolean(subgraphUrl),
|
|
32
|
+
deployments: Boolean(deployments),
|
|
33
|
+
protocols: Boolean(protocols && protocols.length > 0),
|
|
34
|
+
singleAssetDeposit,
|
|
35
|
+
};
|
|
36
|
+
const supportedChain = {
|
|
37
|
+
schemaVersion: 1,
|
|
38
|
+
chain,
|
|
39
|
+
chainId,
|
|
40
|
+
features,
|
|
41
|
+
};
|
|
42
|
+
if (include.subgraph)
|
|
43
|
+
supportedChain.subgraphUrl = subgraphUrl;
|
|
44
|
+
if (include.deployments)
|
|
45
|
+
supportedChain.deployments = deployments;
|
|
46
|
+
if (include.protocols)
|
|
47
|
+
supportedChain.protocols = protocols;
|
|
48
|
+
return supportedChain;
|
|
49
|
+
});
|
|
50
|
+
const featureFilter = options.filter?.feature;
|
|
51
|
+
if (!featureFilter)
|
|
52
|
+
return chains;
|
|
53
|
+
return chains.filter((c) => c.features[featureFilter]);
|
|
54
|
+
}
|
|
55
|
+
export function getSupportedChainIds(options = {}) {
|
|
56
|
+
return getSupportedChains(options).map((c) => c.chainId);
|
|
57
|
+
}
|
|
58
|
+
export function getSupportedChainByChainId(chainId, options = {}) {
|
|
59
|
+
const chainName = Object.values(Chain).find((chain) => getChainId(chain) === chainId);
|
|
60
|
+
if (!chainName)
|
|
61
|
+
return undefined;
|
|
62
|
+
return getSupportedChains({ ...options }).find((c) => c.chainId === chainId);
|
|
63
|
+
}
|
package/dist/esm/const/index.js
CHANGED
|
@@ -19,5 +19,25 @@ export declare class FeeManagerClient extends SubgraphClient {
|
|
|
19
19
|
withdrawFee(params: FeeWithdrawalParams): Promise<SteerResponse<Hash>>;
|
|
20
20
|
withdrawMultipleFees(params: MultipleFeeWithdrawalParams): Promise<SteerResponse<Hash>>;
|
|
21
21
|
withdrawFeesFromMultipleVaults(params: MultiVaultFeeWithdrawalParams): Promise<SteerResponse<Hash>>;
|
|
22
|
+
/**
|
|
23
|
+
* Gets the accrued revenue for a specific fee identifier in a vault
|
|
24
|
+
* @param vault The vault address
|
|
25
|
+
* @param feeIdentifier The fee identifier (e.g., 'STEER_FEES', 'STRATEGIST_FEES')
|
|
26
|
+
* @returns Promise resolving to the accrued amounts for token0 and token1
|
|
27
|
+
*/
|
|
28
|
+
getAccruedRevenue(vault: Address, feeIdentifier: string): Promise<SteerResponse<{
|
|
29
|
+
amount0: bigint;
|
|
30
|
+
amount1: bigint;
|
|
31
|
+
}>>;
|
|
32
|
+
/**
|
|
33
|
+
* Gets a summary of accrued revenue for all configured fee identifiers in a vault
|
|
34
|
+
* @param vault The vault address
|
|
35
|
+
* @returns Promise resolving to a list of fee identifiers and their accrued amounts
|
|
36
|
+
*/
|
|
37
|
+
getVaultRevenueSummary(vault: Address): Promise<SteerResponse<{
|
|
38
|
+
feeIdentifier: string;
|
|
39
|
+
amount0: bigint;
|
|
40
|
+
amount1: bigint;
|
|
41
|
+
}[]>>;
|
|
22
42
|
}
|
|
23
43
|
//# sourceMappingURL=FeeManagerClient.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FeeManagerClient.d.ts","sourceRoot":"","sources":["../../../src/base/FeeManagerClient.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,OAAO,EACZ,KAAK,IAAI,EACT,KAAK,YAAY,EACjB,KAAK,YAAY,EAElB,MAAM,MAAM,CAAC;AACd,OAAO,KAAK,EACV,6BAA6B,EAC7B,GAAG,EACH,sBAAsB,EACtB,mBAAmB,EACnB,2BAA2B,EAC3B,6BAA6B,EAC7B,aAAa,EACd,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"FeeManagerClient.d.ts","sourceRoot":"","sources":["../../../src/base/FeeManagerClient.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,OAAO,EACZ,KAAK,IAAI,EACT,KAAK,YAAY,EACjB,KAAK,YAAY,EAElB,MAAM,MAAM,CAAC;AACd,OAAO,KAAK,EACV,6BAA6B,EAC7B,GAAG,EACH,sBAAsB,EACtB,mBAAmB,EACnB,2BAA2B,EAC3B,6BAA6B,EAC7B,aAAa,EACd,MAAM,aAAa,CAAC;AAGrB,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAErD,qBAAa,gBAAiB,SAAQ,cAAc;IAClD,SAAS,CAAC,QAAQ,CAAC,YAAY,EAAE,YAAY,CAAC;IAC9C,SAAS,CAAC,QAAQ,CAAC,YAAY,EAAE,YAAY,CAAC;IAC9C,SAAS,CAAC,QAAQ,CAAC,iBAAiB,EAAE,OAAO,CAAC;gBAElC,iBAAiB,EAAE,OAAO,EAAE,YAAY,EAAE,YAAY,EAAE,YAAY,EAAE,YAAY;IAOjF,OAAO,CAAC,KAAK,EAAE,OAAO,GAAG,OAAO,CAAC,aAAa,CAAC,GAAG,EAAE,CAAC,CAAC;IAwBtD,YAAY,CAAC,KAAK,EAAE,OAAO,GAAG,OAAO,CAAC,aAAa,CAAC,MAAM,CAAC,CAAC;IAwB5D,aAAa,CACxB,KAAK,EAAE,OAAO,EACd,aAAa,EAAE,MAAM,GACpB,OAAO,CAAC,aAAa,CAAC,OAAO,CAAC,CAAC;IAwBrB,uBAAuB,IAAI,OAAO,CAAC,aAAa,CAAC,OAAO,CAAC,CAAC;IA4B1D,4BAA4B,CACvC,KAAK,EAAE,OAAO,EACd,aAAa,EAAE,MAAM,GACpB,OAAO,CAAC,aAAa,CAAC,OAAO,CAAC,CAAC;IA6BrB,6BAA6B,CACxC,MAAM,EAAE,sBAAsB,GAC7B,OAAO,CAAC,aAAa,CAAC,IAAI,CAAC,CAAC;IAyDlB,oCAAoC,CAC/C,MAAM,EAAE,6BAA6B,GACpC,OAAO,CAAC,aAAa,CAAC,IAAI,CAAC,CAAC;IA+DlB,0CAA0C,IAAI,OAAO,CAAC,aAAa,CAAC,IAAI,CAAC,CAAC;IA6C1E,YAAY,CAAC,KAAK,EAAE,OAAO,EAAE,YAAY,EAAE,MAAM,GAAG,OAAO,CAAC,aAAa,CAAC,IAAI,CAAC,CAAC;IA6ChF,mBAAmB,CAC9B,KAAK,EAAE,OAAO,EACd,aAAa,EAAE,MAAM,EACrB,aAAa,EAAE,OAAO,GACrB,OAAO,CAAC,aAAa,CAAC,IAAI,CAAC,CAAC;IA6ClB,WAAW,CAAC,MAAM,EAAE,mBAAmB,GAAG,OAAO,CAAC,aAAa,CAAC,IAAI,CAAC,CAAC;IAgDtE,oBAAoB,CAC/B,MAAM,EAAE,2BAA2B,GAClC,OAAO,CAAC,aAAa,CAAC,IAAI,CAAC,CAAC;IA2DlB,8BAA8B,CACzC,MAAM,EAAE,6BAA6B,GACpC,OAAO,CAAC,aAAa,CAAC,IAAI,CAAC,CAAC;IA4E/B;;;;;OAKG;IACU,iBAAiB,CAC5B,KAAK,EAAE,OAAO,EACd,aAAa,EAAE,MAAM,GACpB,OAAO,CAAC,aAAa,CAAC;QAAE,OAAO,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IAgC/D;;;;OAIG;IACU,sBAAsB,CACjC,KAAK,EAAE,OAAO,GACb,OAAO,CAAC,aAAa,CAAC;QAAE,aAAa,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,MAAM,CAAA;KAAE,EAAE,CAAC,CAAC;CAgCzF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/const/abis/index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAC;AAC3B,cAAc,aAAa,CAAC;AAC5B,cAAc,cAAc,CAAC;AAC7B,cAAc,yBAAyB,CAAC;AACxC,cAAc,kBAAkB,CAAC;AACjC,cAAc,aAAa,CAAC;AAC5B,cAAc,iBAAiB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/const/abis/index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAC;AAC3B,cAAc,aAAa,CAAC;AAC5B,cAAc,cAAc,CAAC;AAC7B,cAAc,yBAAyB,CAAC;AACxC,cAAc,kBAAkB,CAAC;AACjC,cAAc,aAAa,CAAC;AAC5B,cAAc,iBAAiB,CAAC;AAChC,cAAc,gBAAgB,CAAC"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
export declare const VAULT_FEES_ABI: readonly [{
|
|
2
|
+
readonly inputs: readonly [{
|
|
3
|
+
readonly internalType: "string";
|
|
4
|
+
readonly name: "feeIdentifier";
|
|
5
|
+
readonly type: "string";
|
|
6
|
+
}];
|
|
7
|
+
readonly name: "accruedFees0";
|
|
8
|
+
readonly outputs: readonly [{
|
|
9
|
+
readonly internalType: "uint256";
|
|
10
|
+
readonly name: "";
|
|
11
|
+
readonly type: "uint256";
|
|
12
|
+
}];
|
|
13
|
+
readonly stateMutability: "view";
|
|
14
|
+
readonly type: "function";
|
|
15
|
+
}, {
|
|
16
|
+
readonly inputs: readonly [{
|
|
17
|
+
readonly internalType: "string";
|
|
18
|
+
readonly name: "feeIdentifier";
|
|
19
|
+
readonly type: "string";
|
|
20
|
+
}];
|
|
21
|
+
readonly name: "accruedFees1";
|
|
22
|
+
readonly outputs: readonly [{
|
|
23
|
+
readonly internalType: "uint256";
|
|
24
|
+
readonly name: "";
|
|
25
|
+
readonly type: "uint256";
|
|
26
|
+
}];
|
|
27
|
+
readonly stateMutability: "view";
|
|
28
|
+
readonly type: "function";
|
|
29
|
+
}];
|
|
30
|
+
//# sourceMappingURL=vaultFees.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"vaultFees.d.ts","sourceRoot":"","sources":["../../../../src/const/abis/vaultFees.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAuCjB,CAAC"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { Chain } from './chain.js';
|
|
2
|
+
import { type NetworkConfig } from './network.js';
|
|
3
|
+
import { type ProtocolDetails } from './amm/utils/protocol.js';
|
|
4
|
+
export type SupportedChainsFeature = 'subgraph' | 'deployments' | 'protocols' | 'singleAssetDeposit';
|
|
5
|
+
export type SupportedChainsInclude = {
|
|
6
|
+
subgraph?: boolean;
|
|
7
|
+
deployments?: boolean;
|
|
8
|
+
protocols?: boolean;
|
|
9
|
+
singleAssetDeposit?: boolean;
|
|
10
|
+
};
|
|
11
|
+
export type GetSupportedChainsOptions = {
|
|
12
|
+
theGraphApiKey?: string;
|
|
13
|
+
include?: SupportedChainsInclude;
|
|
14
|
+
filter?: {
|
|
15
|
+
feature?: SupportedChainsFeature;
|
|
16
|
+
};
|
|
17
|
+
};
|
|
18
|
+
export type SupportedChainFeatures = {
|
|
19
|
+
subgraph: boolean;
|
|
20
|
+
deployments: boolean;
|
|
21
|
+
protocols: boolean;
|
|
22
|
+
singleAssetDeposit: boolean;
|
|
23
|
+
};
|
|
24
|
+
export type SupportedChain = {
|
|
25
|
+
schemaVersion: 1;
|
|
26
|
+
chain: Chain;
|
|
27
|
+
chainId: number;
|
|
28
|
+
features: SupportedChainFeatures;
|
|
29
|
+
subgraphUrl?: string;
|
|
30
|
+
deployments?: NetworkConfig;
|
|
31
|
+
protocols?: ProtocolDetails[];
|
|
32
|
+
};
|
|
33
|
+
export declare function getSupportedChains(options?: GetSupportedChainsOptions): SupportedChain[];
|
|
34
|
+
export declare function getSupportedChainIds(options?: GetSupportedChainsOptions): number[];
|
|
35
|
+
export declare function getSupportedChainByChainId(chainId: number, options?: Omit<GetSupportedChainsOptions, 'filter'>): SupportedChain | undefined;
|
|
36
|
+
//# sourceMappingURL=capabilities.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"capabilities.d.ts","sourceRoot":"","sources":["../../../src/const/capabilities.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAW,MAAM,YAAY,CAAC;AAE5C,OAAO,EAA2C,KAAK,aAAa,EAAE,MAAM,cAAc,CAAC;AAC3F,OAAO,EAA4B,KAAK,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAEzF,MAAM,MAAM,sBAAsB,GAC9B,UAAU,GACV,aAAa,GACb,WAAW,GACX,oBAAoB,CAAC;AAEzB,MAAM,MAAM,sBAAsB,GAAG;IACnC,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,kBAAkB,CAAC,EAAE,OAAO,CAAC;CAC9B,CAAC;AAEF,MAAM,MAAM,yBAAyB,GAAG;IACtC,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,OAAO,CAAC,EAAE,sBAAsB,CAAC;IACjC,MAAM,CAAC,EAAE;QACP,OAAO,CAAC,EAAE,sBAAsB,CAAC;KAClC,CAAC;CACH,CAAC;AAEF,MAAM,MAAM,sBAAsB,GAAG;IACnC,QAAQ,EAAE,OAAO,CAAC;IAClB,WAAW,EAAE,OAAO,CAAC;IACrB,SAAS,EAAE,OAAO,CAAC;IACnB,kBAAkB,EAAE,OAAO,CAAC;CAC7B,CAAC;AAEF,MAAM,MAAM,cAAc,GAAG;IAC3B,aAAa,EAAE,CAAC,CAAC;IACjB,KAAK,EAAE,KAAK,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,EAAE,sBAAsB,CAAC;IACjC,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,WAAW,CAAC,EAAE,aAAa,CAAC;IAC5B,SAAS,CAAC,EAAE,eAAe,EAAE,CAAC;CAC/B,CAAC;AAeF,wBAAgB,kBAAkB,CAAC,OAAO,GAAE,yBAA8B,GAAG,cAAc,EAAE,CA4C5F;AAED,wBAAgB,oBAAoB,CAAC,OAAO,GAAE,yBAA8B,GAAG,MAAM,EAAE,CAEtF;AAED,wBAAgB,0BAA0B,CACxC,OAAO,EAAE,MAAM,EACf,OAAO,GAAE,IAAI,CAAC,yBAAyB,EAAE,QAAQ,CAAM,GACtD,cAAc,GAAG,SAAS,CAK5B"}
|
|
@@ -7,6 +7,7 @@ export * from './api.js';
|
|
|
7
7
|
export * from './abis/index.js';
|
|
8
8
|
export * from './amm/index.js';
|
|
9
9
|
export * from './deployments/index.js';
|
|
10
|
+
export * from './capabilities.js';
|
|
10
11
|
export * from './quoter.js';
|
|
11
12
|
export * from './stabilityVaults/index.js';
|
|
12
13
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/const/index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAC;AAC3B,cAAc,cAAc,CAAC;AAC7B,cAAc,eAAe,CAAC;AAC9B,cAAc,eAAe,CAAC;AAC9B,cAAc,eAAe,CAAC;AAC9B,cAAc,UAAU,CAAC;AACzB,cAAc,iBAAiB,CAAC;AAChC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,wBAAwB,CAAC;AACvC,cAAc,aAAa,CAAC;AAC5B,cAAc,4BAA4B,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/const/index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAC;AAC3B,cAAc,cAAc,CAAC;AAC7B,cAAc,eAAe,CAAC;AAC9B,cAAc,eAAe,CAAC;AAC9B,cAAc,eAAe,CAAC;AAC9B,cAAc,UAAU,CAAC;AACzB,cAAc,iBAAiB,CAAC;AAChC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,wBAAwB,CAAC;AACvC,cAAc,mBAAmB,CAAC;AAClC,cAAc,aAAa,CAAC;AAC5B,cAAc,4BAA4B,CAAC"}
|