Skip to content
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

support StakingAccountActions & StakingAccountQueries in LocalOrchestrationAccount #10048

Open
6 tasks
0xpatrickdev opened this issue Sep 9, 2024 · 0 comments
Open
6 tasks
Labels
enhancement New feature or request

Comments

@0xpatrickdev
Copy link
Member

0xpatrickdev commented Sep 9, 2024

What is the Problem Being Solved?

External CosmosOrchestrationAccount supports the StakingAccountActions and StakingAccountQueries interfaces.

export interface StakingAccountActions {
/**
* Delegate an amount to a validator. The promise settles when the delegation is complete.
* @param validator - the validator to delegate to
* @param amount - the amount to delegate
* @returns void
*/
delegate: (
validator: CosmosValidatorAddress,
amount: AmountArg,
) => Promise<void>;
/**
* Redelegate from one delegator to another.
* Settles when the redelegation is established, not 21 days later.
* @param srcValidator - the current validator for the delegation.
* @param dstValidator - the validator that will receive the delegation.
* @param amount - how much to redelegate.
* @returns
*/
redelegate: (
srcValidator: CosmosValidatorAddress,
dstValidator: CosmosValidatorAddress,
amount: AmountArg,
) => Promise<void>;
/**
* Undelegate multiple delegations (concurrently). To delegate independently, pass an array with one item.
* Resolves when the undelegation is complete and the tokens are no longer bonded. Note it may take weeks.
* The unbonding time is padded by 10 minutes to account for clock skew.
* @param delegations - the delegation to undelegate
*/
undelegate: (
delegations: Omit<Delegation, 'delegatorAddress'>[],
) => Promise<void>;
/**
* Withdraw rewards from all validators. The promise settles when the rewards are withdrawn.
* @returns The total amounts of rewards withdrawn
*/
withdrawRewards: () => Promise<DenomAmount[]>;
/**
* Withdraw rewards from a specific validator. The promise settles when the rewards are withdrawn.
* @param validator - the validator to withdraw rewards from
* @returns
*/
withdrawReward: (validator: CosmosValidatorAddress) => Promise<DenomAmount[]>;
}

  1. LocalOrchestrationAccount presents a different interface for delegate and undelegate - it currently takes (string, ertpAmount) instead of (ChainAddress, AmountArg)

  2. There is incongruity between undelegate and delegate/redelegate in the StakingActions interface - the former takes an array of delegations while the latter two only accept a single delegation.

  3. Some StakingActions have yet to be implemented in LocalOrchestrationAccount.

Unification Tasks

Completeness Tasks

Description of the Design

Security Considerations

Scaling Considerations

Test Plan

Upgrade Considerations

@0xpatrickdev 0xpatrickdev added the enhancement New feature or request label Sep 9, 2024
@turadg turadg changed the title Orchestration - unify StakingActions methods support StakingAccountActions & StakingAccountQueries in LocalOrchestrationAccount Sep 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant