From df5c0297055b4057f5b227309e75045285a4ae60 Mon Sep 17 00:00:00 2001 From: ramimbo Date: Fri, 1 May 2026 21:26:09 +0000 Subject: [PATCH] fix distributor stats address docs --- packages/sdk/src/DistributorClient.ts | 8 ++----- packages/sdk/src/__tests__/overloads.test.ts | 22 +------------------- 2 files changed, 3 insertions(+), 27 deletions(-) diff --git a/packages/sdk/src/DistributorClient.ts b/packages/sdk/src/DistributorClient.ts index 6842fb9..e800d87 100644 --- a/packages/sdk/src/DistributorClient.ts +++ b/packages/sdk/src/DistributorClient.ts @@ -100,14 +100,12 @@ export class DistributorClient { /** * Get stats for a specific user. - * @param user The address of the user, or an object containing the user address. + * @param user The address of the user. * @throws {FundableStellarError} If fetch fails with a human-readable error message */ public async getUserStats( user: AddressParam ): Promise> { - const actualUser = typeof user === "object" ? user.user : user; - return executeWithErrorHandling( () => this.client.get_user_stats({ user: addressToString(user) }) as Promise< @@ -119,14 +117,12 @@ export class DistributorClient { /** * Get stats for a specific token. - * @param token The address of the token (contract ID), or an object containing the token address. + * @param token The address of the token contract. * @throws {FundableStellarError} If fetch fails with a human-readable error message */ public async getTokenStats( token: AddressParam ): Promise> { - const actualToken = typeof token === "object" ? token.token : token; - return executeWithErrorHandling( () => this.client.get_token_stats({ token: addressToString(token) }) as Promise< diff --git a/packages/sdk/src/__tests__/overloads.test.ts b/packages/sdk/src/__tests__/overloads.test.ts index e1b1324..7388151 100644 --- a/packages/sdk/src/__tests__/overloads.test.ts +++ b/packages/sdk/src/__tests__/overloads.test.ts @@ -207,16 +207,6 @@ describe("Client Method Overloads", () => { expect(result).toBe(mockResult); }); - it("getUserStats accepts object parameter", async () => { - const mockResult = { signAndSend: vi.fn() }; - mockDistributorClient.get_user_stats.mockResolvedValue(mockResult); - - const result = await distributorClient.getUserStats({ user }); - - expect(mockDistributorClient.get_user_stats).toHaveBeenCalledWith({ user }); - expect(result).toBe(mockResult); - }); - it("getTokenStats accepts individual parameters", async () => { const mockResult = { signAndSend: vi.fn() }; mockDistributorClient.get_token_stats.mockResolvedValue(mockResult); @@ -226,16 +216,6 @@ describe("Client Method Overloads", () => { expect(mockDistributorClient.get_token_stats).toHaveBeenCalledWith({ token }); expect(result).toBe(mockResult); }); - - it("getTokenStats accepts object parameter", async () => { - const mockResult = { signAndSend: vi.fn() }; - mockDistributorClient.get_token_stats.mockResolvedValue(mockResult); - - const result = await distributorClient.getTokenStats({ token }); - - expect(mockDistributorClient.get_token_stats).toHaveBeenCalledWith({ token }); - expect(result).toBe(mockResult); - }); }); describe("DistributorClient - Two Parameter Methods", () => { @@ -296,4 +276,4 @@ describe("Client Method Overloads", () => { expect(result).toBe(mockResult); }); }); -}); \ No newline at end of file +});