Skip to content

v1.4.4

Latest

Choose a tag to compare

@yingyangxu2026 yingyangxu2026 released this 02 Mar 05:51
· 1 commit to main since this release
f4e1d7e

TypeScript SDK v1.4.4 Release Notes

This patch release adds Account Abstraction (AA) wallet support via an optional txHashResolver, chain-based currency token validation (Mainnet: WIP only; Aeneid: WIP or MERC20), and a new getNFTBalance API on NftClient. It also includes dispute settlement retry logic and CI/test stability improvements.

Key Changes

Account Abstraction (AA) Wallet Support — txHashResolver (#695)

When using AA wallets (e.g. ZeroDev, Dynamic Global Wallet), writeContract may return a UserOperation hash instead of a standard transaction hash. The SDK's waitForTransactionReceipt only accepts on-chain transaction hashes, which caused AA wallet transactions to fail or hang.

A new optional txHashResolver parameter can be passed when creating a StoryClient. This function resolves UserOperation hashes into on-chain transaction hashes before the SDK waits for receipts. The resolver is applied transparently — all existing SDK methods work without any changes.

Supported factory methods: StoryClient.newClient, StoryClient.newClientUseWallet, StoryClient.newClientUseAccount.

Normal wallets — no changes needed:

const client = StoryClient.newClient({
  transport: http("https://aeneid.storyrpc.io"),
  account: privateKeyToAccount("0x..."),
});

ZeroDev — Kernel Client (recommended; txHashResolver not needed):

const kernelClient = await createKernelAccountClient({ /* ... */ });
const client = StoryClient.newClientUseWallet({
  transport: http("https://aeneid.storyrpc.io"),
  wallet: kernelClient,
});

Raw UserOp wallet + txHashResolver:

const client = StoryClient.newClientUseWallet({
  transport: http("https://aeneid.storyrpc.io"),
  wallet: rawAAWallet,
  txHashResolver: async (userOpHash) => {
    const receipt = await bundlerClient.waitForUserOperationReceipt({ hash: userOpHash });
    return receipt.receipt.transactionHash;
  },
});

Restrict currency / currencyToken by chain (#701)

The SDK now validates that the currency token is allowed for the connected chain before using it in license terms, registration, and group (royalty/reward) flows.

  • Mainnet (1514): only WIP is allowed as currency token.
  • Aeneid Testnet (1315): WIP or MERC20 is allowed.

Validation is applied in: PIL flavor helpers, license terms registration, IP asset registration with license terms, and Group module methods that accept a currency/token (payRoyaltyOnBehalf, claimReward, getClaimableReward, collectingRoyalties). If an invalid token is used, the SDK throws with a clear error (e.g. "On Mainnet, only WIP is allowed as currency token.").

getNFTBalance on NftClient (#698)

Added getNFTBalance to query the number of NFTs owned by an address in a specific SPG NFT collection. If owner is omitted, the connected wallet address is used.

const balance = await client.nftClient.getNFTBalance({
  spgNftContract: "0x...",
  owner: "0x...", // optional; defaults to wallet
});
// balance: bigint

Fixes

  • Dispute — "Assertion not expired": settleAssertion() in oov3.ts now retries up to 5 times (3s delay) when the assertion liveness period has not yet elapsed, instead of failing immediately. Integration test wait after dispute increased from 3s to 15s for testnet block times.
  • Group tests — "receiver IP not registered": Added this.retries(2) to collect royalties, get claimable reward, and claim reward tests to handle nonce contention from shared test wallet.
  • IP Asset test — "replacement transaction underpriced": Added this.retries(2) to the batch register test to avoid nonce collision with pending transactions.

Other Changes

  • CI: .github/workflows/pr-internal.yml — added paths-ignore for docs/markdown so PRs that only touch docs don't run full CI; switched to secrets: inherit so all repository secrets (e.g. BUNDLER_RPC_URL) are forwarded to the reusable workflow.
  • Pre-commit: Husky pre-commit hook runs pnpm run lint and pnpm run typecheck (#700).
  • Tests: Unit tests for txHashResolver and validateCurrencyToken; integration tests for ZeroDev E2E (kernel client and raw userOp + resolver). ZeroDev E2E tests are skipped when BUNDLER_RPC_URL and WALLET_PRIVATE_KEY are not set in .env.