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.
Files changed (126) hide show
  1. package/CHANGELOG.md +20 -1
  2. package/README.md +10 -7
  3. package/dist/README.md +10 -7
  4. package/dist/index.cjs +33856 -32862
  5. package/dist/index.cjs.map +4 -4
  6. package/dist/index.d.ts +7 -7
  7. package/dist/index.d.ts.map +1 -1
  8. package/dist/index.js +7 -7
  9. package/dist/index.js.map +1 -1
  10. package/dist/index.mjs +7 -7
  11. package/dist/proto/generated/txn_pb.d.ts +8 -0
  12. package/dist/proto/generated/txn_pb.js +1 -1
  13. package/dist/proto/txn.proto +3 -0
  14. package/dist/src/allowance/transaction.d.ts.map +1 -1
  15. package/dist/src/allowance/transaction.js +4 -7
  16. package/dist/src/allowance/transaction.js.map +1 -1
  17. package/dist/src/client/networks.d.ts +1 -1
  18. package/dist/src/client/networks.d.ts.map +1 -1
  19. package/dist/src/client/networks.js +2 -2
  20. package/dist/src/client/networks.js.map +1 -1
  21. package/dist/src/coin-txn/multisig.d.ts +50 -0
  22. package/dist/src/coin-txn/multisig.d.ts.map +1 -0
  23. package/dist/src/coin-txn/multisig.js +194 -0
  24. package/dist/src/coin-txn/multisig.js.map +1 -0
  25. package/dist/src/coin-txn/transaction.d.ts +2 -1
  26. package/dist/src/coin-txn/transaction.d.ts.map +1 -1
  27. package/dist/src/coin-txn/transaction.js +50 -33
  28. package/dist/src/coin-txn/transaction.js.map +1 -1
  29. package/dist/src/contract/create/transaction.d.ts.map +1 -1
  30. package/dist/src/contract/create/transaction.js +2 -1
  31. package/dist/src/contract/create/transaction.js.map +1 -1
  32. package/dist/src/contract/shared/types.d.ts +3 -2
  33. package/dist/src/contract/shared/types.d.ts.map +1 -1
  34. package/dist/src/contract/update/transaction.d.ts.map +1 -1
  35. package/dist/src/contract/update/transaction.js +2 -1
  36. package/dist/src/contract/update/transaction.js.map +1 -1
  37. package/dist/src/grpc/transaction/transaction-client.d.ts.map +1 -1
  38. package/dist/src/grpc/transaction/transaction-client.js +2 -0
  39. package/dist/src/grpc/transaction/transaction-client.js.map +1 -1
  40. package/dist/src/items/transaction.d.ts +2 -3
  41. package/dist/src/items/transaction.d.ts.map +1 -1
  42. package/dist/src/items/transaction.js +2 -3
  43. package/dist/src/items/transaction.js.map +1 -1
  44. package/dist/src/proposal/governance.d.ts.map +1 -1
  45. package/dist/src/proposal/governance.js +9 -31
  46. package/dist/src/proposal/governance.js.map +1 -1
  47. package/dist/src/proposal/transaction.d.ts +2 -2
  48. package/dist/src/proposal/transaction.d.ts.map +1 -1
  49. package/dist/src/proposal/transaction.js +2 -1
  50. package/dist/src/proposal/transaction.js.map +1 -1
  51. package/dist/src/proposal-cancel/transaction.d.ts +2 -2
  52. package/dist/src/proposal-cancel/transaction.d.ts.map +1 -1
  53. package/dist/src/proposal-cancel/transaction.js +2 -1
  54. package/dist/src/proposal-cancel/transaction.js.map +1 -1
  55. package/dist/src/shared/fee-calculators/universal-fee-calculator.d.ts +2 -2
  56. package/dist/src/shared/fee-calculators/universal-fee-calculator.d.ts.map +1 -1
  57. package/dist/src/shared/fee-calculators/universal-fee-calculator.js +2 -1
  58. package/dist/src/shared/fee-calculators/universal-fee-calculator.js.map +1 -1
  59. package/dist/src/shared/tx/admission.d.ts +13 -0
  60. package/dist/src/shared/tx/admission.d.ts.map +1 -0
  61. package/dist/src/shared/tx/admission.js +95 -0
  62. package/dist/src/shared/tx/admission.js.map +1 -0
  63. package/dist/src/shared/tx/base.d.ts +2 -2
  64. package/dist/src/shared/tx/base.d.ts.map +1 -1
  65. package/dist/src/shared/tx/base.js +4 -16
  66. package/dist/src/shared/tx/base.js.map +1 -1
  67. package/dist/src/shared/tx/expiry.d.ts +36 -0
  68. package/dist/src/shared/tx/expiry.d.ts.map +1 -0
  69. package/dist/src/shared/tx/expiry.js +79 -0
  70. package/dist/src/shared/tx/expiry.js.map +1 -0
  71. package/dist/src/shared/tx/standard.d.ts +2 -3
  72. package/dist/src/shared/tx/standard.d.ts.map +1 -1
  73. package/dist/src/shared/tx/standard.js +2 -1
  74. package/dist/src/shared/tx/standard.js.map +1 -1
  75. package/dist/src/sign/context.d.ts +4 -0
  76. package/dist/src/sign/context.d.ts.map +1 -1
  77. package/dist/src/sign/context.js +15 -0
  78. package/dist/src/sign/context.js.map +1 -1
  79. package/dist/src/sign/draft.d.ts +56 -0
  80. package/dist/src/sign/draft.d.ts.map +1 -0
  81. package/dist/src/sign/draft.js +206 -0
  82. package/dist/src/sign/draft.js.map +1 -0
  83. package/dist/src/sign/finalize.d.ts +4 -1
  84. package/dist/src/sign/finalize.d.ts.map +1 -1
  85. package/dist/src/sign/finalize.js +89 -27
  86. package/dist/src/sign/finalize.js.map +1 -1
  87. package/dist/src/sign/index.d.ts +1 -0
  88. package/dist/src/sign/index.d.ts.map +1 -1
  89. package/dist/src/sign/index.js +1 -0
  90. package/dist/src/sign/index.js.map +1 -1
  91. package/dist/src/sign/resources.d.ts +3 -1
  92. package/dist/src/sign/resources.d.ts.map +1 -1
  93. package/dist/src/sign/resources.js +21 -10
  94. package/dist/src/sign/resources.js.map +1 -1
  95. package/dist/src/smart-contracts/shared/base.d.ts +1 -1
  96. package/dist/src/smart-contracts/shared/base.d.ts.map +1 -1
  97. package/dist/src/smart-contracts/shared/base.js +2 -1
  98. package/dist/src/smart-contracts/shared/base.js.map +1 -1
  99. package/dist/src/validator-ops/transaction.d.ts.map +1 -1
  100. package/dist/src/validator-ops/transaction.js +4 -0
  101. package/dist/src/validator-ops/transaction.js.map +1 -1
  102. package/dist/src/vote/transaction.d.ts +2 -3
  103. package/dist/src/vote/transaction.d.ts.map +1 -1
  104. package/dist/src/vote/transaction.js +2 -3
  105. package/dist/src/vote/transaction.js.map +1 -1
  106. package/dist/src/wallet-creation/falcon.d.ts +35 -13
  107. package/dist/src/wallet-creation/falcon.d.ts.map +1 -1
  108. package/dist/src/wallet-creation/falcon.js +69 -37
  109. package/dist/src/wallet-creation/falcon.js.map +1 -1
  110. package/dist/src/wallet-registration/class-policy.d.ts +17 -0
  111. package/dist/src/wallet-registration/class-policy.d.ts.map +1 -0
  112. package/dist/src/wallet-registration/class-policy.js +93 -0
  113. package/dist/src/wallet-registration/class-policy.js.map +1 -0
  114. package/dist/src/wallet-registration/index.d.ts +2 -1
  115. package/dist/src/wallet-registration/index.d.ts.map +1 -1
  116. package/dist/src/wallet-registration/index.js +7 -1
  117. package/dist/src/wallet-registration/index.js.map +1 -1
  118. package/dist/src/wallet-registration/multisig.d.ts +47 -0
  119. package/dist/src/wallet-registration/multisig.d.ts.map +1 -0
  120. package/dist/src/wallet-registration/multisig.js +154 -0
  121. package/dist/src/wallet-registration/multisig.js.map +1 -0
  122. package/dist/src/wallet-registration/policy.d.ts +3 -0
  123. package/dist/src/wallet-registration/policy.d.ts.map +1 -1
  124. package/dist/src/wallet-registration/policy.js +16 -11
  125. package/dist/src/wallet-registration/policy.js.map +1 -1
  126. 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
