shell-sdk 0.7.0 → 0.8.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 CHANGED
@@ -1,5 +1,30 @@
1
1
  # Changelog
2
2
 
3
+ ## [0.8.0] — 2026-05-06
4
+
5
+ ### Added
6
+ - `ShellDecodedProofInput` type: structured proof amendment payload decoded
7
+ from `starkReward` settlement transactions (requires `shell-chain v0.22+`).
8
+ Fields: `layer`, `blockNumber`, `startBlock`, `endBlock`, `nSigs`,
9
+ `compressedSize`, `originalSize`, `settlementTxHash`.
10
+ - `ShellRpcTransaction.decodedInput?: ShellDecodedProofInput | null` — filled
11
+ by the node for `starkReward` system transactions; `null`/absent otherwise.
12
+ - `ShellDecodedProofInput` exported from the package root.
13
+
14
+ ### Changed
15
+ - Aligned with `shell-chain v0.22.0` RPC surface.
16
+
17
+ ## [0.7.1] — 2026-05-06
18
+
19
+ ### Added
20
+ - Typed Shell RPC reward metadata for address-history and transaction-summary
21
+ responses, including block gas rewards, STARK rewards, reward layers,
22
+ source hashes, and compression accounting fields.
23
+
24
+ ### Changed
25
+ - Preserve pq1-only compatibility from `0.7.0` while aligning the SDK type
26
+ surface with `shell-chain v0.21.1`.
27
+
3
28
  ## [0.7.0] — 2026-04-30 ⚠️ BREAKING
4
29
 
5
30
  ### Breaking Changes — F-PQ1-ONLY (pq1 bech32m addresses everywhere)
package/README.md CHANGED
@@ -40,6 +40,7 @@
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
42
  - **Shell-specific RPC** — `shell_getPqPubkey`, `shell_sendTransaction`, `shell_getTransactionsByAddress`, `shell_getNodeInfo`, `shell_getWitness`
43
+ - **Reward-aware history types** — block/address transaction summaries expose readable `shellType`, `rewardKind`, and STARK reward metadata (`rewardLayer`, `rewardSourceHash`, `originalSize`, `compressedSize`)
43
44
  - **Node introspection** — `getNodeInfo()` returns version, block height, peer count, and storage profile; `getWitness()` fetches raw PQ signatures for any block
44
45
  - **Encrypted keystore** — argon2id KDF + xchacha20-poly1305 cipher; compatible with the Shell CLI
45
46
 
@@ -78,7 +79,7 @@ const signer = new ShellSigner("MlDsa65", adapter);
78
79
  const from = signer.getAddress(); // pq1…
79
80
 
80
81
  const provider = createShellProvider();
81
- const nonce = await provider.client.getTransactionCount({ address: signer.getHexAddress() });
82
+ const nonce = await provider.client.getTransactionCount({ address: from });
82
83
 
83
84
  const tx = buildTransferTransaction({ chainId: 424242, nonce, to: "pq1recipient…", value: parseEther("1") });
84
85
  const txHash = hashTransaction(tx);
@@ -107,7 +108,7 @@ blake3( version(1) || algo_id(1) || public_key )[0..20]
107
108
 
108
109
  Algorithm IDs: `Dilithium3=0`, `MlDsa65=1`, `SphincsSha2256f=2`.
109
110
 
110
- Internally the chain also recognises the hex representation (`0x…`) of the same 20 bytes, so both forms are interchangeable in SDK APIs.
111
+ Shell Chain v0.21.0+ accepts `pq1…` addresses at user-facing RPC and SDK boundaries. Legacy `0x…` address inputs are rejected.
111
112
 
112
113
  ### Native account abstraction (AA)
113
114
 
@@ -147,7 +148,9 @@ Defined in `src/types.ts`. All types are re-exported from the package root.
147
148
  | `ShellSignature` | `{ sig_type, data: number[] }` |
148
149
  | `SignedShellTransaction` | Complete signed transaction ready to broadcast |
149
150
  | `ShellAccessListItem` | EIP-2930 access list entry |
