kalvora.js 0.0.1-alpha.3 → 0.0.1-alpha.4
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 +20 -1
- package/README.md +10 -7
- package/dist/README.md +10 -7
- package/dist/index.cjs +33856 -32862
- package/dist/index.cjs.map +4 -4
- package/dist/index.d.ts +7 -7
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +7 -7
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +7 -7
- package/dist/proto/generated/txn_pb.d.ts +8 -0
- package/dist/proto/generated/txn_pb.js +1 -1
- package/dist/proto/txn.proto +3 -0
- package/dist/src/allowance/transaction.d.ts.map +1 -1
- package/dist/src/allowance/transaction.js +4 -7
- package/dist/src/allowance/transaction.js.map +1 -1
- package/dist/src/client/networks.d.ts +1 -1
- package/dist/src/client/networks.d.ts.map +1 -1
- package/dist/src/client/networks.js +2 -2
- package/dist/src/client/networks.js.map +1 -1
- package/dist/src/coin-txn/multisig.d.ts +50 -0
- package/dist/src/coin-txn/multisig.d.ts.map +1 -0
- package/dist/src/coin-txn/multisig.js +194 -0
- package/dist/src/coin-txn/multisig.js.map +1 -0
- package/dist/src/coin-txn/transaction.d.ts +2 -1
- package/dist/src/coin-txn/transaction.d.ts.map +1 -1
- package/dist/src/coin-txn/transaction.js +50 -33
- package/dist/src/coin-txn/transaction.js.map +1 -1
- package/dist/src/contract/create/transaction.d.ts.map +1 -1
- package/dist/src/contract/create/transaction.js +2 -1
- package/dist/src/contract/create/transaction.js.map +1 -1
- package/dist/src/contract/shared/types.d.ts +3 -2
- package/dist/src/contract/shared/types.d.ts.map +1 -1
- package/dist/src/contract/update/transaction.d.ts.map +1 -1
- package/dist/src/contract/update/transaction.js +2 -1
- package/dist/src/contract/update/transaction.js.map +1 -1
- package/dist/src/grpc/transaction/transaction-client.d.ts.map +1 -1
- package/dist/src/grpc/transaction/transaction-client.js +2 -0
- package/dist/src/grpc/transaction/transaction-client.js.map +1 -1
- package/dist/src/items/transaction.d.ts +2 -3
- package/dist/src/items/transaction.d.ts.map +1 -1
- package/dist/src/items/transaction.js +2 -3
- package/dist/src/items/transaction.js.map +1 -1
- package/dist/src/proposal/governance.d.ts.map +1 -1
- package/dist/src/proposal/governance.js +9 -31
- package/dist/src/proposal/governance.js.map +1 -1
- package/dist/src/proposal/transaction.d.ts +2 -2
- package/dist/src/proposal/transaction.d.ts.map +1 -1
- package/dist/src/proposal/transaction.js +2 -1
- package/dist/src/proposal/transaction.js.map +1 -1
- package/dist/src/proposal-cancel/transaction.d.ts +2 -2
- package/dist/src/proposal-cancel/transaction.d.ts.map +1 -1
- package/dist/src/proposal-cancel/transaction.js +2 -1
- package/dist/src/proposal-cancel/transaction.js.map +1 -1
- package/dist/src/shared/fee-calculators/universal-fee-calculator.d.ts +2 -2
- package/dist/src/shared/fee-calculators/universal-fee-calculator.d.ts.map +1 -1
- package/dist/src/shared/fee-calculators/universal-fee-calculator.js +2 -1
- package/dist/src/shared/fee-calculators/universal-fee-calculator.js.map +1 -1
- package/dist/src/shared/tx/admission.d.ts +13 -0
- package/dist/src/shared/tx/admission.d.ts.map +1 -0
- package/dist/src/shared/tx/admission.js +95 -0
- package/dist/src/shared/tx/admission.js.map +1 -0
- package/dist/src/shared/tx/base.d.ts +2 -2
- package/dist/src/shared/tx/base.d.ts.map +1 -1
- package/dist/src/shared/tx/base.js +4 -16
- package/dist/src/shared/tx/base.js.map +1 -1
- package/dist/src/shared/tx/expiry.d.ts +36 -0
- package/dist/src/shared/tx/expiry.d.ts.map +1 -0
- package/dist/src/shared/tx/expiry.js +79 -0
- package/dist/src/shared/tx/expiry.js.map +1 -0
- package/dist/src/shared/tx/standard.d.ts +2 -3
- package/dist/src/shared/tx/standard.d.ts.map +1 -1
- package/dist/src/shared/tx/standard.js +2 -1
- package/dist/src/shared/tx/standard.js.map +1 -1
- package/dist/src/sign/context.d.ts +4 -0
- package/dist/src/sign/context.d.ts.map +1 -1
- package/dist/src/sign/context.js +15 -0
- package/dist/src/sign/context.js.map +1 -1
- package/dist/src/sign/draft.d.ts +56 -0
- package/dist/src/sign/draft.d.ts.map +1 -0
- package/dist/src/sign/draft.js +206 -0
- package/dist/src/sign/draft.js.map +1 -0
- package/dist/src/sign/finalize.d.ts +4 -1
- package/dist/src/sign/finalize.d.ts.map +1 -1
- package/dist/src/sign/finalize.js +89 -27
- package/dist/src/sign/finalize.js.map +1 -1
- package/dist/src/sign/index.d.ts +1 -0
- package/dist/src/sign/index.d.ts.map +1 -1
- package/dist/src/sign/index.js +1 -0
- package/dist/src/sign/index.js.map +1 -1
- package/dist/src/sign/resources.d.ts +3 -1
- package/dist/src/sign/resources.d.ts.map +1 -1
- package/dist/src/sign/resources.js +21 -10
- package/dist/src/sign/resources.js.map +1 -1
- package/dist/src/smart-contracts/shared/base.d.ts +1 -1
- package/dist/src/smart-contracts/shared/base.d.ts.map +1 -1
- package/dist/src/smart-contracts/shared/base.js +2 -1
- package/dist/src/smart-contracts/shared/base.js.map +1 -1
- package/dist/src/validator-ops/transaction.d.ts.map +1 -1
- package/dist/src/validator-ops/transaction.js +4 -0
- package/dist/src/validator-ops/transaction.js.map +1 -1
- package/dist/src/vote/transaction.d.ts +2 -3
- package/dist/src/vote/transaction.d.ts.map +1 -1
- package/dist/src/vote/transaction.js +2 -3
- package/dist/src/vote/transaction.js.map +1 -1
- package/dist/src/wallet-creation/falcon.d.ts +35 -13
- package/dist/src/wallet-creation/falcon.d.ts.map +1 -1
- package/dist/src/wallet-creation/falcon.js +69 -37
- package/dist/src/wallet-creation/falcon.js.map +1 -1
- package/dist/src/wallet-registration/class-policy.d.ts +17 -0
- package/dist/src/wallet-registration/class-policy.d.ts.map +1 -0
- package/dist/src/wallet-registration/class-policy.js +93 -0
- package/dist/src/wallet-registration/class-policy.js.map +1 -0
- package/dist/src/wallet-registration/index.d.ts +2 -1
- package/dist/src/wallet-registration/index.d.ts.map +1 -1
- package/dist/src/wallet-registration/index.js +7 -1
- package/dist/src/wallet-registration/index.js.map +1 -1
- package/dist/src/wallet-registration/multisig.d.ts +47 -0
- package/dist/src/wallet-registration/multisig.d.ts.map +1 -0
- package/dist/src/wallet-registration/multisig.js +154 -0
- package/dist/src/wallet-registration/multisig.js.map +1 -0
- package/dist/src/wallet-registration/policy.d.ts +3 -0
- package/dist/src/wallet-registration/policy.d.ts.map +1 -1
- package/dist/src/wallet-registration/policy.js +16 -11
- package/dist/src/wallet-registration/policy.js.map +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -5,7 +5,26 @@ 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
|
-
## [
|
|
8
|
+
## [0.0.1-alpha.4] — npm prerelease
|
|
9
|
+
|
|
10
|
+
This npm package includes the SDK changes since npm `0.0.1-alpha.3`. Earlier
|
|
11
|
+
GitHub prereleases used version numbers `alpha.4` through `alpha.9`. The
|
|
12
|
+
[original GitHub alpha.4 archive](https://github.com/IntoTheDerk/kalvora.js/releases/tag/v0.0.1-alpha.4)
|
|
13
|
+
contains the first shared-wallet implementation. After publication, install
|
|
14
|
+
this build with `npm install --save-exact kalvora.js@0.0.1-alpha.4`.
|
|
15
|
+
|
|
16
|
+
### Added
|
|
17
|
+
|
|
18
|
+
- Create, import and register shared Falcon wallets with M-of-N thresholds, signer classes and alternative signing rules. Members can approve the same registration on independent devices. [Shared wallet creation](./src/wallet-creation/README.md#shared-wallets)
|
|
19
|
+
- Quote and send native KAL from a registered shared wallet. Each member reviews the same payment and signs in its permanent policy slot. [Shared wallet payments](./src/coin-txn/README.md#shared-wallet-payments)
|
|
20
|
+
- Generate and restore chain-independent keys offline with `FalconKey`. Version 1 wallet backups and version 2 key backups restore the same key. Supply the selected network’s trusted transaction context when signing. [Wallet creation](./src/wallet-creation/README.md)
|
|
21
|
+
- Set an optional signed deadline on eligible multisig transactions for validator versions `200044` and `200045`. Save a prepared transaction, resume it on another device and verify detached Falcon proofs. Supported transactions can add a sponsor after owner approval. Omitting the deadline preserves the existing signing bytes and ten-minute window. [V47 dev-client guide](docs/guides/v47-multisig-expiry.md)
|
|
22
|
+
- Build and sign a proposal containing a Coin payment with both governance and wallet inputs. Submission checks the proposal and child deadlines at nanosecond precision. First inclusion at the deadline is valid. [Governance and eligibility](docs/guides/v47-multisig-expiry.md#which-transactions-qualify)
|
|
23
|
+
|
|
24
|
+
### Fixed
|
|
25
|
+
|
|
26
|
+
- Shared transfer fee quotes use the caller’s current transaction context and check the registered policy, identities, nonce, fees and balance.
|
|
27
|
+
- Coin quotes calculate recipient initialization fees for the transferred instrument. A transfer to an existing balance row, including a zero balance, incurs only the ordinary fee.
|
|
9
28
|
|
|
10
29
|
## [0.0.1-alpha.3] — prerelease
|
|
11
30
|
|
package/README.md
CHANGED
|
@@ -65,19 +65,21 @@ bridge helpers use the optional dependencies `@solana/web3.js` and
|
|
|
65
65
|
|
|
66
66
|
## Quick start
|
|
67
67
|
|
|
68
|
-
|
|
68
|
+
Generate a Falcon key offline and protect its backup. For registration, obtain the current finalized block zero from your authenticated indexer and build the transaction with that context.
|
|
69
69
|
|
|
70
70
|
```typescript
|
|
71
|
-
import {
|
|
71
|
+
import { FalconKey, KalvoraClient, deriveChainId, buildWalletRegistration, signAndFinalize } from 'kalvora.js';
|
|
72
72
|
|
|
73
|
-
const
|
|
74
|
-
const wallet = FalconWallet.generate({ networkName: 'kal_proto', genesisHash: trustedFinalGenesisHash });
|
|
73
|
+
const wallet = FalconKey.generate({ networkName: 'kal_proto' });
|
|
75
74
|
await saveToProtectedStorage(wallet.exportBackup());
|
|
76
75
|
console.log(wallet.walletAddress); // Receiving address for prefunding
|
|
77
76
|
|
|
78
|
-
|
|
77
|
+
// Supply your application's authenticated indexer transport.
|
|
78
|
+
const block = await readFinalizedBlockZeroFromIndexer();
|
|
79
|
+
const transactionContext = { chainId: deriveChainId('kal_proto', block.hash) };
|
|
80
|
+
const client = new KalvoraClient({ network: 'protonet', grpc: { endpoint: trustedEndpoint, trustedOperatorAddress, transactionContext } });
|
|
79
81
|
const registration = await buildWalletRegistration(wallet, { grpcConfig: client.grpcConfig });
|
|
80
|
-
await signAndFinalize(registration, wallet);
|
|
82
|
+
await signAndFinalize(registration, wallet, transactionContext);
|
|
81
83
|
const receipt = await client.submitAndWait(registration, { verifyFinalizedBlock });
|
|
82
84
|
if (!receipt.success) throw new Error(receipt.statusName);
|
|
83
85
|
```
|
|
@@ -90,7 +92,7 @@ See the [migration overview and remaining acceptance checks](./docs/protocol-mig
|
|
|
90
92
|
|
|
91
93
|
### Fresh-genesis wallets
|
|
92
94
|
|
|
93
|
-
The wallet-only entry point exports `
|
|
95
|
+
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.
|
|
94
96
|
|
|
95
97
|
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).
|
|
96
98
|
|
|
@@ -196,6 +198,7 @@ strings shared with wallet apps are exported as constants
|
|
|
196
198
|
| [Getting started](./docs/guides/getting-started.md) | Wallets, connecting, sending, external signers, errors |
|
|
197
199
|
| [HD derivation](./docs/guides/hd-derivation.md) | Exact key derivation for Ed25519 (SLIP-0010) and Ed448, reference vectors |
|
|
198
200
|
| [Transactions](./docs/guides/transactions.md) | Every transaction type, required permissions, shared options |
|
|
201
|
+
| [V47 multisig deadlines](./docs/guides/v47-multisig-expiry.md) | Prepare a shared payment once, collect proofs across sessions and reconcile the signed result |
|
|
199
202
|
| [Contract IDs](./docs/guides/contract-ids.md) | Checksummed Base58 ids, genesis ids, deriving an id while creating a contract |
|
|
200
203
|
| [Querying](./docs/guides/querying.md) | Query clients, blocks, results, events, guardian payloads, raw access |
|
|
201
204
|
| [Proposals](./src/proposal/README.md) | Text proposals and proposals that execute a coin transfer |
|
package/dist/README.md
CHANGED
|
@@ -65,19 +65,21 @@ bridge helpers use the optional dependencies `@solana/web3.js` and
|
|
|
65
65
|
|
|
66
66
|
## Quick start
|
|
67
67
|
|
|
68
|
-
|
|
68
|
+
Generate a Falcon key offline and protect its backup. For registration, obtain the current finalized block zero from your authenticated indexer and build the transaction with that context.
|
|
69
69
|
|
|
70
70
|
```typescript
|
|
71
|
-
import {
|
|
71
|
+
import { FalconKey, KalvoraClient, deriveChainId, buildWalletRegistration, signAndFinalize } from 'kalvora.js';
|
|
72
72
|
|
|
73
|
-
const
|
|
74
|
-
const wallet = FalconWallet.generate({ networkName: 'kal_proto', genesisHash: trustedFinalGenesisHash });
|
|
73
|
+
const wallet = FalconKey.generate({ networkName: 'kal_proto' });
|
|
75
74
|
await saveToProtectedStorage(wallet.exportBackup());
|
|
76
75
|
console.log(wallet.walletAddress); // Receiving address for prefunding
|
|
77
76
|
|
|
78
|
-
|
|
77
|
+
// Supply your application's authenticated indexer transport.
|
|
78
|
+
const block = await readFinalizedBlockZeroFromIndexer();
|
|
79
|
+
const transactionContext = { chainId: deriveChainId('kal_proto', block.hash) };
|
|
80
|
+
const client = new KalvoraClient({ network: 'protonet', grpc: { endpoint: trustedEndpoint, trustedOperatorAddress, transactionContext } });
|
|
79
81
|
const registration = await buildWalletRegistration(wallet, { grpcConfig: client.grpcConfig });
|
|
80
|
-
await signAndFinalize(registration, wallet);
|
|
82
|
+
await signAndFinalize(registration, wallet, transactionContext);
|
|
81
83
|
const receipt = await client.submitAndWait(registration, { verifyFinalizedBlock });
|
|
82
84
|
if (!receipt.success) throw new Error(receipt.statusName);
|
|
83
85
|
```
|
|
@@ -90,7 +92,7 @@ See the [migration overview and remaining acceptance checks](./docs/protocol-mig
|
|
|
90
92
|
|
|
91
93
|
### Fresh-genesis wallets
|
|
92
94
|
|
|
93
|
-
The wallet-only entry point exports `
|
|
95
|
+
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.
|
|
94
96
|
|
|
95
97
|
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).
|
|
96
98
|
|
|
@@ -196,6 +198,7 @@ strings shared with wallet apps are exported as constants
|
|
|
196
198
|
| [Getting started](./docs/guides/getting-started.md) | Wallets, connecting, sending, external signers, errors |
|
|
197
199
|
| [HD derivation](./docs/guides/hd-derivation.md) | Exact key derivation for Ed25519 (SLIP-0010) and Ed448, reference vectors |
|
|
198
200
|
| [Transactions](./docs/guides/transactions.md) | Every transaction type, required permissions, shared options |
|
|
201
|
+
| [V47 multisig deadlines](./docs/guides/v47-multisig-expiry.md) | Prepare a shared payment once, collect proofs across sessions and reconcile the signed result |
|
|
199
202
|
| [Contract IDs](./docs/guides/contract-ids.md) | Checksummed Base58 ids, genesis ids, deriving an id while creating a contract |
|
|
200
203
|
| [Querying](./docs/guides/querying.md) | Query clients, blocks, results, events, guardian payloads, raw access |
|
|
201
204
|
| [Proposals](./src/proposal/README.md) | Text proposals and proposals that execute a coin transfer |
|