Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Fix searching issue #178

Merged
merged 2 commits into from
Dec 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .release/.changeset/healthy-wombats-applaud.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@bnb-chain/canonical-bridge-widget': patch
---

Use own token address for deBridge
5 changes: 5 additions & 0 deletions .release/.changeset/nice-worms-turn.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@bnb-chain/canonical-bridge-widget": patch
---

Fix from & to chain search
12 changes: 12 additions & 0 deletions .release/.changeset/pre.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"mode": "pre",
"tag": "alpha",
"initialVersions": {
"@bnb-chain/canonical-bridge-sdk": "0.4.2",
"@bnb-chain/canonical-bridge-widget": "0.5.8"
},
"changesets": [
"healthy-wombats-applaud",
"nice-worms-turn"
]
}
12 changes: 12 additions & 0 deletions packages/canonical-bridge-widget/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,17 @@
# @bnb-chain/canonical-bridge-widget

## 0.5.9-alpha.1

### Patch Changes

- Use own token address for deBridge

## 0.5.9-alpha.0

### Patch Changes

- Fix from & to chain search

## 0.5.8

### Patch Changes
Expand Down
2 changes: 1 addition & 1 deletion packages/canonical-bridge-widget/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@bnb-chain/canonical-bridge-widget",
"version": "0.5.8",
"version": "0.5.9-alpha.1",
"description": "canonical bridge widget",
"author": "bnb-chain",
"private": false,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ export class MesonAdapter extends BaseAdapter<IMesonChain[], IMesonChain, IMeson

public getTokenInfo({ chainId, token }: { chainId: number; token: IMesonToken }) {
return {
name: (token as any).id, // TODO
name: (token as any).id?.toUpperCase(), // TODO
symbol: token.id.toUpperCase(),
address: token.addr ?? '0x0000000000000000000000000000000000000000',
decimals: token.decimals,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ export function DestinationNetworkModal(props: DestinationNetworkModalProps) {
});

const { isNoResult, result, onSearch } = useSearch({
filter: (item, keyword) => item.name.toLowerCase().includes(keyword),
filter: (item, keyword) => item.name.toLowerCase().includes(keyword?.toLowerCase()),
sorter: (a) => (toChain?.id === a.id ? -1 : 0),
data: toChains,
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ export function SourceNetworkModal(props: SourceNetworkModalProps) {
});

const { isNoResult, result, onSearch } = useSearch({
filter: (item, keyword) => item.name.toLowerCase().includes(keyword),
filter: (item, keyword) => item.name.toLowerCase().includes(keyword?.toLowerCase()),
sorter: (a) => (fromChain?.id === a.id ? -1 : 0),
data: fromChains,
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -157,10 +157,10 @@ export const useLoadingBridgeFees = () => {
},
deBridgeOpts: {
fromChainId: fromChain.id,
fromTokenAddress: selectedToken.address as `0x${string}`,
fromTokenAddress: selectedToken.deBridge?.address as `0x${string}`,
amount,
toChainId: toChain?.id,
toTokenAddress: toToken?.address as `0x${string}`,
toTokenAddress: toToken?.deBridge?.address as `0x${string}`,
accesstoken: deBridgeAccessToken,
userAddress:
fromChain.chainType === 'solana'
Expand Down
Loading