wative-core 2.5.7 → 2.5.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (36) hide show
  1. package/CHANGELOG.md +29 -0
  2. package/README.md +6 -1
  3. package/dist/artifacts/evm/index.cjs +1 -1
  4. package/dist/artifacts/evm/index.d.cts +2 -2
  5. package/dist/artifacts/evm/index.d.ts +2 -2
  6. package/dist/artifacts/evm/index.js +1 -1
  7. package/dist/artifacts/svm/index.cjs +1 -1
  8. package/dist/artifacts/svm/index.d.cts +3 -3
  9. package/dist/artifacts/svm/index.d.ts +3 -3
  10. package/dist/artifacts/svm/index.js +1 -1
  11. package/dist/{container-provider-sRxvigzk.d.cts → container-provider-BECY3xFW.d.cts} +1 -1
  12. package/dist/{container-provider-CqpIaus8.d.ts → container-provider-Da9jn2NY.d.ts} +1 -1
  13. package/dist/{evm-KpZ3cLDe.d.ts → evm-B3-ujBFb.d.ts} +1 -1
  14. package/dist/{evm-hYUvjm9n.d.cts → evm-kJ59A16B.d.cts} +1 -1
  15. package/dist/{file-sink-B94nIe1u.d.cts → file-sink-5QWuUJGt.d.cts} +2 -2
  16. package/dist/{file-sink-Di2hJA5x.d.ts → file-sink-DemUj44c.d.ts} +2 -2
  17. package/dist/index.cjs +1 -1
  18. package/dist/index.d.cts +7 -7
  19. package/dist/index.d.ts +7 -7
  20. package/dist/index.js +1 -1
  21. package/dist/index.node.cjs +1 -1
  22. package/dist/index.node.d.cts +5 -5
  23. package/dist/index.node.d.ts +5 -5
  24. package/dist/index.node.js +1 -1
  25. package/dist/node/index.cjs +1 -1
  26. package/dist/node/index.d.cts +3 -3
  27. package/dist/node/index.d.ts +3 -3
  28. package/dist/node/index.js +1 -1
  29. package/dist/{svm-DYpcdzPR.d.ts → svm-DnKdq2PX.d.ts} +1 -1
  30. package/dist/{svm-B88JqNxb.d.cts → svm-uk1mRC3m.d.cts} +1 -1
  31. package/dist/{workspace-g-1DGOHJ.d.cts → workspace-BoiTRV1J.d.cts} +16 -8
  32. package/dist/{workspace-g-1DGOHJ.d.ts → workspace-BoiTRV1J.d.ts} +16 -8
  33. package/examples/04-network-management.test.cjs +3 -0
  34. package/examples/05-asset-management.test.cjs +2 -0
  35. package/examples/21-token-transfer.test.cjs +13 -0
  36. package/package.json +1 -1
package/CHANGELOG.md CHANGED
@@ -2,6 +2,35 @@
2
2
 
