Document Type <transaction>
Contained in <accountLedger> documents.
Transactions can either be in full or abbreviated form. They are
abbreviated when inside <accountLedger>, except for ledger type "message"
(<notaryMessage>).
Full transactions contain a list of <item> documents.
Abbreviated transactions do not contain the list of
<item> documents. The items will be loaded one by one during
verification, using the getBoxReceipt
message.
- [TODO, verify if this is true].
- Reason: if the inbox contains hundreds of receipts (items), downloading the inbox would take too long or fail altogether, creating resyncing issues.
- The full transactions referenced by abbreviated transactions are stored in
the
*box/*.r/*.rctfiles. See OTTransaction::SaveBoxReceipt().
A transaction can be "in reference to" an <item>.
Base Document Type
Elements and attributes
Those attributes are common to the full form document type and the abbreviated form document types.
- Attribute
type: String. See section Transaction Types. - Attribute
dateSigned: Time. The date when the instrument was last signed. - Attribute
accountID: Identifier. - Attribute
nymID: Identifier. - Attribute
notaryID: Identifier. - Attribute
numberOfOrigin: Integer.- Constant 0 if not applicable.
- If
typeis one of (chequeReceipt,voucherReceipt) and the referenced<item>is of typedepositCheque: Same as the referenced item'snumberOfOrigin. - If
typeis one of (pending,marketReceipt,paymentReceipt,finalReceipt,basketReceipt): same asinReferenceTo. - If
typeis one of (blank,message,notice,replyNotice,successNotice,processNymbox,atProcessNymbox,transferReceipt,deposit,atDeposit,instrumentNotice,instrumentRejection): Not applicable. - For all other
types: same astransactionNum.
- Attribute
transactionNum: Integer. The notary issues this in response to agetTransactionNumbersmessage. TODO: link to tx num spec. - Attribute
inReferenceTo: Integer. Transaction number of the item this transaction is in reference to.
Transaction Types
Possible values for the type attribute. Taken from OTTransaction.hpp.
Nymbox Transaction Types
blank: Freshly issued transaction numbermessage: Message from another Nymnotice: Server noticereplyNotice: A copy of a server reply to a previous request you sentsuccessNotice: A transaction number has successfully been signed out
Inbox and Outbox Transaction Types
pending: Server puts this in your outbox (when sending) and in recipient's inbox.
Inbox receipts
transferReceiptchequeReceiptvoucherReceiptmarketReceiptpaymentReceiptfinalReceipt: When a cron item is expired or cancelled.basketReceipt: When a basket exchange is processed.
Payment Inbox, Payment Outbox, Record Box
instrumentNoticeinstrumentRejection
Messages
processNymboxatProcessNymboxprocessInboxatProcessInboxtransferatTransferdepositatDeposit
Document Type: Full Form
- Optional element
closingTransactionNumber. Only iftypeisfinalReceiptorbasketReceipt. TODO - Optional element
inReferenceTo. Armored contract (TODO: figure out if needed and what can be in there, looks like it can contain different document types depending on the situation). - Optional element
cancelRequest. Armored document. TODO - List of armored
<item>documents.
Document Types: Abbreviated Form
Base Document Type
These attributes are common for all abbreviated records (?)
Elements and attributes
- Attribute
type: String. See Transaction Types - Attribute
dateSigned: Time in seconds, when the instrument was last signed. - Attribute
receiptHash: Identifier. TODO - Attribute
transactionNum: Integer. Transaction number. - Attribute
inRefDisplay: Integer. Transaction number, reference to transaction for display purposes. - Attribute
inReferenceTo: Integer. Transaction number that is related to this transaction.
If type is finalReceipt or basketReceipt:
- Attribute
closingNum: Integer. TODO
Document Type <paymentInboxRecord>
Elements and attributes
- Attribute
displayValue: TODO
Document Type <nymboxRecord>
Elements and attributes
- Attribute
totalListOfNumbers: Comma separated list of transaction numbers successfully signed out. - TODO funny stuff is happening here
Example
<nymboxRecord type="successNotice"
dateSigned="1414495363"
requestNumber="0"
transSuccess="false"
receiptHash="2nG5wGlWKbzF5Mo8M6P9YH44S6FazSNQleaaTWRR0av"
transactionNum="714"
totalListOfNumbers="614,615,616,617,618,619,620,621,622,623,624,625,626,627,628,629,630,631,632,633,634,635,636,637,638,639,640,641,642,643,644,645,646,647,648,649,650,651,652,653,654,655,656,657,658,659,660,661,662,663,664,665,666,667,668,669,670,671,672,673,674,675,676,677,678,679,680,681,682,683,684,685,686,687,688,689,690,691,692,693,694,695,696,697,698,699,700,701,702,703,704,705,706,707,708,709,710,711,712,713"
inRefDisplay="614"
inReferenceTo="614" />
Document Type <outboxRecord>
Elements and attributes
- Attribute
displayValue: TODO - Attribute
adjustment: Integer. TODO - Attribute
numberOfOrigin: Integer. TODO
Document Type <expiredBoxRecord>
Inherits from Document Type <outboxRecord>.
Document Type <recordBoxRecord>
Elements and attributes
- Attribute
displayValue: TODO - Attribute
adjustment: Integer. TODO - Attribute
numberOfOrigin: Integer. TODO
References
Notes
Possible improvements
- Use composition over inheritance.
- Use document types over
typeattribute. - The
messagetype in particular is out of place. - Clean up this hack: https://github.com/Open-Transactions/opentxs/blob/682fd05f/src/server/OTServer.cpp#L786-802