kalvora.js 0.0.1-alpha.4 → 0.0.2-alpha.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 +31 -0
- package/README.md +52 -7
- package/dist/README.md +52 -7
- package/dist/index.cjs +9974 -9902
- package/dist/index.cjs.map +4 -4
- package/dist/index.d.ts +4 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +4 -3
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +4 -3
- package/dist/native.d.ts +25 -0
- package/dist/native.d.ts.map +1 -0
- package/dist/native.js +24 -0
- package/dist/native.js.map +1 -0
- package/dist/src/proposal/transaction.js +3 -3
- package/dist/src/proposal/transaction.js.map +1 -1
- package/dist/src/shared/utils/amount-utils.d.ts +1 -1
- package/dist/src/shared/utils/amount-utils.d.ts.map +1 -1
- package/dist/src/shared/utils/amount-utils.js +1 -1
- package/dist/src/shared/utils/amount-utils.js.map +1 -1
- package/dist/src/version.d.ts +3 -0
- package/dist/src/version.d.ts.map +1 -0
- package/dist/src/version.js +3 -0
- package/dist/src/version.js.map +1 -0
- package/dist/src/wallet-creation/falcon.d.ts +20 -0
- package/dist/src/wallet-creation/falcon.d.ts.map +1 -1
- package/dist/src/wallet-creation/falcon.js +69 -0
- package/dist/src/wallet-creation/falcon.js.map +1 -1
- package/dist/wallet.d.ts +4 -4
- package/dist/wallet.js +4 -4
- package/package.json +21 -5
package/CHANGELOG.md
CHANGED
|
@@ -5,6 +5,37 @@ All notable changes to this project are documented here. The format follows
|
|
|
5
5
|
[Semantic Versioning](https://semver.org/). While the version is `0.0.x`, any
|
|
6
6
|
release may change APIs; pin an exact version.
|
|
7
7
|
|
|
8
|
+
## [0.0.2-alpha.1] — 2026-12-03
|
|
9
|
+
|
|
10
|
+
### Added
|
|
11
|
+
|
|
12
|
+
- Create and recover numbered Falcon accounts from one BIP-39 phrase with
|
|
13
|
+
`FalconKey.fromMnemonic` or from its 64-byte seed with `FalconKey.fromSeed`.
|
|
14
|
+
The default v2 profile derives each variant and account index once across
|
|
15
|
+
Kalvora networks. Recover an account from the network-bound v1 Git preview
|
|
16
|
+
by passing `scheme: FALCON_HD_V1` and its original `networkName`.
|
|
17
|
+
[Recovery specifications and public vectors](docs/guides/falcon-hd.md)
|
|
18
|
+
|
|
19
|
+
## [0.0.2-alpha.0] — prerelease
|
|
20
|
+
|
|
21
|
+
### Added
|
|
22
|
+
|
|
23
|
+
- Import `kalvora.js/native` for native Kalvora queries, governance builders
|
|
24
|
+
and wallet operations through ESM without installing the Solana bridge.
|
|
25
|
+
The native and root entry points export the same SDK `VERSION`.
|
|
26
|
+
- Pinned Git installs generate the protobuf bindings and build the SDK during
|
|
27
|
+
`prepare`. The npm tarball contains the compiled entry points.
|
|
28
|
+
|
|
29
|
+
### Changed
|
|
30
|
+
|
|
31
|
+
- **Breaking installation change for root ESM consumers.** Install
|
|
32
|
+
`@solana/web3.js@^1.98.4` and `@solana/spl-token@^0.4.14` alongside
|
|
33
|
+
`kalvora.js`. Both packages are optional peers. Native and wallet ESM
|
|
34
|
+
consumers can omit them. If either peer is already installed, its version
|
|
35
|
+
must satisfy the declared range.
|
|
36
|
+
- Text proposals preserve leading and trailing whitespace in the Markdown
|
|
37
|
+
body through signing and serialization.
|
|
38
|
+
|
|
8
39
|
## [0.0.1-alpha.4] — npm prerelease
|
|
9
40
|
|
|
10
41
|
This npm package includes the SDK changes since npm `0.0.1-alpha.3`. Earlier
|
package/README.md
CHANGED
|
@@ -56,12 +56,32 @@ or any signer you write.
|
|
|
56
56
|
## Install
|
|
57
57
|
|
|
58
58
|
```bash
|
|
59
|
-
npm install kalvora.js
|
|
59
|
+
npm install --save-exact kalvora.js@0.0.2-alpha.1
|
|
60
60
|
```
|
|
61
61
|
|
|
62
|
-
Use Node.js 20.19 or later for the SDK toolchain. Falcon signing requires a
|
|
63
|
-
|
|
64
|
-
|
|
62
|
+
Use Node.js 20.19 or later for the SDK toolchain. Falcon signing requires a
|
|
63
|
+
cryptographically secure random source in the target runtime. The full ESM
|
|
64
|
+
root eagerly loads the Solana bridge. Its bridge dependencies are optional peers
|
|
65
|
+
and are **not installed automatically**. Use `kalvora.js/native` for native
|
|
66
|
+
queries and governance operations, or `kalvora.js/wallet` for keys only. Neither
|
|
67
|
+
entry requires the Solana packages.
|
|
68
|
+
|
|
69
|
+
Optional peers still impose package-wide version constraints when present. This
|
|
70
|
+
also applies to consumers importing only `/native` or `/wallet`: existing
|
|
71
|
+
`@solana/web3.js` must satisfy `^1.98.4`, and existing `@solana/spl-token` must
|
|
72
|
+
satisfy `^0.4.14`. Incompatible pinned versions can cause npm `ERESOLVE` before
|
|
73
|
+
any SDK code runs. This installation constraint is intentional on the alpha
|
|
74
|
+
development line; consumers without Solana packages need not add them.
|
|
75
|
+
|
|
76
|
+
Before using the full root ESM API or the bridge examples, install the peers:
|
|
77
|
+
|
|
78
|
+
```bash
|
|
79
|
+
npm install --save-exact kalvora.js@0.0.2-alpha.1 "@solana/web3.js@^1.98.4" "@solana/spl-token@^0.4.14"
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
Existing root ESM consumers upgrading from automatic optional dependencies must
|
|
83
|
+
add these two dependencies explicitly. The CommonJS bundle still contains bridge
|
|
84
|
+
code; use the narrow ESM entries to avoid loading it.
|
|
65
85
|
|
|
66
86
|
## Quick start
|
|
67
87
|
|
|
@@ -94,8 +114,31 @@ See the [migration overview and remaining acceptance checks](./docs/protocol-mig
|
|
|
94
114
|
|
|
95
115
|
The wallet-only entry point exports `FalconKey` for offline key generation and restoration, the two padded Falcon variants and all eleven hash choices. `FalconKey.restore(backup)` also reads version 1 backups from the chain-bound `FalconWallet` API. BLAKE3-256 is the default. A different hash for the same key creates a separate address, balance and nonce.
|
|
96
116
|
|
|
117
|
+
For mnemonic-based Falcon accounts, `FalconKey.fromMnemonic(phrase)` restores account 0 and `FalconKey.fromMnemonic(phrase, { accountIndex: 1 })` restores account 1. The default v2 profile derives the same key and selected address across Kalvora networks. Supply the deployment’s trusted chain context when signing. Wallets from the v1 Git preview require `scheme: FALCON_HD_V1` and their original network name. [Falcon HD account recovery](./docs/guides/falcon-hd.md)
|
|
118
|
+
|
|
97
119
|
Historical Ed25519 and Ed448 backups use the [older HD derivation scheme](./docs/guides/hd-derivation.md). Generate and register a fresh Falcon address for the new genesis. See [wallet creation and backup](./src/wallet-creation/README.md).
|
|
98
120
|
|
|
121
|
+
### Native entry: `kalvora.js/native`
|
|
122
|
+
|
|
123
|
+
`kalvora.js/native` is ESM-only and exports the existing native client,
|
|
124
|
+
governance proposal/vote builders, proposal submission, stage-fee arithmetic,
|
|
125
|
+
serialization, address and contract validation, RPC errors, enums, and their
|
|
126
|
+
types and SDK `VERSION`. For transaction construction, pass the selected network’s current finalized block-zero hash from the authenticated indexer to `pinNetwork` and use `client.grpcConfig` for the builder.
|
|
127
|
+
It also exposes `UniversalFeeCalculator` for callers supplying explicit native
|
|
128
|
+
fee metadata.
|
|
129
|
+
|
|
130
|
+
```typescript
|
|
131
|
+
import { KalvoraClient, pinNetwork, buildVoteTXN, serializeTransaction } from 'kalvora.js/native';
|
|
132
|
+
import type { GRPCConfig, ProposalConstructionContext } from 'kalvora.js/native';
|
|
133
|
+
```
|
|
134
|
+
|
|
135
|
+
An ordinary consumer install supports this entry without Solana packages or
|
|
136
|
+
`--omit=optional`. Building the full SDK from source, including its Git `prepare`
|
|
137
|
+
step, installs the bridge packages as development dependencies for its build and
|
|
138
|
+
tests; they are not propagated to consumers. The root exports and CommonJS
|
|
139
|
+
bundle retain their bridge code. This packaging boundary does not remediate
|
|
140
|
+
advisories in bridge consumers or remove code from the full CommonJS bundle.
|
|
141
|
+
|
|
99
142
|
## Querying the network
|
|
100
143
|
|
|
101
144
|
`KalvoraClient` bundles the query clients behind one endpoint configuration:
|
|
@@ -196,7 +239,8 @@ strings shared with wallet apps are exported as constants
|
|
|
196
239
|
| Guide | Covers |
|
|
197
240
|
|-------|--------|
|
|
198
241
|
| [Getting started](./docs/guides/getting-started.md) | Wallets, connecting, sending, external signers, errors |
|
|
199
|
-
| [HD
|
|
242
|
+
| [Falcon HD account recovery](./docs/guides/falcon-hd.md) | Default v2 derivation, v1 preview recovery, public test vectors and account discovery |
|
|
243
|
+
| [Historical HD derivation](./docs/guides/hd-derivation.md) | Exact key derivation for Ed25519 (SLIP-0010) and Ed448, reference vectors |
|
|
200
244
|
| [Transactions](./docs/guides/transactions.md) | Every transaction type, required permissions, shared options |
|
|
201
245
|
| [V47 multisig deadlines](./docs/guides/v47-multisig-expiry.md) | Prepare a shared payment once, collect proofs across sessions and reconcile the signed result |
|
|
202
246
|
| [Contract IDs](./docs/guides/contract-ids.md) | Checksummed Base58 ids, genesis ids, deriving an id while creating a contract |
|
|
@@ -215,9 +259,10 @@ function carries TSDoc. Generate the API reference with `npm run docs`
|
|
|
215
259
|
| Import | Contents | Formats |
|
|
216
260
|
|---|---|---|
|
|
217
261
|
| `kalvora.js` | The full SDK: client, queries, wallets, signing, every transaction builder, adapters, use cases, raw protobuf bindings (`proto`) | ESM, CommonJS, React Native, types |
|
|
218
|
-
| `kalvora.js/wallet` | Offline Falcon keys, address selection, signing, backup and restore, plus historical Ed
|
|
262
|
+
| `kalvora.js/wallet` | Offline Falcon HD and random keys, address selection, signing, backup and restore, plus historical Ed derivation tools | ESM, types |
|
|
263
|
+
| `kalvora.js/native` | Native client and governance operations, encoding, validation and fee calculation; no optional Solana bridge import | ESM, types |
|
|
219
264
|
|
|
220
|
-
Every public API is exported from one of these
|
|
265
|
+
Every public API is exported from one of these entry points; deep imports
|
|
221
266
|
into `dist/` are not supported.
|
|
222
267
|
|
|
223
268
|
## Stability
|
package/dist/README.md
CHANGED
|
@@ -56,12 +56,32 @@ or any signer you write.
|
|
|
56
56
|
## Install
|
|
57
57
|
|
|
58
58
|
```bash
|
|
59
|
-
npm install kalvora.js
|
|
59
|
+
npm install --save-exact kalvora.js@0.0.2-alpha.1
|
|
60
60
|
```
|
|
61
61
|
|
|
62
|
-
Use Node.js 20.19 or later for the SDK toolchain. Falcon signing requires a
|
|
63
|
-
|
|
64
|
-
|
|
62
|
+
Use Node.js 20.19 or later for the SDK toolchain. Falcon signing requires a
|
|
63
|
+
cryptographically secure random source in the target runtime. The full ESM
|
|
64
|
+
root eagerly loads the Solana bridge. Its bridge dependencies are optional peers
|
|
65
|
+
and are **not installed automatically**. Use `kalvora.js/native` for native
|
|
66
|
+
queries and governance operations, or `kalvora.js/wallet` for keys only. Neither
|
|
67
|
+
entry requires the Solana packages.
|
|
68
|
+
|
|
69
|
+
Optional peers still impose package-wide version constraints when present. This
|
|
70
|
+
also applies to consumers importing only `/native` or `/wallet`: existing
|
|
71
|
+
`@solana/web3.js` must satisfy `^1.98.4`, and existing `@solana/spl-token` must
|
|
72
|
+
satisfy `^0.4.14`. Incompatible pinned versions can cause npm `ERESOLVE` before
|
|
73
|
+
any SDK code runs. This installation constraint is intentional on the alpha
|
|
74
|
+
development line; consumers without Solana packages need not add them.
|
|
75
|
+
|
|
76
|
+
Before using the full root ESM API or the bridge examples, install the peers:
|
|
77
|
+
|
|
78
|
+
```bash
|
|
79
|
+
npm install --save-exact kalvora.js@0.0.2-alpha.1 "@solana/web3.js@^1.98.4" "@solana/spl-token@^0.4.14"
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
Existing root ESM consumers upgrading from automatic optional dependencies must
|
|
83
|
+
add these two dependencies explicitly. The CommonJS bundle still contains bridge
|
|
84
|
+
code; use the narrow ESM entries to avoid loading it.
|
|
65
85
|
|
|
66
86
|
## Quick start
|
|
67
87
|
|
|
@@ -94,8 +114,31 @@ See the [migration overview and remaining acceptance checks](./docs/protocol-mig
|
|
|
94
114
|
|
|
95
115
|
The wallet-only entry point exports `FalconKey` for offline key generation and restoration, the two padded Falcon variants and all eleven hash choices. `FalconKey.restore(backup)` also reads version 1 backups from the chain-bound `FalconWallet` API. BLAKE3-256 is the default. A different hash for the same key creates a separate address, balance and nonce.
|
|
96
116
|
|
|
117
|
+
For mnemonic-based Falcon accounts, `FalconKey.fromMnemonic(phrase)` restores account 0 and `FalconKey.fromMnemonic(phrase, { accountIndex: 1 })` restores account 1. The default v2 profile derives the same key and selected address across Kalvora networks. Supply the deployment’s trusted chain context when signing. Wallets from the v1 Git preview require `scheme: FALCON_HD_V1` and their original network name. [Falcon HD account recovery](./docs/guides/falcon-hd.md)
|
|
118
|
+
|
|
97
119
|
Historical Ed25519 and Ed448 backups use the [older HD derivation scheme](./docs/guides/hd-derivation.md). Generate and register a fresh Falcon address for the new genesis. See [wallet creation and backup](./src/wallet-creation/README.md).
|
|
98
120
|
|
|
121
|
+
### Native entry: `kalvora.js/native`
|
|
122
|
+
|
|
123
|
+
`kalvora.js/native` is ESM-only and exports the existing native client,
|
|
124
|
+
governance proposal/vote builders, proposal submission, stage-fee arithmetic,
|
|
125
|
+
serialization, address and contract validation, RPC errors, enums, and their
|
|
126
|
+
types and SDK `VERSION`. For transaction construction, pass the selected network’s current finalized block-zero hash from the authenticated indexer to `pinNetwork` and use `client.grpcConfig` for the builder.
|
|
127
|
+
It also exposes `UniversalFeeCalculator` for callers supplying explicit native
|
|
128
|
+
fee metadata.
|
|
129
|
+
|
|
130
|
+
```typescript
|
|
131
|
+
import { KalvoraClient, pinNetwork, buildVoteTXN, serializeTransaction } from 'kalvora.js/native';
|
|
132
|
+
import type { GRPCConfig, ProposalConstructionContext } from 'kalvora.js/native';
|
|
133
|
+
```
|
|
134
|
+
|
|
135
|
+
An ordinary consumer install supports this entry without Solana packages or
|
|
136
|
+
`--omit=optional`. Building the full SDK from source, including its Git `prepare`
|
|
137
|
+
step, installs the bridge packages as development dependencies for its build and
|
|
138
|
+
tests; they are not propagated to consumers. The root exports and CommonJS
|
|
139
|
+
bundle retain their bridge code. This packaging boundary does not remediate
|
|
140
|
+
advisories in bridge consumers or remove code from the full CommonJS bundle.
|
|
141
|
+
|
|
99
142
|
## Querying the network
|
|
100
143
|
|
|
101
144
|
`KalvoraClient` bundles the query clients behind one endpoint configuration:
|
|
@@ -196,7 +239,8 @@ strings shared with wallet apps are exported as constants
|
|
|
196
239
|
| Guide | Covers |
|
|
197
240
|
|-------|--------|
|
|
198
241
|
| [Getting started](./docs/guides/getting-started.md) | Wallets, connecting, sending, external signers, errors |
|
|
199
|
-
| [HD
|
|
242
|
+
| [Falcon HD account recovery](./docs/guides/falcon-hd.md) | Default v2 derivation, v1 preview recovery, public test vectors and account discovery |
|
|
243
|
+
| [Historical HD derivation](./docs/guides/hd-derivation.md) | Exact key derivation for Ed25519 (SLIP-0010) and Ed448, reference vectors |
|
|
200
244
|
| [Transactions](./docs/guides/transactions.md) | Every transaction type, required permissions, shared options |
|
|
201
245
|
| [V47 multisig deadlines](./docs/guides/v47-multisig-expiry.md) | Prepare a shared payment once, collect proofs across sessions and reconcile the signed result |
|
|
202
246
|
| [Contract IDs](./docs/guides/contract-ids.md) | Checksummed Base58 ids, genesis ids, deriving an id while creating a contract |
|
|
@@ -215,9 +259,10 @@ function carries TSDoc. Generate the API reference with `npm run docs`
|
|
|
215
259
|
| Import | Contents | Formats |
|
|
216
260
|
|---|---|---|
|
|
217
261
|
| `kalvora.js` | The full SDK: client, queries, wallets, signing, every transaction builder, adapters, use cases, raw protobuf bindings (`proto`) | ESM, CommonJS, React Native, types |
|
|
218
|
-
| `kalvora.js/wallet` | Offline Falcon keys, address selection, signing, backup and restore, plus historical Ed
|
|
262
|
+
| `kalvora.js/wallet` | Offline Falcon HD and random keys, address selection, signing, backup and restore, plus historical Ed derivation tools | ESM, types |
|
|
263
|
+
| `kalvora.js/native` | Native client and governance operations, encoding, validation and fee calculation; no optional Solana bridge import | ESM, types |
|
|
219
264
|
|
|
220
|
-
Every public API is exported from one of these
|
|
265
|
+
Every public API is exported from one of these entry points; deep imports
|
|
221
266
|
into `dist/` are not supported.
|
|
222
267
|
|
|
223
268
|
## Stability
|