shell-sdk 0.8.0 → 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 CHANGED
@@ -1,5 +1,10 @@
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
+
3
8
  ## [0.8.0] — 2026-05-06
4
9
 
5
10
  ### Added
package/dist/signer.js CHANGED
@@ -127,7 +127,7 @@ export class ShellSigner {
127
127
  signature,
128
128
  signatureType: this.signatureType,
129
129
  senderPubkey: options.includePublicKey ? this.getPublicKey() : undefined,
130
- aaBbundle: options.aaBundle,
130
+ aaBundle: options.aaBundle,
131
131
  });
132
132
  }
133
133
  }
@@ -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: 21_000 }],
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 });
@@ -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: 21_000 }],
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: number;
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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "shell-sdk",
3
- "version": "0.8.0",
3
+ "version": "0.8.1",
4
4
  "description": "TypeScript SDK for Shell Chain — build quantum-safe dApps before Q-Day.",
5
5
  "license": "MIT",
6
6
  "type": "module",