Skip to content

Tt 1214/transaction cancel#22

Merged
RishabhS7 merged 9 commits intomainfrom
TT-1214/transaction-cancel
Mar 9, 2026
Merged

Tt 1214/transaction cancel#22
RishabhS7 merged 9 commits intomainfrom
TT-1214/transaction-cancel

Conversation

@manishdex25
Copy link
Copy Markdown
Contributor

@manishdex25 manishdex25 commented Mar 3, 2026

Summary by CodeRabbit

  • New Features

    • Transaction command group with a cancel command (interactive and non‑interactive; cancel by hash or nonce+gas; EIP‑1559 aware).
    • Simplified OA encrypt/decrypt UX: encryption generates/displays a key; decryption accepts the hex key.
  • Documentation

    • Added Transaction section, command reference, examples, and updated wallet/key requirements and usage notes.
  • Tests

    • Added unit tests for transaction cancel and updated OA encrypt/decrypt tests.
  • Chores

    • Added sample decrypted document and updated package configuration for local linking.

@manishdex25 manishdex25 requested a review from RishabhS7 March 3, 2026 08:14
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Mar 3, 2026

Important

Review skipped

Review was skipped due to path filters

⛔ Files ignored due to path filters (1)
  • package-lock.json is excluded by !**/package-lock.json

CodeRabbit blocks several paths by default. You can override this behavior by explicitly including those paths in the path filters. For example, including **/dist/** will override the default block on the dist directory, by removing the pattern from both the lists.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Free

Run ID: d20e8138-8fd1-4f60-a98e-f13c720f8b41

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
📝 Walkthrough

Walkthrough

Adds a new CLI "transaction cancel" command (interactive and non-interactive), introduces a transaction command group, updates README docs for transactions and wallet/key behavior, changes OA encrypt/decrypt key handling, updates tests, adds decrypted.json, and points @trustvc/trustvc dependency to a local file path.

Changes

Cohort / File(s) Summary
Documentation & Manifest
README.md, package.json
Inserted Transaction docs and transaction cancel usage/details; README wallets/key prompts updated. package.json dependency @trustvc/trustvc changed from a registry version to file:../trustvc.
Transaction CLI
src/commands/transaction/index.ts, src/commands/transaction/cancel.ts
New transaction command group and cancel subcommand: yargs builder, interactive prompts and non-interactive CLI normalization, wallet resolution, call to cancelTransaction, logging including replacement tx hash and Etherscan link, and exported TransactionCancelCommand types/handlers.
OA encrypt/decrypt
src/commands/oa/encrypt.ts, src/commands/oa/decrypt.ts
Encrypt: switched to generated key returned from encryptString, removed prompting for password, write payload without embedding user key, and print key to user. Decrypt: removed key derivation, accept hex key directly (trimmed). Updated prompts, messages, and imports accordingly.
Tests
tests/commands/transaction/cancel.test.ts, tests/commands/oa/encrypt.test.ts, tests/commands/oa/decrypt.test.ts
Added transaction cancel unit tests; updated OA encrypt/decrypt tests to reflect generated-key flow and removal of key derivation, adjusting mocks and expectations.
Added data file
decrypted.json
New verifiable-credential-like JSON fixture added to repo (no trailing newline noted).

Sequence Diagram

sequenceDiagram
    participant User as User/CLI
    participant Cmd as Transaction Cancel Cmd
    participant Prompt as Prompter
    participant Wallet as Wallet Resolver
    participant TrustVC as TrustVC API
    participant Log as Logger

    User->>Cmd: invoke `trustvc transaction cancel` (args)
    Cmd->>Prompt: normalise args / promptForInputs()
    Prompt->>User: request transaction spec (hash or nonce+gas), network, wallet/key
    User-->>Prompt: provide inputs
    Prompt-->>Cmd: TransactionCancelCommand
    Cmd->>Wallet: getWalletOrSigner(network, wallet details)
    Wallet-->>Cmd: signer
    Cmd->>TrustVC: cancelTransaction(signer, {nonce, gasPrice} or {transactionHash})
    TrustVC-->>Cmd: replacementTxHash (optional)
    Cmd->>Log: log success, replacement hash, Etherscan URL
    Log-->>User: display results
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Poem

🐇 I nibbled prompts and chased a hash,
A cancel trick tucked in my stash.
Non‑interactive or asking your name,
I replace the pending, hop back to my game.
🥕

Tip

Try Coding Plans. Let us write the prompt for your AI agent so you can ship faster (with fewer bugs).
Share your feedback on Discord.


Note

🎁 Summarized by CodeRabbit Free

Your organization is on the Free plan. CodeRabbit will generate a high-level summary and a walkthrough for each pull request. For a comprehensive line-by-line review, please upgrade your subscription to CodeRabbit Pro by visiting https://app.coderabbit.ai/login.

Comment @coderabbitai help to get the list of available commands and usage tips.

@manishdex25 manishdex25 self-assigned this Mar 3, 2026
@RishabhS7 RishabhS7 merged commit 1c65be5 into main Mar 9, 2026
5 checks passed
@RishabhS7 RishabhS7 deleted the TT-1214/transaction-cancel branch March 9, 2026 07:06
@tradetrustimda
Copy link
Copy Markdown

🎉 This PR is included in version 1.0.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants