-
Notifications
You must be signed in to change notification settings - Fork 2
feat(providers): Return http error when network is unsupported #44 #43
Conversation
src/client/getProviderUrl.ts
Outdated
@@ -0,0 +1,30 @@ | |||
const hostByChainId: Record<number, string> = |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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 :)
There was a problem hiding this comment.
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", |
There was a problem hiding this comment.
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
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
src/client/getProviderUrl.ts
Outdated
if (!host) { | ||
throw new Error("Unknown chain ID"); | ||
} | ||
return `https://${host}/${apiKey}`; |
There was a problem hiding this comment.
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
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes thank you
2bcad2e
to
23342c7
Compare
No description provided.