Skip to content

fix: add support for okx testnet on initial connection#4693

Merged
svenvoskamp merged 48 commits intomainfrom
fix/add-testnet-okx
Jul 23, 2025
Merged

fix: add support for okx testnet on initial connection#4693
svenvoskamp merged 48 commits intomainfrom
fix/add-testnet-okx

Conversation

@svenvoskamp
Copy link
Copy Markdown
Contributor

Description

fix: add support for okx testnet on initial connection

Type of change

  • Chore (non-breaking change that addresses non-functional tasks, maintenance, or code quality improvements)
  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)

Associated Issues

For Linear issues: Closes APKT-xxx
For GH issues: closes #...

Showcase (Optional)

If there is a UI change include the screenshots with before and after state.
If new feature is being introduced, include the link to demo recording.

Checklist

  • Code in this PR is covered by automated tests (Unit tests, E2E tests)
  • My changes generate no new warnings
  • I have reviewed my own code
  • I have filled out all required sections
  • I have tested my changes on the preview link
  • Approver of this PR confirms that the changes are tested on the preview link

svenvoskamp added 30 commits May 6, 2025 09:33
cursor[bot]

This comment was marked as outdated.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Jul 23, 2025

Warnings
⚠️

🔑 Potential High‑entropy string detected in packages/adapters/bitcoin/tests/connectors/OKXConnector.test.ts (line 280): 000000000933ea01ad0e...

⚠️

🔑 Potential High‑entropy string detected in packages/adapters/bitcoin/src/connectors/OKXConnector.ts (line 217): com/web3/build/docs/...

Generated by 🚫 dangerJS against ebd8473

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Jul 23, 2025

Coverage Report

Status Category Percentage Covered / Total
🔵 Lines 77.61% 31428 / 40493
🔵 Statements 77.61% 31428 / 40493
🔵 Functions 68.92% 2589 / 3756
🔵 Branches 84.46% 6634 / 7854
File Coverage
File Stmts Branches Functions Lines Uncovered Lines
Changed Files
packages/adapters/bitcoin/src/adapter.ts 86.09% 85.55% 73.33% 86.09% 66-79, 277-278, 310-311, 323-324, 372-373, 429-432, 436-465, 469-470
packages/adapters/bitcoin/src/connectors/OKXConnector.ts 98.57% 97.22% 100% 98.57% 146-147
Generated in workflow #13630 for commit ebd8473 by the Vitest Coverage Report Action

cursor[bot]

This comment was marked as outdated.

Copy link
Copy Markdown

@cursor cursor bot left a comment

Choose a reason for hiding this comment

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

Bug: Active Network Undefined Breaks Chain Filtering

The chains getter in OKXConnector now filters by this.getActiveNetwork()?.caipNetworkId. If getActiveNetwork() returns undefined, the getter returns an empty array because chain.caipNetworkId === undefined is always false. This breaks connection logic that expects at least one chain (e.g., connector.chains[0]), causing failures during initialization or when no active network is set. This is a breaking change from the previous behavior, which always returned Bitcoin mainnet chains.

packages/adapters/bitcoin/src/connectors/OKXConnector.ts#L49-L52

public get chains() {
return this.requestedChains.filter(
chain => chain.caipNetworkId === this.getActiveNetwork()?.caipNetworkId
)

Fix in CursorFix in Web


Was this report helpful? Give feedback by reacting with 👍 or 👎

@svenvoskamp svenvoskamp enabled auto-merge July 23, 2025 09:18
@svenvoskamp svenvoskamp added this pull request to the merge queue Jul 23, 2025
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Jul 23, 2025
@svenvoskamp svenvoskamp added this pull request to the merge queue Jul 23, 2025
Merged via the queue into main with commit 59d6f95 Jul 23, 2025
41 checks passed
@svenvoskamp svenvoskamp deleted the fix/add-testnet-okx branch July 23, 2025 12:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants