Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove inconsistency between bptIn and bptAmountIn #496

Open
brunoguerios opened this issue Nov 21, 2024 · 1 comment
Open

Remove inconsistency between bptIn and bptAmountIn #496

brunoguerios opened this issue Nov 21, 2024 · 1 comment

Comments

@brunoguerios
Copy link
Member

We should keep consistency between bptIn and bptAmountIn throughout the code.

This is a report from @agualis:

Hey team, we already have the nested pool removals working (not yet merged) but I have a DX question:
The Base query output for Remove Liquidity has this type:

bptIn: TokenAmount;

where you have the field: bptIn: TokenAmount
You have 3 Permit helpers for signing removals:

declare class PermitHelper {
    static signRemoveLiquidityApproval: (input: RemoveLiquidityBaseBuildCallInput & {
        client: PublicWalletClient;
        owner: Hex;
        nonce?: bigint;
        deadline?: bigint;
    }) => Promise<Permit>;
    static signRemoveLiquidityNestedApproval: (input: {
        bptAmountIn: TokenAmount; // Could we rename this input to bptIn: TokenAmount?
        chainId: ChainId;
        client: PublicWalletClient;
        owner: Hex;
        nonce?: bigint;
        deadline?: bigint;
    }) => Promise<Permit>;
    static signRemoveLiquidityBoostedApproval: (input: RemoveLiquidityBaseBuildCallInput & {
        client: PublicWalletClient;
        owner: Hex;
        nonce?: bigint;
        deadline?: bigint;
    }) => Promise<Permit>;
} 

signRemoveLiquidityApproval and signRemoveLiquidityBoostedApproval use RemoveLiquidityBaseBuildCallInput which in turn uses RemoveLiquidityBaseQueryOutput, so the will both expect bptIn: TokenAmount as an input parameter
However, signRemoveLiquidityNestedApproval
expects bptAmountIn: TokenAmount;
which breaks the TS contract a little bit.
Our code is working by using a little TS casting but it feels dirty and could be confusing for other integrators.
If you have time it would be nice to rename from bptAmountIn to bptIn (If I’m not missing something important)

@johngrantuk
Copy link
Member

Once this is done/released please check in with FE team to let them know.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants