From 414e0834c43c36b0ebfe8b7c1e5fe67f93af03ff Mon Sep 17 00:00:00 2001 From: Rasa Welcher Date: Mon, 5 May 2025 16:37:01 -0400 Subject: [PATCH] Re-orders ANS api additional where clauses to allow user fine tuning --- CHANGELOG.md | 2 ++ src/internal/ans.ts | 8 ++++---- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 911c9406e..e1c282987 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,8 @@ All notable changes to the Aptos TypeScript SDK will be captured in this file. T ## Unreleased +- Fix ANS api functions overwriting user provided `where` clauses + # 1.39.0 (2025-04-02) - Add a `transferFungibleAssetBetweenStores` function to transfer Fungible Assets between any (primary or secondary) fungible stores. diff --git a/src/internal/ans.ts b/src/internal/ans.ts index e99b439ed..7182a875e 100644 --- a/src/internal/ans.ts +++ b/src/internal/ans.ts @@ -573,9 +573,9 @@ export async function getAccountNames( offset: options?.offset, order_by: options?.orderBy, where_condition: { - ...(args.options?.where ?? {}), owner_address: { _eq: accountAddress.toString() }, expiration_timestamp: { _gte: expirationDate }, + ...(args.options?.where ?? {}), }, }, }, @@ -628,10 +628,10 @@ export async function getAccountDomains( offset: options?.offset, order_by: options?.orderBy, where_condition: { - ...(args.options?.where ?? {}), owner_address: { _eq: accountAddress.toString() }, expiration_timestamp: { _gte: expirationDate }, subdomain: { _eq: "" }, + ...(args.options?.where ?? {}), }, }, }, @@ -684,10 +684,10 @@ export async function getAccountSubdomains( offset: options?.offset, order_by: options?.orderBy, where_condition: { - ...(args.options?.where ?? {}), owner_address: { _eq: accountAddress.toString() }, expiration_timestamp: { _gte: expirationDate }, subdomain: { _neq: "" }, + ...(args.options?.where ?? {}), }, }, }, @@ -736,9 +736,9 @@ export async function getDomainSubdomains( offset: options?.offset, order_by: options?.orderBy, where_condition: { - ...(args.options?.where ?? {}), domain: { _eq: domain }, subdomain: { _neq: "" }, + ...(args.options?.where ?? {}), }, }, },