mirror of
https://github.com/Xahau/xahau.js.git
synced 2025-11-19 11:45:49 +00:00
* fix(#1353): adds memos support for the following transaction types in `getTransactions`: - AccountDelete - OfferCreate - OfferCancel - CheckCancel - CheckCash - CheckCreate - DepositPreauth - SetFee - PaymentChannelFund - PaymentChannelClaim - PaymentChannelCreate - TicketCreate
18 lines
505 B
TypeScript
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
|