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

Humanizer: add getLink #1086

Merged
merged 1 commit into from
Nov 11, 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
12 changes: 11 additions & 1 deletion src/libs/humanizer/interfaces.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,17 @@ import { Call } from '../accountOp/types'
// @TODO remove property humanizerMeta
export type HumanizerVisualization = (
| {
type: 'address' | 'label' | 'action' | 'danger' | 'deadline' | 'chain' | 'message' | 'image'
type:
| 'address'
| 'label'
| 'action'
| 'danger'
| 'deadline'
| 'chain'
| 'message'
| 'image'
| 'link'
url?: string
address?: string
content?: string
value?: bigint
Expand Down
3 changes: 3 additions & 0 deletions src/libs/humanizer/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,9 @@ export function getDeadline(deadlineSecs: bigint | number): HumanizerVisualizati
id: randomId()
}
}
export function getLink(url: string, content: string): HumanizerVisualization {
return { type: 'link', url, content, id: randomId() }
}

/**
* Make a request to coingecko to fetch the latest price of the native token.
Expand Down
Loading