@wasit-dev/core@0.3.0
·
70 commits
to main
since this release
Adds a wallet layer for setting up testnet payer keys, and makes every failure in it speak the same error taxonomy the rest of core already used. No breaking change to the check runners or toStructuredRun().
Install
npm install @wasit-dev/core@0.3.0What changed in this package
- New wallet helpers, exported by name: derive a public key from a secret, read XLM and USDC balances from Horizon, fund via Friendbot, open a USDC trustline, generate a commitment seed.
TESTNET_HORIZON_URLis deliberately not exported — it is an implementation detail, not a supported knob. - Wallet failures now throw
ConfigurationErrororTargetUnreachableErrorfromerrors.tsinstead of leaking raw Stellar SDK errors, with Horizon's result codes (op_underfunded,op_no_trust) folded into the message. Callers rendererror.messageand never inspect an SDK error type — which is what stopped the CLI and the dashboard reporting the same failure two different ways. - Horizon and Friendbot requests are bounded by a 15s timeout. Previously a stalled request had no way back.
- A malformed secret key — a truncated paste, a
G…public key in a secret's slot, a hex commitment seed — is rejected by name with a readable message, and the message never echoes the rejected value. index.tsuses explicit named exports rather thanexport *, so what is public API is decided here rather than by whatever a module happens to export.- First automated unit tests, covering the check pipeline, the error taxonomy, network handling and the wallet layer.
Compatibility
Node.js >=24, ESM only. Additive — nothing removed, no signature changed. Check functions still never reject; the new wallet functions do throw, which is the one contract that differs.
Known issues
A clean install resolves two copies of @stellar/stellar-sdk, and the nested older copy carries open axios advisories with no downstream fix available. The cause is the peer ranges declared by @stellar/mpp@0.7.1, not Wasit's own dependencies. Reported upstream; nothing in this release changes that chain. See SECURITY.md.