wative-core 2.5.0 → 2.5.1
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 +9 -0
- package/README.md +9 -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-DMZGR5MP.d.ts → container-provider-CBBJbpUn.d.ts} +1 -1
- package/dist/{container-provider-BCG7wTYx.d.cts → container-provider-COvXmCLM.d.cts} +1 -1
- package/dist/{evm-BZoe2IFx.d.ts → evm-Dk4ceFz0.d.ts} +1 -1
- package/dist/{evm-BeI4m7M5.d.cts → evm-V5Fn53uW.d.cts} +1 -1
- package/dist/{file-sink-CuPr45EN.d.ts → file-sink-Bf9mpegF.d.ts} +2 -2
- package/dist/{file-sink-BLqWAqHB.d.cts → file-sink-BjbtAHUL.d.cts} +2 -2
- package/dist/index.cjs +1 -1
- package/dist/index.d.cts +8 -8
- package/dist/index.d.ts +8 -8
- 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-Bi74PhrA.d.cts → svm-CjNIJZ4l.d.cts} +1 -1
- package/dist/{svm-BQMaUXEA.d.ts → svm-D8zsWS64.d.ts} +1 -1
- package/dist/{workspace-ZNpsa6W7.d.cts → workspace-DqUdScht.d.cts} +14 -2
- package/dist/{workspace-ZNpsa6W7.d.ts → workspace-DqUdScht.d.ts} +14 -2
- package/examples/20-custom-chain-dialect.test.cjs +6 -6
- package/examples/21-token-transfer.test.cjs +13 -13
- package/examples/README.md +2 -2
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,15 @@
|
|
|
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.1] — 2026-09-12
|
|
6
|
+
|
|
7
|
+
Renames the transfer helper and improves fee handling.
|
|
8
|
+
|
|
9
|
+
### Changed
|
|
10
|
+
- BREAKING: `address.transfer(...)` is now `address.buildTransferPayload(...)`. It returns the transfer's parameters; pass them to `buildTransaction(...)` to sign and send — for example `buildTransaction({ ...buildTransferPayload({ to, asset, amount }), chainId }).send()`.
|
|
11
|
+
- When you don't set gas fees, they are now chosen with more headroom, so a transaction is less likely to sit unconfirmed while network fees rise.
|
|
12
|
+
- The built-in `evm` and `svm` chains can no longer be replaced through `registerDialect`; registering your own chain under a new name is unaffected.
|
|
13
|
+
|
|
5
14
|
## [2.5.0] — 2026-09-12
|
|
6
15
|
|
|
7
16
|
Adds token-aware transfers and a public way to add your own chain.
|
package/README.md
CHANGED
|
@@ -491,20 +491,22 @@ const sim = await evmAddr.simulateTransaction(tx);
|
|
|
491
491
|
console.log(sim.gasUsed);
|
|
492
492
|
```
|
|
493
493
|
|
|
494
|
-
`
|
|
494
|
+
`buildTransferPayload()` is the one-call path for moving value — it works out the right payload for the asset (native value, ERC-20 calldata, or SPL instructions). You then pass that payload to `buildTransaction()` and send it like any other transaction:
|
|
495
495
|
|
|
496
496
|
```ts
|
|
497
497
|
// native coin (omit `asset`)
|
|
498
|
-
const
|
|
498
|
+
const nativePayload = evmAddr.buildTransferPayload({ to: recipient, amount: 1_000_000_000_000_000n });
|
|
499
499
|
// an ERC-20 / SPL token, by contract address or mint
|
|
500
|
-
const
|
|
500
|
+
const tokenPayload = evmAddr.buildTransferPayload({ to: recipient, asset: { address: usdcAddress }, amount: 1_000_000n });
|
|
501
501
|
// or by symbol, resolved against the network's known tokens
|
|
502
|
-
const bySymbol = evmAddr.
|
|
502
|
+
const bySymbol = evmAddr.buildTransferPayload({ to: recipient, asset: { symbol: "USDC" }, amount: 1_000_000n });
|
|
503
503
|
|
|
504
|
-
|
|
504
|
+
// build the transaction from the payload, then sign/send it
|
|
505
|
+
const tx = evmAddr.buildTransaction({ ...nativePayload, chainId: 1 });
|
|
506
|
+
await evmAddr.signTransaction(tx);
|
|
505
507
|
```
|
|
506
508
|
|
|
507
|
-
Amounts are in the token's smallest unit. An SPL transfer to a recipient without a token account prepends the account-creation step for you.
|
|
509
|
+
Amounts are in the token's smallest unit. `buildTransaction` fills in nonce/gas/fees for you when you omit them, or uses the values you pass. An SPL transfer to a recipient without a token account prepends the account-creation step for you.
|
|
508
510
|
|
|
509
511
|
### Network — pre-loaded networks + your own
|
|
510
512
|
|
|
@@ -791,7 +793,7 @@ class MyDialect extends ChainDialect {
|
|
|
791
793
|
|
|
792
794
|
signMessage(ctx: ChainCtx, message: string): string { /* build a digest, sign via ctx._signBytes, format */ }
|
|
793
795
|
buildTransaction(ctx, params) { /* return your chain's transaction */ }
|
|
794
|
-
|
|
796
|
+
buildTransferPayload(ctx, req) { /* lower { to, asset, amount } to a transfer payload */ }
|
|
795
797
|
derive(seed, index) { /* return { publicKey, privateKey } at this index */ }
|
|
796
798
|
addressFromPrivateKey(pk) { /* the address a key controls */ }
|
|
797
799
|
privateKeyMatches(pk, publicKey) { /* whether a key controls an address */ }
|