3
3
  All notable changes to `wative-core` are documented here. The format follows [Keep a Changelog](https://keepachangelog.com/en/1.1.0/) and the project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
4
4
 
5
+ ## [2.5.9] — 2026-10-14
6
+
7
+ Adds `isBuiltin` on networks and tokens, keeps built-ins in step with the library, adds an SPL token-transfer shortcut and frozen / non-transferable destination warnings, and removes two balance-refresh forms that were never implemented.
8
+
9
+ ### Added
10
+ - `network.isBuiltin` and `asset.isBuiltin` tell you whether a network or token ships with the library. A built-in cannot be removed and limits which fields you may edit — a network's connectivity and labels, a token's display settings.
11
+ - `buildTransaction({ tokenMint })` builds a Solana SPL token transfer — the same transfer `buildTransferPayload` produces — without hand-built instructions; `tokenProgram` picks classic SPL or Token-2022.
12
+ - `checkDestination` warns when an SPL recipient's token account is frozen or the token's mint is non-transferable, so you can tell before sending that the transfer would be rejected on-chain (codes `SVM_FROZEN_TOKEN_ACCOUNT`, `SVM_NON_TRANSFERABLE`).
13
+
14
+ ### Changed
15
+ - Built-in networks and tokens stay in step with the library: ones added in a later release show up automatically in workspaces created earlier, and a built-in's details always match the library — your own changes to it (a network's RPC URL, a token's display settings) are kept.
16
+
17
+ ### Fixed
18
+ - A built-in network that first appears in a workspace created before it existed now includes its built-in tokens; previously it showed no balances.
19
+
20
+ ### Removed
21
+ - `address.refreshBalances(network, …)` and `address.refreshBalances(assetId)` are gone — they were never implemented and always failed. `address.refreshBalances()` reads the balances on the address's own network.
22
+
23
+ ## [2.5.8] — 2026-10-14
24
+
25
+ Adds VM-agnostic wallet accessors and a built-in network's canonical RPC URL, and removes the unimplemented Sui placeholder.
26
+
27
+ ### Added
28
+ - `wallet.vm` and `wallet.address` read a wallet without naming a chain: `wallet.vm` is the virtual machine of the account's default network, and `wallet.address` is that wallet's address for it. Changing the account's default network moves both. `wallet.address` is `null` when the wallet has no address for that chain. `wallet.evm` / `wallet.svm` remain for explicit per-chain access.
29
+ - `network.defaultRpcUrl` is a built-in network's canonical RPC URL — the value an overridden built-in resets back to. A custom network has none and reports `UNSUPPORTED_OP`.
30
+
31
+ ### Removed
32
+ - BREAKING: the unimplemented Sui placeholder is gone. A network's VM is now `evm` or `svm` only, and the `wallet.sui` accessor is removed. Register a chain the library does not ship with `registerDialect`.
33
+
5
34
  ## [2.5.7] — 2026-10-12
6
35
 
7
36
  Lets you add, edit, reorder and remove a network's tokens, and save the changes.
package/README.md CHANGED
@@ -71,6 +71,11 @@ refuses the same identity twice, on either chain.
71
71
  > ```ts
72
72
  > const evm = wallet.addresses.find((a) => a.vm === "evm");
73
73
  > ```
74
+ >
75
+ > For the common case — a wallet's address on the account's **default network** —
76
+ > skip the branch and read `wallet.vm` / `wallet.address`: `wallet.vm` is the
77
+ > default network's chain and `wallet.address` is this wallet's address for it
78
+ > (`null` if it has none). `wallet.evm` / `wallet.svm` stay for a named chain.
74
79
 
75
80
  **Which chain a key is for is read off the key** — `vm` is optional:
76
81
 
@@ -321,7 +326,7 @@ The library is organized around seven things you'll work with:
321
326
  - **`Account`** — either an HD account (one BIP-39 mnemonic, can derive many wallets) or a PK account (raw private keys you import one at a time). Each account can have its own password or share the workspace password.
322
327
  - **`Wallet`** — a unit inside an account, holding one address per `(vm, network)`. Both kinds give you an EVM and a Solana address: an HD slot derives one per chain from the mnemonic, an import derives its sibling from the imported key. Treat `wallet.addresses` as the list it is.
323
328
  - **`Address`** — an on-chain identity. Sign messages, build transactions, transfer native coins or tokens, and send them.
324
- - **`Network`** — chain metadata. 15 networks ship pre-loaded.
329
+ - **`Network`** — chain metadata. 15 networks ship pre-loaded. A built-in network's `defaultRpcUrl` is its canonical endpoint — what a customized `rpcUrl` resets back to.
325
330
  - **`Asset`** — token metadata. 32 tokens ship pre-loaded.
326
331
  - **`Transaction`** — `EvmTransaction` or `SvmTransaction`. Subscribe to lifecycle events (`change` / `confirmed` / `failed`) or await terminal states (`whenSubmitted` / `whenMined` / `whenConfirmed` / `whenFinalized`). Tracking stops at first inclusion, so `whenConfirmed(n)` with `n > 1` rejects `UNSUPPORTED_OP` — call it with no argument and poll `receipt.blockNumber` against the chain head if you need depth — and `whenFinalized()` rejects `UNSUPPORTED_OP` unless the node reported finality directly.
327
332