shell-sdk 0.7.1 → 0.8.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 +19 -0
- package/dist/index.d.ts +1 -1
- package/dist/signer.js +1 -1
- package/dist/transactions.d.ts +3 -1
- package/dist/transactions.js +14 -4
- package/dist/types.d.ts +35 -2
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,24 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [0.8.1] — 2026-05-10
|
|
4
|
+
|
|
5
|
+
### Changed
|
|
6
|
+
- Version bump for the next coordinated ShellDAO release cut.
|
|
7
|
+
|
|
8
|
+
## [0.8.0] — 2026-05-06
|
|
9
|
+
|
|
10
|
+
### Added
|
|
11
|
+
- `ShellDecodedProofInput` type: structured proof amendment payload decoded
|
|
12
|
+
from `starkReward` settlement transactions (requires `shell-chain v0.22+`).
|
|
13
|
+
Fields: `layer`, `blockNumber`, `startBlock`, `endBlock`, `nSigs`,
|
|
14
|
+
`compressedSize`, `originalSize`, `settlementTxHash`.
|
|
15
|
+
- `ShellRpcTransaction.decodedInput?: ShellDecodedProofInput | null` — filled
|
|
16
|
+
by the node for `starkReward` system transactions; `null`/absent otherwise.
|
|
17
|
+
- `ShellDecodedProofInput` exported from the package root.
|
|
18
|
+
|
|
19
|
+
### Changed
|
|
20
|
+
- Aligned with `shell-chain v0.22.0` RPC surface.
|
|
21
|
+
|
|
3
22
|
## [0.7.1] — 2026-05-06
|
|
4
23
|
|
|
5
24
|
### Added
|
package/dist/index.d.ts
CHANGED
|
@@ -7,4 +7,4 @@ export { adapterFromKeyPair, generateAdapter, generateMlDsa65KeyPair, generateSl
|
|
|
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
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, ShellSendTransactionParams, ShellSignature, ShellStorageProfile, ShellTransactionRequest, ShellTxByAddressPage, ShellTxWitness, ShellWitnessBundle, ShellWitnessRootResult, SignedShellTransaction, SignatureTypeName, } 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/signer.js
CHANGED
package/dist/transactions.d.ts
CHANGED
|
@@ -51,6 +51,8 @@ export interface BuildSignedTransactionOptions {
|
|
|
51
51
|
/** Optional public key bytes to embed as `sender_pubkey`. */
|
|
52
52
|
senderPubkey?: Uint8Array | number[];
|
|
53
53
|
/** AA bundle to attach when `tx.tx_type === AA_BUNDLE_TX_TYPE`. */
|
|
54
|
+
aaBundle?: AaBundle;
|
|
55
|
+
/** @deprecated Use {@link aaBundle} (typo alias kept for backward compatibility). */
|
|
54
56
|
aaBbundle?: AaBundle;
|
|
55
57
|
}
|
|
56
58
|
/**
|
|
@@ -266,7 +268,7 @@ export declare const DEFAULT_AA_GAS_LIMIT = 200000;
|
|
|
266
268
|
* const { tx, aa_bundle } = buildBatchTransaction({
|
|
267
269
|
* chainId: 424242,
|
|
268
270
|
* nonce: 0,
|
|
269
|
-
* innerCalls: [{ to: "pq1recipient…", value: "0x3e8", data: "0x", gas_limit:
|
|
271
|
+
* innerCalls: [{ to: "pq1recipient…", value: "0x3e8", data: "0x", gas_limit: "0x5208" }],
|
|
270
272
|
* });
|
|
271
273
|
* const signingHash = hashBatchTransaction(tx, aa_bundle);
|
|
272
274
|
* const signed = await signer.buildSignedTransaction({ tx, txHash: signingHash, aaBundle: aa_bundle });
|
package/dist/transactions.js
CHANGED
|
@@ -210,7 +210,7 @@ export function buildSignedTransaction(options) {
|
|
|
210
210
|
tx: options.tx,
|
|
211
211
|
signature: buildSignature(options.signatureType, options.signature),
|
|
212
212
|
sender_pubkey: options.senderPubkey ? toByteArray(options.senderPubkey) : null,
|
|
213
|
-
aa_bundle: options.aaBbundle ?? null,
|
|
213
|
+
aa_bundle: options.aaBundle ?? options.aaBbundle ?? null,
|
|
214
214
|
};
|
|
215
215
|
}
|
|
216
216
|
/**
|
|
@@ -291,7 +291,7 @@ export const DEFAULT_AA_GAS_LIMIT = 200_000;
|
|
|
291
291
|
* const { tx, aa_bundle } = buildBatchTransaction({
|
|
292
292
|
* chainId: 424242,
|
|
293
293
|
* nonce: 0,
|
|
294
|
-
* innerCalls: [{ to: "pq1recipient…", value: "0x3e8", data: "0x", gas_limit:
|
|
294
|
+
* innerCalls: [{ to: "pq1recipient…", value: "0x3e8", data: "0x", gas_limit: "0x5208" }],
|
|
295
295
|
* });
|
|
296
296
|
* const signingHash = hashBatchTransaction(tx, aa_bundle);
|
|
297
297
|
* const signed = await signer.buildSignedTransaction({ tx, txHash: signingHash, aaBundle: aa_bundle });
|
|
@@ -406,6 +406,16 @@ export function hashBatchTransaction(tx, bundle) {
|
|
|
406
406
|
combined.set(bundleRlp, domainBuf.length + txRlp.length);
|
|
407
407
|
return hexToBytes(keccak256(bytesToHex(combined)));
|
|
408
408
|
}
|
|
409
|
+
/**
|
|
410
|
+
* Validate and encode a gas limit as a JSON-RPC hex quantity.
|
|
411
|
+
* Throws if `gasLimit` is not a non-negative safe integer.
|
|
412
|
+
*/
|
|
413
|
+
function toHexGasLimit(gasLimit) {
|
|
414
|
+
if (!Number.isSafeInteger(gasLimit) || gasLimit < 0) {
|
|
415
|
+
throw new RangeError(`gasLimit must be a non-negative safe integer, got: ${gasLimit}`);
|
|
416
|
+
}
|
|
417
|
+
return ("0x" + gasLimit.toString(16));
|
|
418
|
+
}
|
|
409
419
|
/**
|
|
410
420
|
* Convenience helper: build a minimal `AaInnerCall` for a SHELL token transfer.
|
|
411
421
|
*
|
|
@@ -415,7 +425,7 @@ export function hashBatchTransaction(tx, bundle) {
|
|
|
415
425
|
* @returns An `AaInnerCall` ready for use in {@link buildBatchTransaction}.
|
|
416
426
|
*/
|
|
417
427
|
export function buildInnerTransfer(to, value, gasLimit = 21_000) {
|
|
418
|
-
return { to, value: ("0x" + value.toString(16)), data: "0x", gas_limit: gasLimit };
|
|
428
|
+
return { to, value: ("0x" + value.toString(16)), data: "0x", gas_limit: toHexGasLimit(gasLimit) };
|
|
419
429
|
}
|
|
420
430
|
/**
|
|
421
431
|
* Convenience helper: build a contract-call `AaInnerCall`.
|
|
@@ -427,7 +437,7 @@ export function buildInnerTransfer(to, value, gasLimit = 21_000) {
|
|
|
427
437
|
* @returns An `AaInnerCall` ready for use in {@link buildBatchTransaction}.
|
|
428
438
|
*/
|
|
429
439
|
export function buildInnerCall(to, data, gasLimit, value = 0n) {
|
|
430
|
-
return { to, value: ("0x" + value.toString(16)), data, gas_limit: gasLimit };
|
|
440
|
+
return { to, value: ("0x" + value.toString(16)), data, gas_limit: toHexGasLimit(gasLimit) };
|
|
431
441
|
}
|
|
432
442
|
/**
|
|
433
443
|
* Build an AA batch transaction using a **contract paymaster** (Phase 2).
|
package/dist/types.d.ts
CHANGED
|
@@ -1,5 +1,12 @@
|
|
|
1
1
|
/** A `0x`-prefixed hex string, e.g. `"0xdeadbeef"`. */
|
|
2
2
|
export type HexString = `0x${string}`;
|
|
3
|
+
/**
|
|
4
|
+
* A `0x`-prefixed hex-encoded unsigned integer quantity (JSON-RPC "QUANTITY"
|
|
5
|
+
* type), e.g. `"0x0"`, `"0x5208"`. No leading zeros (except `"0x0"` itself).
|
|
6
|
+
* Assignable to `HexString`; use where the value is always a non-negative
|
|
7
|
+
* integer (gas limits, values, nonces).
|
|
8
|
+
*/
|
|
9
|
+
export type HexQuantity = HexString;
|
|
3
10
|
/** A `pq1…` bech32m address string (Shell Chain canonical address format). */
|
|
4
11
|
export type AddressLike = string;
|
|
5
12
|
/** A single entry in an EIP-2930 access list. */
|
|
@@ -82,8 +89,8 @@ export interface AaInnerCall {
|
|
|
82
89
|
value: HexString;
|
|
83
90
|
/** ABI-encoded calldata. */
|
|
84
91
|
data: HexString;
|
|
85
|
-
/** Gas limit for this inner call. */
|
|
86
|
-
gas_limit:
|
|
92
|
+
/** Gas limit for this inner call as a hex-quantity string (e.g. `"0x5208"` for 21 000). Must be a non-negative integer encoded per JSON-RPC QUANTITY rules. */
|
|
93
|
+
gas_limit: HexQuantity;
|
|
87
94
|
}
|
|
88
95
|
/**
|
|
89
96
|
* The AA bundle payload attached to a `tx_type = 0x7E` transaction.
|
|
@@ -244,6 +251,30 @@ export type ShellRpcTxType = ShellKnownRpcTxType | (string & {});
|
|
|
244
251
|
export type ShellRewardKind = "blockGasReward" | "starkReward";
|
|
245
252
|
/** Human-readable transaction label for wallets, explorers, and apps. */
|
|
246
253
|
export type ShellReadableTxType = "Transfer" | "Contract Create" | "Contract Call" | "AA Batch" | "Block Reward" | "STARK Reward" | "System" | "Transaction";
|
|
254
|
+
/**
|
|
255
|
+
* Decoded proof amendment payload for `starkReward` settlement transactions.
|
|
256
|
+
*
|
|
257
|
+
* Populated by the node when `system_tx_to_rpc` decodes the `StarkReward`
|
|
258
|
+
* proof payload; `null` for non-settlement or non-StarkReward transactions.
|
|
259
|
+
*/
|
|
260
|
+
export interface ShellDecodedProofInput {
|
|
261
|
+
/** STARK compression layer (1 = L1, 2 = L2, …). */
|
|
262
|
+
layer: number;
|
|
263
|
+
/** Terminal block number of the proof range. */
|
|
264
|
+
blockNumber: number;
|
|
265
|
+
/** First block number in the proof range. */
|
|
266
|
+
startBlock: number;
|
|
267
|
+
/** Last block number in the proof range (= blockNumber). */
|
|
268
|
+
endBlock: number;
|
|
269
|
+
/** Number of transaction entries (signatures) compressed. */
|
|
270
|
+
nSigs: number;
|
|
271
|
+
/** Size of the stored proof in bytes. */
|
|
272
|
+
compressedSize: number;
|
|
273
|
+
/** Original (pre-compression) witness size in bytes. */
|
|
274
|
+
originalSize: number;
|
|
275
|
+
/** Hash of the settlement transaction that carried this proof, if finalized. */
|
|
276
|
+
settlementTxHash?: HexString | null;
|
|
277
|
+
}
|
|
247
278
|
/** Shell Chain `eth_getTransactionByHash` transaction shape. */
|
|
248
279
|
export interface ShellRpcTransaction {
|
|
249
280
|
hash: HexString;
|
|
@@ -267,6 +298,8 @@ export interface ShellRpcTransaction {
|
|
|
267
298
|
rewardSourceHash?: HexString | null;
|
|
268
299
|
originalSize?: HexString | null;
|
|
269
300
|
compressedSize?: HexString | null;
|
|
301
|
+
/** Decoded proof payload for `starkReward` settlement transactions (v0.22+). */
|
|
302
|
+
decodedInput?: ShellDecodedProofInput | null;
|
|
270
303
|
}
|
|
271
304
|
/** Shell Chain transaction summary returned in block/address transaction lists. */
|
|
272
305
|
export interface ShellRpcTransactionSummary {
|