manifold/common/txn.ts

22 lines
532 B
TypeScript
Raw Normal View History

2022-04-21 11:09:31 +00:00
// A txn (pronounced "texan") respresents a payment between two ids on Manifold
// Shortened from "transaction" to distinguish from Firebase transactions (and save chars)
export type Txn = {
id: string
createdTime: number
fromId: string
2022-04-26 15:49:16 +00:00
fromType: source_type
2022-04-21 11:09:31 +00:00
toId: string
2022-04-26 15:49:16 +00:00
toType: source_type
2022-04-21 11:09:31 +00:00
amount: number
2022-04-28 23:07:13 +00:00
token: 'M$' // | 'USD' | MarketOutcome
2022-04-21 11:09:31 +00:00
2022-04-28 23:07:13 +00:00
category: 'CHARITY' // | 'BET' | 'TIP'
2022-04-21 11:09:31 +00:00
// Human-readable description
description?: string
}
2022-04-26 15:49:16 +00:00
export type source_type = 'user' | 'contract' | 'charity' | 'bank'