timelock-sdk 0.0.110 → 0.0.112

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.
@@ -31824,6 +31824,53 @@ declare const getTimelockLens: (client: Client | PublicClient) => {
31824
31824
  declare const timelockLenses: Record<number, Address>;
31825
31825
  declare const uniswapMathLenses: Record<number, Address>;
31826
31826
  //#endregion
31827
+ //#region src/lib/perpsOperator.d.ts
31828
+ type MintPerpBody = {
31829
+ marketAddr: Address;
31830
+ optionType: 'CALL' | 'PUT';
31831
+ amount: bigint;
31832
+ duration: number;
31833
+ strikeTick: number;
31834
+ };
31835
+ type ExercisePerpBody = {
31836
+ marketAddr: Address;
31837
+ optionId: bigint;
31838
+ liquidities: bigint[];
31839
+ };
31840
+ declare class PerpsOperator {
31841
+ #private;
31842
+ auth?: {
31843
+ message: string;
31844
+ signature: Hex;
31845
+ };
31846
+ constructor(baseUrl: string);
31847
+ getOperatorAddr: () => Promise<Address>;
31848
+ genAuthMessage: (userAddr: Address) => Promise<string>;
31849
+ validateAuthMessage: (message: string, signature: Hex) => Promise<{
31850
+ address: `0x${string}`;
31851
+ createdAt: number;
31852
+ validUntil: number;
31853
+ }>;
31854
+ setAuth: (message: string, signature: Hex) => void;
31855
+ getUserPerps: (userAddr: Address, marketAddr?: Address, type?: "active" | "closed", offset?: number, limit?: number) => Promise<{
31856
+ optionId: bigint;
31857
+ id: string;
31858
+ ownerAddr: Address;
31859
+ marketAddr: Address;
31860
+ perpDuration: number;
31861
+ expiresAt: number;
31862
+ closed: boolean;
31863
+ }[]>;
31864
+ mintPerp: (body: MintPerpBody) => Promise<{
31865
+ txHash: string;
31866
+ optionId: bigint;
31867
+ }>;
31868
+ exercisePerp: (body: ExercisePerpBody) => Promise<{
31869
+ txHash: string;
31870
+ optionId: bigint;
31871
+ }>;
31872
+ }
31873
+ //#endregion
31827
31874
  //#region src/providers/TimelockProvider.d.ts
31828
31875
  type TimelockContextValue = {
31829
31876
  marketData: Partial<TimelockMarketData>;
@@ -31831,6 +31878,7 @@ type TimelockContextValue = {
31831
31878
  uniswapMathLensAddr?: Address;
31832
31879
  envioGraphqlUrl?: string;
31833
31880
  graphqlClient?: ReturnType<typeof getSdk>;
31881
+ perpsOperator?: PerpsOperator;
31834
31882
  perpsOperatorUrl?: string;
31835
31883
  };
31836
31884
  declare const TimelockProvider: ({
@@ -34904,53 +34952,6 @@ declare const useMintPerp: (marketAddr?: Address) => _tanstack_react_query0.UseM
34904
34952
  strikeTick?: number;
34905
34953
  }, unknown>;
34906
34954
  //#endregion
34907
- //#region src/lib/perpsOperator.d.ts
34908
- type MintPerpBody = {
34909
- marketAddr: Address;
34910
- optionType: 'CALL' | 'PUT';
34911
- amount: bigint;
34912
- duration: number;
34913
- strikeTick: number;
34914
- };
34915
- type ExercisePerpBody = {
34916
- marketAddr: Address;
34917
- optionId: bigint;
34918
- liquidities: bigint[];
34919
- };
34920
- declare class PerpsOperator {
34921
- #private;
34922
- auth?: {
34923
- message: string;
34924
- signature: Hex;
34925
- };
34926
- constructor(baseUrl: string);
34927
- getOperatorAddr: () => Promise<Address>;
34928
- genAuthMessage: (userAddr: Address) => Promise<string>;
34929
- validateAuthMessage: (message: string, signature: Hex) => Promise<{
34930
- address: `0x${string}`;
34931
- createdAt: number;
34932
- validUntil: number;
34933
- }>;
34934
- setAuth: (message: string, signature: Hex) => void;
34935
- getUserPerps: (userAddr: Address, marketAddr?: Address, type?: "active" | "closed", offset?: number, limit?: number) => Promise<{
34936
- optionId: bigint;
34937
- id: string;
34938
- ownerAddr: Address;
34939
- marketAddr: Address;
34940
- perpDuration: number;
34941
- expiresAt: number;
34942
- closed: boolean;
34943
- }[]>;
34944
- mintPerp: (body: MintPerpBody) => Promise<{
34945
- txHash: string;
34946
- optionId: bigint;
34947
- }>;
34948
- exercisePerp: (body: ExercisePerpBody) => Promise<{
34949
- txHash: string;
34950
- optionId: bigint;
34951
- }>;
34952
- }
34953
- //#endregion
34954
34955
  //#region src/hooks/perps/useClosePerp.d.ts
34955
34956
  declare const useClosePerp: () => _tanstack_react_query0.UseMutationResult<void, Error, ExercisePerpBody, unknown>;
34956
34957
  //#endregion
@@ -35913,12 +35914,13 @@ declare const useOperatorPerms: (marketAddr?: Address, userAddr?: Address, opera
35913
35914
  promise: Promise<readonly [boolean, boolean, boolean, boolean, bigint]>;
35914
35915
  queryKey: _tanstack_query_core0.QueryKey;
35915
35916
  data: {
35916
- canExtend: boolean;
35917
- canExercise: boolean;
35918
- canTransfer: boolean;
35919
- canMint: boolean;
35920
- spendingApproval: bigint;
35921
- } | undefined;
35917
+ canExtend: boolean | undefined;
35918
+ canExercise: boolean | undefined;
35919
+ canTransfer: boolean | undefined;
35920
+ canMint: boolean | undefined;
35921
+ spendingApproval: bigint | undefined;
35922
+ effectiveApproval: bigint;
35923
+ };
35922
35924
  } | {
35923
35925
  error: null;
35924
35926
  isError: false;
@@ -35947,12 +35949,13 @@ declare const useOperatorPerms: (marketAddr?: Address, userAddr?: Address, opera
35947
35949
  promise: Promise<readonly [boolean, boolean, boolean, boolean, bigint]>;
35948
35950
  queryKey: _tanstack_query_core0.QueryKey;
35949
35951
  data: {
35950
- canExtend: boolean;
35951
- canExercise: boolean;
35952
- canTransfer: boolean;
35953
- canMint: boolean;
35954
- spendingApproval: bigint;
35955
- } | undefined;
35952
+ canExtend: boolean | undefined;
35953
+ canExercise: boolean | undefined;
35954
+ canTransfer: boolean | undefined;
35955
+ canMint: boolean | undefined;
35956
+ spendingApproval: bigint | undefined;
35957
+ effectiveApproval: bigint;
35958
+ };
35956
35959
  } | {
35957
35960
  error: viem0.ReadContractErrorType;
35958
35961
  isError: true;
@@ -35981,12 +35984,13 @@ declare const useOperatorPerms: (marketAddr?: Address, userAddr?: Address, opera
35981
35984
  promise: Promise<readonly [boolean, boolean, boolean, boolean, bigint]>;
35982
35985
  queryKey: _tanstack_query_core0.QueryKey;
35983
35986
  data: {
35984
- canExtend: boolean;
35985
- canExercise: boolean;
35986
- canTransfer: boolean;
35987
- canMint: boolean;
35988
- spendingApproval: bigint;
35989
- } | undefined;
35987
+ canExtend: boolean | undefined;
35988
+ canExercise: boolean | undefined;
35989
+ canTransfer: boolean | undefined;
35990
+ canMint: boolean | undefined;
35991
+ spendingApproval: bigint | undefined;
35992
+ effectiveApproval: bigint;
35993
+ };
35990
35994
  } | {
35991
35995
  error: null;
35992
35996
  isError: false;
@@ -36015,12 +36019,13 @@ declare const useOperatorPerms: (marketAddr?: Address, userAddr?: Address, opera
36015
36019
  promise: Promise<readonly [boolean, boolean, boolean, boolean, bigint]>;
36016
36020
  queryKey: _tanstack_query_core0.QueryKey;
36017
36021
  data: {
36018
- canExtend: boolean;
36019
- canExercise: boolean;
36020
- canTransfer: boolean;
36021
- canMint: boolean;
36022
- spendingApproval: bigint;
36023
- } | undefined;
36022
+ canExtend: boolean | undefined;
36023
+ canExercise: boolean | undefined;
36024
+ canTransfer: boolean | undefined;
36025
+ canMint: boolean | undefined;
36026
+ spendingApproval: bigint | undefined;
36027
+ effectiveApproval: bigint;
36028
+ };
36024
36029
  } | {
36025
36030
  error: null;
36026
36031
  isError: false;
@@ -36049,12 +36054,13 @@ declare const useOperatorPerms: (marketAddr?: Address, userAddr?: Address, opera
36049
36054
  promise: Promise<readonly [boolean, boolean, boolean, boolean, bigint]>;
36050
36055
  queryKey: _tanstack_query_core0.QueryKey;
36051
36056
  data: {
36052
- canExtend: boolean;
36053
- canExercise: boolean;
36054
- canTransfer: boolean;
36055
- canMint: boolean;
36056
- spendingApproval: bigint;
36057
- } | undefined;
36057
+ canExtend: boolean | undefined;
36058
+ canExercise: boolean | undefined;
36059
+ canTransfer: boolean | undefined;
36060
+ canMint: boolean | undefined;
36061
+ spendingApproval: bigint | undefined;
36062
+ effectiveApproval: bigint;
36063
+ };
36058
36064
  } | {
36059
36065
  isError: false;
36060
36066
  error: null;
@@ -36083,12 +36089,13 @@ declare const useOperatorPerms: (marketAddr?: Address, userAddr?: Address, opera
36083
36089
  promise: Promise<readonly [boolean, boolean, boolean, boolean, bigint]>;
36084
36090
  queryKey: _tanstack_query_core0.QueryKey;
36085
36091
  data: {
36086
- canExtend: boolean;
36087
- canExercise: boolean;
36088
- canTransfer: boolean;
36089
- canMint: boolean;
36090
- spendingApproval: bigint;
36091
- } | undefined;
36092
+ canExtend: boolean | undefined;
36093
+ canExercise: boolean | undefined;
36094
+ canTransfer: boolean | undefined;
36095
+ canMint: boolean | undefined;
36096
+ spendingApproval: bigint | undefined;
36097
+ effectiveApproval: bigint;
36098
+ };
36092
36099
  };
36093
36100
  //#endregion
36094
36101
  //#region src/hooks/operators/useUserOperators.d.ts
@@ -62851,4 +62858,4 @@ declare const useApproval: () => {
62851
62858
  };
62852
62859
  //#endregion
62853
62860
  export { formatCondensed as $, PriceDataPoint as A, usePerpsOperator as B, liquiditiesToAmount1 as C, getErc20 as Ct, token0ToToken1 as D, timelockLenses as Dt, roundTickUp as E, getUniswapMathLens as Et, useUserOperators as F, useExtendOption as G, useMintPerp as H, useOperatorPerms as I, useMintOption as J, useOptionPremium as K, useActiveUserPerps as L, getCurrentPrice as M, getPriceHistory as N, token1ToToken0 as O, uniswapMathLenses as Ot, useSetOperatorPerms as P, formatAmount as Q, useClosedUserPerps as R, liquiditiesToAmount0 as S, UniswapMathLens as St, roundTickDown as T, getTimelockMarket as Tt, OptionTimelineData as U, useClosePerp as V, useOptionTimeline as W, Amount as X, useMaxPositionSize as Y, EMPTY_ARRAY as Z, PRICE_PRECISION as _, useCurrentMarket as _t, batchGetAmountsFromLiquidity as a, unscalePrice as at, getPriceAtTick as b, TimelockMarket as bt, useLiquidityBlocks as c, wrapPrice as ct, usePriceAtTick as d, useMarketData as dt, formatUSD as et, UniswapPoolData as f, useExerciseOption as ft, getPayoutAtTick as g, TimelockProvider as gt, useCurrentPrice as h, useClosedUserOptions as ht, useVaultData as i, unscaleAmount as it, PriceResolution as j, PriceData as k, useBurnLiquidity as l, wrapPriceUnscaled as lt, useCurrentTick as m, useActiveUserOptions as mt, useLens as n, scaleAmount as nt, useMintLiquidity as o, wrapAmount as ot, usePoolData as p, OptionData as pt, useOptionPnl as q, useVaultTVL as r, scalePrice as rt, LiquidityBlockData as s, wrapAmountUnscaled as st, useApproval as t, formatVagueAmount as tt, usePriceHistory as u, zero as ut, getAmountsFromLiquidity as v, useTimelockConfig as vt, liquiditiesToAmounts as w, getTimelockLens as wt, getTickAtPrice as x, TimelockMarketData as xt, getNearestValidStrikeTick as y, TimelockLens as yt, useUserPerps as z };
62854
- //# sourceMappingURL=client-61tvmrlq.d.cts.map
62861
+ //# sourceMappingURL=client-191_W3kB.d.cts.map