nim-nitro/nitro/ledger.nim
2021-03-17 12:22:00 +01:00

21 lines
517 B
Nim

import ./basics
import ./channelupdate
import ./protocol
func startLedger*(me: EthAddress,
hub: EthAddress,
chainId: UInt256,
nonce: UInt48,
asset: EthAddress,
amount: UInt256): ChannelUpdate =
ChannelUpdate(
state: State(
channel: ChannelDefinition(
chainId: chainId,
participants: @[me, hub],
nonce: nonce
),
outcome: Outcome.init(asset, {me.toDestination: amount})
)
)