Skip to content

Conversation

Copy link

Copilot AI commented Dec 5, 2025

The SubmitResult type was defined and used internally but not exported, preventing consumers from properly typing the submit method's return value.

Changes

  • Export SubmitResult type from src/index.ts following the pattern used in other SDK packages (e.g., sdk-multisig)

Usage

import { createStatementSdk, type SubmitResult } from '@polkadot-api/sdk-statement'

const sdk = createStatementSdk(client)
const result: SubmitResult = await sdk.submit(statement)

// Type-safe handling of different result statuses
if (result.status === 'rejected') {
  console.log(`Rejected: ${result.reason}`)
}

✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Co-authored-by: carlosala <66907184+carlosala@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix statement return results submission support feedback Export SubmitResult type from sdk-statement Dec 5, 2025
Copilot AI requested a review from carlosala December 5, 2025 11:26
@carlosala
Copy link
Member

5min to add a single line, we need to improve there @copilot 😅

@carlosala carlosala marked this pull request as ready for review December 5, 2025 11:27
Copilot AI review requested due to automatic review settings December 5, 2025 11:27
@carlosala carlosala merged commit 618f356 into cs-statement Dec 5, 2025
4 of 5 checks passed
@carlosala carlosala deleted the copilot/sub-pr-51 branch December 5, 2025 11:27
Copilot AI requested a review from carlosala December 5, 2025 11:28
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 addresses a missing type export by adding SubmitResult to the public API of @polkadot-api/sdk-statement. The SubmitResult type is returned by the submit method of the SDK but was previously not exported, preventing consumers from properly typing their code.

  • Exports the SubmitResult type from the package's main index file
  • Follows the established pattern used in other SDK packages (e.g., sdk-multisig, sdk-ink)
  • Enables type-safe handling of submit method responses with their various status variants (new, known, rejected, invalid)

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

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