@wardenswap/bestrate-sdk-beta 2.11.0 → 2.12.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/dist/index.d.ts +107 -35
- package/dist/index.es.d.ts +107 -35
- package/dist/index.es.js +1 -1
- package/dist/index.js +1 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
@@ -293,46 +293,71 @@ interface Multicall2 extends BaseContract {
|
|
293
293
|
};
|
294
294
|
}
|
295
295
|
|
296
|
+
type Params = {
|
297
|
+
alpha: bigint;
|
298
|
+
beta: bigint;
|
299
|
+
c: bigint;
|
300
|
+
s: bigint;
|
301
|
+
lambda: bigint;
|
302
|
+
};
|
303
|
+
type DerivedParams = {
|
304
|
+
tauAlpha: Vector2;
|
305
|
+
tauBeta: Vector2;
|
306
|
+
u: bigint;
|
307
|
+
v: bigint;
|
308
|
+
w: bigint;
|
309
|
+
z: bigint;
|
310
|
+
dSq: bigint;
|
311
|
+
};
|
312
|
+
type Vector2 = {
|
313
|
+
x: bigint;
|
314
|
+
y: bigint;
|
315
|
+
};
|
316
|
+
|
296
317
|
declare enum DexModel {
|
297
318
|
UniswapV2 = 0,
|
298
319
|
UniswapV3 = 1,
|
299
320
|
PancakeV3 = 2,
|
300
321
|
VelodromeSS = 3,
|
301
322
|
AlgebraV1CL = 4,
|
302
|
-
|
303
|
-
|
304
|
-
|
305
|
-
|
306
|
-
|
307
|
-
|
308
|
-
|
309
|
-
|
310
|
-
|
311
|
-
|
312
|
-
|
313
|
-
|
314
|
-
|
315
|
-
|
316
|
-
|
317
|
-
|
318
|
-
|
319
|
-
|
320
|
-
|
321
|
-
|
322
|
-
|
323
|
-
|
324
|
-
|
325
|
-
|
326
|
-
|
327
|
-
|
328
|
-
|
329
|
-
|
330
|
-
|
331
|
-
|
332
|
-
|
333
|
-
|
334
|
-
|
335
|
-
|
323
|
+
SolidlyV3 = 5,
|
324
|
+
DMM = 6,
|
325
|
+
CurvePlain = 7,
|
326
|
+
CurveMeta = 8,
|
327
|
+
CurvePlainSol = 9,
|
328
|
+
Iron = 10,
|
329
|
+
Synapse = 11,
|
330
|
+
CurveMetaSol = 12,
|
331
|
+
CurveCrypto = 13,
|
332
|
+
CurveTriCryptoNG = 14,
|
333
|
+
CurveStableNG = 15,
|
334
|
+
CurveLendingA = 16,
|
335
|
+
CurveLendingCryptoZap = 17,
|
336
|
+
CurveLendingCryptoTwoZap = 18,
|
337
|
+
CurveLido = 19,
|
338
|
+
PolyDex = 20,
|
339
|
+
FireBirdWeighted = 21,
|
340
|
+
BalancerWeighted = 22,
|
341
|
+
BalancerStable = 23,
|
342
|
+
BalancerComposableStableV6 = 24,
|
343
|
+
BalancerWeightedV4 = 25,
|
344
|
+
BalancerGyroECLP = 26,
|
345
|
+
BalancerMetaStable = 27,
|
346
|
+
BalancerBoostedStable = 28,
|
347
|
+
BalancerLinear = 29,
|
348
|
+
BalancerLiquidityBootstrapping = 30,
|
349
|
+
Biswap = 31,
|
350
|
+
DodoV1 = 32,
|
351
|
+
DodoV2 = 33,
|
352
|
+
Mdex = 34,
|
353
|
+
Mars = 35,
|
354
|
+
Smoothy = 36,
|
355
|
+
Shibaswap = 37,
|
356
|
+
GmxDex = 38,
|
357
|
+
Solidly = 39,
|
358
|
+
VelodromeV2 = 40,
|
359
|
+
Synthetix = 41,
|
360
|
+
Unknown = 42
|
336
361
|
}
|
337
362
|
interface UniswapV2BasedModelInfo {
|
338
363
|
model: DexModel.UniswapV2 | DexModel.Mdex | DexModel.Biswap | DexModel.Mars | DexModel.Shibaswap;
|
@@ -349,6 +374,10 @@ interface UniswapV3ModelInfo extends Omit<UniswapV2BasedModelInfo, 'model' | 'fe
|
|
349
374
|
gasPerInitializedTick: bigint;
|
350
375
|
gasPerTick: bigint;
|
351
376
|
}
|
377
|
+
interface SolidlyV3ModelInfo extends Omit<UniswapV3ModelInfo, 'model' | 'fee'> {
|
378
|
+
model: DexModel.SolidlyV3;
|
379
|
+
tickSpacing: bigint;
|
380
|
+
}
|
352
381
|
interface AlgebraV1CLModelInfo extends Omit<UniswapV3ModelInfo, 'model' | 'fee' | 'feePrecision' | 'factory'> {
|
353
382
|
model: DexModel.AlgebraV1CL;
|
354
383
|
poolDeployer: string;
|
@@ -457,8 +486,14 @@ interface BalancerWeightedModelInfo extends Omit<BalancerStableModelInfo, 'model
|
|
457
486
|
interface BalancerStableModelInfo {
|
458
487
|
model: DexModel.BalancerStable;
|
459
488
|
tokens: string[];
|
489
|
+
/**
|
490
|
+
* Calculated from 1e18 * 10^(18-decimals)
|
491
|
+
*/
|
460
492
|
scalingFactors: bigint[];
|
461
493
|
vaultContract: string;
|
494
|
+
/**
|
495
|
+
* Get from getPoolId() of pool contract
|
496
|
+
*/
|
462
497
|
poolId: string;
|
463
498
|
aPrecision: bigint;
|
464
499
|
depositAddress: string;
|
@@ -485,6 +520,43 @@ interface BalancerMetaStableModelInfo extends Omit<BalancerStableModelInfo, 'mod
|
|
485
520
|
rateProviders: string[];
|
486
521
|
multicall: string;
|
487
522
|
}
|
523
|
+
interface BalancerComposableStableModelInfo extends Omit<BalancerStableModelInfo, 'model' | 'aPrecision'> {
|
524
|
+
model: DexModel.BalancerComposableStableV6;
|
525
|
+
/**
|
526
|
+
* BPT token index
|
527
|
+
* Get from getBptIndex() at pool contract
|
528
|
+
*/
|
529
|
+
bptIndex: number;
|
530
|
+
/**
|
531
|
+
* Rate providers, zero means no providers
|
532
|
+
* Get from getRateProviders() at pool contract
|
533
|
+
*/
|
534
|
+
rateProviders: string[];
|
535
|
+
multicall: string;
|
536
|
+
/**
|
537
|
+
* A flag whether exempt from yield protocol fee
|
538
|
+
* Get from isExemptFromYieldProtocolFee() at pool contract
|
539
|
+
*/
|
540
|
+
isExemptFromYieldProtocolFee: boolean;
|
541
|
+
/**
|
542
|
+
* A flag whether protocol swap fee delegation
|
543
|
+
* Get from getProtocolSwapFeeDelegation() at pool contract
|
544
|
+
*/
|
545
|
+
isProtocolSwapFeeDelegation: boolean;
|
546
|
+
/**
|
547
|
+
* Maximum protocol's swap fee percentage
|
548
|
+
* Get from _MAX_PROTOCOL_SWAP_FEE_PERCENTAGE at ComposableStablePoolFactory.getProtocolFeePercenragesProvider
|
549
|
+
*/
|
550
|
+
maxProtocolSwapFeePercentage: bigint;
|
551
|
+
}
|
552
|
+
interface BalancerWeightedV4ModelInfo extends Omit<BalancerWeightedModelInfo, 'model'> {
|
553
|
+
model: DexModel.BalancerWeightedV4;
|
554
|
+
}
|
555
|
+
interface BalancerGyroECLPModelInfo extends Omit<BalancerWeightedModelInfo, 'model'> {
|
556
|
+
model: DexModel.BalancerGyroECLP;
|
557
|
+
params: Params;
|
558
|
+
derivedParams: DerivedParams;
|
559
|
+
}
|
488
560
|
interface DodoV2ModelInfo {
|
489
561
|
model: DexModel.DodoV2 | DexModel.DodoV1;
|
490
562
|
factoryContract: string;
|
@@ -537,7 +609,7 @@ interface RouteInfo {
|
|
537
609
|
type RouteInfoModel = RouteInfo & {
|
538
610
|
gas: bigint;
|
539
611
|
isTradingAllowed: boolean;
|
540
|
-
} & (UniswapV2BasedModelInfo | UniswapV3ModelInfo | PancakeV3ModelInfo | VelodromeSSModelInfo | AlgebraV1CLModelInfo | CurvePlainModelInfo | CurvePlainNGModelInfo | CurveMetaModelInfo | CurveCryptoModelInfo | CurveCryptoNGModelInfo | CurveCryptoZapModelInfo | CurveCryptoTwoZapModelInfo | CurveLendingModelInfo | CurveLidoModelInfo | DodoV2ModelInfo | SmoothyModelInfo | DMMModelInfo | BalancerWeightedModelInfo | BalancerStableModelInfo | BalancerMetaStableModelInfo | BalancerBoostedStableModelInfo | BalancerLinearModelInfo | PolyDexModelInfo | GmxDexModelInfo | SolidlyModelInfo | VelodromeV2ModelInfo | SynthetixModelInfo | {
|
612
|
+
} & (UniswapV2BasedModelInfo | UniswapV3ModelInfo | PancakeV3ModelInfo | VelodromeSSModelInfo | AlgebraV1CLModelInfo | SolidlyV3ModelInfo | CurvePlainModelInfo | CurvePlainNGModelInfo | CurveMetaModelInfo | CurveCryptoModelInfo | CurveCryptoNGModelInfo | CurveCryptoZapModelInfo | CurveCryptoTwoZapModelInfo | CurveLendingModelInfo | CurveLidoModelInfo | DodoV2ModelInfo | SmoothyModelInfo | DMMModelInfo | BalancerWeightedModelInfo | BalancerStableModelInfo | BalancerMetaStableModelInfo | BalancerBoostedStableModelInfo | BalancerLinearModelInfo | BalancerComposableStableModelInfo | BalancerWeightedV4ModelInfo | BalancerGyroECLPModelInfo | PolyDexModelInfo | GmxDexModelInfo | SolidlyModelInfo | VelodromeV2ModelInfo | SynthetixModelInfo | {
|
541
613
|
model: DexModel.Unknown;
|
542
614
|
});
|
543
615
|
|
package/dist/index.es.d.ts
CHANGED
@@ -293,46 +293,71 @@ interface Multicall2 extends BaseContract {
|
|
293
293
|
};
|
294
294
|
}
|
295
295
|
|
296
|
+
type Params = {
|
297
|
+
alpha: bigint;
|
298
|
+
beta: bigint;
|
299
|
+
c: bigint;
|
300
|
+
s: bigint;
|
301
|
+
lambda: bigint;
|
302
|
+
};
|
303
|
+
type DerivedParams = {
|
304
|
+
tauAlpha: Vector2;
|
305
|
+
tauBeta: Vector2;
|
306
|
+
u: bigint;
|
307
|
+
v: bigint;
|
308
|
+
w: bigint;
|
309
|
+
z: bigint;
|
310
|
+
dSq: bigint;
|
311
|
+
};
|
312
|
+
type Vector2 = {
|
313
|
+
x: bigint;
|
314
|
+
y: bigint;
|
315
|
+
};
|
316
|
+
|
296
317
|
declare enum DexModel {
|
297
318
|
UniswapV2 = 0,
|
298
319
|
UniswapV3 = 1,
|
299
320
|
PancakeV3 = 2,
|
300
321
|
VelodromeSS = 3,
|
301
322
|
AlgebraV1CL = 4,
|
302
|
-
|
303
|
-
|
304
|
-
|
305
|
-
|
306
|
-
|
307
|
-
|
308
|
-
|
309
|
-
|
310
|
-
|
311
|
-
|
312
|
-
|
313
|
-
|
314
|
-
|
315
|
-
|
316
|
-
|
317
|
-
|
318
|
-
|
319
|
-
|
320
|
-
|
321
|
-
|
322
|
-
|
323
|
-
|
324
|
-
|
325
|
-
|
326
|
-
|
327
|
-
|
328
|
-
|
329
|
-
|
330
|
-
|
331
|
-
|
332
|
-
|
333
|
-
|
334
|
-
|
335
|
-
|
323
|
+
SolidlyV3 = 5,
|
324
|
+
DMM = 6,
|
325
|
+
CurvePlain = 7,
|
326
|
+
CurveMeta = 8,
|
327
|
+
CurvePlainSol = 9,
|
328
|
+
Iron = 10,
|
329
|
+
Synapse = 11,
|
330
|
+
CurveMetaSol = 12,
|
331
|
+
CurveCrypto = 13,
|
332
|
+
CurveTriCryptoNG = 14,
|
333
|
+
CurveStableNG = 15,
|
334
|
+
CurveLendingA = 16,
|
335
|
+
CurveLendingCryptoZap = 17,
|
336
|
+
CurveLendingCryptoTwoZap = 18,
|
337
|
+
CurveLido = 19,
|
338
|
+
PolyDex = 20,
|
339
|
+
FireBirdWeighted = 21,
|
340
|
+
BalancerWeighted = 22,
|
341
|
+
BalancerStable = 23,
|
342
|
+
BalancerComposableStableV6 = 24,
|
343
|
+
BalancerWeightedV4 = 25,
|
344
|
+
BalancerGyroECLP = 26,
|
345
|
+
BalancerMetaStable = 27,
|
346
|
+
BalancerBoostedStable = 28,
|
347
|
+
BalancerLinear = 29,
|
348
|
+
BalancerLiquidityBootstrapping = 30,
|
349
|
+
Biswap = 31,
|
350
|
+
DodoV1 = 32,
|
351
|
+
DodoV2 = 33,
|
352
|
+
Mdex = 34,
|
353
|
+
Mars = 35,
|
354
|
+
Smoothy = 36,
|
355
|
+
Shibaswap = 37,
|
356
|
+
GmxDex = 38,
|
357
|
+
Solidly = 39,
|
358
|
+
VelodromeV2 = 40,
|
359
|
+
Synthetix = 41,
|
360
|
+
Unknown = 42
|
336
361
|
}
|
337
362
|
interface UniswapV2BasedModelInfo {
|
338
363
|
model: DexModel.UniswapV2 | DexModel.Mdex | DexModel.Biswap | DexModel.Mars | DexModel.Shibaswap;
|
@@ -349,6 +374,10 @@ interface UniswapV3ModelInfo extends Omit<UniswapV2BasedModelInfo, 'model' | 'fe
|
|
349
374
|
gasPerInitializedTick: bigint;
|
350
375
|
gasPerTick: bigint;
|
351
376
|
}
|
377
|
+
interface SolidlyV3ModelInfo extends Omit<UniswapV3ModelInfo, 'model' | 'fee'> {
|
378
|
+
model: DexModel.SolidlyV3;
|
379
|
+
tickSpacing: bigint;
|
380
|
+
}
|
352
381
|
interface AlgebraV1CLModelInfo extends Omit<UniswapV3ModelInfo, 'model' | 'fee' | 'feePrecision' | 'factory'> {
|
353
382
|
model: DexModel.AlgebraV1CL;
|
354
383
|
poolDeployer: string;
|
@@ -457,8 +486,14 @@ interface BalancerWeightedModelInfo extends Omit<BalancerStableModelInfo, 'model
|
|
457
486
|
interface BalancerStableModelInfo {
|
458
487
|
model: DexModel.BalancerStable;
|
459
488
|
tokens: string[];
|
489
|
+
/**
|
490
|
+
* Calculated from 1e18 * 10^(18-decimals)
|
491
|
+
*/
|
460
492
|
scalingFactors: bigint[];
|
461
493
|
vaultContract: string;
|
494
|
+
/**
|
495
|
+
* Get from getPoolId() of pool contract
|
496
|
+
*/
|
462
497
|
poolId: string;
|
463
498
|
aPrecision: bigint;
|
464
499
|
depositAddress: string;
|
@@ -485,6 +520,43 @@ interface BalancerMetaStableModelInfo extends Omit<BalancerStableModelInfo, 'mod
|
|
485
520
|
rateProviders: string[];
|
486
521
|
multicall: string;
|
487
522
|
}
|
523
|
+
interface BalancerComposableStableModelInfo extends Omit<BalancerStableModelInfo, 'model' | 'aPrecision'> {
|
524
|
+
model: DexModel.BalancerComposableStableV6;
|
525
|
+
/**
|
526
|
+
* BPT token index
|
527
|
+
* Get from getBptIndex() at pool contract
|
528
|
+
*/
|
529
|
+
bptIndex: number;
|
530
|
+
/**
|
531
|
+
* Rate providers, zero means no providers
|
532
|
+
* Get from getRateProviders() at pool contract
|
533
|
+
*/
|
534
|
+
rateProviders: string[];
|
535
|
+
multicall: string;
|
536
|
+
/**
|
537
|
+
* A flag whether exempt from yield protocol fee
|
538
|
+
* Get from isExemptFromYieldProtocolFee() at pool contract
|
539
|
+
*/
|
540
|
+
isExemptFromYieldProtocolFee: boolean;
|
541
|
+
/**
|
542
|
+
* A flag whether protocol swap fee delegation
|
543
|
+
* Get from getProtocolSwapFeeDelegation() at pool contract
|
544
|
+
*/
|
545
|
+
isProtocolSwapFeeDelegation: boolean;
|
546
|
+
/**
|
547
|
+
* Maximum protocol's swap fee percentage
|
548
|
+
* Get from _MAX_PROTOCOL_SWAP_FEE_PERCENTAGE at ComposableStablePoolFactory.getProtocolFeePercenragesProvider
|
549
|
+
*/
|
550
|
+
maxProtocolSwapFeePercentage: bigint;
|
551
|
+
}
|
552
|
+
interface BalancerWeightedV4ModelInfo extends Omit<BalancerWeightedModelInfo, 'model'> {
|
553
|
+
model: DexModel.BalancerWeightedV4;
|
554
|
+
}
|
555
|
+
interface BalancerGyroECLPModelInfo extends Omit<BalancerWeightedModelInfo, 'model'> {
|
556
|
+
model: DexModel.BalancerGyroECLP;
|
557
|
+
params: Params;
|
558
|
+
derivedParams: DerivedParams;
|
559
|
+
}
|
488
560
|
interface DodoV2ModelInfo {
|
489
561
|
model: DexModel.DodoV2 | DexModel.DodoV1;
|
490
562
|
factoryContract: string;
|
@@ -537,7 +609,7 @@ interface RouteInfo {
|
|
537
609
|
type RouteInfoModel = RouteInfo & {
|
538
610
|
gas: bigint;
|
539
611
|
isTradingAllowed: boolean;
|
540
|
-
} & (UniswapV2BasedModelInfo | UniswapV3ModelInfo | PancakeV3ModelInfo | VelodromeSSModelInfo | AlgebraV1CLModelInfo | CurvePlainModelInfo | CurvePlainNGModelInfo | CurveMetaModelInfo | CurveCryptoModelInfo | CurveCryptoNGModelInfo | CurveCryptoZapModelInfo | CurveCryptoTwoZapModelInfo | CurveLendingModelInfo | CurveLidoModelInfo | DodoV2ModelInfo | SmoothyModelInfo | DMMModelInfo | BalancerWeightedModelInfo | BalancerStableModelInfo | BalancerMetaStableModelInfo | BalancerBoostedStableModelInfo | BalancerLinearModelInfo | PolyDexModelInfo | GmxDexModelInfo | SolidlyModelInfo | VelodromeV2ModelInfo | SynthetixModelInfo | {
|
612
|
+
} & (UniswapV2BasedModelInfo | UniswapV3ModelInfo | PancakeV3ModelInfo | VelodromeSSModelInfo | AlgebraV1CLModelInfo | SolidlyV3ModelInfo | CurvePlainModelInfo | CurvePlainNGModelInfo | CurveMetaModelInfo | CurveCryptoModelInfo | CurveCryptoNGModelInfo | CurveCryptoZapModelInfo | CurveCryptoTwoZapModelInfo | CurveLendingModelInfo | CurveLidoModelInfo | DodoV2ModelInfo | SmoothyModelInfo | DMMModelInfo | BalancerWeightedModelInfo | BalancerStableModelInfo | BalancerMetaStableModelInfo | BalancerBoostedStableModelInfo | BalancerLinearModelInfo | BalancerComposableStableModelInfo | BalancerWeightedV4ModelInfo | BalancerGyroECLPModelInfo | PolyDexModelInfo | GmxDexModelInfo | SolidlyModelInfo | VelodromeV2ModelInfo | SynthetixModelInfo | {
|
541
613
|
model: DexModel.Unknown;
|
542
614
|
});
|
543
615
|
|