Skip to content

chore(checkout): Additional overrides to facilitate the Immutable dev env #2607

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

Merged
merged 14 commits into from
Apr 29, 2025

Conversation

keithbro-imx
Copy link
Contributor

@keithbro-imx keithbro-imx commented Mar 31, 2025

Summary

Allows overrides to be passed to the checkout constructor so that it can be used in envs other than sandbox and prod.

Detail and impact of the change

Added

Changed

Deprecated

Removed

Fixed

Security

Anything else worth calling out?

Copy link

nx-cloud bot commented Mar 31, 2025

View your CI Pipeline Execution ↗ for commit f178666.

Command Status Duration Result
nx affected -t build,lint,test ✅ Succeeded 1m 5s View ↗
nx run-many -p @imtbl/sdk,@imtbl/checkout-widge... ✅ Succeeded 2s View ↗

☁️ Nx Cloud last updated this comment at 2025-04-29 03:41:02 UTC

@keithbro-imx keithbro-imx changed the title chore(checkout): Add ability to override networkMap chore(checkout): Additional overrides to facilitate the Immutable dev env Apr 6, 2025

return { balances };
return balanceResults.reduce((acc, resp) => {
if (resp.status !== 'fulfilled' || resp.value.balance === 0n) return acc;
Copy link
Contributor Author

Choose a reason for hiding this comment

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

The change here is to filter out any zero balances. When fetching balances from the RPC it returns all tokens, even zero balance ones. So we need to filter these out to maintain the same behaviour as when we use blockscout.

@@ -91,18 +110,23 @@ export class CheckoutConfiguration {
this.isBridgeEnabled = config.bridge?.enable ?? DEFAULT_BRIDGE_ENABLED;
this.publishableKey = config.publishableKey ?? '<no-publishable-key>';

this.networkMap = networkMap(this.isProduction, this.isDevelopment);
this.networkMap = config.overrides?.networkMap ?? networkMap(this.isProduction, this.isDevelopment);
Copy link
Contributor Author

Choose a reason for hiding this comment

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

These changes are mostly about reading from the overrides

@keithbro-imx keithbro-imx marked this pull request as ready for review April 29, 2025 02:34
@keithbro-imx keithbro-imx requested a review from a team as a code owner April 29, 2025 02:34
@@ -1,10 +1,13 @@
import { Passport } from "@imtbl/passport";
import { Environment } from "@imtbl/config";
import * as x from "@imtbl/x-client";
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Not needed.

@keithbro-imx keithbro-imx added this pull request to the merge queue Apr 29, 2025
Merged via the queue into main with commit 1a2082f Apr 29, 2025
7 checks passed
@keithbro-imx keithbro-imx deleted the task/ability-to-override-network-map branch April 29, 2025 04:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants