Skip to content

Commit

Permalink
fix: hook query options
Browse files Browse the repository at this point in the history
  • Loading branch information
jayeshbhole-rp committed Nov 19, 2024
1 parent 1f91d6a commit 50642e9
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 16 deletions.
6 changes: 6 additions & 0 deletions packages/react/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# @tangled3/react

## 1.14.2

### Patch Changes

- fix query options

## 1.14.1

### Patch Changes
Expand Down
2 changes: 1 addition & 1 deletion packages/react/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@tangled3/react",
"private": false,
"version": "1.14.1",
"version": "1.14.2",
"type": "module",
"license": "MIT",
"main": "./src/index.ts",
Expand Down
5 changes: 2 additions & 3 deletions packages/react/src/hooks/useToken.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,7 @@ export type UseTokenParams = {
chainId: ChainId | undefined;
/** Token Address */
token: string | undefined;
queryOptions?: QueryParameter;
};
} & QueryParameter;

export type TokenMetadata = {
address: string;
Expand All @@ -21,7 +20,7 @@ export type TokenMetadata = {
chainId: ChainId;
};

export const useToken = ({ chainId, token, queryOptions = {} }: UseTokenParams) => {
export const useToken = ({ chainId, token, ...queryOptions }: UseTokenParams) => {
const chain = useChain(chainId);
const connectionOrConfig = useConnectionOrConfig();

Expand Down
11 changes: 2 additions & 9 deletions packages/react/src/hooks/useTokenForAccount.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,16 +18,9 @@ export type UseTokenForAccountParams = {
spender: string | undefined;
/** Subscribe to token balance and allowance changes for every block */
// subscribe?: boolean;
queryOptions?: QueryParameter;
};
} & QueryParameter;

export const useTokenForAccount = ({
chainId,
account,
token,
spender,
queryOptions = {},
}: UseTokenForAccountParams) => {
export const useTokenForAccount = ({ chainId, account, token, spender, ...queryOptions }: UseTokenForAccountParams) => {
const chain = useChain(chainId);
const connectionOrConfig = useConnectionOrConfig();

Expand Down
5 changes: 2 additions & 3 deletions packages/react/src/hooks/useWaitForTransaction.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,7 @@ export type UseWaitForTransactionParams = {
chainId: ChainId | undefined;
/** Transaction overrides {@link WatchTransactionOverrides} */
overrides?: WatchTransactionOverrides<ChainType>;
queryOptions?: QueryParameter;
};
} & QueryParameter;

/**
* Watch transaction Hook
Expand All @@ -24,7 +23,7 @@ export const useWaitForTransaction = ({
transactionParams,
chainId,
overrides,
queryOptions = {},
...queryOptions
}: UseWaitForTransactionParams) => {
const connectionOrConfig = useConnectionOrConfig();
const chain = useChain(chainId);
Expand Down

0 comments on commit 50642e9

Please sign in to comment.