Skip to content
This repository has been archived by the owner on Feb 13, 2024. It is now read-only.

feat(providers): Return http error when network is unsupported #44 #43

Merged
merged 11 commits into from
Aug 26, 2023

Conversation

Mitsichury
Copy link
Contributor

No description provided.

@Mitsichury Mitsichury changed the title feat(unsupported_network): Return http when network is unsupported feat(unsupported_network): Return http when network is unsupported #44 Jul 25, 2023
@Mitsichury Mitsichury changed the title feat(unsupported_network): Return http when network is unsupported #44 feat(providers): Return http error when network is unsupported #44 Jul 26, 2023
@@ -0,0 +1,30 @@
const hostByChainId: Record<number, string> =

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Recommend using apiUrls from @airswap/constants for these.
https://github.com/airswap/airswap-protocols/blob/develop/tools/constants/index.ts#L85

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

using lib and fallback now, thanks :)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please remove the fallback as AirSwap only supports networks found in apiUrls.

package.json Outdated
@@ -16,7 +16,7 @@
"type": "module",
"license": "MIT",
"dependencies": {
"@airswap/libraries": "4.0.10",
"@airswap/libraries": "4.0.13",

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not latest 4.0.19?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

if (!host) {
throw new Error("Unknown chain ID");
}
return `https://${host}/${apiKey}`;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Only append apiKey if host URL includes infura.io/v3.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes thank you

@Mitsichury Mitsichury merged commit 1a589ac into main Aug 26, 2023
1 check passed
@Mitsichury Mitsichury deleted the fix/unsup_network branch October 12, 2023 18:33
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants