Skip to content

refactor(js): narrow sol destination error details - #99

Merged
joncinque merged 2 commits into
solana-program:mainfrom
amilz:refactor/narrow-sol-destination-error
Oct 28, 2026
Merged

joncinque merged 2 commits into
solana-program:mainfrom
amilz:refactor/narrow-sol-destination-error

Conversation

@amilz

@amilz amilz commented Oct 28, 2026

Copy link
Copy Markdown
Contributor
  • Replace reason / owner? on InvalidTransferSolDestinationError with a details union narrowed on reason, matching InvalidTokenTransferDestinationError (feat(js): add token transfer destination assertion token#190)
  • Drop "until the recipient confirms they control them" wording from the off-curve docs and error message
  • Check allowOffCurve before the slower isOffCurveAddress

@mcintyre94 for consistency to solana-program/token#190
Figured we'd include this here as well since it's not yet released (follow-up to #96), so no breaking change for published versions.

- if (err.reason === 'unexpected-owner') log(err.owner!);
+ if (err.details.reason === 'unexpected-owner') log(err.details.owner);

mcintyre94
mcintyre94 previously approved these changes Oct 28, 2026

@mcintyre94 mcintyre94 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thankyou!

- rustls-webpki 0.103.15 → 0.103.16 (RUSTSEC-2026-0382)
- webpki-roots 1.0.1 → 1.0.11 (RUSTSEC-2026-0381)
- zstd-sys 2.0.13 → 2.1.2 (RUSTSEC-2026-0410)

For zstd 0.13.3 (RUSTSEC-2026-0391) and zstd-safe 7.2.1
(RUSTSEC-2026-0403), we will need `solana-rpc-client ` crates to bump
their zstd dependencies. Ignored for now in the Makefile

@mcintyre94 mcintyre94 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Pushed a cherry-pick of #100 (should be noop when this merges)

@joncinque
joncinque merged commit 0e7dc5d into solana-program:main Oct 28, 2026
20 checks passed
@amilz
amilz deleted the refactor/narrow-sol-destination-error branch October 28, 2026 15:41
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.

3 participants