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.
Files changed (36) hide show
  1. package/CHANGELOG.md +9 -0
  2. package/README.md +9 -7
  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-DMZGR5MP.d.ts → container-provider-CBBJbpUn.d.ts} +1 -1
  12. package/dist/{container-provider-BCG7wTYx.d.cts → container-provider-COvXmCLM.d.cts} +1 -1
  13. package/dist/{evm-BZoe2IFx.d.ts → evm-Dk4ceFz0.d.ts} +1 -1
  14. package/dist/{evm-BeI4m7M5.d.cts → evm-V5Fn53uW.d.cts} +1 -1
  15. package/dist/{file-sink-CuPr45EN.d.ts → file-sink-Bf9mpegF.d.ts} +2 -2
  16. package/dist/{file-sink-BLqWAqHB.d.cts → file-sink-BjbtAHUL.d.cts} +2 -2
  17. package/dist/index.cjs +1 -1
  18. package/dist/index.d.cts +8 -8
  19. package/dist/index.d.ts +8 -8
  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-Bi74PhrA.d.cts → svm-CjNIJZ4l.d.cts} +1 -1
  30. package/dist/{svm-BQMaUXEA.d.ts → svm-D8zsWS64.d.ts} +1 -1
  31. package/dist/{workspace-ZNpsa6W7.d.cts → workspace-DqUdScht.d.cts} +14 -2
  32. package/dist/{workspace-ZNpsa6W7.d.ts → workspace-DqUdScht.d.ts} +14 -2
  33. package/examples/20-custom-chain-dialect.test.cjs +6 -6
  34. package/examples/21-token-transfer.test.cjs +13 -13
  35. package/examples/README.md +2 -2
  36. 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
- `transfer()` is the one-call path for moving value — it builds the right transaction for the asset, then you sign and send it like any other:
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 native = evmAddr.transfer({ to: recipient, amount: 1_000_000_000_000_000n });
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 token = evmAddr.transfer({ to: recipient, asset: { address: usdcAddress }, amount: 1_000_000n });
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.transfer({ to: recipient, asset: { symbol: "USDC" }, amount: 1_000_000n });
502
+ const bySymbol = evmAddr.buildTransferPayload({ to: recipient, asset: { symbol: "USDC" }, amount: 1_000_000n });
503
503
 
504
- await evmAddr.signTransaction(native);
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
- transfer(ctx, req) { /* lower { to, asset, amount } to a transaction */ }
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 */ }