Skip to content

Commit

Permalink
fixup! Add EdgeTxInfo types
Browse files Browse the repository at this point in the history
  • Loading branch information
Jon-edge committed Oct 10, 2023
1 parent 47a1b99 commit 65b5c0f
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 5 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# edge-core-js

## Unreleased
- added: EdgeTxInfo types to tag known transaction types (swap, stake, etc)

## 1.8.0 (2023-10-02)

Expand Down
21 changes: 16 additions & 5 deletions src/types/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -251,21 +251,32 @@ export interface EdgeMemo {

export interface EdgeTxAsset {
pluginId: string
tokenId: string
nativeAmount: string
tokenId?: string
nativeAmount?: string
}

export type EdgeTxInfoSwapType =
| 'swap'
| 'swapOrderPost'
| 'swapOrderFill'
| 'swapOrderCancel'

export interface EdgeTxInfoSwap {
type: 'swap' | 'swapOrderPost' | 'swapOrderFill'
type: EdgeTxInfoSwapType
orderId?: string
direction: 'from' | 'to'
canBePartial?: boolean
sourceAsset: EdgeTxAsset
destAsset: EdgeTxAsset
}

export type EdgeTxInfoStakeType =
| 'stake'
| 'stakeOrder'
| 'unstake'
| 'unstakeOrder'

export interface EdgeTxInfoStake {
type: 'stake' | 'stakeOrder' | 'unstake' | 'unstakeOrder'
type: EdgeTxInfoStakeType
stakeAssets: EdgeTxAsset[]
}

Expand Down

0 comments on commit 65b5c0f

Please sign in to comment.