Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion typescript/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"publishConfig": {
"access": "public"
},
"version": "0.0.39",
"version": "0.0.40",
"main": "dist/index.js",
"module": "dist/index.mjs",
"types": "dist/index.d.ts",
Expand Down
9 changes: 0 additions & 9 deletions typescript/src/hooks/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,6 @@ import { HookStateAkron } from './akron/akronHook';

export type HookStateBase = {
hookType: string;
// Configuration flags from hook contract
shouldCallComputeDynamicSwapFee: boolean;
shouldCallBeforeSwap: boolean;
shouldCallAfterSwap: boolean;
shouldCallBeforeAddLiquidity: boolean;
shouldCallAfterAddLiquidity: boolean;
shouldCallBeforeRemoveLiquidity: boolean;
shouldCallAfterRemoveLiquidity: boolean;
enableHookAdjustedAmounts: boolean;
};

export type HookState =
Expand Down
2 changes: 1 addition & 1 deletion typescript/src/reClamm/index.ts
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
export * from './reClammData';
export * from './reClammPool';
export * from './reClammPool';
2 changes: 1 addition & 1 deletion typescript/src/reClammV2/index.ts
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
export * from './reClammV2Data';
export * from './reClammV2Pool';
export * from './reClammV2Pool';
10 changes: 0 additions & 10 deletions typescript/src/vault/vault.ts
Original file line number Diff line number Diff line change
Expand Up @@ -101,16 +101,6 @@ export class Vault {

const hook = new hookClass(hookState);

// Override the hook's flags with those from HookState (if present)
if (
hookState &&
typeof hookState === 'object' &&
'shouldCallComputeDynamicSwapFee' in hookState
) {
const state = hookState as HookState;
Object.assign(hook, state);
}

return hook;
}

Expand Down
42 changes: 0 additions & 42 deletions typescript/test/utils/mapHookState.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,29 +46,8 @@ function mapExitFeeHookState(
);
}

const {
shouldCallComputeDynamicSwapFee,
shouldCallBeforeSwap,
shouldCallAfterSwap,
shouldCallBeforeAddLiquidity,
shouldCallAfterAddLiquidity,
shouldCallBeforeRemoveLiquidity,
shouldCallAfterRemoveLiquidity,
enableHookAdjustedAmounts,
} = hookData;

return {
hookType: 'ExitFee',
// Configuration flags
shouldCallComputeDynamicSwapFee,
shouldCallBeforeSwap,
shouldCallAfterSwap,
shouldCallBeforeAddLiquidity,
shouldCallAfterAddLiquidity,
shouldCallBeforeRemoveLiquidity,
shouldCallAfterRemoveLiquidity,
enableHookAdjustedAmounts,
// Hook-specific data
tokens,
removeLiquidityHookFeePercentage: BigInt(
hookData.dynamicData.removeLiquidityHookFeePercentage,
Expand All @@ -94,29 +73,8 @@ function mapStableSurgeHookState(
throw new Error('STABLE_SURGE hook requires amp from pool data');
}

const {
shouldCallComputeDynamicSwapFee,
shouldCallBeforeSwap,
shouldCallAfterSwap,
shouldCallBeforeAddLiquidity,
shouldCallAfterAddLiquidity,
shouldCallBeforeRemoveLiquidity,
shouldCallAfterRemoveLiquidity,
enableHookAdjustedAmounts,
} = hookData;

return {
hookType: 'StableSurge',
// Configuration flags
shouldCallComputeDynamicSwapFee,
shouldCallBeforeSwap,
shouldCallAfterSwap,
shouldCallBeforeAddLiquidity,
shouldCallAfterAddLiquidity,
shouldCallBeforeRemoveLiquidity,
shouldCallAfterRemoveLiquidity,
enableHookAdjustedAmounts,
// Hook-specific data
amp: poolData.amp,
surgeThresholdPercentage: BigInt(
hookData.dynamicData.surgeThresholdPercentage,
Expand Down
Loading