Skip to content

Commit

Permalink
Merge pull request #178 from bnb-chain/fix1206v1
Browse files Browse the repository at this point in the history
fix: Fix searching issue
  • Loading branch information
wenty22 authored Dec 9, 2024
2 parents 5a30bc4 + 6e1cd4e commit a8ffc99
Show file tree
Hide file tree
Showing 9 changed files with 40 additions and 6 deletions.
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

0 comments on commit a8ffc99

Please sign in to comment.