- ## [Unreleased]
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
- Obtain the network name, final block-zero hash and endpoints from the operator. Generate a Falcon wallet, protect its backup, and prefund its receiving address with enough native KALV to register.
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 { FalconWallet, KalvoraClient, pinNetwork, buildWalletRegistration, signAndFinalize } from 'kalvora.js';
71
+ import { FalconKey, KalvoraClient, deriveChainId, buildWalletRegistration, signAndFinalize } from 'kalvora.js';
72
72
 
73
- const network = pinNetwork('protonet', 'kal_proto', trustedFinalGenesisHash);
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
- const client = new KalvoraClient({ network, grpc: { endpoint: trustedEndpoint, trustedOperatorAddress } });
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 `FalconWallet`, the two padded Falcon variants and all eleven hash choices. `FalconWallet.restore(backup)` restores the key with its selected address and network pin. BLAKE3-256 is the default. A different hash for the same key creates a separate address, balance and nonce.
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
- Obtain the network name, final block-zero hash and endpoints from the operator. Generate a Falcon wallet, protect its backup, and prefund its receiving address with enough native KALV to register.
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 { FalconWallet, KalvoraClient, pinNetwork, buildWalletRegistration, signAndFinalize } from 'kalvora.js';
71
+ import { FalconKey, KalvoraClient, deriveChainId, buildWalletRegistration, signAndFinalize } from 'kalvora.js';
72
72
 
73
- const network = pinNetwork('protonet', 'kal_proto', trustedFinalGenesisHash);
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
- const client = new KalvoraClient({ network, grpc: { endpoint: trustedEndpoint, trustedOperatorAddress } });
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 `FalconWallet`, the two padded Falcon variants and all eleven hash choices. `FalconWallet.restore(backup)` restores the key with its selected address and network pin. BLAKE3-256 is the default. A different hash for the same key creates a separate address, balance and nonce.
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 |