Skip to content

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

Merged
keithbro-imx merged 14 commits into
mainfrom
task/ability-to-override-network-map
Apr 29, 2025
Merged

chore(checkout): Additional overrides to facilitate the Immutable dev env#2607
keithbro-imx merged 14 commits into
mainfrom
task/ability-to-override-network-map

Conversation

@keithbro-imx
Copy link
Copy Markdown
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?

@nx-cloud
Copy link
Copy Markdown

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
Copy Markdown
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.

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
Copy Markdown
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
Copy Markdown
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