Skip to content

Commit

Permalink
Adding withdrawMultipleDelegationRewards to distribution precompile (#…
Browse files Browse the repository at this point in the history
…182)

* add withdrawMultipleDelegationRewards to distribution precompile

* changeset
  • Loading branch information
dssei committed Jun 4, 2024
1 parent fe6ca90 commit 2d0ab5e
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 4 deletions.
5 changes: 5 additions & 0 deletions .changeset/gentle-singers-run.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@sei-js/evm": minor
---

add withdrawMultipleDelegationRewards method to distribution precompile
7 changes: 4 additions & 3 deletions packages/evm/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -145,10 +145,11 @@ The Distribution precompile contract facilitates operations related to rewards w

#### Functions

| Function Name | Input Parameters | Return Value | Description |
|---------------------------------------------------------------------------------------------------------------------------|------------------------------|------------------------|-----------------------------------------------------|
| [`setWithdrawAddress`](/sei-js/docs/interfaces/evm.DistributionPrecompileFunctions.html#setWithdrawAddress) | `withdrawAddress: ` `string` | `{ success: boolean }` | Sets the withdrawal address for rewards. |
| Function Name | Input Parameters | Return Value | Description |
|--------------------------------------------------------------------------------------------------|------------------------------|------------------------|-----------------------------------------------------|
| [`setWithdrawAddress`](/sei-js/docs/interfaces/evm.DistributionPrecompileFunctions.html#setWithdrawAddress) | `withdrawAddress: ` `string` | `{ success: boolean }` | Sets the withdrawal address for rewards. |
| [`withdrawDelegationRewards`](/sei-js/docs/interfaces/evm.DistributionPrecompileFunctions.html#withdrawDelegationRewards) | `validator: ` `string` | `{ success: boolean }` | Withdraws delegation rewards for a given validator. |
| [`withdrawMultipleDelegationRewards`](/sei-js/docs/interfaces/evm.DistributionPrecompileFunctions.html#withdrawMultipleDelegationRewards) | `validators: ` `string[]` | `{ success: boolean }` | Withdraws delegation rewards for given validators. |

#### Precompile Addresses
0x0000000000000000000000000000000000001007
Expand Down
16 changes: 15 additions & 1 deletion packages/evm/src/precompiles/distribution.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,13 @@ export interface DistributionPrecompileFunctions {
* @category Cosmos Interoperability
*/
withdrawDelegationRewards(validator: string): Promise<{ success: boolean }>;
/**
* Withdraws delegation rewards for a given validators.
* @param validators The validators for which to withdraw delegation rewards.
* @returns A Promise resolving to an object indicating the success of the transaction.
* @category Cosmos Interoperability
*/
withdrawMultipleDelegationRewards(validators: string[]): Promise<{ success: boolean }>;
}

/** Represents the typed contract instance for the DISTRIBUTION precompile contract.
Expand Down Expand Up @@ -112,7 +119,14 @@ export const DISTRIBUTION_PRECOMPILE_ABI: Abi = [
outputs: [{ internalType: 'bool', name: 'success', type: 'bool' }],
stateMutability: 'nonpayable',
type: 'function'
}
},
{
inputs: [{ internalType: 'string[]', name: 'validators', type: 'string[]' }],
name: 'withdrawMultipleDelegationRewards',
outputs: [{ internalType: 'bool', name: 'success', type: 'bool' }],
stateMutability: 'nonpayable',
type: 'function'
}
];

/**
Expand Down

0 comments on commit 2d0ab5e

Please sign in to comment.