Skip to content

Commit

Permalink
Merge pull request #237 from bnb-chain/bnbchain-server/cBridge0103
Browse files Browse the repository at this point in the history
feat: Server api take off try catch
  • Loading branch information
Halibao-Lala authored Jan 3, 2025
2 parents c90a101 + 956fcbf commit 606863d
Show file tree
Hide file tree
Showing 14 changed files with 50 additions and 167 deletions.
6 changes: 0 additions & 6 deletions .release/.changeset/bright-impalas-sniff.md

This file was deleted.

6 changes: 0 additions & 6 deletions .release/.changeset/dull-moose-deliver.md

This file was deleted.

6 changes: 0 additions & 6 deletions .release/.changeset/hungry-doors-lick.md

This file was deleted.

6 changes: 0 additions & 6 deletions .release/.changeset/itchy-dots-enjoy.md

This file was deleted.

5 changes: 0 additions & 5 deletions .release/.changeset/poor-kings-compete.md

This file was deleted.

16 changes: 0 additions & 16 deletions .release/.changeset/pre.json

This file was deleted.

5 changes: 0 additions & 5 deletions .release/.changeset/serious-cars-worry.md

This file was deleted.

54 changes: 27 additions & 27 deletions apps/canonical-bridge-server/src/shared/web3/web3.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,41 +60,41 @@ export class Web3Service {
}

async getTransferConfigsForAll() {
try {
const { data } = await this.httpService.axiosRef.get<ITransferConfigsForAll>(
`${CBRIDGE_ENDPOINT}/v2/getTransferConfigsForAll`,
);
return data;
} catch (e) {
console.error(`Failed to retrieve cBridge data at ${new Date().getTime()}`, e.message);
}
// try {
const { data } = await this.httpService.axiosRef.get<ITransferConfigsForAll>(
`${CBRIDGE_ENDPOINT}/v2/getTransferConfigsForAll`,
);
return data;
// } catch (e) {
// console.error(`Failed to retrieve cBridge data at ${new Date().getTime()}`, e.message);
// }
}

async getDebridgeChains() {
try {
const { data } = await this.httpService.axiosRef.get<{ chains: IDebridgeChain[] }>(
`${DEBRIDGE_ENDPOINT}/supported-chains-info`,
);
// try {
const { data } = await this.httpService.axiosRef.get<{ chains: IDebridgeChain[] }>(
`${DEBRIDGE_ENDPOINT}/supported-chains-info`,
);

return data;
} catch (e) {
console.error(`Failed to retrieve DeBridge chain data at ${new Date().getTime()}`, e.message);
}
return data;
// } catch (e) {
// console.error(`Failed to retrieve DeBridge chain data at ${new Date().getTime()}`, e.message);
// }
}

async getDebridgeChainTokens(chainId: number) {
try {
const { data } = await this.httpService.axiosRef.get<{
tokens: Record<string, IDebridgeToken>;
}>(`${DEBRIDGE_ENDPOINT}/token-list?chainId=${chainId}`);
// try {
const { data } = await this.httpService.axiosRef.get<{
tokens: Record<string, IDebridgeToken>;
}>(`${DEBRIDGE_ENDPOINT}/token-list?chainId=${chainId}`);

return data;
} catch (e) {
console.error(
`Failed to retrieve DeBridge token data from ${chainId} at ${new Date().getTime()}`,
e.message,
);
}
return data;
// } catch (e) {
// console.error(
// `Failed to retrieve DeBridge token data from ${chainId} at ${new Date().getTime()}`,
// e.message,
// );
// }
}

async getStargateConfigs() {
Expand Down
9 changes: 9 additions & 0 deletions packages/canonical-bridge-sdk/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
# @bnb-chain/canonical-bridge-sdk

## 0.4.6

### Patch Changes

- Use stargate & meson api to fetch chain & token config
- 2538636: Remove duplicated tokens for stargate
- c4f3ee7: Update token element's info
- 7caf17e: Fix meson token display symbol issue

## 0.4.6-alpha.3

### Patch Changes
Expand Down
2 changes: 1 addition & 1 deletion packages/canonical-bridge-sdk/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@bnb-chain/canonical-bridge-sdk",
"version": "0.4.6-alpha.3",
"version": "0.4.6",
"description": "canonical bridge sdk",
"author": "bnb-chain",
"private": false,
Expand Down

This file was deleted.

This file was deleted.

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.16

### Patch Changes

- Use stargate & meson api to fetch chain & token config
- 2538636: Remove duplicated tokens for stargate
- 5d08223: Fix stargate fee display and handle api error
- c4f3ee7: Update token element's info
- 7caf17e: Fix meson token display symbol issue
- e19a76c: Fix tron does not display due to its id
- b930ad4: Add more token info to token element

## 0.5.16-alpha.5

### 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.16-alpha.5",
"version": "0.5.16",
"description": "canonical bridge widget",
"author": "bnb-chain",
"private": false,
Expand Down

0 comments on commit 606863d

Please sign in to comment.