Skip to content
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
28 changes: 28 additions & 0 deletions src/types/human-description.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
export enum RichFragmentType {
Text = 'text',
TokenValue = 'tokenValue',
Address = 'address',
}

export type RichTokenValueFragment = {
type: RichFragmentType.TokenValue
value: string
symbol: string | null
logoUri: string | null
}

export type RichTextFragment = {
type: RichFragmentType.Text
value: string
}

export type RichAddressFragment = {
type: RichFragmentType.Address
value: string
}

export type RichDecodedInfoFragment = RichTokenValueFragment | RichTextFragment | RichAddressFragment

export type RichDecodedInfo = {
fragments: Array<RichDecodedInfoFragment>
}
6 changes: 6 additions & 0 deletions src/types/transactions.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import type { AddressEx, Page, TokenInfo } from './common'
import type { RichDecodedInfo } from './human-description'

export type ParamValue = string | ParamValue[]

Expand Down Expand Up @@ -120,6 +121,7 @@ export type Transfer = {
direction: TransferDirection
transferInfo: TransferInfo
humanDescription?: string
richDecodedInfo?: RichDecodedInfo
}

export type SetFallbackHandler = {
Expand Down Expand Up @@ -191,6 +193,7 @@ export type SettingsChange = {
dataDecoded: DataDecoded
settingsInfo?: SettingsInfo
humanDescription?: string
richDecodedInfo?: RichDecodedInfo
}

export type Custom = {
Expand All @@ -202,6 +205,7 @@ export type Custom = {
actionCount?: number
isCancellation: boolean
humanDescription?: string
richDecodedInfo?: RichDecodedInfo
}

export type MultiSend = {
Expand All @@ -213,6 +217,7 @@ export type MultiSend = {
actionCount: number
isCancellation: boolean
humanDescription?: string
richDecodedInfo?: RichDecodedInfo
}

export type Cancellation = Custom & {
Expand All @@ -226,6 +231,7 @@ export type Creation = {
implementation?: AddressEx
factory?: AddressEx
humanDescription?: string
richDecodedInfo?: RichDecodedInfo
}

export type TransactionInfo = Transfer | SettingsChange | Custom | MultiSend | Cancellation | Creation
Expand Down