150
- | `ShellTxByAddressPage` | Paginated address history response |
151
+ | `ShellKnownRpcTxType` | Literal union of known Shell RPC transaction kinds |
152
+ | `ShellRpcTransactionSummary` | Lightweight transaction summary with Shell reward metadata |
153
+ | `ShellTxByAddressPage` | Paginated address history response with effective `fromBlock`/`toBlock` range |
151
154
  | `ShellKdfParams` | argon2id parameters inside a keystore |
152
155
  | `ShellCipherParams` | xchacha20-poly1305 nonce inside a keystore |
153
156
  | `ShellEncryptedKey` | Full encrypted keystore file structure |
@@ -173,10 +176,7 @@ Defined in `src/types.ts`. All types are re-exported from the package root.
173
176
  | `bytesToPqAddress` | `(bytes: Uint8Array, version?) → string` | Encode 20 raw bytes as a `pq1…` bech32m address |
174
177
  | `pqAddressToBytes` | `(address: string) → Uint8Array` | Decode a `pq1…` address to its 20 raw bytes |
175
178
  | `pqAddressVersion` | `(address: string) → number` | Extract the version byte from a `pq1…` address |
176
- | `hexAddressToBytes` | `(address: string) → Uint8Array` | Parse a `0x…` address to 20 bytes |
177
- | `bytesToHexAddress` | `(bytes: Uint8Array) → HexString` | Encode 20 bytes as a `0x…` hex address |
178
- | `normalizePqAddress` | `(address: string) → string` | Accept either pq1 or 0x form, always return pq1 |
179
- | `normalizeHexAddress` | `(address: string) → HexString` | Accept either pq1 or 0x form, always return 0x |
179
+ | `normalizePqAddress` | `(address: string) → string` | Validate and return a `pq1…` address |
180
180
  | `derivePqAddressFromPublicKey` | `(pk, algoId, version?) → string` | Derive pq1 address from a raw public key |
181
181
  | `isPqAddress` | `(address: string) → boolean` | Return `true` if the string is a valid pq1 address |
182
182
 
@@ -194,9 +194,9 @@ const address = derivePqAddressFromPublicKey(publicKey, 1 /* MlDsa65 */);
194
194
 
195
195
  console.log(isPqAddress(address)); // true
196
196
 
197
- // Round-trip normalisation
198
- normalizePqAddress("0xabcdef…"); // → "pq1…"
197
+ // Validation / normalisation
199
198
  normalizePqAddress("pq1qx3f…"); // → "pq1qx3f…" (unchanged)
199
+ normalizePqAddress("0xabcdef…"); // throws: expected a pq1… bech32m address
200
200
  ```
201
201
 
202
202
  ---
@@ -236,8 +236,8 @@ import { shellDevnet } from "shell-sdk/provider";
236
236
  | `.rpcHttpUrl` | HTTP RPC URL in use |
237
237
  | `getPqPubkey(address)` | `shell_getPqPubkey` → hex public key or `null` |
238
238
  | `sendTransaction(signed)` | `shell_sendTransaction` → tx hash string |
239
- | `getTransactionsByAddress(address, opts)` | `shell_getTransactionsByAddress` with optional `fromBlock/toBlock/page/limit` |
240
- | `getBlockReceipts(block)` | `eth_getBlockReceipts` → array of receipts |
239
+ | `getTransactionsByAddress(address, opts)` | `shell_getTransactionsByAddress` with optional `fromBlock/toBlock/page/limit`; pin `toBlock` from page 0 for stable full-history pagination |
240
+ | `getBlockReceipts(block)` | `eth_getBlockReceipts` → `ShellRpcReceipt[]` |
241
241
  | `getNodeInfo()` | `shell_getNodeInfo` → `ShellNodeInfo` (version, block height, peer count, storage profile) |
242
242
  | `getWitness(blockNumberOrHash)` | `shell_getWitness` → `ShellWitnessBundle` or `null` if pruned |
243
243
  | `getStorageProfile()` | Convenience wrapper around `getNodeInfo()` → `ShellStorageProfile \| undefined` |
@@ -258,6 +258,11 @@ const pubkeyHex = await provider.getPqPubkey("pq1…");
258
258
  const txHash = await provider.sendTransaction(signedTx);
259
259
 
260
260
  const history = await provider.getTransactionsByAddress("pq1…", { page: 0, limit: 20 });
261
+ const older = await provider.getTransactionsByAddress("pq1…", {
262
+ page: 1,
263
+ limit: 20,
264
+ toBlock: history.toBlock ?? history.to_block,
265
+ });
261
266
  ```
