Skip to content

feat: add batchStakingBuilder (bond and nominate) and bondExtraBuilder #6126

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

abhijit0943
Copy link
Contributor

@abhijit0943 abhijit0943 commented May 14, 2025

TICKET: SC-1826

@abhijit0943 abhijit0943 force-pushed the SC-1826 branch 3 times, most recently from 0691236 to 648f74d Compare May 15, 2025 06:28
@abhijit0943 abhijit0943 changed the title feat: add stake flow (stakingBuilder- bond and bondExtra) for polyx feat: add batchBuilder (bond and nominate) and bondExtraBuilder May 15, 2025
@abhijit0943 abhijit0943 force-pushed the SC-1826 branch 4 times, most recently from c78e900 to 19b1b23 Compare May 15, 2025 11:20
protected _validators: string[] = [];

// Batch control
protected _atomic = true; // Default to batchAll (atomic)
Copy link
Contributor

Choose a reason for hiding this comment

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

We will always set this to true right?
If so we can remove

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sure, I'll force atomic

Comment on lines 5 to 8
amount?: string;
controller?: string;
payee?: string | { Account: string };
validators?: string[];
Copy link
Contributor

Choose a reason for hiding this comment

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

Why optional?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

👍, will edit

const calls: string[] = [];

// Add bond call if amount is set
if (this._amount) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Amount and validator are always required

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, will implement by forcing atomic

import { BatchArgs, BondArgs, NominateArgs } from './iface';
import BigNumber from 'bignumber.js';

export class BatchBuilder extends TransactionBuilder {
Copy link
Contributor

Choose a reason for hiding this comment

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

This will be used for stake and unstake batch?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

We could use another batch builder for unstake, will rename this

@abhijit0943 abhijit0943 changed the title feat: add batchBuilder (bond and nominate) and bondExtraBuilder feat: add batchStakingBuilder (bond and nominate) and bondExtraBuilder May 15, 2025
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