Files
xahau.js/src/ledger/parse/payment-channel-fund.ts
elmurci 650d722609 Fix #1353: add memos support for multiple transaction types in getTransactions (#1397)
* fix(#1353): adds memos support for the following transaction types in `getTransactions`:

- AccountDelete
- OfferCreate
- OfferCancel
- CheckCancel
- CheckCash
- CheckCreate
- DepositPreauth
- SetFee
- PaymentChannelFund
- PaymentChannelClaim
- PaymentChannelCreate
- TicketCreate
2021-04-08 11:46:54 +02:00

18 lines
505 B
TypeScript

import * as assert from 'assert'
import {parseTimestamp,parseMemos} from './utils'
import {removeUndefined} from '../../common'
import parseAmount from './amount'
function parsePaymentChannelFund(tx: any): object {
assert.ok(tx.TransactionType === 'PaymentChannelFund')
return removeUndefined({
memos: parseMemos(tx),
channel: tx.Channel,
amount: parseAmount(tx.Amount).value,
expiration: tx.Expiration && parseTimestamp(tx.Expiration)
})
}
export default parsePaymentChannelFund