wative-core 2.5.6 → 2.5.8
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.
- package/CHANGELOG.md +22 -0
- package/README.md +11 -7
- package/dist/artifacts/evm/index.cjs +1 -1
- package/dist/artifacts/evm/index.d.cts +2 -2
- package/dist/artifacts/evm/index.d.ts +2 -2
- package/dist/artifacts/evm/index.js +1 -1
- package/dist/artifacts/svm/index.cjs +1 -1
- package/dist/artifacts/svm/index.d.cts +3 -3
- package/dist/artifacts/svm/index.d.ts +3 -3
- package/dist/artifacts/svm/index.js +1 -1
- package/dist/{container-provider-QvO3JYFb.d.cts → container-provider-CZ8KFTjR.d.cts} +1 -1
- package/dist/{container-provider-BOFF5wqv.d.ts → container-provider-MsxU8Fv_.d.ts} +1 -1
- package/dist/{evm-DaLCh_ce.d.cts → evm-CUET-BZi.d.cts} +1 -1
- package/dist/{evm-BWORcsia.d.ts → evm-CsE3-oyu.d.ts} +1 -1
- package/dist/{file-sink-DJEWW4yu.d.cts → file-sink-jxjpuv0b.d.cts} +2 -2
- package/dist/{file-sink-bJzTrooq.d.ts → file-sink-m_9jqKTY.d.ts} +2 -2
- package/dist/index.cjs +1 -1
- package/dist/index.d.cts +7 -7
- package/dist/index.d.ts +7 -7
- package/dist/index.js +1 -1
- package/dist/index.node.cjs +1 -1
- package/dist/index.node.d.cts +5 -5
- package/dist/index.node.d.ts +5 -5
- package/dist/index.node.js +1 -1
- package/dist/node/index.cjs +1 -1
- package/dist/node/index.d.cts +3 -3
- package/dist/node/index.d.ts +3 -3
- package/dist/node/index.js +1 -1
- package/dist/{svm-5rQU53_9.d.ts → svm-Cc8p6lK7.d.ts} +1 -1
- package/dist/{svm-BYbTqW4J.d.cts → svm-DtTozGHY.d.cts} +1 -1
- package/dist/{workspace-D7nb3-cO.d.cts → workspace-Bln1maQ9.d.cts} +48 -7
- package/dist/{workspace-D7nb3-cO.d.ts → workspace-Bln1maQ9.d.ts} +48 -7
- package/examples/05-asset-management.test.cjs +135 -36
- package/examples/08-persistence.test.cjs +6 -6
- package/examples/README.md +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,28 @@
|
|
|
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.8] — 2026-10-14
|
|
6
|
+
|
|
7
|
+
Adds VM-agnostic wallet accessors and a built-in network's canonical RPC URL, and removes the unimplemented Sui placeholder.
|
|
8
|
+
|
|
9
|
+
### Added
|
|
10
|
+
- `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.
|
|
11
|
+
- `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`.
|
|
12
|
+
|
|
13
|
+
### Removed
|
|
14
|
+
- 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`.
|
|
15
|
+
|
|
16
|
+
## [2.5.7] — 2026-10-12
|
|
17
|
+
|
|
18
|
+
Lets you add, edit, reorder and remove a network's tokens, and save the changes.
|
|
19
|
+
|
|
20
|
+
### Added
|
|
21
|
+
- A network's tokens are now an editable list — `network.assets` — with `add`, `update`, `drop`, `move` and `byId`.
|
|
22
|
+
- Edit a token with `workspace.updateAsset(id, changes)` or `asset.save()`, and add one from its details with `workspace.addAsset(...)`; new types `AssetAddInit`, `AssetUpdate` and `NetworkAssetCollection`.
|
|
23
|
+
|
|
24
|
+
### Changed
|
|
25
|
+
- A built-in token may change only its display settings and cannot be removed; a user-added token may change every detail and be removed, and a token's id, contract address and network never change. `workspace.addAsset(asset)`, `workspace.dropAsset` and `workspace.moveAsset` are deprecated in favour of a network's token list.
|
|
26
|
+
|
|
5
27
|
## [2.5.6] — 2026-10-11
|
|
6
28
|
|
|
7
29
|
Adds the Ink network and a portable, password-protected backup of an account's seed phrase, and tightens the rules for account and network names.
|
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
|
|
|
@@ -607,22 +612,21 @@ await hd.setDefaultNetwork(Network.Base);
|
|
|
607
612
|
### Asset — pre-loaded tokens + custom tokens
|
|
608
613
|
|
|
609
614
|
```ts
|
|
610
|
-
import {
|
|
615
|
+
import { Network } from "wative-core";
|
|
611
616
|
|
|
612
617
|
const ethAssets = await ws.assets(Network.Ethereum);
|
|
613
618
|
console.log(ethAssets.map((a) => a.symbol));
|
|
614
619
|
|
|
615
|
-
const
|
|
616
|
-
|
|
620
|
+
const eth = ws.networks.bySlug("ethereum");
|
|
621
|
+
const pepe = await eth.assets.add({
|
|
617
622
|
symbol: "PEPE",
|
|
618
623
|
name: "Pepe",
|
|
619
624
|
decimals: 18,
|
|
620
625
|
contractAddress: "0x6982508145454Ce325dDbE47a25d4ec3d2311933",
|
|
621
|
-
network: Network.Ethereum,
|
|
622
626
|
});
|
|
623
|
-
await ws.addAsset(myToken);
|
|
624
627
|
|
|
625
|
-
await
|
|
628
|
+
await eth.assets.update(pepe.id, { displayStatus: false });
|
|
629
|
+
await eth.assets.drop(pepe.id);
|
|
626
630
|
|
|
627
631
|
const found = await ws.filter("USDC", "Asset");
|
|
628
632
|
const byAddr = await ws.filter("0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48", "Asset");
|