Skip to content

chore: fix JS SDK default import for @stellar/stellar-sdk v16.0.0 - #2521

Merged
ElliotFriend merged 1 commit into
mainfrom
chore/sdk-examples-javascript-v16.0.0
Jun 17, 2026
Merged

ElliotFriend merged 1 commit into
mainfrom
chore/sdk-examples-javascript-v16.0.0

Conversation

@ElliotFriend

Copy link
Copy Markdown
Contributor

js-stellar-sdk v16.0.0 removed the ESM default export (and merged @stellar/stellar-base into @stellar/stellar-sdk). The string-to-ScVal example used import StellarSdk from "@stellar/stellar-sdk", which no longer works. Switch to a namespace import (import * as StellarSdk) to preserve the StellarSdk.xdr.ScVal body unchanged.

js-stellar-sdk v16.0.0 removed the ESM default export (and merged
@stellar/stellar-base into @stellar/stellar-sdk). The string-to-ScVal
example used `import StellarSdk from "@stellar/stellar-sdk"`, which no
longer works. Switch to a namespace import (`import * as StellarSdk`)
to preserve the `StellarSdk.xdr.ScVal` body unchanged.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings June 17, 2026 16:09

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Updates the Stellar JS SDK import style in the “string to ScVal” conversion guide to stay compatible with @stellar/stellar-sdk v16.0.0, which removed the ESM default export.

Changes:

  • Replaced the default ESM import with a namespace import (import * as StellarSdk from "@stellar/stellar-sdk") in the JS example to keep StellarSdk.xdr.ScVal... usage unchanged.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.


```js
import StellarSdk from "@stellar/stellar-sdk";
import * as StellarSdk from "@stellar/stellar-sdk";
@stellar-jenkins-ci

Copy link
Copy Markdown

@ElliotFriend
ElliotFriend requested a review from briwylde08 June 17, 2026 16:37
@ElliotFriend
ElliotFriend merged commit 1eb6e36 into main Jun 17, 2026
10 checks passed
@ElliotFriend
ElliotFriend deleted the chore/sdk-examples-javascript-v16.0.0 branch June 17, 2026 19:20
zachfedor pushed a commit to zachfedor/stellar-docs that referenced this pull request Jun 18, 2026
…ellar#2521)

js-stellar-sdk v16.0.0 removed the ESM default export (and merged
@stellar/stellar-base into @stellar/stellar-sdk). The string-to-ScVal
example used `import StellarSdk from "@stellar/stellar-sdk"`, which no
longer works. Switch to a namespace import (`import * as StellarSdk`)
to preserve the `StellarSdk.xdr.ScVal` body unchanged.

Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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