From fe1646a8d5ca0da6b5cd1066766ba92ddc480476 Mon Sep 17 00:00:00 2001 From: johngrantuk Date: Mon, 15 Jul 2024 09:51:33 +0100 Subject: [PATCH 1/2] refactor: Expose missing PoolState and Buffer. --- typescript/src/buffer/index.ts | 2 ++ typescript/src/index.ts | 1 + typescript/src/vault/types.ts | 6 ++++++ typescript/src/vault/vault.ts | 10 +++++----- 4 files changed, 14 insertions(+), 5 deletions(-) create mode 100644 typescript/src/buffer/index.ts diff --git a/typescript/src/buffer/index.ts b/typescript/src/buffer/index.ts new file mode 100644 index 0000000..ffb8830 --- /dev/null +++ b/typescript/src/buffer/index.ts @@ -0,0 +1,2 @@ +export * from './data'; +export * from './erc4626BufferWrapOrUnwrap'; \ No newline at end of file diff --git a/typescript/src/index.ts b/typescript/src/index.ts index 366d89c..20f3919 100644 --- a/typescript/src/index.ts +++ b/typescript/src/index.ts @@ -2,3 +2,4 @@ export * from './stable'; export * from './vault/vault'; export * from './vault/types'; export * from './weighted'; +export * from './buffer'; diff --git a/typescript/src/vault/types.ts b/typescript/src/vault/types.ts index 873e7b5..c7b37c9 100644 --- a/typescript/src/vault/types.ts +++ b/typescript/src/vault/types.ts @@ -1,3 +1,9 @@ +import { BufferState } from "../buffer"; +import { StableState } from "../stable"; +import { WeightedState } from "../weighted"; + +export type PoolState = WeightedState | StableState | BufferState; + export enum SwapKind { GivenIn = 0, GivenOut = 1, diff --git a/typescript/src/vault/vault.ts b/typescript/src/vault/vault.ts index d48a805..84f6dfd 100644 --- a/typescript/src/vault/vault.ts +++ b/typescript/src/vault/vault.ts @@ -6,15 +6,15 @@ import { computeRemoveLiquiditySingleTokenExactIn, computeRemoveLiquiditySingleTokenExactOut, } from './basePoolMath'; -import { Weighted, type WeightedState } from '../weighted'; -import { Stable, type StableState } from '../stable'; -import { erc4626BufferWrapOrUnwrap } from '../buffer/erc4626BufferWrapOrUnwrap'; +import { Weighted } from '../weighted'; +import { Stable } from '../stable'; +import { erc4626BufferWrapOrUnwrap } from '../buffer'; import { isSameAddress } from './utils'; -import { BufferState } from '../buffer/data'; import { AddKind, AddLiquidityInput, PoolBase, + PoolState, RemoveKind, RemoveLiquidityInput, SwapInput, @@ -22,7 +22,7 @@ import { SwapParams, } from './types'; -type PoolState = WeightedState | StableState | BufferState; + type PoolClassConstructor = new (..._args: any[]) => PoolBase; type PoolClasses = Readonly>; From ea678e19f9322eb3690aa6d9e271a8870f654087 Mon Sep 17 00:00:00 2001 From: johngrantuk Date: Mon, 15 Jul 2024 09:52:08 +0100 Subject: [PATCH 2/2] chore: Package bump. --- typescript/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/typescript/package.json b/typescript/package.json index 48d4aac..bd2a14a 100644 --- a/typescript/package.json +++ b/typescript/package.json @@ -9,7 +9,7 @@ "publishConfig": { "access": "public" }, - "version": "0.0.5", + "version": "0.0.6", "main": "dist/index.js", "module": "dist/index.mjs", "types": "dist/index.d.ts",