Skip to content

Conversation

@carlosala
Copy link
Member

No description provided.

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR adds comprehensive type definitions for statement submission results and updates the submit method to return detailed result information instead of void. The implementation includes backward compatibility handling for older API versions that returned undefined for successful submissions.

Key Changes:

  • Introduces SubmitResult discriminated union type covering all possible submission outcomes (new, known, rejected, invalid)
  • Updates the submit method signature to return Promise<SubmitResult> instead of Promise<void>
  • Implements backward compatibility logic to handle API responses from versions prior to polkadot-sdk PR #10421

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 4 comments.

File Description
packages/sdk-statement/src/types.ts Defines comprehensive SubmitResult type with discriminated unions for all possible submission outcomes including detailed rejection and validation failure reasons
packages/sdk-statement/src/statement-sdk.ts Updates submit method return type to SubmitResult and adds backward compatibility handling for older API responses
packages/sdk-statement/src/api.ts Updates internal API type signature to reflect optional SubmitResult return type

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link

Copilot AI commented Dec 5, 2025

@carlosala I've opened a new pull request, #52, to work on those changes. Once the pull request is ready, I'll request review from you.

Co-authored-by: carlosala <[email protected]>
Co-authored-by: copilot-swe-agent[bot] <[email protected]>
@carlosala carlosala merged commit a1cecdd into main Dec 16, 2025
1 check passed
@carlosala carlosala deleted the cs-statement branch December 16, 2025 15:08
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