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

[SOF-2886] add cosmos chains restake-rewards functions #88

Merged
merged 2 commits into from
Feb 1, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 23 additions & 0 deletions src/services/atom.ts
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,29 @@ export class AtomService extends Service {

}

/**
* Craft atom restake rewards transaction
* @param pubkey wallet pubkey, this is different from the wallet address
* @param validatorAccount validator account address (wallet controlling the validator)
* @param validatorAddress validator address to which the delegation has been made
*/
async craftRestakeRewardsTx(
pubkey: string,
validatorAccount: string,
validatorAddress: string,
): Promise<CosmosTx> {

const { data } = await api.post<CosmosTx>(
`/v1/atom/transaction/restake-rewards`,
{
pubkey: pubkey,
validator_account: validatorAccount,
validator_address: validatorAddress,
});
return data;

}

/**
* Craft atom unstaking transaction
* @param pubkey wallet pubkey, this is different from the wallet address
Expand Down
23 changes: 23 additions & 0 deletions src/services/osmo.ts
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,29 @@ export class OsmoService extends Service {

}

/**
* Craft osmo restake rewards transaction
* @param pubkey wallet pubkey, this is different from the wallet address
* @param validatorAccount validator account address (wallet controlling the validator)
* @param validatorAddress validator address to which the delegation has been made
*/
async craftRestakeRewardsTx(
pubkey: string,
validatorAccount: string,
validatorAddress: string,
): Promise<CosmosTx> {

const { data } = await api.post<CosmosTx>(
`/v1/osmo/transaction/restake-rewards`,
{
pubkey: pubkey,
validator_account: validatorAccount,
validator_address: validatorAddress,
});
return data;

}

/**
* Craft osmo unstaking transaction
* @param pubkey wallet pubkey, this is different from the wallet address
Expand Down
23 changes: 23 additions & 0 deletions src/services/tia.ts
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,29 @@ export class TiaService extends Service {

}

/**
* Craft tia restake rewards transaction
* @param pubkey wallet pubkey, this is different from the wallet address
* @param validatorAccount validator account address (wallet controlling the validator)
* @param validatorAddress validator address to which the delegation has been made
*/
async craftRestakeRewardsTx(
pubkey: string,
validatorAccount: string,
validatorAddress: string,
): Promise<CosmosTx> {

const { data } = await api.post<CosmosTx>(
`/v1/tia/transaction/restake-rewards`,
{
pubkey: pubkey,
validator_account: validatorAccount,
validator_address: validatorAddress,
});
return data;

}

/**
* Craft tia unstaking transaction
* @param pubkey wallet pubkey, this is different from the wallet address
Expand Down
Loading