@alephium/powfi-sdk 0.0.1-rc.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +4 -0
- package/clmm/artifacts/BitmapWord.ral.json +125 -0
- package/clmm/artifacts/BitmapWordDeployer.ral.json +31 -0
- package/clmm/artifacts/CreateConfig.ral.json +37 -0
- package/clmm/artifacts/CreateLiquidPool.ral.json +55 -0
- package/clmm/artifacts/DexAccount.ral.json +110 -0
- package/clmm/artifacts/LiquidityAmountsTest.ral.json +161 -0
- package/clmm/artifacts/LiquidityManagmentTest.ral.json +384 -0
- package/clmm/artifacts/Pool.ral.json +1530 -0
- package/clmm/artifacts/PoolConfig.ral.json +31 -0
- package/clmm/artifacts/PoolFactory.ral.json +300 -0
- package/clmm/artifacts/PoolRouterDemo.ral.json +49 -0
- package/clmm/artifacts/PoolUser.ral.json +89 -0
- package/clmm/artifacts/Position.ral.json +183 -0
- package/clmm/artifacts/PositionManager.ral.json +416 -0
- package/clmm/artifacts/SwapWithoutAccount.ral.json +46 -0
- package/clmm/artifacts/TestToken.ral.json +68 -0
- package/clmm/artifacts/Tick.ral.json +161 -0
- package/clmm/artifacts/TickBitmapTest.ral.json +220 -0
- package/clmm/artifacts/constants.ral.json +81 -0
- package/clmm/artifacts/structs.ral.json +335 -0
- package/clmm/artifacts/ts/BitmapWord.ts +337 -0
- package/clmm/artifacts/ts/BitmapWordDeployer.ts +164 -0
- package/clmm/artifacts/ts/DexAccount.ts +330 -0
- package/clmm/artifacts/ts/LiquidityAmountsTest.ts +464 -0
- package/clmm/artifacts/ts/LiquidityManagmentTest.ts +859 -0
- package/clmm/artifacts/ts/Pool.ts +2535 -0
- package/clmm/artifacts/ts/PoolConfig.ts +179 -0
- package/clmm/artifacts/ts/PoolFactory.ts +640 -0
- package/clmm/artifacts/ts/PoolUser.ts +237 -0
- package/clmm/artifacts/ts/Position.ts +440 -0
- package/clmm/artifacts/ts/PositionManager.ts +929 -0
- package/clmm/artifacts/ts/TestToken.ts +277 -0
- package/clmm/artifacts/ts/Tick.ts +351 -0
- package/clmm/artifacts/ts/TickBitmapTest.ts +512 -0
- package/clmm/artifacts/ts/constants.ts +17 -0
- package/clmm/artifacts/ts/contracts.ts +26 -0
- package/clmm/artifacts/ts/deployments.ts +160 -0
- package/clmm/artifacts/ts/index.ts +20 -0
- package/clmm/artifacts/ts/scripts.ts +76 -0
- package/clmm/artifacts/ts/types.ts +105 -0
- package/clmm/deployments/.deployments.devnet.json +350 -0
- package/clmm/deployments/.deployments.testnet.json +350 -0
- package/cpmm/artifacts/dex/DexAccount.ral.json +110 -0
- package/cpmm/artifacts/dex/Router.ral.json +361 -0
- package/cpmm/artifacts/dex/TokenPair.ral.json +512 -0
- package/cpmm/artifacts/dex/TokenPairFactory.ral.json +297 -0
- package/cpmm/artifacts/examples/ExampleOracleSimple.ral.json +192 -0
- package/cpmm/artifacts/examples/FeeCollectorFactoryImpl.ral.json +185 -0
- package/cpmm/artifacts/examples/FeeCollectorPerTokenPairImpl.ral.json +216 -0
- package/cpmm/artifacts/examples/FullMathTest.ral.json +123 -0
- package/cpmm/artifacts/scripts/AddLiquidity.ral.json +46 -0
- package/cpmm/artifacts/scripts/Burn.ral.json +31 -0
- package/cpmm/artifacts/scripts/CollectFee.ral.json +25 -0
- package/cpmm/artifacts/scripts/CreatePair.ral.json +37 -0
- package/cpmm/artifacts/scripts/CreatePairAndAddLiquidity.ral.json +43 -0
- package/cpmm/artifacts/scripts/EnableFeeCollector.ral.json +28 -0
- package/cpmm/artifacts/scripts/Mint.ral.json +34 -0
- package/cpmm/artifacts/scripts/RemoveLiquidity.ral.json +43 -0
- package/cpmm/artifacts/scripts/SetFeeCollectorFactory.ral.json +28 -0
- package/cpmm/artifacts/scripts/Swap.ral.json +46 -0
- package/cpmm/artifacts/scripts/SwapMaxIn.ral.json +46 -0
- package/cpmm/artifacts/scripts/SwapMinOut.ral.json +46 -0
- package/cpmm/artifacts/test/GetToken.ral.json +31 -0
- package/cpmm/artifacts/test/MathTest.ral.json +49 -0
- package/cpmm/artifacts/test/TestToken.ral.json +87 -0
- package/cpmm/artifacts/ts/DexAccount.ts +329 -0
- package/cpmm/artifacts/ts/ExampleOracleSimple.ts +383 -0
- package/cpmm/artifacts/ts/FeeCollectorFactoryImpl.ts +227 -0
- package/cpmm/artifacts/ts/FeeCollectorPerTokenPairImpl.ts +327 -0
- package/cpmm/artifacts/ts/FullMathTest.ts +251 -0
- package/cpmm/artifacts/ts/MathTest.ts +183 -0
- package/cpmm/artifacts/ts/Router.ts +554 -0
- package/cpmm/artifacts/ts/TestToken.ts +312 -0
- package/cpmm/artifacts/ts/TokenPair.ts +947 -0
- package/cpmm/artifacts/ts/TokenPairFactory.ts +501 -0
- package/cpmm/artifacts/ts/contracts.ts +26 -0
- package/cpmm/artifacts/ts/deployments.ts +109 -0
- package/cpmm/artifacts/ts/index.ts +16 -0
- package/cpmm/artifacts/ts/scripts.ts +142 -0
- package/cpmm/deployments/.deployments.devnet.json +77 -0
- package/cpmm/deployments/.deployments.testnet.json +79 -0
- package/lib/index.d.mts +8800 -0
- package/lib/index.d.ts +8800 -0
- package/lib/index.js +21769 -0
- package/lib/index.js.map +1 -0
- package/lib/index.mjs +22118 -0
- package/lib/index.mjs.map +1 -0
- package/package.json +80 -0
- package/src/clmm/clmm.ts +607 -0
- package/src/clmm/constants.ts +7 -0
- package/src/clmm/index.ts +6 -0
- package/src/clmm/liquidity.ts +163 -0
- package/src/clmm/pool.ts +154 -0
- package/src/clmm/tick.ts +335 -0
- package/src/clmm/types.ts +155 -0
- package/src/common/constants.ts +1 -0
- package/src/common/error.ts +46 -0
- package/src/common/index.ts +7 -0
- package/src/common/logger.ts +82 -0
- package/src/common/math.ts +88 -0
- package/src/common/numeric.ts +64 -0
- package/src/common/types.ts +49 -0
- package/src/common/utils.ts +3 -0
- package/src/cpmm/constants.ts +2 -0
- package/src/cpmm/cpmm.ts +631 -0
- package/src/cpmm/index.ts +3 -0
- package/src/cpmm/types.ts +113 -0
- package/src/index.ts +25 -0
- package/src/moduleBase.ts +64 -0
- package/src/staking/index.ts +4 -0
- package/src/staking/settings.ts +38 -0
- package/src/staking/staking.ts +277 -0
- package/src/staking/types.ts +15 -0
- package/src/staking/utils.ts +25 -0
- package/src/token/index.ts +1 -0
- package/src/token/token.ts +163 -0
- package/src/zeta.ts +105 -0
- package/staking/artifacts/AlphStakeAndLock.ral.json +31 -0
- package/staking/artifacts/AlphUnstakeVault.ral.json +151 -0
- package/staking/artifacts/XAlphStakeVault.ral.json +559 -0
- package/staking/artifacts/XAlphToken.ral.json +404 -0
- package/staking/artifacts/XAlphUnlockAndStartUnstake.ral.json +31 -0
- package/staking/artifacts/examples/GovernanceDemo.ral.json +282 -0
- package/staking/artifacts/examples/RewardSharingVault.ral.json +253 -0
- package/staking/artifacts/structs.ral.json +47 -0
- package/staking/artifacts/ts/AlphUnstakeVault.ts +354 -0
- package/staking/artifacts/ts/FullMathTest.ts +175 -0
- package/staking/artifacts/ts/GovernanceDemo.ts +726 -0
- package/staking/artifacts/ts/RewardSharingVault.ts +559 -0
- package/staking/artifacts/ts/TestDynamicArrayByteVec32.ts +431 -0
- package/staking/artifacts/ts/TestDynamicSortedArrayForU256.ts +516 -0
- package/staking/artifacts/ts/TestMerkleProof.ts +343 -0
- package/staking/artifacts/ts/XAlphStakeVault.ts +1120 -0
- package/staking/artifacts/ts/XAlphToken.ts +835 -0
- package/staking/artifacts/ts/contracts.ts +26 -0
- package/staking/artifacts/ts/deployments.ts +109 -0
- package/staking/artifacts/ts/index.ts +15 -0
- package/staking/artifacts/ts/scripts.ts +35 -0
- package/staking/artifacts/ts/types.ts +19 -0
- package/staking/artifacts/utils/FullMathTest.ral.json +57 -0
- package/staking/artifacts/utils/TestDynamicArrayByteVec32.ral.json +165 -0
- package/staking/artifacts/utils/TestDynamicSortedArrayForU256.ral.json +189 -0
- package/staking/artifacts/utils/TestMerkleProof.ral.json +134 -0
- package/staking/deployments/.deployments.devnet.json +77 -0
- package/staking/deployments/.deployments.testnet.json +78 -0
|
@@ -0,0 +1,160 @@
|
|
|
1
|
+
/* Autogenerated file. Do not edit manually. */
|
|
2
|
+
/* tslint:disable */
|
|
3
|
+
/* eslint-disable */
|
|
4
|
+
|
|
5
|
+
import {
|
|
6
|
+
RunScriptResult,
|
|
7
|
+
DeployContractExecutionResult,
|
|
8
|
+
NetworkId,
|
|
9
|
+
} from "@alephium/web3";
|
|
10
|
+
import {
|
|
11
|
+
Pool,
|
|
12
|
+
PoolInstance,
|
|
13
|
+
Position,
|
|
14
|
+
PositionInstance,
|
|
15
|
+
Tick,
|
|
16
|
+
TickInstance,
|
|
17
|
+
BitmapWord,
|
|
18
|
+
BitmapWordInstance,
|
|
19
|
+
PoolConfig,
|
|
20
|
+
PoolConfigInstance,
|
|
21
|
+
DexAccount,
|
|
22
|
+
DexAccountInstance,
|
|
23
|
+
PoolFactory,
|
|
24
|
+
PoolFactoryInstance,
|
|
25
|
+
PositionManager,
|
|
26
|
+
PositionManagerInstance,
|
|
27
|
+
} from ".";
|
|
28
|
+
import { default as testnetDeployments } from "../../deployments/.deployments.testnet.json";
|
|
29
|
+
import { default as devnetDeployments } from "../../deployments/.deployments.devnet.json";
|
|
30
|
+
|
|
31
|
+
export type Deployments = {
|
|
32
|
+
deployerAddress: string;
|
|
33
|
+
contracts: {
|
|
34
|
+
Pool: DeployContractExecutionResult<PoolInstance>;
|
|
35
|
+
Position: DeployContractExecutionResult<PositionInstance>;
|
|
36
|
+
Tick: DeployContractExecutionResult<TickInstance>;
|
|
37
|
+
BitmapWord: DeployContractExecutionResult<BitmapWordInstance>;
|
|
38
|
+
PoolConfig: DeployContractExecutionResult<PoolConfigInstance>;
|
|
39
|
+
DexAccount: DeployContractExecutionResult<DexAccountInstance>;
|
|
40
|
+
PoolFactory: DeployContractExecutionResult<PoolFactoryInstance>;
|
|
41
|
+
PositionManager: DeployContractExecutionResult<PositionManagerInstance>;
|
|
42
|
+
};
|
|
43
|
+
scripts: {
|
|
44
|
+
CreateConfig_CreateConfig0: RunScriptResult;
|
|
45
|
+
CreateConfig_CreateConfig1: RunScriptResult;
|
|
46
|
+
CreateConfig_CreateConfig2: RunScriptResult;
|
|
47
|
+
CreateConfig_CreateConfig3: RunScriptResult;
|
|
48
|
+
CreateConfig_CreateConfig4: RunScriptResult;
|
|
49
|
+
CreateConfig_CreateConfig5: RunScriptResult;
|
|
50
|
+
CreateConfig_CreateConfig6: RunScriptResult;
|
|
51
|
+
CreateConfig_CreateConfig7: RunScriptResult;
|
|
52
|
+
CreateConfig_CreateConfig8: RunScriptResult;
|
|
53
|
+
CreateConfig_CreateConfig9: RunScriptResult;
|
|
54
|
+
};
|
|
55
|
+
};
|
|
56
|
+
|
|
57
|
+
function toDeployments(json: any): Deployments {
|
|
58
|
+
const contracts = {
|
|
59
|
+
Pool: {
|
|
60
|
+
...json.contracts["Pool"],
|
|
61
|
+
contractInstance: Pool.at(
|
|
62
|
+
json.contracts["Pool"].contractInstance.address
|
|
63
|
+
),
|
|
64
|
+
},
|
|
65
|
+
Position: {
|
|
66
|
+
...json.contracts["Position"],
|
|
67
|
+
contractInstance: Position.at(
|
|
68
|
+
json.contracts["Position"].contractInstance.address
|
|
69
|
+
),
|
|
70
|
+
},
|
|
71
|
+
Tick: {
|
|
72
|
+
...json.contracts["Tick"],
|
|
73
|
+
contractInstance: Tick.at(
|
|
74
|
+
json.contracts["Tick"].contractInstance.address
|
|
75
|
+
),
|
|
76
|
+
},
|
|
77
|
+
BitmapWord: {
|
|
78
|
+
...json.contracts["BitmapWord"],
|
|
79
|
+
contractInstance: BitmapWord.at(
|
|
80
|
+
json.contracts["BitmapWord"].contractInstance.address
|
|
81
|
+
),
|
|
82
|
+
},
|
|
83
|
+
PoolConfig: {
|
|
84
|
+
...json.contracts["PoolConfig"],
|
|
85
|
+
contractInstance: PoolConfig.at(
|
|
86
|
+
json.contracts["PoolConfig"].contractInstance.address
|
|
87
|
+
),
|
|
88
|
+
},
|
|
89
|
+
DexAccount: {
|
|
90
|
+
...json.contracts["DexAccount"],
|
|
91
|
+
contractInstance: DexAccount.at(
|
|
92
|
+
json.contracts["DexAccount"].contractInstance.address
|
|
93
|
+
),
|
|
94
|
+
},
|
|
95
|
+
PoolFactory: {
|
|
96
|
+
...json.contracts["PoolFactory"],
|
|
97
|
+
contractInstance: PoolFactory.at(
|
|
98
|
+
json.contracts["PoolFactory"].contractInstance.address
|
|
99
|
+
),
|
|
100
|
+
},
|
|
101
|
+
PositionManager: {
|
|
102
|
+
...json.contracts["PositionManager"],
|
|
103
|
+
contractInstance: PositionManager.at(
|
|
104
|
+
json.contracts["PositionManager"].contractInstance.address
|
|
105
|
+
),
|
|
106
|
+
},
|
|
107
|
+
};
|
|
108
|
+
return {
|
|
109
|
+
...json,
|
|
110
|
+
contracts: contracts as Deployments["contracts"],
|
|
111
|
+
scripts: {
|
|
112
|
+
CreateConfig_CreateConfig0: json.scripts["CreateConfig:CreateConfig0"],
|
|
113
|
+
CreateConfig_CreateConfig1: json.scripts["CreateConfig:CreateConfig1"],
|
|
114
|
+
CreateConfig_CreateConfig2: json.scripts["CreateConfig:CreateConfig2"],
|
|
115
|
+
CreateConfig_CreateConfig3: json.scripts["CreateConfig:CreateConfig3"],
|
|
116
|
+
CreateConfig_CreateConfig4: json.scripts["CreateConfig:CreateConfig4"],
|
|
117
|
+
CreateConfig_CreateConfig5: json.scripts["CreateConfig:CreateConfig5"],
|
|
118
|
+
CreateConfig_CreateConfig6: json.scripts["CreateConfig:CreateConfig6"],
|
|
119
|
+
CreateConfig_CreateConfig7: json.scripts["CreateConfig:CreateConfig7"],
|
|
120
|
+
CreateConfig_CreateConfig8: json.scripts["CreateConfig:CreateConfig8"],
|
|
121
|
+
CreateConfig_CreateConfig9: json.scripts["CreateConfig:CreateConfig9"],
|
|
122
|
+
},
|
|
123
|
+
};
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
export function loadDeployments(
|
|
127
|
+
networkId: NetworkId,
|
|
128
|
+
deployerAddress?: string
|
|
129
|
+
): Deployments {
|
|
130
|
+
const deployments =
|
|
131
|
+
networkId === "testnet"
|
|
132
|
+
? testnetDeployments
|
|
133
|
+
: networkId === "devnet"
|
|
134
|
+
? devnetDeployments
|
|
135
|
+
: undefined;
|
|
136
|
+
if (deployments === undefined) {
|
|
137
|
+
throw Error("The contract has not been deployed to the " + networkId);
|
|
138
|
+
}
|
|
139
|
+
const allDeployments: any[] = Array.isArray(deployments)
|
|
140
|
+
? deployments
|
|
141
|
+
: [deployments];
|
|
142
|
+
if (deployerAddress === undefined) {
|
|
143
|
+
if (allDeployments.length > 1) {
|
|
144
|
+
throw Error(
|
|
145
|
+
"The contract has been deployed multiple times on " +
|
|
146
|
+
networkId +
|
|
147
|
+
", please specify the deployer address"
|
|
148
|
+
);
|
|
149
|
+
} else {
|
|
150
|
+
return toDeployments(allDeployments[0]);
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
const result = allDeployments.find(
|
|
154
|
+
(d) => d.deployerAddress === deployerAddress
|
|
155
|
+
);
|
|
156
|
+
if (result === undefined) {
|
|
157
|
+
throw Error("The contract deployment result does not exist");
|
|
158
|
+
}
|
|
159
|
+
return toDeployments(result);
|
|
160
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/* Autogenerated file. Do not edit manually. */
|
|
2
|
+
/* tslint:disable */
|
|
3
|
+
/* eslint-disable */
|
|
4
|
+
|
|
5
|
+
export * from "./BitmapWord";
|
|
6
|
+
export * from "./BitmapWordDeployer";
|
|
7
|
+
export * from "./DexAccount";
|
|
8
|
+
export * from "./LiquidityAmountsTest";
|
|
9
|
+
export * from "./LiquidityManagmentTest";
|
|
10
|
+
export * from "./Pool";
|
|
11
|
+
export * from "./PoolConfig";
|
|
12
|
+
export * from "./PoolFactory";
|
|
13
|
+
export * from "./PoolUser";
|
|
14
|
+
export * from "./Position";
|
|
15
|
+
export * from "./PositionManager";
|
|
16
|
+
export * from "./TestToken";
|
|
17
|
+
export * from "./Tick";
|
|
18
|
+
export * from "./TickBitmapTest";
|
|
19
|
+
export * from "./contracts";
|
|
20
|
+
export * from "./scripts";
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
/* Autogenerated file. Do not edit manually. */
|
|
2
|
+
/* tslint:disable */
|
|
3
|
+
/* eslint-disable */
|
|
4
|
+
|
|
5
|
+
import {
|
|
6
|
+
Address,
|
|
7
|
+
ExecutableScript,
|
|
8
|
+
ExecuteScriptParams,
|
|
9
|
+
ExecuteScriptResult,
|
|
10
|
+
Script,
|
|
11
|
+
SignerProvider,
|
|
12
|
+
HexString,
|
|
13
|
+
} from "@alephium/web3";
|
|
14
|
+
import { getContractByCodeHash } from "./contracts";
|
|
15
|
+
import { default as CreateConfigScriptJson } from "../CreateConfig.ral.json";
|
|
16
|
+
import { default as CreateLiquidPoolScriptJson } from "../CreateLiquidPool.ral.json";
|
|
17
|
+
import { default as PoolRouterDemoScriptJson } from "../PoolRouterDemo.ral.json";
|
|
18
|
+
import { default as SwapWithoutAccountScriptJson } from "../SwapWithoutAccount.ral.json";
|
|
19
|
+
import * as types from "./types";
|
|
20
|
+
|
|
21
|
+
export const CreateConfig = new ExecutableScript<{
|
|
22
|
+
factory: HexString;
|
|
23
|
+
tickSpacing: bigint;
|
|
24
|
+
fee: bigint;
|
|
25
|
+
feeProtocol: bigint;
|
|
26
|
+
configIndex: bigint;
|
|
27
|
+
}>(
|
|
28
|
+
Script.fromJson(CreateConfigScriptJson, "", types.AllStructs),
|
|
29
|
+
getContractByCodeHash
|
|
30
|
+
);
|
|
31
|
+
|
|
32
|
+
export const CreateLiquidPool = new ExecutableScript<{
|
|
33
|
+
factory: HexString;
|
|
34
|
+
token0: HexString;
|
|
35
|
+
token1: HexString;
|
|
36
|
+
configIndex: bigint;
|
|
37
|
+
sqrtPriceX96: bigint;
|
|
38
|
+
rewardToken: HexString;
|
|
39
|
+
tickLower: bigint;
|
|
40
|
+
tickUpper: bigint;
|
|
41
|
+
liquidity: bigint;
|
|
42
|
+
amount0: bigint;
|
|
43
|
+
amount1: bigint;
|
|
44
|
+
}>(
|
|
45
|
+
Script.fromJson(CreateLiquidPoolScriptJson, "", types.AllStructs),
|
|
46
|
+
getContractByCodeHash
|
|
47
|
+
);
|
|
48
|
+
|
|
49
|
+
export const PoolRouterDemo = new ExecutableScript<{
|
|
50
|
+
pool_: HexString;
|
|
51
|
+
position_: HexString;
|
|
52
|
+
tick_: HexString;
|
|
53
|
+
word_: HexString;
|
|
54
|
+
factory_: HexString;
|
|
55
|
+
user_: HexString;
|
|
56
|
+
config_: HexString;
|
|
57
|
+
dexAccount_: HexString;
|
|
58
|
+
counter: bigint;
|
|
59
|
+
}>(
|
|
60
|
+
Script.fromJson(PoolRouterDemoScriptJson, "", types.AllStructs),
|
|
61
|
+
getContractByCodeHash
|
|
62
|
+
);
|
|
63
|
+
|
|
64
|
+
export const SwapWithoutAccount = new ExecutableScript<{
|
|
65
|
+
dexAccount: HexString;
|
|
66
|
+
pool: HexString;
|
|
67
|
+
tokenIn: HexString;
|
|
68
|
+
tokenOut: HexString;
|
|
69
|
+
zeroForOne: boolean;
|
|
70
|
+
amountSpecified: bigint;
|
|
71
|
+
sqrtPriceLimitX96: bigint;
|
|
72
|
+
data: HexString;
|
|
73
|
+
}>(
|
|
74
|
+
Script.fromJson(SwapWithoutAccountScriptJson, "", types.AllStructs),
|
|
75
|
+
getContractByCodeHash
|
|
76
|
+
);
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
/* Autogenerated file. Do not edit manually. */
|
|
2
|
+
/* tslint:disable */
|
|
3
|
+
/* eslint-disable */
|
|
4
|
+
|
|
5
|
+
import { Address, HexString, Val, Struct } from "@alephium/web3";
|
|
6
|
+
import { default as allStructsJson } from "../structs.ral.json";
|
|
7
|
+
export const AllStructs = allStructsJson.map((json) => Struct.fromJson(json));
|
|
8
|
+
export interface CollectParams extends Record<string, Val> {
|
|
9
|
+
token0: HexString;
|
|
10
|
+
token1: HexString;
|
|
11
|
+
configIndex: bigint;
|
|
12
|
+
owner: Address;
|
|
13
|
+
recipient: Address;
|
|
14
|
+
tickLower: bigint;
|
|
15
|
+
tickUpper: bigint;
|
|
16
|
+
amount0Max: bigint;
|
|
17
|
+
amount1Max: bigint;
|
|
18
|
+
}
|
|
19
|
+
export interface Config extends Record<string, Val> {
|
|
20
|
+
tickSpacing: bigint;
|
|
21
|
+
fee: bigint;
|
|
22
|
+
feeProtocol: bigint;
|
|
23
|
+
}
|
|
24
|
+
export interface DecreaseLiquidityParams extends Record<string, Val> {
|
|
25
|
+
token0: HexString;
|
|
26
|
+
token1: HexString;
|
|
27
|
+
configIndex: bigint;
|
|
28
|
+
owner: Address;
|
|
29
|
+
tickLower: bigint;
|
|
30
|
+
tickUpper: bigint;
|
|
31
|
+
amount0Min: bigint;
|
|
32
|
+
amount1Min: bigint;
|
|
33
|
+
}
|
|
34
|
+
export interface ModifyLiquidityParams extends Record<string, Val> {
|
|
35
|
+
token0: HexString;
|
|
36
|
+
token1: HexString;
|
|
37
|
+
configIndex: bigint;
|
|
38
|
+
owner: Address;
|
|
39
|
+
tickLower: bigint;
|
|
40
|
+
tickUpper: bigint;
|
|
41
|
+
amount0Desired: bigint;
|
|
42
|
+
amount1Desired: bigint;
|
|
43
|
+
amount0Min: bigint;
|
|
44
|
+
amount1Min: bigint;
|
|
45
|
+
}
|
|
46
|
+
export interface ModifyPositionParams extends Record<string, Val> {
|
|
47
|
+
owner: Address;
|
|
48
|
+
tickLower: bigint;
|
|
49
|
+
tickUpper: bigint;
|
|
50
|
+
liquidityDelta: bigint;
|
|
51
|
+
}
|
|
52
|
+
export interface PositionInfo extends Record<string, Val> {
|
|
53
|
+
amount0: bigint;
|
|
54
|
+
amount1: bigint;
|
|
55
|
+
fees: [bigint, bigint, bigint];
|
|
56
|
+
avgValue: bigint;
|
|
57
|
+
avgFees: bigint;
|
|
58
|
+
avgTime: bigint;
|
|
59
|
+
}
|
|
60
|
+
export interface ProtocolFees extends Record<string, Val> {
|
|
61
|
+
token0: bigint;
|
|
62
|
+
token1: bigint;
|
|
63
|
+
}
|
|
64
|
+
export interface Reward extends Record<string, Val> {
|
|
65
|
+
nextOpenTime: bigint;
|
|
66
|
+
endTime: bigint;
|
|
67
|
+
amount: bigint;
|
|
68
|
+
}
|
|
69
|
+
export interface Slot0 extends Record<string, Val> {
|
|
70
|
+
sqrtPriceX96: bigint;
|
|
71
|
+
tick: bigint;
|
|
72
|
+
feeProtocol: bigint;
|
|
73
|
+
}
|
|
74
|
+
export interface StepComputations extends Record<string, Val> {
|
|
75
|
+
sqrtPriceStartX96: bigint;
|
|
76
|
+
tickNext: bigint;
|
|
77
|
+
initialized: boolean;
|
|
78
|
+
sqrtPriceNextX96: bigint;
|
|
79
|
+
amountIn: bigint;
|
|
80
|
+
amountOut: bigint;
|
|
81
|
+
feeAmount: bigint;
|
|
82
|
+
}
|
|
83
|
+
export interface SwapCache extends Record<string, Val> {
|
|
84
|
+
liquidityStart: bigint;
|
|
85
|
+
feeProtocol: bigint;
|
|
86
|
+
}
|
|
87
|
+
export interface SwapParams extends Record<string, Val> {
|
|
88
|
+
payer: Address;
|
|
89
|
+
recipient: Address;
|
|
90
|
+
token: HexString;
|
|
91
|
+
payToken: HexString;
|
|
92
|
+
toPay: bigint;
|
|
93
|
+
withdrawToken: HexString;
|
|
94
|
+
toWithdraw: bigint;
|
|
95
|
+
data: HexString;
|
|
96
|
+
}
|
|
97
|
+
export interface SwapState extends Record<string, Val> {
|
|
98
|
+
amountSpecifiedRemaining: bigint;
|
|
99
|
+
amountCalculated: bigint;
|
|
100
|
+
sqrtPriceX96: bigint;
|
|
101
|
+
tick: bigint;
|
|
102
|
+
feeGrowthGlobalX128: bigint;
|
|
103
|
+
liquidity: bigint;
|
|
104
|
+
protocolFee: bigint;
|
|
105
|
+
}
|