262
267
 
263
268
  **Custom endpoint:**
@@ -334,7 +339,6 @@ const signer = new ShellSigner("MlDsa65", MlDsa65Adapter.generate());
334
339
  | `algorithmId` | Numeric algorithm ID (`0`, `1`, or `2`) |
335
340
  | `getPublicKey()` | Raw public key bytes |
336
341
  | `getAddress()` | `pq1…` bech32m address |
337
- | `getHexAddress()` | `0x…` hex address |
338
342
  | `sign(message)` | Sign an arbitrary byte message → signature bytes |
339
343
  | `buildSignedTransaction(options)` | Sign `txHash` and assemble a `SignedShellTransaction` |
340
344
 
@@ -568,7 +572,6 @@ import { buildTransferTransaction, hashTransaction } from "shell-sdk/transaction
568
572
  const adapter = MlDsa65Adapter.generate();
569
573
  const signer = new ShellSigner("MlDsa65", adapter);
570
574
  const from = signer.getAddress(); // pq1…
571
- const fromHex = signer.getHexAddress(); // 0x…
572
575
 
573
576
  console.log("Address:", from);
574
577
 
@@ -576,7 +579,7 @@ console.log("Address:", from);
576
579
  const provider = createShellProvider(); // defaults to http://127.0.0.1:8545
577
580
 
578
581
  // 3. Get current nonce
579
- const nonce = await provider.client.getTransactionCount({ address: fromHex });
582
+ const nonce = await provider.client.getTransactionCount({ address: from });
580
583
 
581
584
  // 4. Build the transaction
