@steerprotocol/sdk 3.0.21 → 3.0.23

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