-
Notifications
You must be signed in to change notification settings - Fork 6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
docs: database structure #80
Merged
Merged
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
506496c
docs: database structure
Vovke c69aa99
chore: Additional state for withdrawal, more fields from the API spec
Vovke 8f16f10
chore: missing state for failed withdrawal
Vovke 23bed58
chore: Apply suggestions from code review
Vovke a99e001
Apply suggestions from code review
Vovke 34595ae
Merge branch 'main' into database-discussion
Vovke File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
Plan is to update the database scheme in a way that it will support the requirements we have as for the API specs and additional improvements of the deamon. | ||
|
||
## Tables | ||
### Orders (`orders`) | ||
- order - String: order identifier provided by the frontend | ||
- payment_status - Enum: (pending|paid|timed_out). | ||
- withdrawal_status - Enum: (waiting|failed|completed|forced|none). | ||
- amount - u128: Order amount | ||
- currency - String: Currency ticker ("DOT"|"USDC"|...). | ||
- callback: String: Callback url for frontend order status update | ||
- payment_account: [u8; 32]: Derived address for this order. | ||
- recipient: [u8; 32]: Address that will receive the payout once the order is fulfilled. | ||
- message: String|null: Optional parameter for failed orders. | ||
- payment_page: String|null: Optional parameter for the frontend to redirect to a payment page. | ||
- redirect_url: String|null: Optional parameter for the frontend to redirect once the order is repaid. | ||
- death: u32: Expiry timestamp for the order. | ||
|
||
### Transactions (`transactions`) | ||
- transaction_id - unique id generated by us to allow linking transaction to order | ||
- order - String: order id to link transaction to order | ||
Vovke marked this conversation as resolved.
Show resolved
Hide resolved
|
||
- chain - String: identifier for the chain where transaction occurred | ||
- block_number - Integer: Block number where the transaction is recorded. | ||
- position_in_block - Integer: Position of the transaction within the block. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. we might also (later?) want to store the block for which transaction was submitted. It is included into saved transaction bytes though, so maybe not |
||
- timestamp - Timestamp: Timestamp of the transaction. | ||
- transaction_bytes - String: Raw transaction data. | ||
- sender - String: Address sending the transaction. | ||
- recipient - String: Address receiving the transaction. | ||
- amount - Float: transaction amount | ||
- currency: String: Transaction currency | ||
- type - Enum: Transaction type (payment|withdrawal) to distinguish between internal (withdrawal) and external (payment) transactions | ||
- status - Enum: Transaction status (pending|finalized|failed). | ||
Vovke marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
### Instance Metadata (`instance_info`) | ||
- instance_id - String: instance id randomly generated, happy-octopus or similar shit | ||
- version - String: daemon version (storing it just for consistency with ServerInfo struct) | ||
- debug - String: Debug toggle | ||
- kalatori_remark: String: Environment specific something, can be used for whatever |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
are these things derived from API? Please indicate if something is different from types defined there, ideally these should be as similar as possible, but deviations are ok where they make sense
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Addressed in c69aa99