March Docs

CryptoEvent

Types

typeEventKindEventKind = Transfer | Deposit | Withdrawal | Trade | FeeOnly#

Functions

fncontextcontext(id : String, ref : CryptoReference.Reference, source : String, effective : Int, recorded : Int) : Result(Context, CryptoError.Error)#
fndepositdeposit(c : Context, amount : CryptoIdentity.Amount, counterparty : LedgerAccount.Account, custody : LedgerAccount.Account, fee : Option(CryptoFee.Fee)) : Result(Event, CryptoError.Error)#
fndraftdraft(e : Event) : LedgerEntry.Draft do match e do EventValue(_, _, _, d) -> d end end#
fnfee_onlyfee_only(c : Context, fee : CryptoFee.Fee) : Result(Event, CryptoError.Error)#

Fee-only adjustment or failed transaction; emits no principal legs.

fnkindkind(e : Event) : EventKind do match e do EventValue(k, _, _, _) -> k end end#
fnmetadatametadata(e : Event) : FinanceMetadata.Metadata do match e do EventValue(_, _, m, _) -> m end end#
fnreferencereference(e : Event) : CryptoReference.Reference do match e do EventValue(_, r, _, _) -> r end end#
fntradetrade(c : Context, buy : CryptoIdentity.Amount, sell : CryptoIdentity.Amount, receive : LedgerAccount.Account, pay : LedgerAccount.Account, buy_clearing : LedgerAccount.Account, sell_clearing : LedgerAccount.Account, fee : Option(CryptoFee.Fee)) : Result(Event, CryptoError.Error)#

Four gross trade legs plus optional separate fee legs; no implicit valuation.

fntransfertransfer(c : Context, amount : CryptoIdentity.Amount, source : LedgerAccount.Account, destination : LedgerAccount.Account, fee : Option(CryptoFee.Fee)) : Result(Event, CryptoError.Error)#
fnwithdrawalwithdrawal(c : Context, amount : CryptoIdentity.Amount, custody : LedgerAccount.Account, counterparty : LedgerAccount.Account, fee : Option(CryptoFee.Fee)) : Result(Event, CryptoError.Error)#