shell-sdk 0.2.0 → 0.3.0
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 +3 -8
- package/README.md +6 -2
- package/dist/index.d.ts +1 -1
- package/dist/provider.d.ts +29 -1
- package/dist/provider.js +35 -0
- package/dist/types.d.ts +55 -0
- package/package.json +3 -3
package/CHANGELOG.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
-
## [0.
|
|
3
|
+
## [0.3.0] — 2026-04-22
|
|
4
4
|
|
|
5
5
|
### Added
|
|
6
6
|
- **API freeze**: `ShellSigner`, `ShellProvider`, and `ShellWallet` are now stable public APIs.
|
|
@@ -8,18 +8,13 @@
|
|
|
8
8
|
- `examples/minimal-dapp`: Node.js (`node-demo.mjs`) and browser (`browser-demo.html`) integration examples.
|
|
9
9
|
- JSDoc complete for all public-facing exports.
|
|
10
10
|
- `MlDsa65Adapter` round-trip sign+verify test.
|
|
11
|
+
- `getNodeInfo()`, `getWitness()`, and `getStorageProfile()` helpers for Shell-specific node capabilities.
|
|
11
12
|
|
|
12
13
|
### Changed
|
|
13
14
|
- `adapters.ts`: both `"Dilithium3"` and `"MlDsa65"` aliases now explicitly document ML-DSA-65 (FIPS 204) wire compatibility with the chain's Dilithium3 verifier.
|
|
14
15
|
- `hashTransaction()` canonical RLP field ordering aligned with `shell-chain` deserialiser.
|
|
15
16
|
- Package root export surface narrowed to stable application-facing APIs.
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
- **Signing compatibility confirmed**: `pqcrypto-dilithium` v0.5 (shell-chain) implements FIPS 204 ML-DSA-65, byte-identical with `@noble/post-quantum` `ml_dsa65`. The `Dilithium3` alias in the SDK now documents this equivalence explicitly (pk=1952, sk=4032, sig=3309 bytes).
|
|
20
|
-
- add cross-validation tests verifying ML-DSA-65 key/signature sizes against chain expectations
|
|
21
|
-
- add `MlDsa65Adapter` round-trip sign+verify test
|
|
22
|
-
- clarify `adapters.ts` JSDoc: both `"Dilithium3"` and `"MlDsa65"` route to ML-DSA-65 (FIPS 204) which is wire-compatible with the chain's Dilithium3 verifier
|
|
17
|
+
- NodeInfo example version string now reflects current node naming (`shell-node/0.17.0`) without tying the SDK package version to the chain version.
|
|
23
18
|
|
|
24
19
|
## 0.2.0-rc.1
|
|
25
20
|
|
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# shell-sdk
|
|
2
2
|
|
|
3
|
-
**TypeScript / JavaScript SDK for Shell Chain** —
|
|
3
|
+
**TypeScript / JavaScript SDK for Shell Chain** — build quantum-safe dApps on the first EVM chain secured before Q-Day.
|
|
4
4
|
|
|
5
5
|
[](https://nodejs.org/)
|
|
6
6
|
[](https://nodejs.org/api/esm.html)
|
|
@@ -39,7 +39,8 @@
|
|
|
39
39
|
- **PQ addresses** — bech32m-encoded `pq1…` addresses derived from PQ public keys via BLAKE3
|
|
40
40
|
- **Native account abstraction** — key rotation and custom validation code via system contracts
|
|
41
41
|
- **viem integration** — standard Ethereum JSON-RPC methods via a typed `PublicClient`
|
|
42
|
-
- **Shell-specific RPC** — `shell_getPqPubkey`, `shell_sendTransaction`, `shell_getTransactionsByAddress`
|
|
42
|
+
- **Shell-specific RPC** — `shell_getPqPubkey`, `shell_sendTransaction`, `shell_getTransactionsByAddress`, `shell_getNodeInfo`, `shell_getWitness`
|
|
43
|
+
- **Node introspection** — `getNodeInfo()` returns version, block height, peer count, and storage profile; `getWitness()` fetches raw PQ signatures for any block
|
|
43
44
|
- **Encrypted keystore** — argon2id KDF + xchacha20-poly1305 cipher; compatible with the Shell CLI
|
|
44
45
|
|
|
45
46
|
---
|
|
@@ -237,6 +238,9 @@ import { shellDevnet } from "shell-sdk/provider";
|
|
|
237
238
|
| `sendTransaction(signed)` | `shell_sendTransaction` → tx hash string |
|
|
238
239
|
| `getTransactionsByAddress(address, opts)` | `shell_getTransactionsByAddress` with optional `fromBlock/toBlock/page/limit` |
|
|
239
240
|
| `getBlockReceipts(block)` | `eth_getBlockReceipts` → array of receipts |
|
|
241
|
+
| `getNodeInfo()` | `shell_getNodeInfo` → `ShellNodeInfo` (version, block height, peer count, storage profile) |
|
|
242
|
+
| `getWitness(blockNumberOrHash)` | `shell_getWitness` → `ShellWitnessBundle` or `null` if pruned |
|
|
243
|
+
| `getStorageProfile()` | Convenience wrapper around `getNodeInfo()` → `ShellStorageProfile \| undefined` |
|
|
240
244
|
|
|
241
245
|
**Examples:**
|
|
242
246
|
|
package/dist/index.d.ts
CHANGED
|
@@ -5,4 +5,4 @@ export { buildClearValidationCodeTransaction, buildRotateKeyTransaction, buildSe
|
|
|
5
5
|
export { assertSignerMatchesKeystore, decryptKeystore, exportEncryptedKeyJson, parseEncryptedKey, validateEncryptedKeyAddress, type ParsedShellKeystore, } from "./keystore.js";
|
|
6
6
|
export { adapterFromKeyPair, generateAdapter, generateMlDsa65KeyPair, generateSlhDsaKeyPair, MlDsa65Adapter, SlhDsaAdapter, type MlDsa65KeyPair, type SlhDsaKeyPair, } from "./adapters.js";
|
|
7
7
|
export { buildShellSignature, publicKeyFromHex, ShellSigner, signatureTypeFromKeyType, type SignerAdapter, } from "./signer.js";
|
|
8
|
-
export type { AddressLike, HexString, ShellAccessListItem, ShellCipherParams, ShellEncryptedKey, ShellSendTransactionParams, ShellKdfParams, ShellSignature, ShellTransactionRequest, ShellTxByAddressPage, SignedShellTransaction, SignatureTypeName, } from "./types.js";
|
|
8
|
+
export type { AddressLike, HexString, ShellAccessListItem, ShellCipherParams, ShellEncryptedKey, ShellNodeInfo, ShellSendTransactionParams, ShellKdfParams, ShellSignature, ShellStorageProfile, ShellTransactionRequest, ShellTxByAddressPage, ShellTxWitness, ShellWitnessBundle, SignedShellTransaction, SignatureTypeName, } from "./types.js";
|
package/dist/provider.d.ts
CHANGED
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
* @module provider
|
|
17
17
|
*/
|
|
18
18
|
import { type Chain, type PublicClient } from "viem";
|
|
19
|
-
import type { SignedShellTransaction } from "./types.js";
|
|
19
|
+
import type { ShellNodeInfo, ShellStorageProfile, ShellWitnessBundle, SignedShellTransaction } from "./types.js";
|
|
20
20
|
/**
|
|
21
21
|
* Pre-configured viem chain definition for Shell Devnet.
|
|
22
22
|
*
|
|
@@ -155,6 +155,34 @@ export declare class ShellProvider {
|
|
|
155
155
|
* @returns Array of transaction receipt objects.
|
|
156
156
|
*/
|
|
157
157
|
getBlockReceipts(block: string): Promise<unknown[]>;
|
|
158
|
+
/**
|
|
159
|
+
* Fetch metadata about the connected Shell Chain node.
|
|
160
|
+
*
|
|
161
|
+
* Calls `shell_getNodeInfo`.
|
|
162
|
+
*
|
|
163
|
+
* @returns Node info including version, block height, peer count, and storage profile.
|
|
164
|
+
*/
|
|
165
|
+
getNodeInfo(): Promise<ShellNodeInfo>;
|
|
166
|
+
/**
|
|
167
|
+
* Fetch the PQ witness bundle for a block.
|
|
168
|
+
*
|
|
169
|
+
* Calls `shell_getWitness`. Returns `null` if the witness has been pruned
|
|
170
|
+
* (the node is running with a `full` or `light` profile and the STARK proof
|
|
171
|
+
* has already replaced the raw signatures).
|
|
172
|
+
*
|
|
173
|
+
* @param blockNumberOrHash - Hex block number (`"0x1a"`) or block hash.
|
|
174
|
+
* @returns Witness bundle, or `null` if pruned.
|
|
175
|
+
*/
|
|
176
|
+
getWitness(blockNumberOrHash: string): Promise<ShellWitnessBundle | null>;
|
|
177
|
+
/**
|
|
178
|
+
* Fetch the active storage profile of the connected node.
|
|
179
|
+
*
|
|
180
|
+
* Convenience wrapper around {@link getNodeInfo}.
|
|
181
|
+
*
|
|
182
|
+
* @returns Storage profile string (`"archive"`, `"full"`, or `"light"`), or
|
|
183
|
+
* `undefined` if the node does not report it.
|
|
184
|
+
*/
|
|
185
|
+
getStorageProfile(): Promise<ShellStorageProfile | undefined>;
|
|
158
186
|
}
|
|
159
187
|
/**
|
|
160
188
|
* Create a viem `PublicClient` connected to Shell Chain over HTTP.
|
package/dist/provider.js
CHANGED
|
@@ -137,6 +137,41 @@ export class ShellProvider {
|
|
|
137
137
|
async getBlockReceipts(block) {
|
|
138
138
|
return this.request("eth_getBlockReceipts", [block]);
|
|
139
139
|
}
|
|
140
|
+
/**
|
|
141
|
+
* Fetch metadata about the connected Shell Chain node.
|
|
142
|
+
*
|
|
143
|
+
* Calls `shell_getNodeInfo`.
|
|
144
|
+
*
|
|
145
|
+
* @returns Node info including version, block height, peer count, and storage profile.
|
|
146
|
+
*/
|
|
147
|
+
async getNodeInfo() {
|
|
148
|
+
return this.request("shell_getNodeInfo", []);
|
|
149
|
+
}
|
|
150
|
+
/**
|
|
151
|
+
* Fetch the PQ witness bundle for a block.
|
|
152
|
+
*
|
|
153
|
+
* Calls `shell_getWitness`. Returns `null` if the witness has been pruned
|
|
154
|
+
* (the node is running with a `full` or `light` profile and the STARK proof
|
|
155
|
+
* has already replaced the raw signatures).
|
|
156
|
+
*
|
|
157
|
+
* @param blockNumberOrHash - Hex block number (`"0x1a"`) or block hash.
|
|
158
|
+
* @returns Witness bundle, or `null` if pruned.
|
|
159
|
+
*/
|
|
160
|
+
async getWitness(blockNumberOrHash) {
|
|
161
|
+
return this.request("shell_getWitness", [blockNumberOrHash]);
|
|
162
|
+
}
|
|
163
|
+
/**
|
|
164
|
+
* Fetch the active storage profile of the connected node.
|
|
165
|
+
*
|
|
166
|
+
* Convenience wrapper around {@link getNodeInfo}.
|
|
167
|
+
*
|
|
168
|
+
* @returns Storage profile string (`"archive"`, `"full"`, or `"light"`), or
|
|
169
|
+
* `undefined` if the node does not report it.
|
|
170
|
+
*/
|
|
171
|
+
async getStorageProfile() {
|
|
172
|
+
const info = await this.getNodeInfo();
|
|
173
|
+
return info.storage_profile;
|
|
174
|
+
}
|
|
140
175
|
}
|
|
141
176
|
/**
|
|
142
177
|
* Create a viem `PublicClient` connected to Shell Chain over HTTP.
|
package/dist/types.d.ts
CHANGED
|
@@ -82,6 +82,61 @@ export interface SignedShellTransaction {
|
|
|
82
82
|
*/
|
|
83
83
|
sender_pubkey?: number[] | null;
|
|
84
84
|
}
|
|
85
|
+
/**
|
|
86
|
+
* Node storage profile as advertised via the `StorageCapability` P2P message.
|
|
87
|
+
*
|
|
88
|
+
* - `"archive"` — all TX bodies and PQ witnesses kept forever; STARK proofs never replace witnesses.
|
|
89
|
+
* - `"full"` — TX bodies kept forever; PQ witnesses replaced by STARK proofs when they arrive.
|
|
90
|
+
* - `"light"` — rolling ~4096-block window; older data pruned.
|
|
91
|
+
*/
|
|
92
|
+
export type ShellStorageProfile = "archive" | "full" | "light";
|
|
93
|
+
/**
|
|
94
|
+
* Response from `shell_getNodeInfo`.
|
|
95
|
+
*
|
|
96
|
+
* Contains runtime metadata about the connected Shell Chain node.
|
|
97
|
+
*/
|
|
98
|
+
export interface ShellNodeInfo {
|
|
99
|
+
/** Node software version string, e.g. `"shell-node/0.17.0"`, independent of the SDK package version. */
|
|
100
|
+
version: string;
|
|
101
|
+
/** Chain ID as a decimal string. */
|
|
102
|
+
chain_id: string;
|
|
103
|
+
/** Current head block number (decimal). */
|
|
104
|
+
block_height: number;
|
|
105
|
+
/** libp2p peer ID of this node. */
|
|
106
|
+
peer_id: string;
|
|
107
|
+
/** Number of currently connected peers. */
|
|
108
|
+
peer_count: number;
|
|
109
|
+
/** Active storage profile. */
|
|
110
|
+
storage_profile?: ShellStorageProfile;
|
|
111
|
+
/** Oldest block number for which this node has full body data. */
|
|
112
|
+
oldest_body_block?: number;
|
|
113
|
+
}
|
|
114
|
+
/**
|
|
115
|
+
* A single PQ transaction witness from `shell_getBlockWitnesses` / `shell_getWitness`.
|
|
116
|
+
*/
|
|
117
|
+
export interface ShellTxWitness {
|
|
118
|
+
/** Zero-based transaction index within the block. */
|
|
119
|
+
tx_index: number;
|
|
120
|
+
/** Signature algorithm name. */
|
|
121
|
+
sig_type: SignatureTypeName;
|
|
122
|
+
/** Raw signature bytes as hex string. */
|
|
123
|
+
signature: string;
|
|
124
|
+
/** Raw public key bytes as hex string (only present on first-use txs). */
|
|
125
|
+
public_key?: string;
|
|
126
|
+
}
|
|
127
|
+
/**
|
|
128
|
+
* Response from `shell_getWitness` for a single block.
|
|
129
|
+
*/
|
|
130
|
+
export interface ShellWitnessBundle {
|
|
131
|
+
/** Block hash (0x-prefixed). */
|
|
132
|
+
block_hash: string;
|
|
133
|
+
/** Block number. */
|
|
134
|
+
block_number: number;
|
|
135
|
+
/** Number of witnesses in this bundle. */
|
|
136
|
+
witness_count: number;
|
|
137
|
+
/** Individual transaction witnesses. */
|
|
138
|
+
witnesses: ShellTxWitness[];
|
|
139
|
+
}
|
|
85
140
|
/** Paginated response from `shell_getTransactionsByAddress`. */
|
|
86
141
|
export interface ShellTxByAddressPage {
|
|
87
142
|
address: AddressLike;
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "shell-sdk",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"description": "TypeScript SDK for Shell Chain",
|
|
3
|
+
"version": "0.3.0",
|
|
4
|
+
"description": "TypeScript SDK for Shell Chain — build quantum-safe dApps before Q-Day.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"main": "./dist/index.js",
|
|
@@ -53,7 +53,7 @@
|
|
|
53
53
|
"build": "tsc -p tsconfig.json",
|
|
54
54
|
"clean": "rm -rf dist",
|
|
55
55
|
"typecheck": "tsc -p tsconfig.json --noEmit",
|
|
56
|
-
"test": "npm run build && node --test tests
|
|
56
|
+
"test": "npm run build && node --test tests/*.test.mjs"
|
|
57
57
|
},
|
|
58
58
|
"keywords": [
|
|
59
59
|
"shell-chain",
|