From d1355d993cc5558ef3ba9519481f95bf5d2e90f0 Mon Sep 17 00:00:00 2001 From: Daniel Dimitrov Date: Thu, 12 Sep 2024 17:08:39 +0200 Subject: [PATCH] feat: add staking claim types --- src/types/decoded-data.ts | 11 +++++++++++ src/types/transactions.ts | 14 ++++++++++++-- 2 files changed, 23 insertions(+), 2 deletions(-) diff --git a/src/types/decoded-data.ts b/src/types/decoded-data.ts index 7f3f82e8..5a174344 100644 --- a/src/types/decoded-data.ts +++ b/src/types/decoded-data.ts @@ -7,6 +7,7 @@ export enum ConfirmationViewTypes { COW_SWAP_TWAP_ORDER = 'COW_SWAP_TWAP_ORDER', KILN_NATIVE_STAKING_DEPOSIT = 'KILN_NATIVE_STAKING_DEPOSIT', KILN_NATIVE_STAKING_VALIDATORS_EXIT = 'KILN_NATIVE_STAKING_VALIDATORS_EXIT', + KILN_NATIVE_STAKING_WITHDRAW = 'KILN_NATIVE_STAKING_WITHDRAW', } export type DecodedDataRequest = { @@ -106,9 +107,18 @@ export type NativeStakingValidatorsExitConfirmationView = { tokenInfo: TokenInfo } & DecodedDataResponse +export type NativeStakingWithdrawConfirmationView = { + /** @enum {string} */ + type: ConfirmationViewTypes.KILN_NATIVE_STAKING_WITHDRAW + value: string + rewards: string + tokenInfo: TokenInfo +} & DecodedDataResponse + export type AnyStakingConfirmationView = | NativeStakingDepositConfirmationView | NativeStakingValidatorsExitConfirmationView + | NativeStakingWithdrawConfirmationView /* Union */ export type AnyConfirmationView = @@ -117,3 +127,4 @@ export type AnyConfirmationView = | TwapOrderConfirmationView | NativeStakingDepositConfirmationView | NativeStakingValidatorsExitConfirmationView + | NativeStakingWithdrawConfirmationView diff --git a/src/types/transactions.ts b/src/types/transactions.ts index 87998340..68b0e823 100644 --- a/src/types/transactions.ts +++ b/src/types/transactions.ts @@ -1,5 +1,9 @@ import type { AddressEx, Page, TokenInfo } from './common' -import type { NativeStakingDepositConfirmationView, NativeStakingValidatorsExitConfirmationView } from './decoded-data' +import type { + NativeStakingDepositConfirmationView, + NativeStakingValidatorsExitConfirmationView, + NativeStakingWithdrawConfirmationView, +} from './decoded-data' import type { RichDecodedInfo } from './human-description' export type ParamValue = string | ParamValue[] @@ -74,6 +78,7 @@ export enum TransactionInfoType { SWAP_TRANSFER = 'SwapTransfer', NATIVE_STAKING_DEPOSIT = 'NativeStakingDeposit', NATIVE_STAKING_VALIDATORS_EXIT = 'NativeStakingValidatorsExit', + NATIVE_STAKING_WITHDRAW = 'NativeStakingWithdraw', } export enum ConflictType { @@ -351,7 +356,12 @@ export type StakingTxExitInfo = { humanDescription?: string } & Omit -export type StakingTxInfo = StakingTxDepositInfo | StakingTxExitInfo +export type StakingTxWithdrawInfo = { + type: TransactionInfoType.NATIVE_STAKING_WITHDRAW + humanDescription?: string +} & Omit + +export type StakingTxInfo = StakingTxDepositInfo | StakingTxExitInfo | StakingTxWithdrawInfo export type TransactionInfo = | Transfer