@steerprotocol/sdk 3.0.27 → 3.1.0-test-archived-subgraph-support.1
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.browser.mjs +44 -68
- package/dist/index.browser.mjs.map +1 -1
- package/dist/index.cjs +23387 -74
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.mts +416 -10
- package/dist/index.d.mts.map +1 -1
- package/dist/index.mjs +23389 -74
- package/dist/index.mjs.map +1 -1
- package/package.json +3 -3
package/dist/index.d.mts
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import * as _$viem from "viem";
|
|
2
2
|
import { Address, Client, Hash, PublicClient, TestClient, WalletClient } from "viem";
|
|
3
3
|
import { Campaign, createClient } from "@steerprotocol/api-sdk";
|
|
4
|
-
import { Pool } from "@uniswap/v3-sdk";
|
|
5
4
|
import { Decimal } from "decimal.js";
|
|
6
5
|
|
|
7
6
|
//#region src/utils/subgraph-types.d.ts
|
|
@@ -310,9 +309,7 @@ declare enum MultiPositionManagers {
|
|
|
310
309
|
MultiPositionHenjinAlgebraHook = "HenjinIntegralHook",
|
|
311
310
|
MultiPositionHydrex = "MultiPositionHydrex",
|
|
312
311
|
MultiPositionBittensorUniV3 = "MultiPositionBittensorUniV3",
|
|
313
|
-
MultiPositionReserveV4 = "MultiPositionReserveV4"
|
|
314
|
-
TestCypherAlgebraIntegralHook = "TestCypherAlgebraIntegralHook",
|
|
315
|
-
TestQuickswapAlgebraIntegralHook = "TestQuickswapAlgebraIntegralHook"
|
|
312
|
+
MultiPositionReserveV4 = "MultiPositionReserveV4"
|
|
316
313
|
}
|
|
317
314
|
declare const AlgebgraHookBeacons: MultiPositionManagers[];
|
|
318
315
|
declare const UniswapHookBeacons: MultiPositionManagers[];
|
|
@@ -585,7 +582,6 @@ type ProtocolInfo = {
|
|
|
585
582
|
EntryPointAddress?: Partial<{ [chain in Chain]: string }>;
|
|
586
583
|
beaconAlgebraHook?: string;
|
|
587
584
|
algebraHookSupportedChains?: Chain[];
|
|
588
|
-
algebraHookBeaconsByChain?: Partial<{ [chain in Chain]: string[] }>;
|
|
589
585
|
};
|
|
590
586
|
type AMMConfigType = Partial<{ [protocol in SupportedProtocol]: ProtocolInfo }>;
|
|
591
587
|
interface Fee {
|
|
@@ -745,11 +741,6 @@ interface NetworkData {
|
|
|
745
741
|
* URL for accessing deprecated bundle information
|
|
746
742
|
*/
|
|
747
743
|
declare const deprecatedBundlesURL = "https://api.steer.finance/deprecated-bundles";
|
|
748
|
-
/**
|
|
749
|
-
* Configuration mapping of supported chains to their respective subgraph endpoints.
|
|
750
|
-
* Each chain has a dedicated subgraph URL for querying protocol data.
|
|
751
|
-
* Updated each chains for ormi and thegraph
|
|
752
|
-
*/
|
|
753
744
|
declare const steerSubgraphConfig: { [protocol in SteerSupportedChains]: string };
|
|
754
745
|
/**
|
|
755
746
|
* Retrieves the subgraph URL for a given chain ID.
|
|
@@ -8554,6 +8545,421 @@ interface PoolSlot0 {
|
|
|
8554
8545
|
unlocked: boolean;
|
|
8555
8546
|
}
|
|
8556
8547
|
//#endregion
|
|
8548
|
+
//#region node_modules/jsbi/jsbi.d.ts
|
|
8549
|
+
declare class JSBI {
|
|
8550
|
+
private constructor(length: number, sign: boolean);
|
|
8551
|
+
private length: number;
|
|
8552
|
+
private sign: boolean;
|
|
8553
|
+
static BigInt(from: number | string | boolean | object): JSBI;
|
|
8554
|
+
toString(radix?: number): string;
|
|
8555
|
+
static toNumber(x: JSBI): number;
|
|
8556
|
+
static unaryMinus(x: JSBI): JSBI;
|
|
8557
|
+
static bitwiseNot(x: JSBI): JSBI;
|
|
8558
|
+
static exponentiate(x: JSBI, y: JSBI): JSBI;
|
|
8559
|
+
static multiply(x: JSBI, y: JSBI): JSBI;
|
|
8560
|
+
static divide(x: JSBI, y: JSBI): JSBI;
|
|
8561
|
+
static remainder(x: JSBI, y: JSBI): JSBI;
|
|
8562
|
+
static add(x: JSBI, y: JSBI): JSBI;
|
|
8563
|
+
static subtract(x: JSBI, y: JSBI): JSBI;
|
|
8564
|
+
static leftShift(x: JSBI, y: JSBI): JSBI;
|
|
8565
|
+
static signedRightShift(x: JSBI, y: JSBI): JSBI;
|
|
8566
|
+
static lessThan(x: JSBI, y: JSBI): boolean;
|
|
8567
|
+
static lessThanOrEqual(x: JSBI, y: JSBI): boolean;
|
|
8568
|
+
static greaterThan(x: JSBI, y: JSBI): boolean;
|
|
8569
|
+
static greaterThanOrEqual(x: JSBI, y: JSBI): boolean;
|
|
8570
|
+
static equal(x: JSBI, y: JSBI): boolean;
|
|
8571
|
+
static notEqual(x: JSBI, y: JSBI): boolean;
|
|
8572
|
+
static bitwiseAnd(x: JSBI, y: JSBI): JSBI;
|
|
8573
|
+
static bitwiseXor(x: JSBI, y: JSBI): JSBI;
|
|
8574
|
+
static bitwiseOr(x: JSBI, y: JSBI): JSBI;
|
|
8575
|
+
static asIntN(n: number, x: JSBI): JSBI;
|
|
8576
|
+
static asUintN(n: number, x: JSBI): JSBI;
|
|
8577
|
+
static ADD(x: any, y: any): any;
|
|
8578
|
+
static LT(x: any, y: any): boolean;
|
|
8579
|
+
static LE(x: any, y: any): boolean;
|
|
8580
|
+
static GT(x: any, y: any): boolean;
|
|
8581
|
+
static GE(x: any, y: any): boolean;
|
|
8582
|
+
static EQ(x: any, y: any): boolean;
|
|
8583
|
+
static NE(x: any, y: any): boolean;
|
|
8584
|
+
}
|
|
8585
|
+
//#endregion
|
|
8586
|
+
//#region node_modules/@uniswap/v3-sdk/node_modules/@uniswap/sdk-core/dist/constants.d.ts
|
|
8587
|
+
declare type BigintIsh = JSBI | string | number;
|
|
8588
|
+
declare enum Rounding {
|
|
8589
|
+
ROUND_DOWN = 0,
|
|
8590
|
+
ROUND_HALF_UP = 1,
|
|
8591
|
+
ROUND_UP = 2
|
|
8592
|
+
}
|
|
8593
|
+
//#endregion
|
|
8594
|
+
//#region node_modules/@ethersproject/bytes/lib/index.d.ts
|
|
8595
|
+
declare type Bytes = ArrayLike<number>;
|
|
8596
|
+
interface Hexable {
|
|
8597
|
+
toHexString(): string;
|
|
8598
|
+
}
|
|
8599
|
+
//#endregion
|
|
8600
|
+
//#region node_modules/@ethersproject/bignumber/lib/bignumber.d.ts
|
|
8601
|
+
declare type BigNumberish = BigNumber | Bytes | bigint | string | number;
|
|
8602
|
+
declare class BigNumber implements Hexable {
|
|
8603
|
+
readonly _hex: string;
|
|
8604
|
+
readonly _isBigNumber: boolean;
|
|
8605
|
+
constructor(constructorGuard: any, hex: string);
|
|
8606
|
+
fromTwos(value: number): BigNumber;
|
|
8607
|
+
toTwos(value: number): BigNumber;
|
|
8608
|
+
abs(): BigNumber;
|
|
8609
|
+
add(other: BigNumberish): BigNumber;
|
|
8610
|
+
sub(other: BigNumberish): BigNumber;
|
|
8611
|
+
div(other: BigNumberish): BigNumber;
|
|
8612
|
+
mul(other: BigNumberish): BigNumber;
|
|
8613
|
+
mod(other: BigNumberish): BigNumber;
|
|
8614
|
+
pow(other: BigNumberish): BigNumber;
|
|
8615
|
+
and(other: BigNumberish): BigNumber;
|
|
8616
|
+
or(other: BigNumberish): BigNumber;
|
|
8617
|
+
xor(other: BigNumberish): BigNumber;
|
|
8618
|
+
mask(value: number): BigNumber;
|
|
8619
|
+
shl(value: number): BigNumber;
|
|
8620
|
+
shr(value: number): BigNumber;
|
|
8621
|
+
eq(other: BigNumberish): boolean;
|
|
8622
|
+
lt(other: BigNumberish): boolean;
|
|
8623
|
+
lte(other: BigNumberish): boolean;
|
|
8624
|
+
gt(other: BigNumberish): boolean;
|
|
8625
|
+
gte(other: BigNumberish): boolean;
|
|
8626
|
+
isNegative(): boolean;
|
|
8627
|
+
isZero(): boolean;
|
|
8628
|
+
toNumber(): number;
|
|
8629
|
+
toBigInt(): bigint;
|
|
8630
|
+
toString(): string;
|
|
8631
|
+
toHexString(): string;
|
|
8632
|
+
toJSON(key?: string): any;
|
|
8633
|
+
static from(value: any): BigNumber;
|
|
8634
|
+
static isBigNumber(value: any): value is BigNumber;
|
|
8635
|
+
}
|
|
8636
|
+
//#endregion
|
|
8637
|
+
//#region node_modules/@uniswap/v3-sdk/node_modules/@uniswap/sdk-core/dist/entities/token.d.ts
|
|
8638
|
+
/**
|
|
8639
|
+
* Represents an ERC20 token with a unique address and some metadata.
|
|
8640
|
+
*/
|
|
8641
|
+
declare class Token extends BaseCurrency {
|
|
8642
|
+
readonly isNative: false;
|
|
8643
|
+
readonly isToken: true;
|
|
8644
|
+
/**
|
|
8645
|
+
* The contract address on the chain on which this token lives
|
|
8646
|
+
*/
|
|
8647
|
+
readonly address: string;
|
|
8648
|
+
/**
|
|
8649
|
+
* Relevant for fee-on-transfer (FOT) token taxes,
|
|
8650
|
+
* Not every ERC20 token is FOT token, so this field is optional
|
|
8651
|
+
*/
|
|
8652
|
+
readonly buyFeeBps?: BigNumber;
|
|
8653
|
+
readonly sellFeeBps?: BigNumber;
|
|
8654
|
+
/**
|
|
8655
|
+
*
|
|
8656
|
+
* @param chainId {@link BaseCurrency#chainId}
|
|
8657
|
+
* @param address The contract address on the chain on which this token lives
|
|
8658
|
+
* @param decimals {@link BaseCurrency#decimals}
|
|
8659
|
+
* @param symbol {@link BaseCurrency#symbol}
|
|
8660
|
+
* @param name {@link BaseCurrency#name}
|
|
8661
|
+
* @param bypassChecksum If true it only checks for length === 42, startsWith 0x and contains only hex characters
|
|
8662
|
+
* @param buyFeeBps Buy fee tax for FOT tokens, in basis points
|
|
8663
|
+
* @param sellFeeBps Sell fee tax for FOT tokens, in basis points
|
|
8664
|
+
*/
|
|
8665
|
+
constructor(chainId: number, address: string, decimals: number, symbol?: string, name?: string, bypassChecksum?: boolean, buyFeeBps?: BigNumber, sellFeeBps?: BigNumber);
|
|
8666
|
+
/**
|
|
8667
|
+
* Returns true if the two tokens are equivalent, i.e. have the same chainId and address.
|
|
8668
|
+
* @param other other token to compare
|
|
8669
|
+
*/
|
|
8670
|
+
equals(other: Currency): boolean;
|
|
8671
|
+
/**
|
|
8672
|
+
* Returns true if the address of this token sorts before the address of the other token
|
|
8673
|
+
* @param other other token to compare
|
|
8674
|
+
* @throws if the tokens have the same address
|
|
8675
|
+
* @throws if the tokens are on different chains
|
|
8676
|
+
*/
|
|
8677
|
+
sortsBefore(other: Token): boolean;
|
|
8678
|
+
/**
|
|
8679
|
+
* Return this token, which does not need to be wrapped
|
|
8680
|
+
*/
|
|
8681
|
+
get wrapped(): Token;
|
|
8682
|
+
}
|
|
8683
|
+
//#endregion
|
|
8684
|
+
//#region node_modules/@uniswap/v3-sdk/node_modules/@uniswap/sdk-core/dist/entities/baseCurrency.d.ts
|
|
8685
|
+
/**
|
|
8686
|
+
* A currency is any fungible financial instrument, including Ether, all ERC20 tokens, and other chain-native currencies
|
|
8687
|
+
*/
|
|
8688
|
+
declare abstract class BaseCurrency {
|
|
8689
|
+
/**
|
|
8690
|
+
* Returns whether the currency is native to the chain and must be wrapped (e.g. Ether)
|
|
8691
|
+
*/
|
|
8692
|
+
abstract readonly isNative: boolean;
|
|
8693
|
+
/**
|
|
8694
|
+
* Returns whether the currency is a token that is usable in Uniswap without wrapping
|
|
8695
|
+
*/
|
|
8696
|
+
abstract readonly isToken: boolean;
|
|
8697
|
+
/**
|
|
8698
|
+
* The chain ID on which this currency resides
|
|
8699
|
+
*/
|
|
8700
|
+
readonly chainId: number;
|
|
8701
|
+
/**
|
|
8702
|
+
* The decimals used in representing currency amounts
|
|
8703
|
+
*/
|
|
8704
|
+
readonly decimals: number;
|
|
8705
|
+
/**
|
|
8706
|
+
* The symbol of the currency, i.e. a short textual non-unique identifier
|
|
8707
|
+
*/
|
|
8708
|
+
readonly symbol?: string;
|
|
8709
|
+
/**
|
|
8710
|
+
* The name of the currency, i.e. a descriptive textual non-unique identifier
|
|
8711
|
+
*/
|
|
8712
|
+
readonly name?: string;
|
|
8713
|
+
/**
|
|
8714
|
+
* Constructs an instance of the base class `BaseCurrency`.
|
|
8715
|
+
* @param chainId the chain ID on which this currency resides
|
|
8716
|
+
* @param decimals decimals of the currency
|
|
8717
|
+
* @param symbol symbol of the currency
|
|
8718
|
+
* @param name of the currency
|
|
8719
|
+
*/
|
|
8720
|
+
protected constructor(chainId: number, decimals: number, symbol?: string, name?: string);
|
|
8721
|
+
/**
|
|
8722
|
+
* Returns whether this currency is functionally equivalent to the other currency
|
|
8723
|
+
* @param other the other currency
|
|
8724
|
+
*/
|
|
8725
|
+
abstract equals(other: Currency): boolean;
|
|
8726
|
+
/**
|
|
8727
|
+
* Return the wrapped version of this currency that can be used with the Uniswap contracts. Currencies must
|
|
8728
|
+
* implement this to be used in Uniswap
|
|
8729
|
+
*/
|
|
8730
|
+
abstract get wrapped(): Token;
|
|
8731
|
+
}
|
|
8732
|
+
//#endregion
|
|
8733
|
+
//#region node_modules/@uniswap/v3-sdk/node_modules/@uniswap/sdk-core/dist/entities/nativeCurrency.d.ts
|
|
8734
|
+
/**
|
|
8735
|
+
* Represents the native currency of the chain on which it resides, e.g.
|
|
8736
|
+
*/
|
|
8737
|
+
declare abstract class NativeCurrency extends BaseCurrency {
|
|
8738
|
+
readonly isNative: true;
|
|
8739
|
+
readonly isToken: false;
|
|
8740
|
+
}
|
|
8741
|
+
//#endregion
|
|
8742
|
+
//#region node_modules/@uniswap/v3-sdk/node_modules/@uniswap/sdk-core/dist/entities/currency.d.ts
|
|
8743
|
+
declare type Currency = NativeCurrency | Token;
|
|
8744
|
+
//#endregion
|
|
8745
|
+
//#region node_modules/@uniswap/v3-sdk/node_modules/@uniswap/sdk-core/dist/entities/fractions/fraction.d.ts
|
|
8746
|
+
declare class Fraction {
|
|
8747
|
+
readonly numerator: JSBI;
|
|
8748
|
+
readonly denominator: JSBI;
|
|
8749
|
+
constructor(numerator: BigintIsh, denominator?: BigintIsh);
|
|
8750
|
+
private static tryParseFraction;
|
|
8751
|
+
get quotient(): JSBI;
|
|
8752
|
+
get remainder(): Fraction;
|
|
8753
|
+
invert(): Fraction;
|
|
8754
|
+
add(other: Fraction | BigintIsh): Fraction;
|
|
8755
|
+
subtract(other: Fraction | BigintIsh): Fraction;
|
|
8756
|
+
lessThan(other: Fraction | BigintIsh): boolean;
|
|
8757
|
+
equalTo(other: Fraction | BigintIsh): boolean;
|
|
8758
|
+
greaterThan(other: Fraction | BigintIsh): boolean;
|
|
8759
|
+
multiply(other: Fraction | BigintIsh): Fraction;
|
|
8760
|
+
divide(other: Fraction | BigintIsh): Fraction;
|
|
8761
|
+
toSignificant(significantDigits: number, format?: object, rounding?: Rounding): string;
|
|
8762
|
+
toFixed(decimalPlaces: number, format?: object, rounding?: Rounding): string;
|
|
8763
|
+
/**
|
|
8764
|
+
* Helper method for converting any super class back to a fraction
|
|
8765
|
+
*/
|
|
8766
|
+
get asFraction(): Fraction;
|
|
8767
|
+
}
|
|
8768
|
+
//#endregion
|
|
8769
|
+
//#region node_modules/@uniswap/v3-sdk/node_modules/@uniswap/sdk-core/dist/entities/fractions/currencyAmount.d.ts
|
|
8770
|
+
declare class CurrencyAmount<T extends Currency> extends Fraction {
|
|
8771
|
+
readonly currency: T;
|
|
8772
|
+
readonly decimalScale: JSBI;
|
|
8773
|
+
/**
|
|
8774
|
+
* Returns a new currency amount instance from the unitless amount of token, i.e. the raw amount
|
|
8775
|
+
* @param currency the currency in the amount
|
|
8776
|
+
* @param rawAmount the raw token or ether amount
|
|
8777
|
+
*/
|
|
8778
|
+
static fromRawAmount<T extends Currency>(currency: T, rawAmount: BigintIsh): CurrencyAmount<T>;
|
|
8779
|
+
/**
|
|
8780
|
+
* Construct a currency amount with a denominator that is not equal to 1
|
|
8781
|
+
* @param currency the currency
|
|
8782
|
+
* @param numerator the numerator of the fractional token amount
|
|
8783
|
+
* @param denominator the denominator of the fractional token amount
|
|
8784
|
+
*/
|
|
8785
|
+
static fromFractionalAmount<T extends Currency>(currency: T, numerator: BigintIsh, denominator: BigintIsh): CurrencyAmount<T>;
|
|
8786
|
+
protected constructor(currency: T, numerator: BigintIsh, denominator?: BigintIsh);
|
|
8787
|
+
add(other: CurrencyAmount<T>): CurrencyAmount<T>;
|
|
8788
|
+
subtract(other: CurrencyAmount<T>): CurrencyAmount<T>;
|
|
8789
|
+
multiply(other: Fraction | BigintIsh): CurrencyAmount<T>;
|
|
8790
|
+
divide(other: Fraction | BigintIsh): CurrencyAmount<T>;
|
|
8791
|
+
toSignificant(significantDigits?: number, format?: object, rounding?: Rounding): string;
|
|
8792
|
+
toFixed(decimalPlaces?: number, format?: object, rounding?: Rounding): string;
|
|
8793
|
+
toExact(format?: object): string;
|
|
8794
|
+
get wrapped(): CurrencyAmount<Token>;
|
|
8795
|
+
}
|
|
8796
|
+
//#endregion
|
|
8797
|
+
//#region node_modules/@uniswap/v3-sdk/node_modules/@uniswap/sdk-core/dist/entities/fractions/price.d.ts
|
|
8798
|
+
declare class Price<TBase extends Currency, TQuote extends Currency> extends Fraction {
|
|
8799
|
+
readonly baseCurrency: TBase;
|
|
8800
|
+
readonly quoteCurrency: TQuote;
|
|
8801
|
+
readonly scalar: Fraction;
|
|
8802
|
+
/**
|
|
8803
|
+
* Construct a price, either with the base and quote currency amount, or the
|
|
8804
|
+
* @param args
|
|
8805
|
+
*/
|
|
8806
|
+
constructor(...args: [TBase, TQuote, BigintIsh, BigintIsh] | [{
|
|
8807
|
+
baseAmount: CurrencyAmount<TBase>;
|
|
8808
|
+
quoteAmount: CurrencyAmount<TQuote>;
|
|
8809
|
+
}]);
|
|
8810
|
+
/**
|
|
8811
|
+
* Flip the price, switching the base and quote currency
|
|
8812
|
+
*/
|
|
8813
|
+
invert(): Price<TQuote, TBase>;
|
|
8814
|
+
/**
|
|
8815
|
+
* Multiply the price by another price, returning a new price. The other price must have the same base currency as this price's quote currency
|
|
8816
|
+
* @param other the other price
|
|
8817
|
+
*/
|
|
8818
|
+
multiply<TOtherQuote extends Currency>(other: Price<TQuote, TOtherQuote>): Price<TBase, TOtherQuote>;
|
|
8819
|
+
/**
|
|
8820
|
+
* Return the amount of quote currency corresponding to a given amount of the base currency
|
|
8821
|
+
* @param currencyAmount the amount of base currency to quote against the price
|
|
8822
|
+
*/
|
|
8823
|
+
quote(currencyAmount: CurrencyAmount<TBase>): CurrencyAmount<TQuote>;
|
|
8824
|
+
/**
|
|
8825
|
+
* Get the value scaled by decimals for formatting
|
|
8826
|
+
* @private
|
|
8827
|
+
*/
|
|
8828
|
+
private get adjustedForDecimals();
|
|
8829
|
+
toSignificant(significantDigits?: number, format?: object, rounding?: Rounding): string;
|
|
8830
|
+
toFixed(decimalPlaces?: number, format?: object, rounding?: Rounding): string;
|
|
8831
|
+
}
|
|
8832
|
+
//#endregion
|
|
8833
|
+
//#region node_modules/@uniswap/v3-sdk/dist/constants.d.ts
|
|
8834
|
+
/**
|
|
8835
|
+
* The default factory enabled fee amounts, denominated in hundredths of bips.
|
|
8836
|
+
*/
|
|
8837
|
+
declare enum FeeAmount {
|
|
8838
|
+
LOWEST = 100,
|
|
8839
|
+
LOW_200 = 200,
|
|
8840
|
+
LOW_300 = 300,
|
|
8841
|
+
LOW_400 = 400,
|
|
8842
|
+
LOW = 500,
|
|
8843
|
+
MEDIUM = 3000,
|
|
8844
|
+
HIGH = 10000
|
|
8845
|
+
}
|
|
8846
|
+
//#endregion
|
|
8847
|
+
//#region node_modules/@uniswap/v3-sdk/dist/entities/tick.d.ts
|
|
8848
|
+
interface TickConstructorArgs {
|
|
8849
|
+
index: number;
|
|
8850
|
+
liquidityGross: BigintIsh;
|
|
8851
|
+
liquidityNet: BigintIsh;
|
|
8852
|
+
}
|
|
8853
|
+
declare class Tick {
|
|
8854
|
+
readonly index: number;
|
|
8855
|
+
readonly liquidityGross: JSBI;
|
|
8856
|
+
readonly liquidityNet: JSBI;
|
|
8857
|
+
constructor({
|
|
8858
|
+
index,
|
|
8859
|
+
liquidityGross,
|
|
8860
|
+
liquidityNet
|
|
8861
|
+
}: TickConstructorArgs);
|
|
8862
|
+
}
|
|
8863
|
+
//#endregion
|
|
8864
|
+
//#region node_modules/@uniswap/v3-sdk/dist/entities/tickDataProvider.d.ts
|
|
8865
|
+
/**
|
|
8866
|
+
* Provides information about ticks
|
|
8867
|
+
*/
|
|
8868
|
+
interface TickDataProvider {
|
|
8869
|
+
/**
|
|
8870
|
+
* Return information corresponding to a specific tick
|
|
8871
|
+
* @param tick the tick to load
|
|
8872
|
+
*/
|
|
8873
|
+
getTick(tick: number): Promise<{
|
|
8874
|
+
liquidityNet: BigintIsh;
|
|
8875
|
+
}>;
|
|
8876
|
+
/**
|
|
8877
|
+
* Return the next tick that is initialized within a single word
|
|
8878
|
+
* @param tick The current tick
|
|
8879
|
+
* @param lte Whether the next tick should be lte the current tick
|
|
8880
|
+
* @param tickSpacing The tick spacing of the pool
|
|
8881
|
+
*/
|
|
8882
|
+
nextInitializedTickWithinOneWord(tick: number, lte: boolean, tickSpacing: number): Promise<[number, boolean]>;
|
|
8883
|
+
}
|
|
8884
|
+
//#endregion
|
|
8885
|
+
//#region node_modules/@uniswap/v3-sdk/dist/entities/pool.d.ts
|
|
8886
|
+
/**
|
|
8887
|
+
* Represents a V3 pool
|
|
8888
|
+
*/
|
|
8889
|
+
declare class Pool {
|
|
8890
|
+
readonly token0: Token;
|
|
8891
|
+
readonly token1: Token;
|
|
8892
|
+
readonly fee: FeeAmount;
|
|
8893
|
+
readonly sqrtRatioX96: JSBI;
|
|
8894
|
+
readonly liquidity: JSBI;
|
|
8895
|
+
readonly tickCurrent: number;
|
|
8896
|
+
readonly tickDataProvider: TickDataProvider;
|
|
8897
|
+
private _token0Price?;
|
|
8898
|
+
private _token1Price?;
|
|
8899
|
+
static getAddress(tokenA: Token, tokenB: Token, fee: FeeAmount, initCodeHashManualOverride?: string, factoryAddressOverride?: string): string;
|
|
8900
|
+
/**
|
|
8901
|
+
* Construct a pool
|
|
8902
|
+
* @param tokenA One of the tokens in the pool
|
|
8903
|
+
* @param tokenB The other token in the pool
|
|
8904
|
+
* @param fee The fee in hundredths of a bips of the input amount of every swap that is collected by the pool
|
|
8905
|
+
* @param sqrtRatioX96 The sqrt of the current ratio of amounts of token1 to token0
|
|
8906
|
+
* @param liquidity The current value of in range liquidity
|
|
8907
|
+
* @param tickCurrent The current tick of the pool
|
|
8908
|
+
* @param ticks The current state of the pool ticks or a data provider that can return tick data
|
|
8909
|
+
*/
|
|
8910
|
+
constructor(tokenA: Token, tokenB: Token, fee: FeeAmount, sqrtRatioX96: BigintIsh, liquidity: BigintIsh, tickCurrent: number, ticks?: TickDataProvider | (Tick | TickConstructorArgs)[]);
|
|
8911
|
+
/**
|
|
8912
|
+
* Returns true if the token is either token0 or token1
|
|
8913
|
+
* @param token The token to check
|
|
8914
|
+
* @returns True if token is either token0 or token
|
|
8915
|
+
*/
|
|
8916
|
+
involvesToken(token: Token): boolean;
|
|
8917
|
+
/**
|
|
8918
|
+
* Returns the current mid price of the pool in terms of token0, i.e. the ratio of token1 over token0
|
|
8919
|
+
*/
|
|
8920
|
+
get token0Price(): Price<Token, Token>;
|
|
8921
|
+
/**
|
|
8922
|
+
* Returns the current mid price of the pool in terms of token1, i.e. the ratio of token0 over token1
|
|
8923
|
+
*/
|
|
8924
|
+
get token1Price(): Price<Token, Token>;
|
|
8925
|
+
/**
|
|
8926
|
+
* Return the price of the given token in terms of the other token in the pool.
|
|
8927
|
+
* @param token The token to return price of
|
|
8928
|
+
* @returns The price of the given token, in terms of the other.
|
|
8929
|
+
*/
|
|
8930
|
+
priceOf(token: Token): Price<Token, Token>;
|
|
8931
|
+
/**
|
|
8932
|
+
* Returns the chain ID of the tokens in the pool.
|
|
8933
|
+
*/
|
|
8934
|
+
get chainId(): number;
|
|
8935
|
+
/**
|
|
8936
|
+
* Given an input amount of a token, return the computed output amount, and a pool with state updated after the trade
|
|
8937
|
+
* @param inputAmount The input amount for which to quote the output amount
|
|
8938
|
+
* @param sqrtPriceLimitX96 The Q64.96 sqrt price limit
|
|
8939
|
+
* @returns The output amount and the pool with updated state
|
|
8940
|
+
*/
|
|
8941
|
+
getOutputAmount(inputAmount: CurrencyAmount<Token>, sqrtPriceLimitX96?: JSBI): Promise<[CurrencyAmount<Token>, Pool]>;
|
|
8942
|
+
/**
|
|
8943
|
+
* Given a desired output amount of a token, return the computed input amount and a pool with state updated after the trade
|
|
8944
|
+
* @param outputAmount the output amount for which to quote the input amount
|
|
8945
|
+
* @param sqrtPriceLimitX96 The Q64.96 sqrt price limit. If zero for one, the price cannot be less than this value after the swap. If one for zero, the price cannot be greater than this value after the swap
|
|
8946
|
+
* @returns The input amount and the pool with updated state
|
|
8947
|
+
*/
|
|
8948
|
+
getInputAmount(outputAmount: CurrencyAmount<Token>, sqrtPriceLimitX96?: JSBI): Promise<[CurrencyAmount<Token>, Pool]>;
|
|
8949
|
+
/**
|
|
8950
|
+
* Executes a swap
|
|
8951
|
+
* @param zeroForOne Whether the amount in is token0 or token1
|
|
8952
|
+
* @param amountSpecified The amount of the swap, which implicitly configures the swap as exact input (positive), or exact output (negative)
|
|
8953
|
+
* @param sqrtPriceLimitX96 The Q64.96 sqrt price limit. If zero for one, the price cannot be less than this value after the swap. If one for zero, the price cannot be greater than this value after the swap
|
|
8954
|
+
* @returns amountCalculated
|
|
8955
|
+
* @returns sqrtRatioX96
|
|
8956
|
+
* @returns liquidity
|
|
8957
|
+
* @returns tickCurrent
|
|
8958
|
+
*/
|
|
8959
|
+
private swap;
|
|
8960
|
+
get tickSpacing(): number;
|
|
8961
|
+
}
|
|
8962
|
+
//#endregion
|
|
8557
8963
|
//#region src/base/SubgraphClient.d.ts
|
|
8558
8964
|
declare abstract class SubgraphClient {
|
|
8559
8965
|
protected readonly client: Client;
|