Skip to content

Conversation

@ameya-deshmukh
Copy link
Collaborator

@ameya-deshmukh ameya-deshmukh commented Dec 17, 2025

Note

Adds SRC20 ABIs, directory key utilities, and event-watching actions (public/wallet) with decryption, integrated into clients and exports; bumps seismic-viem to 1.0.54.

  • seismic-viem (core):
    • ABIs: Add @sviem/abis/src20.ts and @sviem/abis/directory.ts (with DIRECTORY_ADDRESS).
    • SRC20 Actions:
      • Public: watchSRC20EventsWithKey via src20PublicActions.
      • Wallet: watchSRC20Events via src20WalletActions.
      • Event decryption using AES (filters by encryptKeyHash).
    • Directory Helpers: checkRegistration, getKeyHash, getKey (signed read), registerKey (timeout), computeKeyHash.
    • Crypto Util: parseEncryptedData for ciphertext/nonce parsing.
    • Client Integration: Extend ShieldedPublicClient/ShieldedWalletClient with SRC20 actions; wire into createShieldedPublicClient and getSeismicClients.
    • Exports: Re-export SRC20 actions/types, directory helpers, and ABIs from src/index.ts.
    • Version: Bump seismic-viem to 1.0.54.

Written by Cursor Bugbot for commit a40154a. This will update automatically on new commits. Configure here.

Copy link

@cursor cursor bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This PR is being reviewed by Cursor Bugbot

Details

Your team is on the Bugbot Free tier. On this plan, Bugbot will review limited PRs each billing cycle for each member of your team.

To receive Bugbot reviews on all of your PRs, visit the Cursor dashboard to activate Pro and start your 14-day free trial.

@ameya-deshmukh ameya-deshmukh merged commit 3264df1 into main Dec 18, 2025
5 checks passed
@ameya-deshmukh ameya-deshmukh deleted the ameya/src20-listener branch December 18, 2025 19:12
to: log.args.to as Address,
encryptKeyHash: log.args.encryptKeyHash as Hex,
encryptedAmount: log.args.encryptedAmount as Hex,
decryptedAmount: BigInt(decryptedAmount),
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bug: BigInt('0x') throws SyntaxError for empty decrypted data

When aesCipher.decrypt returns '0x' for empty ciphertext, calling BigInt(decryptedAmount) throws a SyntaxError because '0x' is not a valid BigInt literal—it requires at least one digit after the prefix like '0x0'. This can occur if the encrypted data contains only a nonce with no ciphertext, causing parseEncryptedData to return an empty ciphertext. The error is caught and passed to onError, but a zero amount should return 0n rather than triggering an error callback.

Additional Locations (1)

Fix in Cursor Fix in Web

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants