@strobelabs/perpcity-sdk 0.2.0 → 0.3.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/LICENSE.md +21 -674
- package/README.md +188 -79
- package/dist/index.d.mts +964 -541
- package/dist/index.d.ts +964 -541
- package/dist/index.js +1454 -1308
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +1453 -1291
- package/dist/index.mjs.map +1 -1
- package/package.json +2 -5
package/dist/index.d.mts
CHANGED
|
@@ -1,27 +1,20 @@
|
|
|
1
1
|
import * as viem__types_actions_siwe_verifySiweMessage from 'viem/_types/actions/siwe/verifySiweMessage';
|
|
2
2
|
import * as viem from 'viem';
|
|
3
3
|
import { WalletClient, Address, Hex } from 'viem';
|
|
4
|
-
import { GraphQLClient } from 'graphql-request';
|
|
5
4
|
|
|
6
5
|
interface PerpCityDeployments {
|
|
7
6
|
perpManager: Address;
|
|
8
7
|
usdc: Address;
|
|
8
|
+
feesModule?: Address;
|
|
9
|
+
marginRatiosModule?: Address;
|
|
10
|
+
lockupPeriodModule?: Address;
|
|
11
|
+
sqrtPriceImpactLimitModule?: Address;
|
|
9
12
|
}
|
|
10
13
|
interface PerpCityContextConfig {
|
|
11
14
|
walletClient: WalletClient;
|
|
12
|
-
goldskyBearerToken?: string;
|
|
13
|
-
goldskyEndpoint: string;
|
|
14
15
|
deployments: PerpCityDeployments;
|
|
15
16
|
}
|
|
16
17
|
|
|
17
|
-
type OpenInterest = {
|
|
18
|
-
takerLongNotional: number;
|
|
19
|
-
takerShortNotional: number;
|
|
20
|
-
};
|
|
21
|
-
type TimeSeries<T extends number | OpenInterest> = {
|
|
22
|
-
timestamp: number;
|
|
23
|
-
value: T;
|
|
24
|
-
};
|
|
25
18
|
type Bounds = {
|
|
26
19
|
minMargin: number;
|
|
27
20
|
minTakerLeverage: number;
|
|
@@ -39,12 +32,6 @@ type LiveDetails = {
|
|
|
39
32
|
effectiveMargin: number;
|
|
40
33
|
isLiquidatable: boolean;
|
|
41
34
|
};
|
|
42
|
-
type ClosedPosition = {
|
|
43
|
-
perpId: Hex;
|
|
44
|
-
wasMaker: boolean;
|
|
45
|
-
wasLong: boolean;
|
|
46
|
-
pnlAtClose: number;
|
|
47
|
-
};
|
|
48
35
|
type ClosePositionParams = {
|
|
49
36
|
minAmt0Out: number;
|
|
50
37
|
minAmt1Out: number;
|
|
@@ -67,32 +54,23 @@ type OpenMakerPositionParams = {
|
|
|
67
54
|
type CreatePerpParams = {
|
|
68
55
|
startingPrice: number;
|
|
69
56
|
beacon: Address;
|
|
57
|
+
fees?: Address;
|
|
58
|
+
marginRatios?: Address;
|
|
59
|
+
lockupPeriod?: Address;
|
|
60
|
+
sqrtPriceImpactLimit?: Address;
|
|
70
61
|
};
|
|
71
62
|
type PerpData = {
|
|
72
63
|
id: Hex;
|
|
73
64
|
tickSpacing: number;
|
|
74
65
|
mark: number;
|
|
75
|
-
index: number;
|
|
76
66
|
beacon: Address;
|
|
77
|
-
lastIndexUpdate: number;
|
|
78
|
-
openInterest: OpenInterest;
|
|
79
|
-
markTimeSeries: TimeSeries<number>[];
|
|
80
|
-
indexTimeSeries: TimeSeries<number>[];
|
|
81
|
-
fundingRate: number;
|
|
82
67
|
bounds: Bounds;
|
|
83
68
|
fees: Fees;
|
|
84
|
-
openInterestTimeSeries: TimeSeries<OpenInterest>[];
|
|
85
|
-
fundingRateTimeSeries: TimeSeries<number>[];
|
|
86
|
-
totalOpenMakerPnl: number;
|
|
87
|
-
totalOpenTakerPnl: number;
|
|
88
69
|
};
|
|
89
70
|
type UserData = {
|
|
90
71
|
walletAddress: Hex;
|
|
91
72
|
usdcBalance: number;
|
|
92
73
|
openPositions: OpenPositionData[];
|
|
93
|
-
closedPositions: ClosedPosition[];
|
|
94
|
-
realizedPnl: number;
|
|
95
|
-
unrealizedPnl: number;
|
|
96
74
|
};
|
|
97
75
|
type OpenPositionData = {
|
|
98
76
|
perpId: Hex;
|
|
@@ -105,6 +83,22 @@ type CacheConfig = {
|
|
|
105
83
|
ttl: number;
|
|
106
84
|
maxSize: number;
|
|
107
85
|
};
|
|
86
|
+
type PerpConfig = {
|
|
87
|
+
key: {
|
|
88
|
+
currency0: Address;
|
|
89
|
+
currency1: Address;
|
|
90
|
+
fee: number;
|
|
91
|
+
tickSpacing: number;
|
|
92
|
+
hooks: Address;
|
|
93
|
+
};
|
|
94
|
+
creator: Address;
|
|
95
|
+
vault: Address;
|
|
96
|
+
beacon: Address;
|
|
97
|
+
fees: Address;
|
|
98
|
+
marginRatios: Address;
|
|
99
|
+
lockupPeriod: Address;
|
|
100
|
+
sqrtPriceImpactLimit: Address;
|
|
101
|
+
};
|
|
108
102
|
|
|
109
103
|
declare class PerpCityContext {
|
|
110
104
|
readonly walletClient: viem.Client<viem.Transport, viem.Chain | undefined, viem.Account | undefined, viem.WalletRpcSchema, {
|
|
@@ -3699,34 +3693,42 @@ declare class PerpCityContext {
|
|
|
3699
3693
|
watchEvent: <const abiEvent extends viem.AbiEvent | undefined = undefined, const abiEvents extends readonly viem.AbiEvent[] | readonly unknown[] | undefined = abiEvent extends viem.AbiEvent ? [abiEvent] : undefined, strict extends boolean | undefined = undefined>(args: viem.WatchEventParameters<abiEvent, abiEvents, strict, viem.Transport>) => viem.WatchEventReturnType;
|
|
3700
3694
|
watchPendingTransactions: (args: viem.WatchPendingTransactionsParameters<viem.Transport>) => viem.WatchPendingTransactionsReturnType;
|
|
3701
3695
|
} & viem.WalletActions<viem.Chain | undefined, viem.Account | undefined>>;
|
|
3702
|
-
readonly goldskyClient: GraphQLClient;
|
|
3703
3696
|
private readonly _deployments;
|
|
3697
|
+
private readonly configCache;
|
|
3704
3698
|
constructor(config: PerpCityContextConfig);
|
|
3705
3699
|
deployments(): PerpCityDeployments;
|
|
3706
3700
|
private fetchPerpData;
|
|
3701
|
+
/**
|
|
3702
|
+
* Fetches and caches the config for a perpId
|
|
3703
|
+
* The config includes module addresses (fees, marginRatios, etc.) and pool settings
|
|
3704
|
+
*/
|
|
3705
|
+
getPerpConfig(perpId: Hex): Promise<PerpConfig>;
|
|
3707
3706
|
private fetchPerpContractData;
|
|
3708
3707
|
/**
|
|
3709
3708
|
* Fetch comprehensive perp data with all related information in a single batched request
|
|
3710
3709
|
*/
|
|
3711
3710
|
getPerpData(perpId: Hex): Promise<PerpData>;
|
|
3712
|
-
/**
|
|
3713
|
-
* Fetch data for multiple perps efficiently with true batching
|
|
3714
|
-
* This fetches all perps in just 2 Goldsky requests total (not 2N!)
|
|
3715
|
-
*/
|
|
3716
|
-
getMultiplePerpData(perpIds: Hex[]): Promise<Map<Hex, PerpData>>;
|
|
3717
|
-
private fetchMultiplePerpContractData;
|
|
3718
3711
|
private fetchUserData;
|
|
3719
|
-
private fetchUserOpenPositions;
|
|
3720
|
-
private fetchUserClosedPositions;
|
|
3721
3712
|
private fetchPositionLiveDetailsFromContract;
|
|
3722
3713
|
/**
|
|
3723
|
-
* Fetch comprehensive user data with
|
|
3714
|
+
* Fetch comprehensive user data with live details for all positions
|
|
3715
|
+
* @param userAddress - The user's wallet address
|
|
3716
|
+
* @param positions - Array of position metadata (perpId, positionId, isLong, isMaker) tracked from transaction receipts
|
|
3724
3717
|
*/
|
|
3725
|
-
getUserData(userAddress: Hex
|
|
3718
|
+
getUserData(userAddress: Hex, positions: Array<{
|
|
3719
|
+
perpId: Hex;
|
|
3720
|
+
positionId: bigint;
|
|
3721
|
+
isLong: boolean;
|
|
3722
|
+
isMaker: boolean;
|
|
3723
|
+
}>): Promise<UserData>;
|
|
3726
3724
|
/**
|
|
3727
3725
|
* Fetch open position data with live details
|
|
3726
|
+
* @param perpId - The perpetual market ID
|
|
3727
|
+
* @param positionId - The position ID
|
|
3728
|
+
* @param isLong - Whether the position is long (true) or short (false)
|
|
3729
|
+
* @param isMaker - Whether the position is a maker (LP) position
|
|
3728
3730
|
*/
|
|
3729
|
-
getOpenPositionData(perpId: Hex, positionId: bigint): Promise<OpenPositionData>;
|
|
3731
|
+
getOpenPositionData(perpId: Hex, positionId: bigint, isLong: boolean, isMaker: boolean): Promise<OpenPositionData>;
|
|
3730
3732
|
}
|
|
3731
3733
|
|
|
3732
3734
|
declare function priceToSqrtPriceX96(price: number): bigint;
|
|
@@ -3744,6 +3746,13 @@ declare const NUMBER_1E6: number;
|
|
|
3744
3746
|
declare const BIGINT_1E6: bigint;
|
|
3745
3747
|
declare const Q96: bigint;
|
|
3746
3748
|
|
|
3749
|
+
/**
|
|
3750
|
+
* Calculate liquidity from USDC amount (amount1) using Uniswap v3 formula
|
|
3751
|
+
* liquidity = amount1 / (sqrt(priceUpper) - sqrt(priceLower))
|
|
3752
|
+
*
|
|
3753
|
+
* This replicates the estimateLiquidityForAmount1 function that existed in older contracts
|
|
3754
|
+
* but is not present in the deployed contracts.
|
|
3755
|
+
*/
|
|
3747
3756
|
declare function estimateLiquidity(context: PerpCityContext, tickLower: number, tickUpper: number, usdScaled: bigint): Promise<bigint>;
|
|
3748
3757
|
|
|
3749
3758
|
/**
|
|
@@ -3773,12 +3782,6 @@ declare class TransactionRejectedError extends PerpCityError {
|
|
|
3773
3782
|
declare class InsufficientFundsError extends PerpCityError {
|
|
3774
3783
|
constructor(message?: string, cause?: Error);
|
|
3775
3784
|
}
|
|
3776
|
-
/**
|
|
3777
|
-
* Error thrown when a GraphQL query fails
|
|
3778
|
-
*/
|
|
3779
|
-
declare class GraphQLError extends PerpCityError {
|
|
3780
|
-
constructor(message: string, cause?: Error);
|
|
3781
|
-
}
|
|
3782
3785
|
/**
|
|
3783
3786
|
* Error thrown when an RPC call fails
|
|
3784
3787
|
*/
|
|
@@ -3800,18 +3803,66 @@ declare function parseContractError(error: unknown): PerpCityError;
|
|
|
3800
3803
|
*/
|
|
3801
3804
|
declare function withErrorHandling<T>(fn: () => Promise<T>, context: string): Promise<T>;
|
|
3802
3805
|
|
|
3806
|
+
/**
|
|
3807
|
+
* RPC URL utilities for connecting to blockchain networks
|
|
3808
|
+
*/
|
|
3809
|
+
interface RpcConfig {
|
|
3810
|
+
url?: string;
|
|
3811
|
+
}
|
|
3812
|
+
/**
|
|
3813
|
+
* Get the RPC URL from environment or configuration
|
|
3814
|
+
*
|
|
3815
|
+
* This is a simple helper that retrieves the RPC URL from the RPC_URL
|
|
3816
|
+
* environment variable or accepts a direct override. The function does
|
|
3817
|
+
* not construct URLs - it expects the full endpoint URL to be provided.
|
|
3818
|
+
*
|
|
3819
|
+
* @param config - Optional configuration with URL override
|
|
3820
|
+
* @returns The RPC URL to use for connections
|
|
3821
|
+
* @throws Error if no RPC URL is configured
|
|
3822
|
+
*
|
|
3823
|
+
* @example
|
|
3824
|
+
* // Get URL from RPC_URL environment variable
|
|
3825
|
+
* // RPC_URL=https://your-rpc-endpoint.example
|
|
3826
|
+
* const url = getRpcUrl();
|
|
3827
|
+
* // Returns: https://your-rpc-endpoint.example
|
|
3828
|
+
*
|
|
3829
|
+
* @example
|
|
3830
|
+
* // Override with custom URL
|
|
3831
|
+
* const url = getRpcUrl({
|
|
3832
|
+
* url: 'https://custom-rpc.example'
|
|
3833
|
+
* });
|
|
3834
|
+
* // Returns: https://custom-rpc.example
|
|
3835
|
+
*/
|
|
3836
|
+
declare function getRpcUrl(config?: RpcConfig): string;
|
|
3837
|
+
|
|
3803
3838
|
declare const PERP_MANAGER_ABI: readonly [{
|
|
3804
3839
|
readonly inputs: readonly [{
|
|
3805
|
-
readonly internalType: "contract IPoolManager";
|
|
3806
|
-
readonly name: "poolManager";
|
|
3807
|
-
readonly type: "address";
|
|
3808
|
-
}, {
|
|
3809
3840
|
readonly internalType: "address";
|
|
3810
|
-
readonly name: "
|
|
3841
|
+
readonly name: "owner";
|
|
3811
3842
|
readonly type: "address";
|
|
3812
3843
|
}];
|
|
3813
3844
|
readonly stateMutability: "nonpayable";
|
|
3814
3845
|
readonly type: "constructor";
|
|
3846
|
+
}, {
|
|
3847
|
+
readonly inputs: readonly [];
|
|
3848
|
+
readonly name: "AccountBalanceOverflow";
|
|
3849
|
+
readonly type: "error";
|
|
3850
|
+
}, {
|
|
3851
|
+
readonly inputs: readonly [];
|
|
3852
|
+
readonly name: "AlreadyInitialized";
|
|
3853
|
+
readonly type: "error";
|
|
3854
|
+
}, {
|
|
3855
|
+
readonly inputs: readonly [];
|
|
3856
|
+
readonly name: "BalanceQueryForZeroAddress";
|
|
3857
|
+
readonly type: "error";
|
|
3858
|
+
}, {
|
|
3859
|
+
readonly inputs: readonly [];
|
|
3860
|
+
readonly name: "FeeTooLarge";
|
|
3861
|
+
readonly type: "error";
|
|
3862
|
+
}, {
|
|
3863
|
+
readonly inputs: readonly [];
|
|
3864
|
+
readonly name: "FeesNotRegistered";
|
|
3865
|
+
readonly type: "error";
|
|
3815
3866
|
}, {
|
|
3816
3867
|
readonly inputs: readonly [{
|
|
3817
3868
|
readonly internalType: "uint8";
|
|
@@ -3821,33 +3872,9 @@ declare const PERP_MANAGER_ABI: readonly [{
|
|
|
3821
3872
|
readonly name: "InvalidAction";
|
|
3822
3873
|
readonly type: "error";
|
|
3823
3874
|
}, {
|
|
3824
|
-
readonly inputs: readonly [
|
|
3825
|
-
readonly internalType: "address";
|
|
3826
|
-
readonly name: "caller";
|
|
3827
|
-
readonly type: "address";
|
|
3828
|
-
}, {
|
|
3829
|
-
readonly internalType: "address";
|
|
3830
|
-
readonly name: "expectedCaller";
|
|
3831
|
-
readonly type: "address";
|
|
3832
|
-
}];
|
|
3875
|
+
readonly inputs: readonly [];
|
|
3833
3876
|
readonly name: "InvalidCaller";
|
|
3834
3877
|
readonly type: "error";
|
|
3835
|
-
}, {
|
|
3836
|
-
readonly inputs: readonly [{
|
|
3837
|
-
readonly internalType: "address";
|
|
3838
|
-
readonly name: "caller";
|
|
3839
|
-
readonly type: "address";
|
|
3840
|
-
}, {
|
|
3841
|
-
readonly internalType: "address";
|
|
3842
|
-
readonly name: "holder";
|
|
3843
|
-
readonly type: "address";
|
|
3844
|
-
}, {
|
|
3845
|
-
readonly internalType: "bool";
|
|
3846
|
-
readonly name: "isLiquidated";
|
|
3847
|
-
readonly type: "bool";
|
|
3848
|
-
}];
|
|
3849
|
-
readonly name: "InvalidClose";
|
|
3850
|
-
readonly type: "error";
|
|
3851
3878
|
}, {
|
|
3852
3879
|
readonly inputs: readonly [{
|
|
3853
3880
|
readonly internalType: "uint128";
|
|
@@ -3857,24 +3884,28 @@ declare const PERP_MANAGER_ABI: readonly [{
|
|
|
3857
3884
|
readonly name: "InvalidLiquidity";
|
|
3858
3885
|
readonly type: "error";
|
|
3859
3886
|
}, {
|
|
3860
|
-
readonly inputs: readonly [
|
|
3861
|
-
readonly internalType: "uint256";
|
|
3862
|
-
readonly name: "margin";
|
|
3863
|
-
readonly type: "uint256";
|
|
3864
|
-
}];
|
|
3887
|
+
readonly inputs: readonly [];
|
|
3865
3888
|
readonly name: "InvalidMargin";
|
|
3866
3889
|
readonly type: "error";
|
|
3867
3890
|
}, {
|
|
3868
3891
|
readonly inputs: readonly [{
|
|
3869
3892
|
readonly internalType: "uint256";
|
|
3870
|
-
readonly name: "
|
|
3871
|
-
readonly type: "uint256";
|
|
3872
|
-
}, {
|
|
3873
|
-
readonly internalType: "uint256";
|
|
3874
|
-
readonly name: "lockupPeriodEnd";
|
|
3893
|
+
readonly name: "marginRatio";
|
|
3875
3894
|
readonly type: "uint256";
|
|
3876
3895
|
}];
|
|
3877
|
-
readonly name: "
|
|
3896
|
+
readonly name: "InvalidMarginRatio";
|
|
3897
|
+
readonly type: "error";
|
|
3898
|
+
}, {
|
|
3899
|
+
readonly inputs: readonly [];
|
|
3900
|
+
readonly name: "LockupPeriodNotRegistered";
|
|
3901
|
+
readonly type: "error";
|
|
3902
|
+
}, {
|
|
3903
|
+
readonly inputs: readonly [];
|
|
3904
|
+
readonly name: "MakerNotAllowed";
|
|
3905
|
+
readonly type: "error";
|
|
3906
|
+
}, {
|
|
3907
|
+
readonly inputs: readonly [];
|
|
3908
|
+
readonly name: "MarginRatiosNotRegistered";
|
|
3878
3909
|
readonly type: "error";
|
|
3879
3910
|
}, {
|
|
3880
3911
|
readonly inputs: readonly [{
|
|
@@ -3900,30 +3931,122 @@ declare const PERP_MANAGER_ABI: readonly [{
|
|
|
3900
3931
|
}];
|
|
3901
3932
|
readonly name: "MinimumAmountInsufficient";
|
|
3902
3933
|
readonly type: "error";
|
|
3934
|
+
}, {
|
|
3935
|
+
readonly inputs: readonly [];
|
|
3936
|
+
readonly name: "ModuleAlreadyRegistered";
|
|
3937
|
+
readonly type: "error";
|
|
3938
|
+
}, {
|
|
3939
|
+
readonly inputs: readonly [];
|
|
3940
|
+
readonly name: "NewOwnerIsZeroAddress";
|
|
3941
|
+
readonly type: "error";
|
|
3942
|
+
}, {
|
|
3943
|
+
readonly inputs: readonly [];
|
|
3944
|
+
readonly name: "NoHandoverRequest";
|
|
3945
|
+
readonly type: "error";
|
|
3946
|
+
}, {
|
|
3947
|
+
readonly inputs: readonly [];
|
|
3948
|
+
readonly name: "NotOwnerNorApproved";
|
|
3949
|
+
readonly type: "error";
|
|
3903
3950
|
}, {
|
|
3904
3951
|
readonly inputs: readonly [];
|
|
3905
3952
|
readonly name: "NotPoolManager";
|
|
3906
3953
|
readonly type: "error";
|
|
3907
3954
|
}, {
|
|
3955
|
+
readonly inputs: readonly [];
|
|
3956
|
+
readonly name: "PositionLocked";
|
|
3957
|
+
readonly type: "error";
|
|
3958
|
+
}, {
|
|
3959
|
+
readonly inputs: readonly [];
|
|
3960
|
+
readonly name: "SqrtPriceImpactLimitNotRegistered";
|
|
3961
|
+
readonly type: "error";
|
|
3962
|
+
}, {
|
|
3963
|
+
readonly inputs: readonly [];
|
|
3964
|
+
readonly name: "TokenAlreadyExists";
|
|
3965
|
+
readonly type: "error";
|
|
3966
|
+
}, {
|
|
3967
|
+
readonly inputs: readonly [];
|
|
3968
|
+
readonly name: "TokenDoesNotExist";
|
|
3969
|
+
readonly type: "error";
|
|
3970
|
+
}, {
|
|
3971
|
+
readonly inputs: readonly [];
|
|
3972
|
+
readonly name: "TransferFromIncorrectOwner";
|
|
3973
|
+
readonly type: "error";
|
|
3974
|
+
}, {
|
|
3975
|
+
readonly inputs: readonly [];
|
|
3976
|
+
readonly name: "TransferToNonERC721ReceiverImplementer";
|
|
3977
|
+
readonly type: "error";
|
|
3978
|
+
}, {
|
|
3979
|
+
readonly inputs: readonly [];
|
|
3980
|
+
readonly name: "TransferToZeroAddress";
|
|
3981
|
+
readonly type: "error";
|
|
3982
|
+
}, {
|
|
3983
|
+
readonly inputs: readonly [];
|
|
3984
|
+
readonly name: "Unauthorized";
|
|
3985
|
+
readonly type: "error";
|
|
3986
|
+
}, {
|
|
3987
|
+
readonly inputs: readonly [];
|
|
3988
|
+
readonly name: "ZeroDelta";
|
|
3989
|
+
readonly type: "error";
|
|
3990
|
+
}, {
|
|
3991
|
+
readonly anonymous: false;
|
|
3908
3992
|
readonly inputs: readonly [{
|
|
3909
|
-
readonly
|
|
3910
|
-
readonly
|
|
3911
|
-
readonly
|
|
3993
|
+
readonly indexed: true;
|
|
3994
|
+
readonly internalType: "address";
|
|
3995
|
+
readonly name: "owner";
|
|
3996
|
+
readonly type: "address";
|
|
3997
|
+
}, {
|
|
3998
|
+
readonly indexed: true;
|
|
3999
|
+
readonly internalType: "address";
|
|
4000
|
+
readonly name: "account";
|
|
4001
|
+
readonly type: "address";
|
|
4002
|
+
}, {
|
|
4003
|
+
readonly indexed: true;
|
|
4004
|
+
readonly internalType: "uint256";
|
|
4005
|
+
readonly name: "id";
|
|
4006
|
+
readonly type: "uint256";
|
|
3912
4007
|
}];
|
|
3913
|
-
readonly name: "
|
|
3914
|
-
readonly type: "
|
|
4008
|
+
readonly name: "Approval";
|
|
4009
|
+
readonly type: "event";
|
|
3915
4010
|
}, {
|
|
4011
|
+
readonly anonymous: false;
|
|
3916
4012
|
readonly inputs: readonly [{
|
|
3917
|
-
readonly
|
|
3918
|
-
readonly
|
|
3919
|
-
readonly
|
|
4013
|
+
readonly indexed: true;
|
|
4014
|
+
readonly internalType: "address";
|
|
4015
|
+
readonly name: "owner";
|
|
4016
|
+
readonly type: "address";
|
|
3920
4017
|
}, {
|
|
3921
|
-
readonly
|
|
3922
|
-
readonly
|
|
3923
|
-
readonly
|
|
4018
|
+
readonly indexed: true;
|
|
4019
|
+
readonly internalType: "address";
|
|
4020
|
+
readonly name: "operator";
|
|
4021
|
+
readonly type: "address";
|
|
4022
|
+
}, {
|
|
4023
|
+
readonly indexed: false;
|
|
4024
|
+
readonly internalType: "bool";
|
|
4025
|
+
readonly name: "isApproved";
|
|
4026
|
+
readonly type: "bool";
|
|
3924
4027
|
}];
|
|
3925
|
-
readonly name: "
|
|
3926
|
-
readonly type: "
|
|
4028
|
+
readonly name: "ApprovalForAll";
|
|
4029
|
+
readonly type: "event";
|
|
4030
|
+
}, {
|
|
4031
|
+
readonly anonymous: false;
|
|
4032
|
+
readonly inputs: readonly [{
|
|
4033
|
+
readonly indexed: false;
|
|
4034
|
+
readonly internalType: "contract IFees";
|
|
4035
|
+
readonly name: "feesModule";
|
|
4036
|
+
readonly type: "address";
|
|
4037
|
+
}];
|
|
4038
|
+
readonly name: "FeesModuleRegistered";
|
|
4039
|
+
readonly type: "event";
|
|
4040
|
+
}, {
|
|
4041
|
+
readonly anonymous: false;
|
|
4042
|
+
readonly inputs: readonly [{
|
|
4043
|
+
readonly indexed: false;
|
|
4044
|
+
readonly internalType: "contract ILockupPeriod";
|
|
4045
|
+
readonly name: "lockupPeriodModule";
|
|
4046
|
+
readonly type: "address";
|
|
4047
|
+
}];
|
|
4048
|
+
readonly name: "LockupPeriodModuleRegistered";
|
|
4049
|
+
readonly type: "event";
|
|
3927
4050
|
}, {
|
|
3928
4051
|
readonly anonymous: false;
|
|
3929
4052
|
readonly inputs: readonly [{
|
|
@@ -3942,7 +4065,87 @@ declare const PERP_MANAGER_ABI: readonly [{
|
|
|
3942
4065
|
readonly name: "newMargin";
|
|
3943
4066
|
readonly type: "uint256";
|
|
3944
4067
|
}];
|
|
3945
|
-
readonly name: "
|
|
4068
|
+
readonly name: "MarginAdjusted";
|
|
4069
|
+
readonly type: "event";
|
|
4070
|
+
}, {
|
|
4071
|
+
readonly anonymous: false;
|
|
4072
|
+
readonly inputs: readonly [{
|
|
4073
|
+
readonly indexed: false;
|
|
4074
|
+
readonly internalType: "contract IMarginRatios";
|
|
4075
|
+
readonly name: "marginRatiosModule";
|
|
4076
|
+
readonly type: "address";
|
|
4077
|
+
}];
|
|
4078
|
+
readonly name: "MarginRatiosModuleRegistered";
|
|
4079
|
+
readonly type: "event";
|
|
4080
|
+
}, {
|
|
4081
|
+
readonly anonymous: false;
|
|
4082
|
+
readonly inputs: readonly [{
|
|
4083
|
+
readonly indexed: false;
|
|
4084
|
+
readonly internalType: "PoolId";
|
|
4085
|
+
readonly name: "perpId";
|
|
4086
|
+
readonly type: "bytes32";
|
|
4087
|
+
}, {
|
|
4088
|
+
readonly indexed: false;
|
|
4089
|
+
readonly internalType: "uint256";
|
|
4090
|
+
readonly name: "sqrtPriceX96";
|
|
4091
|
+
readonly type: "uint256";
|
|
4092
|
+
}, {
|
|
4093
|
+
readonly indexed: false;
|
|
4094
|
+
readonly internalType: "uint256";
|
|
4095
|
+
readonly name: "longOI";
|
|
4096
|
+
readonly type: "uint256";
|
|
4097
|
+
}, {
|
|
4098
|
+
readonly indexed: false;
|
|
4099
|
+
readonly internalType: "uint256";
|
|
4100
|
+
readonly name: "shortOI";
|
|
4101
|
+
readonly type: "uint256";
|
|
4102
|
+
}, {
|
|
4103
|
+
readonly indexed: false;
|
|
4104
|
+
readonly internalType: "uint256";
|
|
4105
|
+
readonly name: "posId";
|
|
4106
|
+
readonly type: "uint256";
|
|
4107
|
+
}, {
|
|
4108
|
+
readonly indexed: false;
|
|
4109
|
+
readonly internalType: "int256";
|
|
4110
|
+
readonly name: "newPerpDelta";
|
|
4111
|
+
readonly type: "int256";
|
|
4112
|
+
}];
|
|
4113
|
+
readonly name: "NotionalAdjusted";
|
|
4114
|
+
readonly type: "event";
|
|
4115
|
+
}, {
|
|
4116
|
+
readonly anonymous: false;
|
|
4117
|
+
readonly inputs: readonly [{
|
|
4118
|
+
readonly indexed: true;
|
|
4119
|
+
readonly internalType: "address";
|
|
4120
|
+
readonly name: "pendingOwner";
|
|
4121
|
+
readonly type: "address";
|
|
4122
|
+
}];
|
|
4123
|
+
readonly name: "OwnershipHandoverCanceled";
|
|
4124
|
+
readonly type: "event";
|
|
4125
|
+
}, {
|
|
4126
|
+
readonly anonymous: false;
|
|
4127
|
+
readonly inputs: readonly [{
|
|
4128
|
+
readonly indexed: true;
|
|
4129
|
+
readonly internalType: "address";
|
|
4130
|
+
readonly name: "pendingOwner";
|
|
4131
|
+
readonly type: "address";
|
|
4132
|
+
}];
|
|
4133
|
+
readonly name: "OwnershipHandoverRequested";
|
|
4134
|
+
readonly type: "event";
|
|
4135
|
+
}, {
|
|
4136
|
+
readonly anonymous: false;
|
|
4137
|
+
readonly inputs: readonly [{
|
|
4138
|
+
readonly indexed: true;
|
|
4139
|
+
readonly internalType: "address";
|
|
4140
|
+
readonly name: "oldOwner";
|
|
4141
|
+
readonly type: "address";
|
|
4142
|
+
}, {
|
|
4143
|
+
readonly indexed: true;
|
|
4144
|
+
readonly internalType: "address";
|
|
4145
|
+
readonly name: "newOwner";
|
|
4146
|
+
readonly type: "address";
|
|
4147
|
+
}];
|
|
4148
|
+
readonly name: "OwnershipTransferred";
|
|
3946
4149
|
readonly type: "event";
|
|
3947
4150
|
}, {
|
|
3948
4151
|
readonly anonymous: false;
|
|
@@ -3959,7 +4162,7 @@ declare const PERP_MANAGER_ABI: readonly [{
|
|
|
3959
4162
|
}, {
|
|
3960
4163
|
readonly indexed: false;
|
|
3961
4164
|
readonly internalType: "uint256";
|
|
3962
|
-
readonly name: "
|
|
4165
|
+
readonly name: "sqrtPriceX96";
|
|
3963
4166
|
readonly type: "uint256";
|
|
3964
4167
|
}, {
|
|
3965
4168
|
readonly indexed: false;
|
|
@@ -3979,28 +4182,23 @@ declare const PERP_MANAGER_ABI: readonly [{
|
|
|
3979
4182
|
}, {
|
|
3980
4183
|
readonly indexed: false;
|
|
3981
4184
|
readonly internalType: "uint256";
|
|
3982
|
-
readonly name: "
|
|
4185
|
+
readonly name: "sqrtPriceX96";
|
|
3983
4186
|
readonly type: "uint256";
|
|
3984
4187
|
}, {
|
|
3985
4188
|
readonly indexed: false;
|
|
3986
|
-
readonly internalType: "
|
|
3987
|
-
readonly name: "
|
|
3988
|
-
readonly type: "
|
|
3989
|
-
}, {
|
|
3990
|
-
readonly indexed: false;
|
|
3991
|
-
readonly internalType: "bool";
|
|
3992
|
-
readonly name: "wasMaker";
|
|
3993
|
-
readonly type: "bool";
|
|
4189
|
+
readonly internalType: "uint256";
|
|
4190
|
+
readonly name: "longOI";
|
|
4191
|
+
readonly type: "uint256";
|
|
3994
4192
|
}, {
|
|
3995
4193
|
readonly indexed: false;
|
|
3996
|
-
readonly internalType: "
|
|
3997
|
-
readonly name: "
|
|
3998
|
-
readonly type: "
|
|
4194
|
+
readonly internalType: "uint256";
|
|
4195
|
+
readonly name: "shortOI";
|
|
4196
|
+
readonly type: "uint256";
|
|
3999
4197
|
}, {
|
|
4000
4198
|
readonly indexed: false;
|
|
4001
|
-
readonly internalType: "
|
|
4002
|
-
readonly name: "
|
|
4003
|
-
readonly type: "
|
|
4199
|
+
readonly internalType: "uint256";
|
|
4200
|
+
readonly name: "posId";
|
|
4201
|
+
readonly type: "uint256";
|
|
4004
4202
|
}, {
|
|
4005
4203
|
readonly indexed: false;
|
|
4006
4204
|
readonly internalType: "bool";
|
|
@@ -4008,14 +4206,9 @@ declare const PERP_MANAGER_ABI: readonly [{
|
|
|
4008
4206
|
readonly type: "bool";
|
|
4009
4207
|
}, {
|
|
4010
4208
|
readonly indexed: false;
|
|
4011
|
-
readonly internalType: "
|
|
4012
|
-
readonly name: "
|
|
4013
|
-
readonly type: "
|
|
4014
|
-
}, {
|
|
4015
|
-
readonly indexed: false;
|
|
4016
|
-
readonly internalType: "int256";
|
|
4017
|
-
readonly name: "fundingPremiumPerSecX96";
|
|
4018
|
-
readonly type: "int256";
|
|
4209
|
+
readonly internalType: "bool";
|
|
4210
|
+
readonly name: "wasPartialClose";
|
|
4211
|
+
readonly type: "bool";
|
|
4019
4212
|
}];
|
|
4020
4213
|
readonly name: "PositionClosed";
|
|
4021
4214
|
readonly type: "event";
|
|
@@ -4029,13 +4222,23 @@ declare const PERP_MANAGER_ABI: readonly [{
|
|
|
4029
4222
|
}, {
|
|
4030
4223
|
readonly indexed: false;
|
|
4031
4224
|
readonly internalType: "uint256";
|
|
4032
|
-
readonly name: "
|
|
4225
|
+
readonly name: "sqrtPriceX96";
|
|
4033
4226
|
readonly type: "uint256";
|
|
4034
4227
|
}, {
|
|
4035
4228
|
readonly indexed: false;
|
|
4036
|
-
readonly internalType: "
|
|
4037
|
-
readonly name: "
|
|
4038
|
-
readonly type: "
|
|
4229
|
+
readonly internalType: "uint256";
|
|
4230
|
+
readonly name: "longOI";
|
|
4231
|
+
readonly type: "uint256";
|
|
4232
|
+
}, {
|
|
4233
|
+
readonly indexed: false;
|
|
4234
|
+
readonly internalType: "uint256";
|
|
4235
|
+
readonly name: "shortOI";
|
|
4236
|
+
readonly type: "uint256";
|
|
4237
|
+
}, {
|
|
4238
|
+
readonly indexed: false;
|
|
4239
|
+
readonly internalType: "uint256";
|
|
4240
|
+
readonly name: "posId";
|
|
4241
|
+
readonly type: "uint256";
|
|
4039
4242
|
}, {
|
|
4040
4243
|
readonly indexed: false;
|
|
4041
4244
|
readonly internalType: "bool";
|
|
@@ -4044,74 +4247,226 @@ declare const PERP_MANAGER_ABI: readonly [{
|
|
|
4044
4247
|
}, {
|
|
4045
4248
|
readonly indexed: false;
|
|
4046
4249
|
readonly internalType: "int256";
|
|
4047
|
-
readonly name: "
|
|
4250
|
+
readonly name: "entryPerpDelta";
|
|
4048
4251
|
readonly type: "int256";
|
|
4049
|
-
}
|
|
4252
|
+
}];
|
|
4253
|
+
readonly name: "PositionOpened";
|
|
4254
|
+
readonly type: "event";
|
|
4255
|
+
}, {
|
|
4256
|
+
readonly anonymous: false;
|
|
4257
|
+
readonly inputs: readonly [{
|
|
4050
4258
|
readonly indexed: false;
|
|
4259
|
+
readonly internalType: "contract ISqrtPriceImpactLimit";
|
|
4260
|
+
readonly name: "sqrtPriceImpactLimitModule";
|
|
4261
|
+
readonly type: "address";
|
|
4262
|
+
}];
|
|
4263
|
+
readonly name: "SqrtPriceImpactLimitModuleRegistered";
|
|
4264
|
+
readonly type: "event";
|
|
4265
|
+
}, {
|
|
4266
|
+
readonly anonymous: false;
|
|
4267
|
+
readonly inputs: readonly [{
|
|
4268
|
+
readonly indexed: true;
|
|
4269
|
+
readonly internalType: "address";
|
|
4270
|
+
readonly name: "from";
|
|
4271
|
+
readonly type: "address";
|
|
4272
|
+
}, {
|
|
4273
|
+
readonly indexed: true;
|
|
4274
|
+
readonly internalType: "address";
|
|
4275
|
+
readonly name: "to";
|
|
4276
|
+
readonly type: "address";
|
|
4277
|
+
}, {
|
|
4278
|
+
readonly indexed: true;
|
|
4051
4279
|
readonly internalType: "uint256";
|
|
4052
|
-
readonly name: "
|
|
4280
|
+
readonly name: "id";
|
|
4053
4281
|
readonly type: "uint256";
|
|
4054
|
-
}, {
|
|
4055
|
-
readonly indexed: false;
|
|
4056
|
-
readonly internalType: "int256";
|
|
4057
|
-
readonly name: "fundingPremiumPerSecX96";
|
|
4058
|
-
readonly type: "int256";
|
|
4059
4282
|
}];
|
|
4060
|
-
readonly name: "
|
|
4283
|
+
readonly name: "Transfer";
|
|
4061
4284
|
readonly type: "event";
|
|
4062
4285
|
}, {
|
|
4063
4286
|
readonly inputs: readonly [];
|
|
4064
|
-
readonly name: "
|
|
4287
|
+
readonly name: "ERC721_NAME";
|
|
4065
4288
|
readonly outputs: readonly [{
|
|
4066
|
-
readonly internalType: "
|
|
4289
|
+
readonly internalType: "string";
|
|
4067
4290
|
readonly name: "";
|
|
4068
|
-
readonly type: "
|
|
4291
|
+
readonly type: "string";
|
|
4069
4292
|
}];
|
|
4070
4293
|
readonly stateMutability: "view";
|
|
4071
4294
|
readonly type: "function";
|
|
4072
4295
|
}, {
|
|
4073
4296
|
readonly inputs: readonly [];
|
|
4074
|
-
readonly name: "
|
|
4297
|
+
readonly name: "ERC721_SYMBOL";
|
|
4075
4298
|
readonly outputs: readonly [{
|
|
4076
|
-
readonly internalType: "
|
|
4299
|
+
readonly internalType: "string";
|
|
4077
4300
|
readonly name: "";
|
|
4078
|
-
readonly type: "
|
|
4301
|
+
readonly type: "string";
|
|
4302
|
+
}];
|
|
4303
|
+
readonly stateMutability: "view";
|
|
4304
|
+
readonly type: "function";
|
|
4305
|
+
}, {
|
|
4306
|
+
readonly inputs: readonly [];
|
|
4307
|
+
readonly name: "ERC721_URI";
|
|
4308
|
+
readonly outputs: readonly [{
|
|
4309
|
+
readonly internalType: "string";
|
|
4310
|
+
readonly name: "";
|
|
4311
|
+
readonly type: "string";
|
|
4312
|
+
}];
|
|
4313
|
+
readonly stateMutability: "view";
|
|
4314
|
+
readonly type: "function";
|
|
4315
|
+
}, {
|
|
4316
|
+
readonly inputs: readonly [];
|
|
4317
|
+
readonly name: "MAX_PROTOCOL_FEE";
|
|
4318
|
+
readonly outputs: readonly [{
|
|
4319
|
+
readonly internalType: "uint24";
|
|
4320
|
+
readonly name: "";
|
|
4321
|
+
readonly type: "uint24";
|
|
4079
4322
|
}];
|
|
4080
4323
|
readonly stateMutability: "view";
|
|
4081
4324
|
readonly type: "function";
|
|
4082
4325
|
}, {
|
|
4083
4326
|
readonly inputs: readonly [{
|
|
4084
|
-
readonly internalType: "PoolId";
|
|
4085
|
-
readonly name: "perpId";
|
|
4086
|
-
readonly type: "bytes32";
|
|
4087
|
-
}, {
|
|
4088
4327
|
readonly components: readonly [{
|
|
4089
|
-
readonly internalType: "
|
|
4328
|
+
readonly internalType: "uint256";
|
|
4090
4329
|
readonly name: "posId";
|
|
4091
|
-
readonly type: "
|
|
4330
|
+
readonly type: "uint256";
|
|
4092
4331
|
}, {
|
|
4332
|
+
readonly internalType: "int256";
|
|
4333
|
+
readonly name: "marginDelta";
|
|
4334
|
+
readonly type: "int256";
|
|
4335
|
+
}];
|
|
4336
|
+
readonly internalType: "struct IPerpManager.AdjustMarginParams";
|
|
4337
|
+
readonly name: "params";
|
|
4338
|
+
readonly type: "tuple";
|
|
4339
|
+
}];
|
|
4340
|
+
readonly name: "adjustMargin";
|
|
4341
|
+
readonly outputs: readonly [];
|
|
4342
|
+
readonly stateMutability: "nonpayable";
|
|
4343
|
+
readonly type: "function";
|
|
4344
|
+
}, {
|
|
4345
|
+
readonly inputs: readonly [{
|
|
4346
|
+
readonly components: readonly [{
|
|
4093
4347
|
readonly internalType: "uint256";
|
|
4094
|
-
readonly name: "
|
|
4348
|
+
readonly name: "posId";
|
|
4095
4349
|
readonly type: "uint256";
|
|
4350
|
+
}, {
|
|
4351
|
+
readonly internalType: "int256";
|
|
4352
|
+
readonly name: "perpDelta";
|
|
4353
|
+
readonly type: "int256";
|
|
4354
|
+
}, {
|
|
4355
|
+
readonly internalType: "uint128";
|
|
4356
|
+
readonly name: "usdLimit";
|
|
4357
|
+
readonly type: "uint128";
|
|
4096
4358
|
}];
|
|
4097
|
-
readonly internalType: "struct IPerpManager.
|
|
4359
|
+
readonly internalType: "struct IPerpManager.AdjustNotionalParams";
|
|
4098
4360
|
readonly name: "params";
|
|
4099
4361
|
readonly type: "tuple";
|
|
4100
4362
|
}];
|
|
4101
|
-
readonly name: "
|
|
4363
|
+
readonly name: "adjustNotional";
|
|
4102
4364
|
readonly outputs: readonly [];
|
|
4103
4365
|
readonly stateMutability: "nonpayable";
|
|
4104
4366
|
readonly type: "function";
|
|
4367
|
+
}, {
|
|
4368
|
+
readonly inputs: readonly [{
|
|
4369
|
+
readonly internalType: "address";
|
|
4370
|
+
readonly name: "account";
|
|
4371
|
+
readonly type: "address";
|
|
4372
|
+
}, {
|
|
4373
|
+
readonly internalType: "uint256";
|
|
4374
|
+
readonly name: "id";
|
|
4375
|
+
readonly type: "uint256";
|
|
4376
|
+
}];
|
|
4377
|
+
readonly name: "approve";
|
|
4378
|
+
readonly outputs: readonly [];
|
|
4379
|
+
readonly stateMutability: "payable";
|
|
4380
|
+
readonly type: "function";
|
|
4381
|
+
}, {
|
|
4382
|
+
readonly inputs: readonly [{
|
|
4383
|
+
readonly internalType: "address";
|
|
4384
|
+
readonly name: "owner";
|
|
4385
|
+
readonly type: "address";
|
|
4386
|
+
}];
|
|
4387
|
+
readonly name: "balanceOf";
|
|
4388
|
+
readonly outputs: readonly [{
|
|
4389
|
+
readonly internalType: "uint256";
|
|
4390
|
+
readonly name: "result";
|
|
4391
|
+
readonly type: "uint256";
|
|
4392
|
+
}];
|
|
4393
|
+
readonly stateMutability: "view";
|
|
4394
|
+
readonly type: "function";
|
|
4395
|
+
}, {
|
|
4396
|
+
readonly inputs: readonly [];
|
|
4397
|
+
readonly name: "cancelOwnershipHandover";
|
|
4398
|
+
readonly outputs: readonly [];
|
|
4399
|
+
readonly stateMutability: "payable";
|
|
4400
|
+
readonly type: "function";
|
|
4105
4401
|
}, {
|
|
4106
4402
|
readonly inputs: readonly [{
|
|
4107
4403
|
readonly internalType: "PoolId";
|
|
4108
|
-
readonly name: "
|
|
4404
|
+
readonly name: "";
|
|
4109
4405
|
readonly type: "bytes32";
|
|
4406
|
+
}];
|
|
4407
|
+
readonly name: "cfgs";
|
|
4408
|
+
readonly outputs: readonly [{
|
|
4409
|
+
readonly components: readonly [{
|
|
4410
|
+
readonly internalType: "Currency";
|
|
4411
|
+
readonly name: "currency0";
|
|
4412
|
+
readonly type: "address";
|
|
4413
|
+
}, {
|
|
4414
|
+
readonly internalType: "Currency";
|
|
4415
|
+
readonly name: "currency1";
|
|
4416
|
+
readonly type: "address";
|
|
4417
|
+
}, {
|
|
4418
|
+
readonly internalType: "uint24";
|
|
4419
|
+
readonly name: "fee";
|
|
4420
|
+
readonly type: "uint24";
|
|
4421
|
+
}, {
|
|
4422
|
+
readonly internalType: "int24";
|
|
4423
|
+
readonly name: "tickSpacing";
|
|
4424
|
+
readonly type: "int24";
|
|
4425
|
+
}, {
|
|
4426
|
+
readonly internalType: "contract IHooks";
|
|
4427
|
+
readonly name: "hooks";
|
|
4428
|
+
readonly type: "address";
|
|
4429
|
+
}];
|
|
4430
|
+
readonly internalType: "struct PoolKey";
|
|
4431
|
+
readonly name: "key";
|
|
4432
|
+
readonly type: "tuple";
|
|
4433
|
+
}, {
|
|
4434
|
+
readonly internalType: "address";
|
|
4435
|
+
readonly name: "creator";
|
|
4436
|
+
readonly type: "address";
|
|
4437
|
+
}, {
|
|
4438
|
+
readonly internalType: "address";
|
|
4439
|
+
readonly name: "vault";
|
|
4440
|
+
readonly type: "address";
|
|
4110
4441
|
}, {
|
|
4442
|
+
readonly internalType: "address";
|
|
4443
|
+
readonly name: "beacon";
|
|
4444
|
+
readonly type: "address";
|
|
4445
|
+
}, {
|
|
4446
|
+
readonly internalType: "contract IFees";
|
|
4447
|
+
readonly name: "fees";
|
|
4448
|
+
readonly type: "address";
|
|
4449
|
+
}, {
|
|
4450
|
+
readonly internalType: "contract IMarginRatios";
|
|
4451
|
+
readonly name: "marginRatios";
|
|
4452
|
+
readonly type: "address";
|
|
4453
|
+
}, {
|
|
4454
|
+
readonly internalType: "contract ILockupPeriod";
|
|
4455
|
+
readonly name: "lockupPeriod";
|
|
4456
|
+
readonly type: "address";
|
|
4457
|
+
}, {
|
|
4458
|
+
readonly internalType: "contract ISqrtPriceImpactLimit";
|
|
4459
|
+
readonly name: "sqrtPriceImpactLimit";
|
|
4460
|
+
readonly type: "address";
|
|
4461
|
+
}];
|
|
4462
|
+
readonly stateMutability: "view";
|
|
4463
|
+
readonly type: "function";
|
|
4464
|
+
}, {
|
|
4465
|
+
readonly inputs: readonly [{
|
|
4111
4466
|
readonly components: readonly [{
|
|
4112
|
-
readonly internalType: "
|
|
4467
|
+
readonly internalType: "uint256";
|
|
4113
4468
|
readonly name: "posId";
|
|
4114
|
-
readonly type: "
|
|
4469
|
+
readonly type: "uint256";
|
|
4115
4470
|
}, {
|
|
4116
4471
|
readonly internalType: "uint128";
|
|
4117
4472
|
readonly name: "minAmt0Out";
|
|
@@ -4130,23 +4485,55 @@ declare const PERP_MANAGER_ABI: readonly [{
|
|
|
4130
4485
|
readonly type: "tuple";
|
|
4131
4486
|
}];
|
|
4132
4487
|
readonly name: "closePosition";
|
|
4133
|
-
readonly outputs: readonly [
|
|
4134
|
-
|
|
4135
|
-
|
|
4136
|
-
|
|
4488
|
+
readonly outputs: readonly [];
|
|
4489
|
+
readonly stateMutability: "nonpayable";
|
|
4490
|
+
readonly type: "function";
|
|
4491
|
+
}, {
|
|
4492
|
+
readonly inputs: readonly [{
|
|
4493
|
+
readonly internalType: "address";
|
|
4494
|
+
readonly name: "recipient";
|
|
4495
|
+
readonly type: "address";
|
|
4137
4496
|
}];
|
|
4497
|
+
readonly name: "collectProtocolFees";
|
|
4498
|
+
readonly outputs: readonly [];
|
|
4138
4499
|
readonly stateMutability: "nonpayable";
|
|
4139
4500
|
readonly type: "function";
|
|
4501
|
+
}, {
|
|
4502
|
+
readonly inputs: readonly [{
|
|
4503
|
+
readonly internalType: "address";
|
|
4504
|
+
readonly name: "pendingOwner";
|
|
4505
|
+
readonly type: "address";
|
|
4506
|
+
}];
|
|
4507
|
+
readonly name: "completeOwnershipHandover";
|
|
4508
|
+
readonly outputs: readonly [];
|
|
4509
|
+
readonly stateMutability: "payable";
|
|
4510
|
+
readonly type: "function";
|
|
4140
4511
|
}, {
|
|
4141
4512
|
readonly inputs: readonly [{
|
|
4142
4513
|
readonly components: readonly [{
|
|
4143
|
-
readonly internalType: "uint160";
|
|
4144
|
-
readonly name: "startingSqrtPriceX96";
|
|
4145
|
-
readonly type: "uint160";
|
|
4146
|
-
}, {
|
|
4147
4514
|
readonly internalType: "address";
|
|
4148
4515
|
readonly name: "beacon";
|
|
4149
4516
|
readonly type: "address";
|
|
4517
|
+
}, {
|
|
4518
|
+
readonly internalType: "contract IFees";
|
|
4519
|
+
readonly name: "fees";
|
|
4520
|
+
readonly type: "address";
|
|
4521
|
+
}, {
|
|
4522
|
+
readonly internalType: "contract IMarginRatios";
|
|
4523
|
+
readonly name: "marginRatios";
|
|
4524
|
+
readonly type: "address";
|
|
4525
|
+
}, {
|
|
4526
|
+
readonly internalType: "contract ILockupPeriod";
|
|
4527
|
+
readonly name: "lockupPeriod";
|
|
4528
|
+
readonly type: "address";
|
|
4529
|
+
}, {
|
|
4530
|
+
readonly internalType: "contract ISqrtPriceImpactLimit";
|
|
4531
|
+
readonly name: "sqrtPriceImpactLimit";
|
|
4532
|
+
readonly type: "address";
|
|
4533
|
+
}, {
|
|
4534
|
+
readonly internalType: "uint160";
|
|
4535
|
+
readonly name: "startingSqrtPriceX96";
|
|
4536
|
+
readonly type: "uint160";
|
|
4150
4537
|
}];
|
|
4151
4538
|
readonly internalType: "struct IPerpManager.CreatePerpParams";
|
|
4152
4539
|
readonly name: "params";
|
|
@@ -4162,189 +4549,125 @@ declare const PERP_MANAGER_ABI: readonly [{
|
|
|
4162
4549
|
readonly type: "function";
|
|
4163
4550
|
}, {
|
|
4164
4551
|
readonly inputs: readonly [{
|
|
4165
|
-
readonly internalType: "int24";
|
|
4166
|
-
readonly name: "tickA";
|
|
4167
|
-
readonly type: "int24";
|
|
4168
|
-
}, {
|
|
4169
|
-
readonly internalType: "int24";
|
|
4170
|
-
readonly name: "tickB";
|
|
4171
|
-
readonly type: "int24";
|
|
4172
|
-
}, {
|
|
4173
4552
|
readonly internalType: "uint256";
|
|
4174
|
-
readonly name: "
|
|
4553
|
+
readonly name: "id";
|
|
4175
4554
|
readonly type: "uint256";
|
|
4176
4555
|
}];
|
|
4177
|
-
readonly name: "
|
|
4556
|
+
readonly name: "getApproved";
|
|
4178
4557
|
readonly outputs: readonly [{
|
|
4179
|
-
readonly internalType: "
|
|
4180
|
-
readonly name: "
|
|
4181
|
-
readonly type: "
|
|
4558
|
+
readonly internalType: "address";
|
|
4559
|
+
readonly name: "result";
|
|
4560
|
+
readonly type: "address";
|
|
4182
4561
|
}];
|
|
4183
|
-
readonly stateMutability: "
|
|
4562
|
+
readonly stateMutability: "view";
|
|
4184
4563
|
readonly type: "function";
|
|
4185
4564
|
}, {
|
|
4186
4565
|
readonly inputs: readonly [{
|
|
4187
4566
|
readonly internalType: "PoolId";
|
|
4188
4567
|
readonly name: "perpId";
|
|
4189
4568
|
readonly type: "bytes32";
|
|
4190
|
-
}];
|
|
4191
|
-
readonly name: "fees";
|
|
4192
|
-
readonly outputs: readonly [{
|
|
4193
|
-
readonly internalType: "uint24";
|
|
4194
|
-
readonly name: "creatorFee";
|
|
4195
|
-
readonly type: "uint24";
|
|
4196
4569
|
}, {
|
|
4197
|
-
readonly internalType: "
|
|
4198
|
-
readonly name: "
|
|
4199
|
-
readonly type: "
|
|
4200
|
-
}
|
|
4201
|
-
|
|
4202
|
-
|
|
4203
|
-
|
|
4570
|
+
readonly internalType: "uint16";
|
|
4571
|
+
readonly name: "cardinalityCap";
|
|
4572
|
+
readonly type: "uint16";
|
|
4573
|
+
}];
|
|
4574
|
+
readonly name: "increaseCardinalityCap";
|
|
4575
|
+
readonly outputs: readonly [];
|
|
4576
|
+
readonly stateMutability: "nonpayable";
|
|
4577
|
+
readonly type: "function";
|
|
4578
|
+
}, {
|
|
4579
|
+
readonly inputs: readonly [{
|
|
4580
|
+
readonly internalType: "address";
|
|
4581
|
+
readonly name: "owner";
|
|
4582
|
+
readonly type: "address";
|
|
4204
4583
|
}, {
|
|
4205
|
-
readonly internalType: "
|
|
4206
|
-
readonly name: "
|
|
4207
|
-
readonly type: "
|
|
4584
|
+
readonly internalType: "address";
|
|
4585
|
+
readonly name: "operator";
|
|
4586
|
+
readonly type: "address";
|
|
4587
|
+
}];
|
|
4588
|
+
readonly name: "isApprovedForAll";
|
|
4589
|
+
readonly outputs: readonly [{
|
|
4590
|
+
readonly internalType: "bool";
|
|
4591
|
+
readonly name: "result";
|
|
4592
|
+
readonly type: "bool";
|
|
4208
4593
|
}];
|
|
4209
4594
|
readonly stateMutability: "view";
|
|
4210
4595
|
readonly type: "function";
|
|
4211
4596
|
}, {
|
|
4212
4597
|
readonly inputs: readonly [{
|
|
4213
|
-
readonly internalType: "
|
|
4214
|
-
readonly name: "
|
|
4215
|
-
readonly type: "
|
|
4216
|
-
}, {
|
|
4217
|
-
readonly internalType: "uint128";
|
|
4218
|
-
readonly name: "posId";
|
|
4219
|
-
readonly type: "uint128";
|
|
4598
|
+
readonly internalType: "contract IFees";
|
|
4599
|
+
readonly name: "";
|
|
4600
|
+
readonly type: "address";
|
|
4220
4601
|
}];
|
|
4221
|
-
readonly name: "
|
|
4602
|
+
readonly name: "isFeesRegistered";
|
|
4222
4603
|
readonly outputs: readonly [{
|
|
4223
|
-
readonly
|
|
4224
|
-
readonly internalType: "address";
|
|
4225
|
-
readonly name: "holder";
|
|
4226
|
-
readonly type: "address";
|
|
4227
|
-
}, {
|
|
4228
|
-
readonly internalType: "uint256";
|
|
4229
|
-
readonly name: "margin";
|
|
4230
|
-
readonly type: "uint256";
|
|
4231
|
-
}, {
|
|
4232
|
-
readonly internalType: "int256";
|
|
4233
|
-
readonly name: "perpDelta";
|
|
4234
|
-
readonly type: "int256";
|
|
4235
|
-
}, {
|
|
4236
|
-
readonly internalType: "int256";
|
|
4237
|
-
readonly name: "usdDelta";
|
|
4238
|
-
readonly type: "int256";
|
|
4239
|
-
}, {
|
|
4240
|
-
readonly internalType: "int256";
|
|
4241
|
-
readonly name: "entryTwPremiumX96";
|
|
4242
|
-
readonly type: "int256";
|
|
4243
|
-
}, {
|
|
4244
|
-
readonly components: readonly [{
|
|
4245
|
-
readonly internalType: "uint32";
|
|
4246
|
-
readonly name: "entryTimestamp";
|
|
4247
|
-
readonly type: "uint32";
|
|
4248
|
-
}, {
|
|
4249
|
-
readonly internalType: "int24";
|
|
4250
|
-
readonly name: "tickLower";
|
|
4251
|
-
readonly type: "int24";
|
|
4252
|
-
}, {
|
|
4253
|
-
readonly internalType: "int24";
|
|
4254
|
-
readonly name: "tickUpper";
|
|
4255
|
-
readonly type: "int24";
|
|
4256
|
-
}, {
|
|
4257
|
-
readonly internalType: "uint128";
|
|
4258
|
-
readonly name: "liquidity";
|
|
4259
|
-
readonly type: "uint128";
|
|
4260
|
-
}, {
|
|
4261
|
-
readonly internalType: "int256";
|
|
4262
|
-
readonly name: "entryTwPremiumGrowthInsideX96";
|
|
4263
|
-
readonly type: "int256";
|
|
4264
|
-
}, {
|
|
4265
|
-
readonly internalType: "int256";
|
|
4266
|
-
readonly name: "entryTwPremiumDivBySqrtPriceGrowthInsideX96";
|
|
4267
|
-
readonly type: "int256";
|
|
4268
|
-
}, {
|
|
4269
|
-
readonly internalType: "int256";
|
|
4270
|
-
readonly name: "entryTwPremiumGrowthBelowX96";
|
|
4271
|
-
readonly type: "int256";
|
|
4272
|
-
}];
|
|
4273
|
-
readonly internalType: "struct IPerpManager.MakerDetails";
|
|
4274
|
-
readonly name: "makerDetails";
|
|
4275
|
-
readonly type: "tuple";
|
|
4276
|
-
}];
|
|
4277
|
-
readonly internalType: "struct IPerpManager.Position";
|
|
4604
|
+
readonly internalType: "bool";
|
|
4278
4605
|
readonly name: "";
|
|
4279
|
-
readonly type: "
|
|
4606
|
+
readonly type: "bool";
|
|
4280
4607
|
}];
|
|
4281
4608
|
readonly stateMutability: "view";
|
|
4282
4609
|
readonly type: "function";
|
|
4283
4610
|
}, {
|
|
4284
4611
|
readonly inputs: readonly [{
|
|
4285
|
-
readonly internalType: "
|
|
4286
|
-
readonly name: "
|
|
4287
|
-
readonly type: "
|
|
4288
|
-
}, {
|
|
4289
|
-
readonly internalType: "uint32";
|
|
4290
|
-
readonly name: "secondsAgo";
|
|
4291
|
-
readonly type: "uint32";
|
|
4612
|
+
readonly internalType: "contract ILockupPeriod";
|
|
4613
|
+
readonly name: "";
|
|
4614
|
+
readonly type: "address";
|
|
4292
4615
|
}];
|
|
4293
|
-
readonly name: "
|
|
4616
|
+
readonly name: "isLockupPeriodRegistered";
|
|
4294
4617
|
readonly outputs: readonly [{
|
|
4295
|
-
readonly internalType: "
|
|
4618
|
+
readonly internalType: "bool";
|
|
4296
4619
|
readonly name: "";
|
|
4297
|
-
readonly type: "
|
|
4620
|
+
readonly type: "bool";
|
|
4298
4621
|
}];
|
|
4299
4622
|
readonly stateMutability: "view";
|
|
4300
4623
|
readonly type: "function";
|
|
4301
4624
|
}, {
|
|
4302
4625
|
readonly inputs: readonly [{
|
|
4303
|
-
readonly internalType: "
|
|
4304
|
-
readonly name: "
|
|
4305
|
-
readonly type: "
|
|
4306
|
-
}, {
|
|
4307
|
-
readonly internalType: "uint32";
|
|
4308
|
-
readonly name: "cardinalityNext";
|
|
4309
|
-
readonly type: "uint32";
|
|
4626
|
+
readonly internalType: "contract IMarginRatios";
|
|
4627
|
+
readonly name: "";
|
|
4628
|
+
readonly type: "address";
|
|
4310
4629
|
}];
|
|
4311
|
-
readonly name: "
|
|
4312
|
-
readonly outputs: readonly [
|
|
4313
|
-
|
|
4630
|
+
readonly name: "isMarginRatiosRegistered";
|
|
4631
|
+
readonly outputs: readonly [{
|
|
4632
|
+
readonly internalType: "bool";
|
|
4633
|
+
readonly name: "";
|
|
4634
|
+
readonly type: "bool";
|
|
4635
|
+
}];
|
|
4636
|
+
readonly stateMutability: "view";
|
|
4314
4637
|
readonly type: "function";
|
|
4315
4638
|
}, {
|
|
4316
4639
|
readonly inputs: readonly [{
|
|
4317
|
-
readonly internalType: "
|
|
4318
|
-
readonly name: "
|
|
4319
|
-
readonly type: "
|
|
4320
|
-
}, {
|
|
4321
|
-
readonly internalType: "uint128";
|
|
4322
|
-
readonly name: "posId";
|
|
4323
|
-
readonly type: "uint128";
|
|
4640
|
+
readonly internalType: "contract ISqrtPriceImpactLimit";
|
|
4641
|
+
readonly name: "";
|
|
4642
|
+
readonly type: "address";
|
|
4324
4643
|
}];
|
|
4325
|
-
readonly name: "
|
|
4644
|
+
readonly name: "isSqrtPriceImpactLimitRegistered";
|
|
4326
4645
|
readonly outputs: readonly [{
|
|
4327
|
-
readonly internalType: "int256";
|
|
4328
|
-
readonly name: "pnl";
|
|
4329
|
-
readonly type: "int256";
|
|
4330
|
-
}, {
|
|
4331
|
-
readonly internalType: "int256";
|
|
4332
|
-
readonly name: "fundingPayment";
|
|
4333
|
-
readonly type: "int256";
|
|
4334
|
-
}, {
|
|
4335
|
-
readonly internalType: "int256";
|
|
4336
|
-
readonly name: "effectiveMargin";
|
|
4337
|
-
readonly type: "int256";
|
|
4338
|
-
}, {
|
|
4339
4646
|
readonly internalType: "bool";
|
|
4340
|
-
readonly name: "
|
|
4647
|
+
readonly name: "";
|
|
4341
4648
|
readonly type: "bool";
|
|
4342
|
-
}
|
|
4649
|
+
}];
|
|
4650
|
+
readonly stateMutability: "view";
|
|
4651
|
+
readonly type: "function";
|
|
4652
|
+
}, {
|
|
4653
|
+
readonly inputs: readonly [];
|
|
4654
|
+
readonly name: "name";
|
|
4655
|
+
readonly outputs: readonly [{
|
|
4656
|
+
readonly internalType: "string";
|
|
4657
|
+
readonly name: "";
|
|
4658
|
+
readonly type: "string";
|
|
4659
|
+
}];
|
|
4660
|
+
readonly stateMutability: "pure";
|
|
4661
|
+
readonly type: "function";
|
|
4662
|
+
}, {
|
|
4663
|
+
readonly inputs: readonly [];
|
|
4664
|
+
readonly name: "nextPosId";
|
|
4665
|
+
readonly outputs: readonly [{
|
|
4343
4666
|
readonly internalType: "uint256";
|
|
4344
|
-
readonly name: "
|
|
4667
|
+
readonly name: "";
|
|
4345
4668
|
readonly type: "uint256";
|
|
4346
4669
|
}];
|
|
4347
|
-
readonly stateMutability: "
|
|
4670
|
+
readonly stateMutability: "view";
|
|
4348
4671
|
readonly type: "function";
|
|
4349
4672
|
}, {
|
|
4350
4673
|
readonly inputs: readonly [{
|
|
@@ -4353,6 +4676,10 @@ declare const PERP_MANAGER_ABI: readonly [{
|
|
|
4353
4676
|
readonly type: "bytes32";
|
|
4354
4677
|
}, {
|
|
4355
4678
|
readonly components: readonly [{
|
|
4679
|
+
readonly internalType: "address";
|
|
4680
|
+
readonly name: "holder";
|
|
4681
|
+
readonly type: "address";
|
|
4682
|
+
}, {
|
|
4356
4683
|
readonly internalType: "uint256";
|
|
4357
4684
|
readonly name: "margin";
|
|
4358
4685
|
readonly type: "uint256";
|
|
@@ -4381,11 +4708,11 @@ declare const PERP_MANAGER_ABI: readonly [{
|
|
|
4381
4708
|
readonly name: "params";
|
|
4382
4709
|
readonly type: "tuple";
|
|
4383
4710
|
}];
|
|
4384
|
-
readonly name: "
|
|
4711
|
+
readonly name: "openMakerPos";
|
|
4385
4712
|
readonly outputs: readonly [{
|
|
4386
|
-
readonly internalType: "
|
|
4387
|
-
readonly name: "
|
|
4388
|
-
readonly type: "
|
|
4713
|
+
readonly internalType: "uint256";
|
|
4714
|
+
readonly name: "posId";
|
|
4715
|
+
readonly type: "uint256";
|
|
4389
4716
|
}];
|
|
4390
4717
|
readonly stateMutability: "nonpayable";
|
|
4391
4718
|
readonly type: "function";
|
|
@@ -4396,6 +4723,10 @@ declare const PERP_MANAGER_ABI: readonly [{
|
|
|
4396
4723
|
readonly type: "bytes32";
|
|
4397
4724
|
}, {
|
|
4398
4725
|
readonly components: readonly [{
|
|
4726
|
+
readonly internalType: "address";
|
|
4727
|
+
readonly name: "holder";
|
|
4728
|
+
readonly type: "address";
|
|
4729
|
+
}, {
|
|
4399
4730
|
readonly internalType: "bool";
|
|
4400
4731
|
readonly name: "isLong";
|
|
4401
4732
|
readonly type: "bool";
|
|
@@ -4416,208 +4747,180 @@ declare const PERP_MANAGER_ABI: readonly [{
|
|
|
4416
4747
|
readonly name: "params";
|
|
4417
4748
|
readonly type: "tuple";
|
|
4418
4749
|
}];
|
|
4419
|
-
readonly name: "
|
|
4750
|
+
readonly name: "openTakerPos";
|
|
4420
4751
|
readonly outputs: readonly [{
|
|
4421
|
-
readonly internalType: "
|
|
4422
|
-
readonly name: "
|
|
4423
|
-
readonly type: "
|
|
4752
|
+
readonly internalType: "uint256";
|
|
4753
|
+
readonly name: "posId";
|
|
4754
|
+
readonly type: "uint256";
|
|
4424
4755
|
}];
|
|
4425
4756
|
readonly stateMutability: "nonpayable";
|
|
4426
4757
|
readonly type: "function";
|
|
4427
4758
|
}, {
|
|
4428
|
-
readonly inputs: readonly [
|
|
4429
|
-
|
|
4430
|
-
readonly name: "";
|
|
4431
|
-
readonly type: "bytes32";
|
|
4432
|
-
}];
|
|
4433
|
-
readonly name: "perps";
|
|
4759
|
+
readonly inputs: readonly [];
|
|
4760
|
+
readonly name: "owner";
|
|
4434
4761
|
readonly outputs: readonly [{
|
|
4435
4762
|
readonly internalType: "address";
|
|
4436
|
-
readonly name: "
|
|
4763
|
+
readonly name: "result";
|
|
4437
4764
|
readonly type: "address";
|
|
4438
|
-
}
|
|
4765
|
+
}];
|
|
4766
|
+
readonly stateMutability: "view";
|
|
4767
|
+
readonly type: "function";
|
|
4768
|
+
}, {
|
|
4769
|
+
readonly inputs: readonly [{
|
|
4770
|
+
readonly internalType: "uint256";
|
|
4771
|
+
readonly name: "id";
|
|
4772
|
+
readonly type: "uint256";
|
|
4773
|
+
}];
|
|
4774
|
+
readonly name: "ownerOf";
|
|
4775
|
+
readonly outputs: readonly [{
|
|
4439
4776
|
readonly internalType: "address";
|
|
4440
|
-
readonly name: "
|
|
4777
|
+
readonly name: "result";
|
|
4441
4778
|
readonly type: "address";
|
|
4442
|
-
}
|
|
4779
|
+
}];
|
|
4780
|
+
readonly stateMutability: "view";
|
|
4781
|
+
readonly type: "function";
|
|
4782
|
+
}, {
|
|
4783
|
+
readonly inputs: readonly [{
|
|
4443
4784
|
readonly internalType: "address";
|
|
4444
|
-
readonly name: "
|
|
4785
|
+
readonly name: "pendingOwner";
|
|
4445
4786
|
readonly type: "address";
|
|
4446
|
-
}
|
|
4447
|
-
|
|
4448
|
-
|
|
4449
|
-
readonly type: "uint32";
|
|
4450
|
-
}, {
|
|
4451
|
-
readonly internalType: "uint32";
|
|
4452
|
-
readonly name: "makerLockupPeriod";
|
|
4453
|
-
readonly type: "uint32";
|
|
4454
|
-
}, {
|
|
4455
|
-
readonly internalType: "uint32";
|
|
4456
|
-
readonly name: "twapWindow";
|
|
4457
|
-
readonly type: "uint32";
|
|
4458
|
-
}, {
|
|
4459
|
-
readonly internalType: "uint32";
|
|
4460
|
-
readonly name: "lastTwPremiumsUpdate";
|
|
4461
|
-
readonly type: "uint32";
|
|
4462
|
-
}, {
|
|
4463
|
-
readonly internalType: "uint24";
|
|
4464
|
-
readonly name: "creatorFee";
|
|
4465
|
-
readonly type: "uint24";
|
|
4466
|
-
}, {
|
|
4467
|
-
readonly internalType: "uint24";
|
|
4468
|
-
readonly name: "insuranceFee";
|
|
4469
|
-
readonly type: "uint24";
|
|
4470
|
-
}, {
|
|
4471
|
-
readonly internalType: "uint24";
|
|
4472
|
-
readonly name: "liquidationFee";
|
|
4473
|
-
readonly type: "uint24";
|
|
4474
|
-
}, {
|
|
4475
|
-
readonly internalType: "uint24";
|
|
4476
|
-
readonly name: "liquidatorFeeSplit";
|
|
4477
|
-
readonly type: "uint24";
|
|
4478
|
-
}, {
|
|
4479
|
-
readonly internalType: "uint128";
|
|
4480
|
-
readonly name: "nextPosId";
|
|
4481
|
-
readonly type: "uint128";
|
|
4482
|
-
}, {
|
|
4787
|
+
}];
|
|
4788
|
+
readonly name: "ownershipHandoverExpiresAt";
|
|
4789
|
+
readonly outputs: readonly [{
|
|
4483
4790
|
readonly internalType: "uint256";
|
|
4484
|
-
readonly name: "
|
|
4791
|
+
readonly name: "result";
|
|
4485
4792
|
readonly type: "uint256";
|
|
4486
|
-
}
|
|
4793
|
+
}];
|
|
4794
|
+
readonly stateMutability: "view";
|
|
4795
|
+
readonly type: "function";
|
|
4796
|
+
}, {
|
|
4797
|
+
readonly inputs: readonly [{
|
|
4487
4798
|
readonly internalType: "uint256";
|
|
4488
|
-
readonly name: "
|
|
4799
|
+
readonly name: "";
|
|
4489
4800
|
readonly type: "uint256";
|
|
4801
|
+
}];
|
|
4802
|
+
readonly name: "positions";
|
|
4803
|
+
readonly outputs: readonly [{
|
|
4804
|
+
readonly internalType: "PoolId";
|
|
4805
|
+
readonly name: "perpId";
|
|
4806
|
+
readonly type: "bytes32";
|
|
4490
4807
|
}, {
|
|
4491
|
-
readonly internalType: "
|
|
4492
|
-
readonly name: "
|
|
4493
|
-
readonly type: "
|
|
4494
|
-
}, {
|
|
4495
|
-
readonly internalType: "uint24";
|
|
4496
|
-
readonly name: "minMakerOpeningMarginRatio";
|
|
4497
|
-
readonly type: "uint24";
|
|
4498
|
-
}, {
|
|
4499
|
-
readonly internalType: "uint24";
|
|
4500
|
-
readonly name: "maxMakerOpeningMarginRatio";
|
|
4501
|
-
readonly type: "uint24";
|
|
4502
|
-
}, {
|
|
4503
|
-
readonly internalType: "uint24";
|
|
4504
|
-
readonly name: "makerLiquidationMarginRatio";
|
|
4505
|
-
readonly type: "uint24";
|
|
4506
|
-
}, {
|
|
4507
|
-
readonly internalType: "uint24";
|
|
4508
|
-
readonly name: "minTakerOpeningMarginRatio";
|
|
4509
|
-
readonly type: "uint24";
|
|
4510
|
-
}, {
|
|
4511
|
-
readonly internalType: "uint24";
|
|
4512
|
-
readonly name: "maxTakerOpeningMarginRatio";
|
|
4513
|
-
readonly type: "uint24";
|
|
4514
|
-
}, {
|
|
4515
|
-
readonly internalType: "uint24";
|
|
4516
|
-
readonly name: "takerLiquidationMarginRatio";
|
|
4517
|
-
readonly type: "uint24";
|
|
4808
|
+
readonly internalType: "uint256";
|
|
4809
|
+
readonly name: "margin";
|
|
4810
|
+
readonly type: "uint256";
|
|
4518
4811
|
}, {
|
|
4519
4812
|
readonly internalType: "int256";
|
|
4520
|
-
readonly name: "
|
|
4813
|
+
readonly name: "entryPerpDelta";
|
|
4521
4814
|
readonly type: "int256";
|
|
4522
4815
|
}, {
|
|
4523
4816
|
readonly internalType: "int256";
|
|
4524
|
-
readonly name: "
|
|
4817
|
+
readonly name: "entryUsdDelta";
|
|
4525
4818
|
readonly type: "int256";
|
|
4526
4819
|
}, {
|
|
4527
4820
|
readonly internalType: "int256";
|
|
4528
|
-
readonly name: "
|
|
4821
|
+
readonly name: "entryCumlFundingX96";
|
|
4529
4822
|
readonly type: "int256";
|
|
4823
|
+
}, {
|
|
4824
|
+
readonly internalType: "uint256";
|
|
4825
|
+
readonly name: "entryCumlBadDebtX96";
|
|
4826
|
+
readonly type: "uint256";
|
|
4827
|
+
}, {
|
|
4828
|
+
readonly internalType: "uint256";
|
|
4829
|
+
readonly name: "entryCumlUtilizationX96";
|
|
4830
|
+
readonly type: "uint256";
|
|
4530
4831
|
}, {
|
|
4531
4832
|
readonly components: readonly [{
|
|
4532
|
-
readonly internalType: "Currency";
|
|
4533
|
-
readonly name: "currency0";
|
|
4534
|
-
readonly type: "address";
|
|
4535
|
-
}, {
|
|
4536
|
-
readonly internalType: "Currency";
|
|
4537
|
-
readonly name: "currency1";
|
|
4538
|
-
readonly type: "address";
|
|
4539
|
-
}, {
|
|
4540
4833
|
readonly internalType: "uint24";
|
|
4541
|
-
readonly name: "
|
|
4834
|
+
readonly name: "min";
|
|
4542
4835
|
readonly type: "uint24";
|
|
4543
4836
|
}, {
|
|
4544
|
-
readonly internalType: "
|
|
4545
|
-
readonly name: "
|
|
4546
|
-
readonly type: "
|
|
4837
|
+
readonly internalType: "uint24";
|
|
4838
|
+
readonly name: "max";
|
|
4839
|
+
readonly type: "uint24";
|
|
4547
4840
|
}, {
|
|
4548
|
-
readonly internalType: "
|
|
4549
|
-
readonly name: "
|
|
4550
|
-
readonly type: "
|
|
4841
|
+
readonly internalType: "uint24";
|
|
4842
|
+
readonly name: "liq";
|
|
4843
|
+
readonly type: "uint24";
|
|
4551
4844
|
}];
|
|
4552
|
-
readonly internalType: "struct
|
|
4553
|
-
readonly name: "
|
|
4845
|
+
readonly internalType: "struct IMarginRatios.MarginRatios";
|
|
4846
|
+
readonly name: "marginRatios";
|
|
4554
4847
|
readonly type: "tuple";
|
|
4555
4848
|
}, {
|
|
4556
4849
|
readonly components: readonly [{
|
|
4557
|
-
readonly internalType: "
|
|
4558
|
-
readonly name: "
|
|
4559
|
-
readonly type: "
|
|
4560
|
-
}, {
|
|
4561
|
-
readonly internalType: "uint128";
|
|
4562
|
-
readonly name: "startFeeX96";
|
|
4563
|
-
readonly type: "uint128";
|
|
4564
|
-
}, {
|
|
4565
|
-
readonly internalType: "uint128";
|
|
4566
|
-
readonly name: "targetFeeX96";
|
|
4567
|
-
readonly type: "uint128";
|
|
4850
|
+
readonly internalType: "uint32";
|
|
4851
|
+
readonly name: "unlockTimestamp";
|
|
4852
|
+
readonly type: "uint32";
|
|
4568
4853
|
}, {
|
|
4569
|
-
readonly internalType: "
|
|
4570
|
-
readonly name: "
|
|
4571
|
-
readonly type: "
|
|
4854
|
+
readonly internalType: "int24";
|
|
4855
|
+
readonly name: "tickLower";
|
|
4856
|
+
readonly type: "int24";
|
|
4572
4857
|
}, {
|
|
4573
|
-
readonly internalType: "
|
|
4574
|
-
readonly name: "
|
|
4575
|
-
readonly type: "
|
|
4858
|
+
readonly internalType: "int24";
|
|
4859
|
+
readonly name: "tickUpper";
|
|
4860
|
+
readonly type: "int24";
|
|
4576
4861
|
}, {
|
|
4577
4862
|
readonly internalType: "uint128";
|
|
4578
|
-
readonly name: "
|
|
4863
|
+
readonly name: "liquidity";
|
|
4579
4864
|
readonly type: "uint128";
|
|
4580
|
-
}];
|
|
4581
|
-
readonly internalType: "struct TradingFee.Config";
|
|
4582
|
-
readonly name: "tradingFeeConfig";
|
|
4583
|
-
readonly type: "tuple";
|
|
4584
|
-
}, {
|
|
4585
|
-
readonly components: readonly [{
|
|
4586
|
-
readonly internalType: "uint32";
|
|
4587
|
-
readonly name: "index";
|
|
4588
|
-
readonly type: "uint32";
|
|
4589
4865
|
}, {
|
|
4590
|
-
readonly internalType: "
|
|
4591
|
-
readonly name: "
|
|
4592
|
-
readonly type: "
|
|
4866
|
+
readonly internalType: "int256";
|
|
4867
|
+
readonly name: "entryCumlFundingBelowX96";
|
|
4868
|
+
readonly type: "int256";
|
|
4593
4869
|
}, {
|
|
4594
|
-
readonly internalType: "
|
|
4595
|
-
readonly name: "
|
|
4596
|
-
readonly type: "
|
|
4870
|
+
readonly internalType: "int256";
|
|
4871
|
+
readonly name: "entryCumlFundingWithinX96";
|
|
4872
|
+
readonly type: "int256";
|
|
4597
4873
|
}, {
|
|
4598
|
-
readonly
|
|
4599
|
-
|
|
4600
|
-
|
|
4601
|
-
readonly type: "uint32";
|
|
4602
|
-
}, {
|
|
4603
|
-
readonly internalType: "uint216";
|
|
4604
|
-
readonly name: "cumulativeValue";
|
|
4605
|
-
readonly type: "uint216";
|
|
4606
|
-
}, {
|
|
4607
|
-
readonly internalType: "bool";
|
|
4608
|
-
readonly name: "initialized";
|
|
4609
|
-
readonly type: "bool";
|
|
4610
|
-
}];
|
|
4611
|
-
readonly internalType: "struct TimeWeightedAvg.Observation[65535]";
|
|
4612
|
-
readonly name: "observations";
|
|
4613
|
-
readonly type: "tuple[65535]";
|
|
4874
|
+
readonly internalType: "int256";
|
|
4875
|
+
readonly name: "entryCumlFundingDivSqrtPWithinX96";
|
|
4876
|
+
readonly type: "int256";
|
|
4614
4877
|
}];
|
|
4615
|
-
readonly internalType: "struct
|
|
4616
|
-
readonly name: "
|
|
4878
|
+
readonly internalType: "struct IPerpManager.MakerDetails";
|
|
4879
|
+
readonly name: "makerDetails";
|
|
4617
4880
|
readonly type: "tuple";
|
|
4618
4881
|
}];
|
|
4619
4882
|
readonly stateMutability: "view";
|
|
4620
4883
|
readonly type: "function";
|
|
4884
|
+
}, {
|
|
4885
|
+
readonly inputs: readonly [];
|
|
4886
|
+
readonly name: "protocolFee";
|
|
4887
|
+
readonly outputs: readonly [{
|
|
4888
|
+
readonly internalType: "uint24";
|
|
4889
|
+
readonly name: "";
|
|
4890
|
+
readonly type: "uint24";
|
|
4891
|
+
}];
|
|
4892
|
+
readonly stateMutability: "view";
|
|
4893
|
+
readonly type: "function";
|
|
4894
|
+
}, {
|
|
4895
|
+
readonly inputs: readonly [{
|
|
4896
|
+
readonly internalType: "uint256";
|
|
4897
|
+
readonly name: "posId";
|
|
4898
|
+
readonly type: "uint256";
|
|
4899
|
+
}];
|
|
4900
|
+
readonly name: "quoteClosePosition";
|
|
4901
|
+
readonly outputs: readonly [{
|
|
4902
|
+
readonly internalType: "bool";
|
|
4903
|
+
readonly name: "success";
|
|
4904
|
+
readonly type: "bool";
|
|
4905
|
+
}, {
|
|
4906
|
+
readonly internalType: "int256";
|
|
4907
|
+
readonly name: "pnl";
|
|
4908
|
+
readonly type: "int256";
|
|
4909
|
+
}, {
|
|
4910
|
+
readonly internalType: "int256";
|
|
4911
|
+
readonly name: "funding";
|
|
4912
|
+
readonly type: "int256";
|
|
4913
|
+
}, {
|
|
4914
|
+
readonly internalType: "uint256";
|
|
4915
|
+
readonly name: "netMargin";
|
|
4916
|
+
readonly type: "uint256";
|
|
4917
|
+
}, {
|
|
4918
|
+
readonly internalType: "bool";
|
|
4919
|
+
readonly name: "wasLiquidated";
|
|
4920
|
+
readonly type: "bool";
|
|
4921
|
+
}];
|
|
4922
|
+
readonly stateMutability: "nonpayable";
|
|
4923
|
+
readonly type: "function";
|
|
4621
4924
|
}, {
|
|
4622
4925
|
readonly inputs: readonly [{
|
|
4623
4926
|
readonly internalType: "PoolId";
|
|
@@ -4625,6 +4928,10 @@ declare const PERP_MANAGER_ABI: readonly [{
|
|
|
4625
4928
|
readonly type: "bytes32";
|
|
4626
4929
|
}, {
|
|
4627
4930
|
readonly components: readonly [{
|
|
4931
|
+
readonly internalType: "address";
|
|
4932
|
+
readonly name: "holder";
|
|
4933
|
+
readonly type: "address";
|
|
4934
|
+
}, {
|
|
4628
4935
|
readonly internalType: "uint256";
|
|
4629
4936
|
readonly name: "margin";
|
|
4630
4937
|
readonly type: "uint256";
|
|
@@ -4653,7 +4960,7 @@ declare const PERP_MANAGER_ABI: readonly [{
|
|
|
4653
4960
|
readonly name: "params";
|
|
4654
4961
|
readonly type: "tuple";
|
|
4655
4962
|
}];
|
|
4656
|
-
readonly name: "
|
|
4963
|
+
readonly name: "quoteOpenMakerPosition";
|
|
4657
4964
|
readonly outputs: readonly [{
|
|
4658
4965
|
readonly internalType: "bool";
|
|
4659
4966
|
readonly name: "success";
|
|
@@ -4666,18 +4973,6 @@ declare const PERP_MANAGER_ABI: readonly [{
|
|
|
4666
4973
|
readonly internalType: "int256";
|
|
4667
4974
|
readonly name: "usdDelta";
|
|
4668
4975
|
readonly type: "int256";
|
|
4669
|
-
}, {
|
|
4670
|
-
readonly internalType: "uint256";
|
|
4671
|
-
readonly name: "creatorFeeAmt";
|
|
4672
|
-
readonly type: "uint256";
|
|
4673
|
-
}, {
|
|
4674
|
-
readonly internalType: "uint256";
|
|
4675
|
-
readonly name: "insuranceFeeAmt";
|
|
4676
|
-
readonly type: "uint256";
|
|
4677
|
-
}, {
|
|
4678
|
-
readonly internalType: "uint256";
|
|
4679
|
-
readonly name: "lpFeeAmt";
|
|
4680
|
-
readonly type: "uint256";
|
|
4681
4976
|
}];
|
|
4682
4977
|
readonly stateMutability: "nonpayable";
|
|
4683
4978
|
readonly type: "function";
|
|
@@ -4688,6 +4983,10 @@ declare const PERP_MANAGER_ABI: readonly [{
|
|
|
4688
4983
|
readonly type: "bytes32";
|
|
4689
4984
|
}, {
|
|
4690
4985
|
readonly components: readonly [{
|
|
4986
|
+
readonly internalType: "address";
|
|
4987
|
+
readonly name: "holder";
|
|
4988
|
+
readonly type: "address";
|
|
4989
|
+
}, {
|
|
4691
4990
|
readonly internalType: "bool";
|
|
4692
4991
|
readonly name: "isLong";
|
|
4693
4992
|
readonly type: "bool";
|
|
@@ -4708,7 +5007,7 @@ declare const PERP_MANAGER_ABI: readonly [{
|
|
|
4708
5007
|
readonly name: "params";
|
|
4709
5008
|
readonly type: "tuple";
|
|
4710
5009
|
}];
|
|
4711
|
-
readonly name: "
|
|
5010
|
+
readonly name: "quoteOpenTakerPosition";
|
|
4712
5011
|
readonly outputs: readonly [{
|
|
4713
5012
|
readonly internalType: "bool";
|
|
4714
5013
|
readonly name: "success";
|
|
@@ -4721,46 +5020,164 @@ declare const PERP_MANAGER_ABI: readonly [{
|
|
|
4721
5020
|
readonly internalType: "int256";
|
|
4722
5021
|
readonly name: "usdDelta";
|
|
4723
5022
|
readonly type: "int256";
|
|
5023
|
+
}];
|
|
5024
|
+
readonly stateMutability: "nonpayable";
|
|
5025
|
+
readonly type: "function";
|
|
5026
|
+
}, {
|
|
5027
|
+
readonly inputs: readonly [{
|
|
5028
|
+
readonly internalType: "contract IFees";
|
|
5029
|
+
readonly name: "feesModule";
|
|
5030
|
+
readonly type: "address";
|
|
5031
|
+
}];
|
|
5032
|
+
readonly name: "registerFeesModule";
|
|
5033
|
+
readonly outputs: readonly [];
|
|
5034
|
+
readonly stateMutability: "nonpayable";
|
|
5035
|
+
readonly type: "function";
|
|
5036
|
+
}, {
|
|
5037
|
+
readonly inputs: readonly [{
|
|
5038
|
+
readonly internalType: "contract ILockupPeriod";
|
|
5039
|
+
readonly name: "lockupPeriodModule";
|
|
5040
|
+
readonly type: "address";
|
|
5041
|
+
}];
|
|
5042
|
+
readonly name: "registerLockupPeriodModule";
|
|
5043
|
+
readonly outputs: readonly [];
|
|
5044
|
+
readonly stateMutability: "nonpayable";
|
|
5045
|
+
readonly type: "function";
|
|
5046
|
+
}, {
|
|
5047
|
+
readonly inputs: readonly [{
|
|
5048
|
+
readonly internalType: "contract IMarginRatios";
|
|
5049
|
+
readonly name: "marginRatiosModule";
|
|
5050
|
+
readonly type: "address";
|
|
5051
|
+
}];
|
|
5052
|
+
readonly name: "registerMarginRatiosModule";
|
|
5053
|
+
readonly outputs: readonly [];
|
|
5054
|
+
readonly stateMutability: "nonpayable";
|
|
5055
|
+
readonly type: "function";
|
|
5056
|
+
}, {
|
|
5057
|
+
readonly inputs: readonly [{
|
|
5058
|
+
readonly internalType: "contract ISqrtPriceImpactLimit";
|
|
5059
|
+
readonly name: "sqrtPriceImpactLimitModule";
|
|
5060
|
+
readonly type: "address";
|
|
5061
|
+
}];
|
|
5062
|
+
readonly name: "registerSqrtPriceImpactLimitModule";
|
|
5063
|
+
readonly outputs: readonly [];
|
|
5064
|
+
readonly stateMutability: "nonpayable";
|
|
5065
|
+
readonly type: "function";
|
|
5066
|
+
}, {
|
|
5067
|
+
readonly inputs: readonly [];
|
|
5068
|
+
readonly name: "renounceOwnership";
|
|
5069
|
+
readonly outputs: readonly [];
|
|
5070
|
+
readonly stateMutability: "payable";
|
|
5071
|
+
readonly type: "function";
|
|
5072
|
+
}, {
|
|
5073
|
+
readonly inputs: readonly [];
|
|
5074
|
+
readonly name: "requestOwnershipHandover";
|
|
5075
|
+
readonly outputs: readonly [];
|
|
5076
|
+
readonly stateMutability: "payable";
|
|
5077
|
+
readonly type: "function";
|
|
5078
|
+
}, {
|
|
5079
|
+
readonly inputs: readonly [{
|
|
5080
|
+
readonly internalType: "address";
|
|
5081
|
+
readonly name: "from";
|
|
5082
|
+
readonly type: "address";
|
|
4724
5083
|
}, {
|
|
4725
|
-
readonly internalType: "
|
|
4726
|
-
readonly name: "
|
|
4727
|
-
readonly type: "
|
|
5084
|
+
readonly internalType: "address";
|
|
5085
|
+
readonly name: "to";
|
|
5086
|
+
readonly type: "address";
|
|
4728
5087
|
}, {
|
|
4729
5088
|
readonly internalType: "uint256";
|
|
4730
|
-
readonly name: "
|
|
5089
|
+
readonly name: "id";
|
|
4731
5090
|
readonly type: "uint256";
|
|
5091
|
+
}];
|
|
5092
|
+
readonly name: "safeTransferFrom";
|
|
5093
|
+
readonly outputs: readonly [];
|
|
5094
|
+
readonly stateMutability: "payable";
|
|
5095
|
+
readonly type: "function";
|
|
5096
|
+
}, {
|
|
5097
|
+
readonly inputs: readonly [{
|
|
5098
|
+
readonly internalType: "address";
|
|
5099
|
+
readonly name: "from";
|
|
5100
|
+
readonly type: "address";
|
|
5101
|
+
}, {
|
|
5102
|
+
readonly internalType: "address";
|
|
5103
|
+
readonly name: "to";
|
|
5104
|
+
readonly type: "address";
|
|
4732
5105
|
}, {
|
|
4733
5106
|
readonly internalType: "uint256";
|
|
4734
|
-
readonly name: "
|
|
5107
|
+
readonly name: "id";
|
|
4735
5108
|
readonly type: "uint256";
|
|
5109
|
+
}, {
|
|
5110
|
+
readonly internalType: "bytes";
|
|
5111
|
+
readonly name: "data";
|
|
5112
|
+
readonly type: "bytes";
|
|
5113
|
+
}];
|
|
5114
|
+
readonly name: "safeTransferFrom";
|
|
5115
|
+
readonly outputs: readonly [];
|
|
5116
|
+
readonly stateMutability: "payable";
|
|
5117
|
+
readonly type: "function";
|
|
5118
|
+
}, {
|
|
5119
|
+
readonly inputs: readonly [{
|
|
5120
|
+
readonly internalType: "address";
|
|
5121
|
+
readonly name: "operator";
|
|
5122
|
+
readonly type: "address";
|
|
5123
|
+
}, {
|
|
5124
|
+
readonly internalType: "bool";
|
|
5125
|
+
readonly name: "isApproved";
|
|
5126
|
+
readonly type: "bool";
|
|
4736
5127
|
}];
|
|
5128
|
+
readonly name: "setApprovalForAll";
|
|
5129
|
+
readonly outputs: readonly [];
|
|
4737
5130
|
readonly stateMutability: "nonpayable";
|
|
4738
5131
|
readonly type: "function";
|
|
4739
5132
|
}, {
|
|
4740
5133
|
readonly inputs: readonly [{
|
|
4741
|
-
readonly internalType: "
|
|
4742
|
-
readonly name: "
|
|
4743
|
-
readonly type: "
|
|
5134
|
+
readonly internalType: "uint24";
|
|
5135
|
+
readonly name: "newProtocolFee";
|
|
5136
|
+
readonly type: "uint24";
|
|
5137
|
+
}];
|
|
5138
|
+
readonly name: "setProtocolFee";
|
|
5139
|
+
readonly outputs: readonly [];
|
|
5140
|
+
readonly stateMutability: "nonpayable";
|
|
5141
|
+
readonly type: "function";
|
|
5142
|
+
}, {
|
|
5143
|
+
readonly inputs: readonly [{
|
|
5144
|
+
readonly internalType: "bytes4";
|
|
5145
|
+
readonly name: "interfaceId";
|
|
5146
|
+
readonly type: "bytes4";
|
|
4744
5147
|
}];
|
|
4745
|
-
readonly name: "
|
|
5148
|
+
readonly name: "supportsInterface";
|
|
4746
5149
|
readonly outputs: readonly [{
|
|
4747
|
-
readonly internalType: "
|
|
4748
|
-
readonly name: "
|
|
4749
|
-
readonly type: "
|
|
5150
|
+
readonly internalType: "bool";
|
|
5151
|
+
readonly name: "result";
|
|
5152
|
+
readonly type: "bool";
|
|
4750
5153
|
}];
|
|
4751
5154
|
readonly stateMutability: "view";
|
|
4752
5155
|
readonly type: "function";
|
|
5156
|
+
}, {
|
|
5157
|
+
readonly inputs: readonly [];
|
|
5158
|
+
readonly name: "symbol";
|
|
5159
|
+
readonly outputs: readonly [{
|
|
5160
|
+
readonly internalType: "string";
|
|
5161
|
+
readonly name: "";
|
|
5162
|
+
readonly type: "string";
|
|
5163
|
+
}];
|
|
5164
|
+
readonly stateMutability: "pure";
|
|
5165
|
+
readonly type: "function";
|
|
4753
5166
|
}, {
|
|
4754
5167
|
readonly inputs: readonly [{
|
|
4755
5168
|
readonly internalType: "PoolId";
|
|
4756
5169
|
readonly name: "perpId";
|
|
4757
5170
|
readonly type: "bytes32";
|
|
4758
5171
|
}];
|
|
4759
|
-
readonly name: "
|
|
5172
|
+
readonly name: "takerOpenInterest";
|
|
4760
5173
|
readonly outputs: readonly [{
|
|
4761
|
-
readonly internalType: "
|
|
4762
|
-
readonly name: "";
|
|
4763
|
-
readonly type: "
|
|
5174
|
+
readonly internalType: "uint128";
|
|
5175
|
+
readonly name: "longOI";
|
|
5176
|
+
readonly type: "uint128";
|
|
5177
|
+
}, {
|
|
5178
|
+
readonly internalType: "uint128";
|
|
5179
|
+
readonly name: "shortOI";
|
|
5180
|
+
readonly type: "uint128";
|
|
4764
5181
|
}];
|
|
4765
5182
|
readonly stateMutability: "view";
|
|
4766
5183
|
readonly type: "function";
|
|
@@ -4769,38 +5186,60 @@ declare const PERP_MANAGER_ABI: readonly [{
|
|
|
4769
5186
|
readonly internalType: "PoolId";
|
|
4770
5187
|
readonly name: "perpId";
|
|
4771
5188
|
readonly type: "bytes32";
|
|
5189
|
+
}, {
|
|
5190
|
+
readonly internalType: "uint32";
|
|
5191
|
+
readonly name: "lookbackWindow";
|
|
5192
|
+
readonly type: "uint32";
|
|
4772
5193
|
}];
|
|
4773
|
-
readonly name: "
|
|
5194
|
+
readonly name: "timeWeightedAvgSqrtPriceX96";
|
|
4774
5195
|
readonly outputs: readonly [{
|
|
4775
|
-
readonly internalType: "
|
|
4776
|
-
readonly name: "
|
|
4777
|
-
readonly type: "
|
|
4778
|
-
}
|
|
4779
|
-
|
|
4780
|
-
|
|
4781
|
-
|
|
4782
|
-
|
|
4783
|
-
readonly internalType: "
|
|
4784
|
-
readonly name: "
|
|
4785
|
-
readonly type: "
|
|
4786
|
-
}
|
|
4787
|
-
|
|
4788
|
-
|
|
4789
|
-
readonly
|
|
4790
|
-
|
|
4791
|
-
readonly
|
|
4792
|
-
|
|
4793
|
-
|
|
5196
|
+
readonly internalType: "uint256";
|
|
5197
|
+
readonly name: "twAvg";
|
|
5198
|
+
readonly type: "uint256";
|
|
5199
|
+
}];
|
|
5200
|
+
readonly stateMutability: "view";
|
|
5201
|
+
readonly type: "function";
|
|
5202
|
+
}, {
|
|
5203
|
+
readonly inputs: readonly [{
|
|
5204
|
+
readonly internalType: "uint256";
|
|
5205
|
+
readonly name: "posId";
|
|
5206
|
+
readonly type: "uint256";
|
|
5207
|
+
}];
|
|
5208
|
+
readonly name: "tokenURI";
|
|
5209
|
+
readonly outputs: readonly [{
|
|
5210
|
+
readonly internalType: "string";
|
|
5211
|
+
readonly name: "";
|
|
5212
|
+
readonly type: "string";
|
|
5213
|
+
}];
|
|
5214
|
+
readonly stateMutability: "pure";
|
|
5215
|
+
readonly type: "function";
|
|
5216
|
+
}, {
|
|
5217
|
+
readonly inputs: readonly [{
|
|
5218
|
+
readonly internalType: "address";
|
|
5219
|
+
readonly name: "from";
|
|
5220
|
+
readonly type: "address";
|
|
4794
5221
|
}, {
|
|
4795
|
-
readonly internalType: "
|
|
4796
|
-
readonly name: "
|
|
4797
|
-
readonly type: "
|
|
5222
|
+
readonly internalType: "address";
|
|
5223
|
+
readonly name: "to";
|
|
5224
|
+
readonly type: "address";
|
|
4798
5225
|
}, {
|
|
4799
|
-
readonly internalType: "
|
|
4800
|
-
readonly name: "
|
|
4801
|
-
readonly type: "
|
|
5226
|
+
readonly internalType: "uint256";
|
|
5227
|
+
readonly name: "id";
|
|
5228
|
+
readonly type: "uint256";
|
|
4802
5229
|
}];
|
|
4803
|
-
readonly
|
|
5230
|
+
readonly name: "transferFrom";
|
|
5231
|
+
readonly outputs: readonly [];
|
|
5232
|
+
readonly stateMutability: "payable";
|
|
5233
|
+
readonly type: "function";
|
|
5234
|
+
}, {
|
|
5235
|
+
readonly inputs: readonly [{
|
|
5236
|
+
readonly internalType: "address";
|
|
5237
|
+
readonly name: "newOwner";
|
|
5238
|
+
readonly type: "address";
|
|
5239
|
+
}];
|
|
5240
|
+
readonly name: "transferOwnership";
|
|
5241
|
+
readonly outputs: readonly [];
|
|
5242
|
+
readonly stateMutability: "payable";
|
|
4804
5243
|
readonly type: "function";
|
|
4805
5244
|
}, {
|
|
4806
5245
|
readonly inputs: readonly [{
|
|
@@ -5012,6 +5451,12 @@ declare const BEACON_ABI: readonly [{
|
|
|
5012
5451
|
readonly type: "function";
|
|
5013
5452
|
}];
|
|
5014
5453
|
|
|
5454
|
+
declare function getPerpMark(perpData: PerpData): number;
|
|
5455
|
+
declare function getPerpBeacon(perpData: PerpData): string;
|
|
5456
|
+
declare function getPerpBounds(perpData: PerpData): Bounds;
|
|
5457
|
+
declare function getPerpFees(perpData: PerpData): Fees;
|
|
5458
|
+
declare function getPerpTickSpacing(perpData: PerpData): number;
|
|
5459
|
+
|
|
5015
5460
|
declare class OpenPosition {
|
|
5016
5461
|
readonly context: PerpCityContext;
|
|
5017
5462
|
readonly perpId: Hex;
|
|
@@ -5023,34 +5468,12 @@ declare class OpenPosition {
|
|
|
5023
5468
|
liveDetails(): Promise<LiveDetails>;
|
|
5024
5469
|
}
|
|
5025
5470
|
|
|
5026
|
-
declare function getPerpMark(perpData: PerpData): number;
|
|
5027
|
-
declare function getPerpIndex(perpData: PerpData): number;
|
|
5028
|
-
declare function getPerpBeacon(perpData: PerpData): string;
|
|
5029
|
-
declare function getPerpLastIndexUpdate(perpData: PerpData): number;
|
|
5030
|
-
declare function getPerpOpenInterest(perpData: PerpData): OpenInterest;
|
|
5031
|
-
declare function getPerpMarkTimeSeries(perpData: PerpData): TimeSeries<number>[];
|
|
5032
|
-
declare function getPerpIndexTimeSeries(perpData: PerpData): TimeSeries<number>[];
|
|
5033
|
-
declare function getPerpFundingRate(perpData: PerpData): number;
|
|
5034
|
-
declare function getPerpBounds(perpData: PerpData): Bounds;
|
|
5035
|
-
declare function getPerpFees(perpData: PerpData): Fees;
|
|
5036
|
-
declare function getPerpOpenInterestTimeSeries(perpData: PerpData): TimeSeries<OpenInterest>[];
|
|
5037
|
-
declare function getPerpFundingRateTimeSeries(perpData: PerpData): TimeSeries<number>[];
|
|
5038
|
-
declare function getPerpTickSpacing(perpData: PerpData): number;
|
|
5039
|
-
declare function getAllMakerPositions(context: PerpCityContext, perpId: Hex): Promise<OpenPosition[]>;
|
|
5040
|
-
declare function getAllTakerPositions(context: PerpCityContext, perpId: Hex): Promise<OpenPosition[]>;
|
|
5041
|
-
declare function getTotalOpenMakerPnl(context: PerpCityContext, perpId: Hex): Promise<number>;
|
|
5042
|
-
declare function getTotalOpenTakerPnl(context: PerpCityContext, perpId: Hex): Promise<number>;
|
|
5043
|
-
|
|
5044
|
-
declare function getPerps(context: PerpCityContext): Promise<Hex[]>;
|
|
5045
5471
|
declare function createPerp(context: PerpCityContext, params: CreatePerpParams): Promise<Hex>;
|
|
5046
5472
|
declare function openTakerPosition(context: PerpCityContext, perpId: Hex, params: OpenTakerPositionParams): Promise<OpenPosition>;
|
|
5047
5473
|
declare function openMakerPosition(context: PerpCityContext, perpId: Hex, params: OpenMakerPositionParams): Promise<OpenPosition>;
|
|
5048
5474
|
|
|
5049
5475
|
declare function getUserUsdcBalance(userData: UserData): number;
|
|
5050
5476
|
declare function getUserOpenPositions(userData: UserData): OpenPositionData[];
|
|
5051
|
-
declare function getUserClosedPositions(userData: UserData): ClosedPosition[];
|
|
5052
|
-
declare function getUserRealizedPnl(userData: UserData): number;
|
|
5053
|
-
declare function getUserUnrealizedPnl(userData: UserData): number;
|
|
5054
5477
|
declare function getUserWalletAddress(userData: UserData): Hex;
|
|
5055
5478
|
|
|
5056
5479
|
declare function getPositionPerpId(positionData: OpenPositionData): Hex;
|
|
@@ -5065,4 +5488,4 @@ declare function getPositionIsLiquidatable(positionData: OpenPositionData): bool
|
|
|
5065
5488
|
declare function closePosition(context: PerpCityContext, perpId: Hex, positionId: bigint, params: ClosePositionParams): Promise<OpenPositionData | null>;
|
|
5066
5489
|
declare function getPositionLiveDetailsFromContract(context: PerpCityContext, perpId: Hex, positionId: bigint): Promise<LiveDetails>;
|
|
5067
5490
|
|
|
5068
|
-
export { BEACON_ABI, BIGINT_1E6, type Bounds, type CacheConfig, type ClosePositionParams,
|
|
5491
|
+
export { BEACON_ABI, BIGINT_1E6, type Bounds, type CacheConfig, type ClosePositionParams, ContractError, type CreatePerpParams, type Fees, InsufficientFundsError, type LiveDetails, NUMBER_1E6, type OpenMakerPositionParams, OpenPosition, type OpenPositionData, type OpenTakerPositionParams, PERP_MANAGER_ABI, PerpCityContext, type PerpCityContextConfig, type PerpCityDeployments, PerpCityError, type PerpConfig, type PerpData, Q96, RPCError, type RpcConfig, TransactionRejectedError, type UserData, ValidationError, approveUsdc, closePosition, createPerp, estimateLiquidity, getPerpBeacon, getPerpBounds, getPerpFees, getPerpMark, getPerpTickSpacing, getPositionEffectiveMargin, getPositionFundingPayment, getPositionId, getPositionIsLiquidatable, getPositionIsLong, getPositionIsMaker, getPositionLiveDetails, getPositionLiveDetailsFromContract, getPositionPerpId, getPositionPnl, getRpcUrl, getUserOpenPositions, getUserUsdcBalance, getUserWalletAddress, marginRatioToLeverage, openMakerPosition, openTakerPosition, parseContractError, priceToSqrtPriceX96, priceToTick, scale6Decimals, scaleFrom6Decimals, scaleFromX96, scaleToX96, sqrtPriceX96ToPrice, withErrorHandling };
|