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

Feat: staking deposit decoding #196

Merged
merged 7 commits into from
Aug 30, 2024
Merged
Changes from 1 commit
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
20 changes: 19 additions & 1 deletion src/types/decoded-data.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import type { SwapOrder, TwapOrder } from './transactions'
export enum ConfirmationViewTypes {
COW_SWAP_ORDER = 'COW_SWAP_ORDER',
COW_SWAP_TWAP_ORDER = 'COW_SWAP_TWAP_ORDER',
KILN_NATIVE_STAKING_DEPOSIT = 'KILN_NATIVE_STAKING_DEPOSIT',
}

export type DecodedDataRequest = {
Expand Down Expand Up @@ -42,6 +43,7 @@ export type BaselineConfirmationView = {
type: 'GENERIC'
} & DecodedDataResponse

/* Swaps */
export type SwapOrderConfirmationView = {
type: ConfirmationViewTypes.COW_SWAP_ORDER
} & DecodedDataResponse &
Expand All @@ -52,4 +54,20 @@ export type TwapOrderConfirmationView = {
} & DecodedDataResponse &
Omit<TwapOrder, 'type' | 'humanDescription' | 'richDecodedInfo'>

export type OrderConfirmationView = SwapOrderConfirmationView | TwapOrderConfirmationView
/* Staking */
export type NativeStakingDepositConfirmationView = {
type: ConfirmationViewTypes.KILN_NATIVE_STAKING_DEPOSIT
status: 'unknown'
estimatedEntryTime: number
estimatedExitTime: number
estimatedWithdrawalTime: number
fee: number
monthlyNrr: number
annualNrr: number
} & DecodedDataResponse

/* Union */
export type OrderConfirmationView =
| SwapOrderConfirmationView
| TwapOrderConfirmationView
| NativeStakingDepositConfirmationView
Loading