Skip to content
This repository was archived by the owner on Jan 14, 2026. It is now read-only.

Commit 44f4fae

Browse files
committed
fix: accept null for address parameter in FetchQuoteParams
Update `FetchQuoteParams` to accept `string | null` for the `address` field to match the return type of `activeAddress` from `@txnlab/use-wallet-*`. This eliminates the need for `|| undefined` fallbacks in consuming code. The client normalizes null to undefined internally when creating quotes.
1 parent 37b7a7e commit 44f4fae

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

examples/react/src/App.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ function App() {
4646
fromASAID: fromAsset,
4747
toASAID: toAsset,
4848
amount: amountInBaseUnits,
49-
address: activeAddress || undefined,
49+
address: activeAddress,
5050
})
5151
console.log('Quote received', quoteResult)
5252

packages/deflex/src/client.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -301,7 +301,7 @@ export class DeflexClient {
301301
...response,
302302
quote: response.quote === '' ? 0n : BigInt(response.quote),
303303
amount: BigInt(params.amount),
304-
address: params.address,
304+
address: params.address ?? undefined,
305305
createdAt: Date.now(),
306306
}
307307
}

packages/deflex/src/types.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ export interface FetchQuoteParams {
7373
readonly optIn?: boolean
7474

7575
/** Address of the account that will perform the swap (required if autoOptIn is enabled) */
76-
readonly address?: string
76+
readonly address?: string | null
7777
}
7878

7979
/**

0 commit comments

Comments
 (0)