Skip to content

Commit aa68da8

Browse files
committed
fix: add type of deposit in metadata
1 parent 2b61ced commit aa68da8

File tree

2 files changed

+15
-2
lines changed

2 files changed

+15
-2
lines changed

src/sdk/pools/PoolService.ts

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,18 +63,25 @@ export class PoolService extends SDKConstruct implements IPoolsService {
6363
if (this.sdk.tokensMeta.isKYCUnderlying(underlying)) {
6464
switch (underlying.contractType) {
6565
case KYC_UNDERLYING_DEFAULT: {
66-
return this.#depositMetadata(pool, tokenIn, tokenOut, false);
66+
return this.#depositMetadata(
67+
"kyc-default",
68+
pool,
69+
tokenIn,
70+
tokenOut,
71+
false,
72+
);
6773
}
6874
case KYC_UNDERLYING_ON_DEMAND:
6975
return {
7076
zapper: undefined,
7177
approveTarget: underlying.liquidityProvider,
7278
permissible: false,
79+
type: "kyc-on-demand",
7380
};
7481
}
7582
}
7683

77-
return this.#depositMetadata(pool, tokenIn, tokenOut, true);
84+
return this.#depositMetadata("classic", pool, tokenIn, tokenOut, true);
7885
}
7986

8087
public addLiquidity(props: AddLiquidityProps): PoolServiceCall | undefined {
@@ -262,6 +269,7 @@ export class PoolService extends SDKConstruct implements IPoolsService {
262269
return zappers?.[0];
263270
}
264271
#depositMetadata(
272+
type: DepositMetadata["type"],
265273
poolAddr: Address,
266274
tokenIn: Address,
267275
tokenOut?: Address,
@@ -290,6 +298,7 @@ export class PoolService extends SDKConstruct implements IPoolsService {
290298
// TODO: instead of permissible, return permitType зависимости от tokenIn
291299
// "none" | "eip2612" | "dai_like";
292300
permissible: !!zapper && tokenIn !== NATIVE_ADDRESS,
301+
type,
293302
};
294303
}
295304

src/sdk/pools/types.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,10 @@ export interface DepositMetadata {
7171
* If true, user can avoid approval step and deposit with permit
7272
*/
7373
permissible: boolean;
74+
/**
75+
* Type of deposit
76+
*/
77+
type: "kyc-on-demand" | "kyc-default" | "classic";
7478
}
7579

7680
export interface IPoolsService {

0 commit comments

Comments
 (0)