Skip to content

Commit

Permalink
Add 'stakefio' handling to parseAction()
Browse files Browse the repository at this point in the history
  • Loading branch information
Jon-edge committed Sep 5, 2024
1 parent 6417abc commit ca9387b
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
6 changes: 6 additions & 0 deletions src/fio/FioEngine.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2081,6 +2081,12 @@ export const parseAction = ({
otherParams.meta.isTransferProcessed = true
break

case 'stakefio': {
nativeAmount = `-${dataAmount}`
otherParams.meta.isTransferProcessed = true
break
}

case 'unstakefio':
updateStakingStatus = {
nativeAmount,
Expand Down
8 changes: 4 additions & 4 deletions src/fio/fioSchema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ export const asGetFioDomains = asObject({
)
})

export const asFioTxName = asMaybe(
asValue('unstakefio', 'transfer', 'regaddress', 'trnsfiopubky'),
export const asSupportedFioTxName = asMaybe(
asValue('unstakefio', 'stakefio', 'transfer', 'regaddress', 'trnsfiopubky'),
null
)

Expand All @@ -40,7 +40,7 @@ export const asFioHistoryNodeAction = asObject({
receiver: asString,
act: asObject({
account: asString,
name: asFioTxName,
name: asSupportedFioTxName,
authorization: asArray(
asObject({
actor: asString,
Expand Down Expand Up @@ -79,5 +79,5 @@ export const asGetFioBalanceResponse = asObject({
roe: asString
})

export type FioTxName = ReturnType<typeof asFioTxName>
export type FioTxName = ReturnType<typeof asSupportedFioTxName>
export type FioHistoryNodeAction = ReturnType<typeof asFioHistoryNodeAction>

0 comments on commit ca9387b

Please sign in to comment.