Files
xahau.js/src/ledger/parse/payment-channel-fund.ts
Fred K. Schott fadfd4e06c update typescript
2019-10-13 16:19:45 -07:00

17 lines
467 B
TypeScript

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