mirror of
https://github.com/Xahau/xahau.js.git
synced 2025-11-18 11:15:48 +00:00
17 lines
467 B
TypeScript
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
|