582
585
  const tx = buildTransferTransaction({
@@ -614,7 +617,7 @@ import { parseEther } from "viem";
614
617
 
615
618
  const signer = await decryptKeystore(readFileSync("./key.json", "utf8"), process.env.PASSPHRASE!);
616
619
  const provider = createShellProvider();
617
- const nonce = await provider.client.getTransactionCount({ address: signer.getHexAddress() });
620
+ const nonce = await provider.client.getTransactionCount({ address: signer.getAddress() });
618
621
 
619
622
  const tx = buildTransferTransaction({
620
623
  chainId: 424242,
@@ -639,13 +642,13 @@ This is the recommended shape for a Chrome extension background worker: keep the
639
642
  import { createShellProvider, buildTransferTransaction, hashTransaction } from "shell-sdk";
640
643
 
641
644
  async function submitTransfer({ signer, to, value, rpcHttpUrl }: {
642
- signer: { getHexAddress(): `0x${string}`; buildSignedTransaction(args: { tx: unknown; txHash: Uint8Array; includePublicKey?: boolean }): Promise<unknown> };
645
+ signer: { getAddress(): string; buildSignedTransaction(args: { tx: unknown; txHash: Uint8Array; includePublicKey?: boolean }): Promise<unknown> };
643
646
  to: string;
644
647
  value: bigint;
645
648
  rpcHttpUrl: string;
646
649
  }) {
647
650
  const provider = createShellProvider({ rpcHttpUrl });
648
- const nonce = await provider.client.getTransactionCount({ address: signer.getHexAddress() });
651
+ const nonce = await provider.client.getTransactionCount({ address: signer.getAddress() });
649
652
 
650
653
  const tx = buildTransferTransaction({
651
654
  chainId: 424242,
@@ -671,7 +674,7 @@ const provider = createShellProvider({
671
674
  rpcHttpUrl: "https://rpc.testnet.shell.network",
672
675
  });
673
676
 
674
- const account = normalizePqAddress("0x1234...abcd");
677
+ const account = normalizePqAddress("pq1qx3f...");
675
678
  const history = await provider.getTransactionsByAddress(account, { page: 1, limit: 10 });
676
679
 
677
680
  console.log("recent txs:", history.transactions);
@@ -699,7 +702,7 @@ const currentSigner = await decryptKeystore(readFileSync("old-key.json", "utf8")
699
702
  const newAdapter = MlDsa65Adapter.generate();
700
703
  const newSigner = new ShellSigner("MlDsa65", newAdapter);
701
704
 
702
- const nonce = await provider.client.getTransactionCount({ address: currentSigner.getHexAddress() });
705
+ const nonce = await provider.client.getTransactionCount({ address: currentSigner.getAddress() });
703
706
 
704
707
  // Build the rotateKey system transaction
705
708
  const tx = buildRotateKeyTransaction({
@@ -728,7 +731,6 @@ All SDK functions throw standard `Error` instances. Common error messages:
728
731
  |---|---|
729
732
  | `expected 20 address bytes, got N` | Wrong-length bytes passed to address helpers |
730
733
  | `expected pq address prefix, got X` | bech32m prefix is not `pq` |
731
- | `invalid hex address` | String does not start with `0x` |
732
734
  | `invalid bech32m address` | String is not a valid bech32m address |
733
735
  | `unsupported key type: X` | Keystore `key_type` not recognised |
734
736
  | `unsupported kdf: X` | Only `argon2id` is supported |
package/dist/index.d.ts CHANGED
@@ -6,4 +6,5 @@ export { assertSignerMatchesKeystore, decryptKeystore, exportEncryptedKeyJson, p
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
8
  export { AA_MAX_PAYMASTER_CONTEXT, AA_SESSION_KEY_GAS_SURCHARGE } from "./types.js";
9
- export type { AaBundle, AaInnerCall, AddressLike, GuardianConfig, HexString, RecoveryProposal, SessionAuth, ShellAccessListItem, ShellBatchInnerCallRequest, ShellBatchInnerGas, ShellCipherParams, ShellEncryptedKey, ShellEstimateBatchRequest, ShellEstimateBatchResult, ShellIsSponsoredResult, ShellKdfParams, ShellNodeInfo, ShellPaymasterPolicy, ShellSendTransactionParams, ShellSignature, ShellStorageProfile, ShellTransactionRequest, ShellTxByAddressPage, ShellTxWitness, ShellWitnessBundle, ShellWitnessRootResult, SignedShellTransaction, SignatureTypeName, } from "./types.js";
9
+ export { formatShellRpcTxType } from "./types.js";
10
+ export type { AaBundle, AaInnerCall, AddressLike, GuardianConfig, HexString, RecoveryProposal, SessionAuth, ShellAccessListItem, ShellBatchInnerCallRequest, ShellBatchInnerGas, ShellCipherParams, ShellEncryptedKey, ShellEstimateBatchRequest, ShellEstimateBatchResult, ShellKnownRpcTxType, ShellIsSponsoredResult, ShellKdfParams, ShellNodeInfo, ShellPaymasterPolicy, ShellReadableTxType, ShellRewardKind, ShellRpcReceipt, ShellRpcTransaction, ShellRpcTransactionSummary, ShellRpcTxType, ShellDecodedProofInput, ShellSendTransactionParams, ShellSignature, ShellStorageProfile, ShellTransactionRequest, ShellTxByAddressPage, ShellTxWitness, ShellWitnessBundle, ShellWitnessRootResult, SignedShellTransaction, SignatureTypeName, } from "./types.js";
package/dist/index.js CHANGED
@@ -6,3 +6,4 @@ export { assertSignerMatchesKeystore, decryptKeystore, exportEncryptedKeyJson, p
6
6
  export { adapterFromKeyPair, generateAdapter, generateMlDsa65KeyPair, generateSlhDsaKeyPair, MlDsa65Adapter, SlhDsaAdapter, } from "./adapters.js";
7
7
  export { buildShellSignature, publicKeyFromHex, ShellSigner, signatureTypeFromKeyType, } from "./signer.js";
8
8
  export { AA_MAX_PAYMASTER_CONTEXT, AA_SESSION_KEY_GAS_SURCHARGE } from "./types.js";
9
+ export { formatShellRpcTxType } from "./types.js";
@@ -16,7 +16,7 @@
16
16
  * @module provider
17
17
  */
18
18
  import { type Chain, type PublicClient } from "viem";
19
- import type { ShellEstimateBatchRequest, ShellEstimateBatchResult, ShellIsSponsoredResult, ShellNodeInfo, ShellPaymasterPolicy, ShellStorageProfile, ShellWitnessBundle, ShellWitnessRootResult, SignedShellTransaction } from "./types.js";
19
+ import type { ShellEstimateBatchRequest, ShellEstimateBatchResult, ShellIsSponsoredResult, ShellNodeInfo, ShellPaymasterPolicy, ShellRpcReceipt, ShellStorageProfile, ShellTxByAddressPage, ShellWitnessBundle, ShellWitnessRootResult, SignedShellTransaction } from "./types.js";
20
20
  /**
21
21
  * Pre-configured viem chain definition for Shell Devnet.
22
22
  *
@@ -90,6 +90,7 @@ export interface CreateShellPublicClientOptions {
90
90
  }
91
91
  /** A typed alias for a viem `PublicClient`. */
92
92
  export type ShellPublicClient = PublicClient;
93
+ export type ShellBlockRangeBound = number | `0x${string}`;
93
94
  /**
94
95
  * RPC client for Shell Chain.
95
96
  *
@@ -138,14 +139,16 @@ export declare class ShellProvider {
138
139
  * @param options.toBlock - End of block range (inclusive).
139
140
  * @param options.page - Zero-based page index.
140
141
  * @param options.limit - Maximum number of results per page.
141
- * @returns Raw paginated response from the node.
142
+ * @returns Paginated response from the node. `fromBlock`/`toBlock` in the
143
+ * response is the effective inclusive range; clients that paginate under
144
+ * live load should pin `toBlock` from the first page.
142
145
  */
143
146
  getTransactionsByAddress(address: string, options?: {
144
- fromBlock?: number;
145
- toBlock?: number;
147
+ fromBlock?: ShellBlockRangeBound;
148
+ toBlock?: ShellBlockRangeBound;
146
149
  page?: number;
147
150
  limit?: number;
148
- }): Promise<unknown>;
151
+ }): Promise<ShellTxByAddressPage>;
149
152
  /**
150
153
  * Fetch all transaction receipts for a block.
151
154
  *
@@ -154,7 +157,7 @@ export declare class ShellProvider {
154
157
  * @param block - Block identifier: `"latest"`, `"earliest"`, or a hex block number.
155
158
  * @returns Array of transaction receipt objects.
156
159
  */
157
- getBlockReceipts(block: string): Promise<unknown[]>;
160
+ getBlockReceipts(block: string): Promise<ShellRpcReceipt[]>;
158
161
  /**
159
162
  * Fetch metadata about the connected Shell Chain node.
160
163
  *
package/dist/provider.js CHANGED
@@ -115,7 +115,9 @@ export class ShellProvider {
115
115
  * @param options.toBlock - End of block range (inclusive).
116
116
  * @param options.page - Zero-based page index.
117
117
  * @param options.limit - Maximum number of results per page.
118
- * @returns Raw paginated response from the node.
118
+ * @returns Paginated response from the node. `fromBlock`/`toBlock` in the
119
+ * response is the effective inclusive range; clients that paginate under
120
+ * live load should pin `toBlock` from the first page.
119
121
  */
120
122
  async getTransactionsByAddress(address, options = {}) {
121
123
  return this.request("shell_getTransactionsByAddress", [
package/dist/types.d.ts CHANGED
@@ -237,6 +237,109 @@ export interface SignedShellTransaction {
237
237
  */
238
238
  aa_bundle?: AaBundle | null;
239
239
  }
240
+ /** Product-level transaction kind emitted by Shell Chain RPC. */
241
+ export type ShellKnownRpcTxType = "transfer" | "contractCreate" | "contractCall" | "aaBatch" | "blockGasReward" | "starkReward";
242
+ export type ShellRpcTxType = ShellKnownRpcTxType | (string & {});
243
+ /** Reward kind emitted for first-class system reward transactions. */
244
+ export type ShellRewardKind = "blockGasReward" | "starkReward";
245
+ /** Human-readable transaction label for wallets, explorers, and apps. */
246
+ export type ShellReadableTxType = "Transfer" | "Contract Create" | "Contract Call" | "AA Batch" | "Block Reward" | "STARK Reward" | "System" | "Transaction";
247
+ /**
248
+ * Decoded proof amendment payload for `starkReward` settlement transactions.
249
+ *
250
+ * Populated by the node when `system_tx_to_rpc` decodes the `StarkReward`
251
+ * proof payload; `null` for non-settlement or non-StarkReward transactions.
252
+ */
253
+ export interface ShellDecodedProofInput {
254
+ /** STARK compression layer (1 = L1, 2 = L2, …). */
255
+ layer: number;
256
+ /** Terminal block number of the proof range. */
257
+ blockNumber: number;
258
+ /** First block number in the proof range. */
259
+ startBlock: number;
260
+ /** Last block number in the proof range (= blockNumber). */
261
+ endBlock: number;
262
+ /** Number of transaction entries (signatures) compressed. */
263
+ nSigs: number;
264
+ /** Size of the stored proof in bytes. */
265
+ compressedSize: number;
266
+ /** Original (pre-compression) witness size in bytes. */
267
+ originalSize: number;
268
+ /** Hash of the settlement transaction that carried this proof, if finalized. */
269
+ settlementTxHash?: HexString | null;
270
+ }
271
+ /** Shell Chain `eth_getTransactionByHash` transaction shape. */
272
+ export interface ShellRpcTransaction {
273
+ hash: HexString;
274
+ blockHash?: HexString | null;
275
+ blockNumber?: HexString | null;
276
+ transactionIndex?: HexString | null;
277
+ from: AddressLike;
278
+ to?: AddressLike | null;
279
+ value: HexString;
280
+ gas: HexString;
281
+ gasPrice: HexString;
282
+ maxFeePerGas?: HexString;
283
+ maxPriorityFeePerGas?: HexString;
284
+ nonce: HexString;
285
+ input: HexString;
286
+ chainId: HexString;
287
+ type: HexString;
288
+ shellType?: ShellRpcTxType | null;
289
+ rewardKind?: ShellRewardKind | null;
290
+ rewardLayer?: HexString | null;
291
+ rewardSourceHash?: HexString | null;
292
+ originalSize?: HexString | null;
293
+ compressedSize?: HexString | null;
294
+ /** Decoded proof payload for `starkReward` settlement transactions (v0.22+). */
295
+ decodedInput?: ShellDecodedProofInput | null;
296
+ }
297
+ /** Shell Chain transaction summary returned in block/address transaction lists. */
298
+ export interface ShellRpcTransactionSummary {
299
+ hash: HexString;
300
+ blockHash?: HexString | null;
301
+ blockNumber?: HexString | null;
302
+ transactionIndex?: HexString | null;
303
+ from?: AddressLike;
304
+ to?: AddressLike | null;
305
+ value?: HexString;
306
+ type?: HexString;
307
+ hasInput?: boolean;
308
+ shellType?: ShellRpcTxType | null;
309
+ rewardKind?: ShellRewardKind | null;
310
+ rewardLayer?: HexString | null;
311
+ rewardSourceHash?: HexString | null;
312
+ originalSize?: HexString | null;
313
+ compressedSize?: HexString | null;
314
+ }
315
+ /** Shell Chain transaction receipt shape, including system reward metadata. */
316
+ export interface ShellRpcReceipt {
317
+ transactionHash: HexString;
318
+ blockHash: HexString;
319
+ blockNumber: HexString;
320
+ transactionIndex: HexString;
321
+ from: AddressLike;
322
+ to?: AddressLike | null;
323
+ status: HexString;
324
+ gasUsed: HexString;
325
+ cumulativeGasUsed: HexString;
326
+ effectiveGasPrice: HexString;
327
+ contractAddress?: AddressLike | null;
328
+ logs: unknown[];
329
+ logsBloom: HexString;
330
+ type: HexString;
331
+ shellType?: ShellRpcTxType | null;
332
+ rewardKind?: ShellRewardKind | null;
333
+ }
334
+ /** Return a user-facing transaction type label without leaking EIP wire labels. */
335
+ export declare function formatShellRpcTxType(tx: {
336
+ type?: string | null;
337
+ to?: AddressLike | null;
338
+ hasInput?: boolean;
339
+ input?: string | null;
340
+ shellType?: ShellRpcTxType | null;
341
+ rewardKind?: ShellRewardKind | null;
342
+ }): ShellReadableTxType;
240
343
  /**
241
344
  * A single inner call entry in a `shell_estimateBatch` request.
242
345
  */
@@ -399,10 +502,18 @@ export interface ShellWitnessBundle {
399
502
  /** Paginated response from `shell_getTransactionsByAddress`. */
400
503
  export interface ShellTxByAddressPage {
401
504
  address: AddressLike;
505
+ /** Inclusive lower block bound used for the query, hex-encoded. */
506
+ from_block?: HexString;
507
+ /** Inclusive upper block snapshot used for the query, hex-encoded. */
508
+ to_block?: HexString;
509
+ /** Inclusive lower block bound used for the query, hex-encoded. */
510
+ fromBlock?: HexString;
511
+ /** Inclusive upper block snapshot used for the query, hex-encoded. */
512
+ toBlock?: HexString;
402
513
  page: number;
403
514
  limit: number;
404
515
  total: number;
405
- transactions: unknown[];
516
+ transactions: ShellRpcTransactionSummary[];
406
517
  }
407
518
  /** Parameters for `shell_sendTransaction`. */
408
519
  export interface ShellSendTransactionParams {
package/dist/types.js CHANGED
@@ -23,3 +23,36 @@ export const AA_MAX_PAYMASTER_CONTEXT = 256;
23
23
  * Added to intrinsic gas when a session key is used.
24
24
  */
25
25
  export const AA_SESSION_KEY_GAS_SURCHARGE = 20_000;
26
+ /** Return a user-facing transaction type label without leaking EIP wire labels. */
27
+ export function formatShellRpcTxType(tx) {
28
+ const shellType = tx.shellType ?? tx.rewardKind;
29
+ if (shellType === "blockGasReward")
30
+ return "Block Reward";
31
+ if (shellType === "starkReward")
32
+ return "STARK Reward";
33
+ if (shellType === "aaBatch")
34
+ return "AA Batch";
35
+ if (shellType === "contractCreate")
36
+ return "Contract Create";
37
+ if (shellType === "contractCall")
38
+ return "Contract Call";
39
+ if (shellType === "transfer")
40
+ return "Transfer";
41
+ if (shellType)
42
+ return "System";
43
+ if (tx.type === "0x7e")
44
+ return "AA Batch";
45
+ if (tx.to === null)
46
+ return "Contract Create";
47
+ if (tx.hasInput || (tx.input && tx.input !== "0x"))
48
+ return "Contract Call";
49
+ if (tx.type === "0x80")
50
+ return "System";
51
+ if (tx.type == null &&
52
+ tx.to === undefined &&
53
+ tx.hasInput === undefined &&
54
+ tx.input === undefined) {
55
+ return "Transaction";
56
+ }
57
+ return "Transfer";
58
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "shell-sdk",
3
- "version": "0.7.0",
3
+ "version": "0.8.0",
4
4
  "description": "TypeScript SDK for Shell Chain — build quantum-safe dApps before Q-Day.",
5
5
  "license": "MIT",
6
6
  "type": "module",