-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathopenapi.json
More file actions
1869 lines (1869 loc) Β· 76.2 KB
/
openapi.json
File metadata and controls
1869 lines (1869 loc) Β· 76.2 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
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
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
{
"openapi": "3.1.0",
"info": {
"title": "minotari",
"description": "",
"license": {
"name": ""
},
"version": "0.1.0"
},
"paths": {
"/accounts/{name}/address": {
"get": {
"tags": [
"accounts"
],
"summary": "Retrieves the Tari address for a specified account.",
"description": "Returns the account's Tari address in Base58 format along with the emoji ID\nrepresentation. This address can be shared with others to receive payments.\n\n# Path Parameters\n\n- `name`: The unique account name to query\n\n# Response\n\nReturns an [`AddressResponse`] object containing:\n- The address in Base58 encoding\n- The emoji ID representation\n\n# Errors\n\n- [`ApiError::AccountNotFound`]: The specified account does not exist\n- [`ApiError::DbError`]: Database connection or query failure\n\n# Example Response\n\n```json\n{\n \"address\": \"f4FxMqKAPDMqAjh6hTpCnLKfEu3MmS7NRu2YmKZPvZHc2K\",\n \"emoji_id\": \"πππ...\"\n}\n```",
"operationId": "api_get_address",
"parameters": [
{
"name": "name",
"in": "path",
"description": "Name of the account to retrieve address for",
"required": true,
"schema": {
"type": "string"
}
}
],
"responses": {
"200": {
"description": "Account address retrieved successfully",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/AddressResponse"
}
}
}
},
"404": {
"description": "Account not found",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ApiError"
}
}
}
},
"500": {
"description": "Internal server error",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ApiError"
}
}
}
}
}
}
},
"/accounts/{name}/address_with_payment_id": {
"post": {
"tags": [
"accounts"
],
"summary": "Creates a Tari address with an embedded payment ID for a specified account.",
"description": "Generates a new address that includes a payment ID, which can be used to\nidentify specific transactions or invoices. When someone sends funds to\nthis address, the payment ID will be included in the transaction.\n\n# Path Parameters\n\n- `name`: The unique account name\n\n# Request Body\n\nSee [`CreatePaymentIdAddressRequest`] for the complete request schema.\n\n# Response\n\nReturns an [`AddressWithPaymentIdResponse`] object containing:\n- The address with embedded payment ID in Base58 encoding\n- The emoji ID representation\n- The original payment ID\n\n# Errors\n\n- [`ApiError::AccountNotFound`]: The specified account does not exist\n- [`ApiError::DbError`]: Database connection or query failure\n- [`ApiError::InternalServerError`]: Failed to generate the address\n\n# Example Request\n\n```bash\ncurl -X POST http://localhost:8080/accounts/default/address_with_payment_id \\\n -H \"Content-Type: application/json\" \\\n -d '{\"payment_id\": \"696e766f6963652d3132333435\"}'\n```\n\n# Example Response\n\n```json\n{\n \"address\": \"f4FxMqKAPDMqAjh6hTpCnLKfEu3MmS7NRu2YmKZPvZHc2K\",\n \"emoji_id\": \"πππ...\",\n \"payment_id_hex\": \"696e766f6963652d3132333435\"\n}\n```",
"operationId": "api_create_address_with_payment_id",
"parameters": [
{
"name": "name",
"in": "path",
"description": "Name of the account to create address for",
"required": true,
"schema": {
"type": "string"
}
}
],
"requestBody": {
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/CreatePaymentIdAddressRequest"
}
}
},
"required": true
},
"responses": {
"200": {
"description": "Address with payment ID created successfully",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/AddressWithPaymentIdResponse"
}
}
}
},
"400": {
"description": "Bad request",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ApiError"
}
}
}
},
"404": {
"description": "Account not found",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ApiError"
}
}
}
},
"500": {
"description": "Internal server error",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ApiError"
}
}
}
}
}
}
},
"/accounts/{name}/balance": {
"get": {
"tags": [
"accounts"
],
"summary": "Retrieves the current balance for a specified account.",
"description": "Returns the account's available balance, pending incoming transactions,\nand locked funds. This endpoint is useful for displaying wallet status\nor checking available funds before initiating a transaction.\n\n# Path Parameters\n\n- `name`: The unique account name to query\n\n# Response\n\nReturns an [`AccountBalance`] object containing:\n- Available (spendable) balance\n- Pending incoming balance\n- Locked balance (reserved for pending transactions)\n\n# Errors\n\n- [`ApiError::AccountNotFound`]: The specified account does not exist\n- [`ApiError::DbError`]: Database connection or query failure\n\n# Example Response\n\n```json\n{\n \"available\": 10000000,\n \"pending_incoming\": 500000,\n \"locked\": 200000\n}\n```",
"operationId": "api_get_balance",
"parameters": [
{
"name": "name",
"in": "path",
"description": "Name of the account to retrieve balance for",
"required": true,
"schema": {
"type": "string"
}
}
],
"responses": {
"200": {
"description": "Account balance retrieved successfully",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/AccountBalance"
}
}
}
},
"404": {
"description": "Account not found",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ApiError"
}
}
}
},
"500": {
"description": "Internal server error",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ApiError"
}
}
}
}
}
}
},
"/accounts/{name}/completed_transactions": {
"get": {
"tags": [
"accounts"
],
"summary": "Retrieves completed transactions for a specified account with pagination.",
"description": "Returns a paginated list of completed transactions for the account, including\ntheir status, mined block information, and confirmation details. Transactions\nare ordered by creation time (most recent first).\n\n# Path Parameters\n\n- `name`: The unique account name to query\n\n# Query Parameters\n\n- `limit`: Maximum number of transactions to return (default: 50, max: 1000)\n- `offset`: Number of transactions to skip for pagination (default: 0)\n\n# Response\n\nReturns a list of [`CompletedTransactionResponse`] objects, each containing:\n- Transaction ID and status\n- Kernel excess (hex encoded)\n- Mining and confirmation details\n- Creation and update timestamps\n\n# Errors\n\n- [`ApiError::AccountNotFound`]: The specified account does not exist\n- [`ApiError::DbError`]: Database connection or query failure\n\n# Example Request\n\n```bash\n# Get first 50 completed transactions (default)\ncurl -X GET http://localhost:8080/accounts/default/completed_transactions\n\n# Get 100 transactions starting from offset 50\ncurl -X GET \"http://localhost:8080/accounts/default/completed_transactions?limit=100&offset=50\"\n```\n\n# Example Response\n\n```json\n[\n {\n \"id\": \"550e8400-e29b-41d4-a716-446655440000\",\n \"pending_tx_id\": \"661e8400-e29b-41d4-a716-446655440001\",\n \"account_id\": 1,\n \"status\": \"mined_confirmed\",\n \"last_rejected_reason\": null,\n \"kernel_excess_hex\": \"abc123...\",\n \"sent_payref\": \"payref-123\",\n \"sent_output_hash\": \"def456...\",\n \"mined_height\": 12345,\n \"mined_block_hash_hex\": \"789abc...\",\n \"confirmation_height\": 12350,\n \"broadcast_attempts\": 1,\n \"created_at\": \"2024-01-15T10:30:00Z\",\n \"updated_at\": \"2024-01-15T10:35:00Z\"\n }\n]\n```",
"operationId": "api_get_completed_transactions",
"parameters": [
{
"name": "name",
"in": "path",
"description": "Name of the account to retrieve completed transactions for",
"required": true,
"schema": {
"type": "string"
}
},
{
"name": "limit",
"in": "query",
"description": "Maximum number of transactions to return (default: 50, max: 1000)",
"required": false,
"schema": {
"type": "integer",
"format": "int64"
}
},
{
"name": "offset",
"in": "query",
"description": "Number of transactions to skip for pagination (default: 0)",
"required": false,
"schema": {
"type": "integer",
"format": "int64"
}
}
],
"responses": {
"200": {
"description": "Completed transactions retrieved successfully",
"content": {
"application/json": {
"schema": {
"type": "array",
"items": {
"$ref": "#/components/schemas/CompletedTransactionResponse"
}
}
}
}
},
"404": {
"description": "Account not found",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ApiError"
}
}
}
},
"500": {
"description": "Internal server error",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ApiError"
}
}
}
}
}
}
},
"/accounts/{name}/completed_transactions/by_payref/{payref}": {
"get": {
"tags": [
"accounts"
],
"summary": "Retrieves a completed transaction by its payment reference.",
"description": "Returns a completed transaction that matches the specified payment reference.\nThe payment reference is typically assigned when a transaction is confirmed\non the blockchain.\n\n# Path Parameters\n\n- `name`: The unique account name to query\n- `payref`: The payment reference to search for\n\n# Response\n\nReturns a [`CompletedTransactionResponse`] object if found, containing:\n- Transaction ID and status\n- Kernel excess (hex encoded)\n- Mining and confirmation details\n- Creation and update timestamps\n\n# Errors\n\n- [`ApiError::AccountNotFound`]: The specified account does not exist\n- [`ApiError::NotFound`]: No transaction found with the given payment reference\n- [`ApiError::DbError`]: Database connection or query failure\n\n# Example Request\n\n```bash\ncurl -X GET http://localhost:8080/accounts/default/completed_transactions/by_payref/my-payment-ref-123\n```",
"operationId": "api_get_completed_transaction_by_payref",
"parameters": [
{
"name": "name",
"in": "path",
"description": "Name of the account to retrieve transaction from",
"required": true,
"schema": {
"type": "string"
}
},
{
"name": "payref",
"in": "path",
"description": "Payment reference to search for",
"required": true,
"schema": {
"type": "string"
}
}
],
"responses": {
"200": {
"description": "Completed transaction retrieved successfully",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/CompletedTransactionResponse"
}
}
}
},
"404": {
"description": "Account or transaction not found",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ApiError"
}
}
}
},
"500": {
"description": "Internal server error",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ApiError"
}
}
}
}
}
}
},
"/accounts/{name}/create_unsigned_transaction": {
"post": {
"tags": [
"accounts"
],
"summary": "Creates an unsigned one-sided transaction for external signing.",
"description": "This endpoint constructs a complete transaction ready for signing, including\ninput selection, output creation, and fee calculation. The transaction is\nreturned in an unsigned state, allowing it to be signed by an external\nkey management system or hardware wallet.\n\n# Path Parameters\n\n- `name`: The account name to send funds from\n\n# Request Body\n\nSee [`CreateTransactionRequest`] for the complete request schema.\n\n# Response\n\nReturns a JSON object containing the unsigned transaction data, including:\n- Transaction inputs (selected UTXOs)\n- Transaction outputs (recipient outputs and change)\n- Fee information\n- Data required for signing\n\n# Errors\n\n- [`ApiError::AccountNotFound`]: The specified account does not exist\n- [`ApiError::FailedToLockFunds`]: Insufficient funds or UTXO selection failure\n- [`ApiError::FailedCreateUnsignedTx`]: Transaction construction failure\n- [`ApiError::DbError`]: Database connection or query failure\n\n# Example\n\n```bash\ncurl -X POST http://localhost:8080/accounts/default/create_unsigned_transaction \\\n -H \"Content-Type: application/json\" \\\n -d '{\n \"recipients\": [\n {\"address\": \"f4FxMqKAPDMqAjh6hTpC...\", \"amount\": 1000000}\n ]\n }'\n```\n\n# Workflow\n\n1. Client calls this endpoint to create an unsigned transaction\n2. Server locks required UTXOs and constructs the transaction\n3. Client signs the transaction externally\n4. Client broadcasts the signed transaction to the network\n\n# Notes\n\n- This creates a one-sided transaction (no recipient interaction required)\n- UTXOs are automatically locked for the configured duration\n- Fee is calculated at 5 MicroMinotari per gram\n- Change outputs are created automatically when necessary",
"operationId": "api_create_unsigned_transaction",
"parameters": [
{
"name": "name",
"in": "path",
"description": "Name of the account to create transaction for",
"required": true,
"schema": {
"type": "string"
}
}
],
"requestBody": {
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/CreateTransactionRequest"
}
}
},
"required": true
},
"responses": {
"200": {
"description": "Unsigned transaction created successfully",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Value"
}
}
}
},
"400": {
"description": "Bad request",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ApiError"
}
}
}
},
"404": {
"description": "Account not found",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ApiError"
}
}
}
},
"500": {
"description": "Internal server error",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ApiError"
}
}
}
}
}
}
},
"/accounts/{name}/displayed_transactions": {
"get": {
"tags": [
"accounts"
],
"summary": "Retrieves displayed transactions for a specified account with pagination.",
"description": "Returns a paginated list of user-friendly transactions for the account,\nincluding incoming and outgoing transactions with their status, amounts,\nand blockchain information. Transactions are ordered by block height\n(most recent first).\n\n# Path Parameters\n\n- `name`: The unique account name to query\n\n# Query Parameters\n\n- `limit`: Maximum number of transactions to return (default: 50, max: 1000)\n- `offset`: Number of transactions to skip for pagination (default: 0)\n\n# Response\n\nReturns a list of [`DisplayedTransaction`] objects, each containing:\n- Transaction ID, direction (incoming/outgoing), and source\n- Status (pending, unconfirmed, confirmed, cancelled, etc.)\n- Amount and formatted display amount\n- Counterparty information (if available)\n- Blockchain details (block height, timestamp, confirmations)\n- Fee information (for outgoing transactions)\n- Detailed input/output information\n\n# Errors\n\n- [`ApiError::AccountNotFound`]: The specified account does not exist\n- [`ApiError::DbError`]: Database connection or query failure\n\n# Example Request\n\n```bash\n# Get first 50 displayed transactions (default)\ncurl -X GET http://localhost:8080/accounts/default/displayed_transactions\n\n# Get 100 transactions starting from offset 50\ncurl -X GET \"http://localhost:8080/accounts/default/displayed_transactions?limit=100&offset=50\"\n```\n\n# Example Response\n\n```json\n[\n {\n \"id\": \"tx-123\",\n \"direction\": \"incoming\",\n \"source\": \"transfer\",\n \"status\": \"confirmed\",\n \"amount\": 1000000,\n \"amount_display\": \"1.000000 XTM\",\n \"message\": null,\n \"counterparty\": {\n \"address\": \"f4FxMqKAPDMqAjh6hTpC...\",\n \"address_emoji\": \"ππ...\",\n \"label\": null\n },\n \"blockchain\": {\n \"block_height\": 12345,\n \"timestamp\": \"2024-01-15T10:30:00\",\n \"confirmations\": 10\n },\n \"fee\": null,\n \"details\": {\n \"account_id\": 1,\n \"total_credit\": 1000000,\n \"total_debit\": 0,\n \"inputs\": [],\n \"outputs\": [...]\n }\n }\n]\n```",
"operationId": "api_get_displayed_transactions",
"parameters": [
{
"name": "name",
"in": "path",
"description": "Name of the account to retrieve displayed transactions for",
"required": true,
"schema": {
"type": "string"
}
},
{
"name": "limit",
"in": "query",
"description": "Maximum number of transactions to return (default: 50, max: 1000)",
"required": false,
"schema": {
"type": "integer",
"format": "int64"
}
},
{
"name": "offset",
"in": "query",
"description": "Number of transactions to skip for pagination (default: 0)",
"required": false,
"schema": {
"type": "integer",
"format": "int64"
}
}
],
"responses": {
"200": {
"description": "Displayed transactions retrieved successfully",
"content": {
"application/json": {
"schema": {
"type": "array",
"items": {
"$ref": "#/components/schemas/DisplayedTransaction"
}
}
}
}
},
"404": {
"description": "Account not found",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ApiError"
}
}
}
},
"500": {
"description": "Internal server error",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ApiError"
}
}
}
}
}
}
},
"/accounts/{name}/displayed_transactions/by_payref/{payref}": {
"get": {
"tags": [
"accounts"
],
"summary": "Retrieves displayed transactions by payment reference.",
"description": "Returns displayed transactions that contain the specified payment reference.\nThis searches within the payment references stored in each transaction.\n\n# Path Parameters\n\n- `name`: The unique account name to query\n- `payref`: The payment reference to search for\n\n# Response\n\nReturns a list of [`DisplayedTransaction`] objects that contain the payment reference.\n\n# Errors\n\n- [`ApiError::AccountNotFound`]: The specified account does not exist\n- [`ApiError::DbError`]: Database connection or query failure\n\n# Example Request\n\n```bash\ncurl -X GET http://localhost:8080/accounts/default/displayed_transactions/by_payref/my-payment-ref-123\n```",
"operationId": "api_get_displayed_transactions_by_payref",
"parameters": [
{
"name": "name",
"in": "path",
"description": "Name of the account to retrieve transactions from",
"required": true,
"schema": {
"type": "string"
}
},
{
"name": "payref",
"in": "path",
"description": "Payment reference to search for",
"required": true,
"schema": {
"type": "string"
}
}
],
"responses": {
"200": {
"description": "Displayed transactions retrieved successfully",
"content": {
"application/json": {
"schema": {
"type": "array",
"items": {
"$ref": "#/components/schemas/DisplayedTransaction"
}
}
}
}
},
"404": {
"description": "Account not found",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ApiError"
}
}
}
},
"500": {
"description": "Internal server error",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ApiError"
}
}
}
}
}
}
},
"/accounts/{name}/estimate_fees": {
"post": {
"tags": [
"accounts"
],
"summary": "Estimates transaction fees based on current network conditions.",
"description": "Calculates fee estimates for Slow, Medium, and Fast priority levels by analyzing\nthe mempool state and selecting appropriate UTXOs for the requested amount.\n\n# Path Parameters\n\n- `name`: The account name to estimate fees for\n\n# Request Body\n\nSee [`EstimateFeeRequest`] for the complete request schema.\n\n# Response\n\nReturns a list of [`FeeEstimateResponse`] objects for different priorities.\n\n# Errors\n\n- [`ApiError::AccountNotFound`]: The specified account does not exist\n- [`ApiError::InternalServerError`]: Failed to query base node or calculate fees\n- [`ApiError::DbError`]: Database connection or query failure\n\n# Example Request\n\n```bash\ncurl -X POST http://localhost:8080/accounts/default/estimate_fees \\\n -H \"Content-Type: application/json\" \\\n -d '{\"amount\": 1000000}'\n```",
"operationId": "api_estimate_fees",
"parameters": [
{
"name": "name",
"in": "path",
"description": "Name of the account to estimate fees for",
"required": true,
"schema": {
"type": "string"
}
}
],
"requestBody": {
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/EstimateFeeRequest"
}
}
},
"required": true
},
"responses": {
"200": {
"description": "Fees estimated successfully",
"content": {
"application/json": {
"schema": {
"type": "array",
"items": {
"$ref": "#/components/schemas/FeeEstimateResponse"
}
}
}
}
},
"400": {
"description": "Bad request",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ApiError"
}
}
}
},
"404": {
"description": "Account not found",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ApiError"
}
}
}
},
"500": {
"description": "Internal server error",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ApiError"
}
}
}
}
}
}
},
"/accounts/{name}/events": {
"get": {
"tags": [
"accounts"
],
"summary": "Retrieves wallet events for a specified account with pagination.",
"description": "Returns a paginated list of events that have occurred for the account, including\noutput detection, confirmation, transaction broadcasts, and blockchain\nreorganizations. Events are ordered by creation time (most recent first).\n\n# Path Parameters\n\n- `name`: The unique account name to query\n\n# Query Parameters\n\n- `limit`: Maximum number of events to return (default: 50, max: 1000)\n- `offset`: Number of events to skip for pagination (default: 0)\n\n# Response\n\nReturns a list of [`DbWalletEvent`] objects, each containing:\n- Event ID and type\n- Human-readable description\n- JSON data with event-specific details\n- Creation timestamp\n\n# Errors\n\n- [`ApiError::AccountNotFound`]: The specified account does not exist\n- [`ApiError::DbError`]: Database connection or query failure\n\n# Example Request\n\n```bash\n# Get first 50 events (default)\ncurl -X GET http://localhost:8080/accounts/default/events\n\n# Get 100 events starting from offset 50\ncurl -X GET \"http://localhost:8080/accounts/default/events?limit=100&offset=50\"\n```\n\n# Example Response\n\n```json\n[\n {\n \"id\": 42,\n \"account_id\": 1,\n \"event_type\": \"OutputDetected\",\n \"description\": \"Detected output at height 12345\",\n \"data_json\": \"{\\\"hash\\\":\\\"abc...\\\",\\\"block_height\\\":12345}\",\n \"created_at\": \"2024-01-15T10:30:00\"\n }\n]\n```",
"operationId": "api_get_events",
"parameters": [
{
"name": "name",
"in": "path",
"description": "Name of the account to retrieve events for",
"required": true,
"schema": {
"type": "string"
}
},
{
"name": "limit",
"in": "query",
"description": "Maximum number of events to return (default: 50, max: 1000)",
"required": false,
"schema": {
"type": "integer",
"format": "int64"
}
},
{
"name": "offset",
"in": "query",
"description": "Number of events to skip for pagination (default: 0)",
"required": false,
"schema": {
"type": "integer",
"format": "int64"
}
}
],
"responses": {
"200": {
"description": "Account events retrieved successfully",
"content": {
"application/json": {
"schema": {
"type": "array",
"items": {
"$ref": "#/components/schemas/DbWalletEvent"
}
}
}
}
},
"404": {
"description": "Account not found",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ApiError"
}
}
}
},
"500": {
"description": "Internal server error",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ApiError"
}
}
}
}
}
}
},
"/accounts/{name}/lock_funds": {
"post": {
"tags": [
"accounts"
],
"summary": "Locks funds from an account for transaction preparation.",
"description": "This endpoint reserves UTXOs totaling at least the requested amount,\npreventing them from being used in other transactions. This is typically\nthe first step in creating a transaction, ensuring funds are available\nand reserved before constructing the transaction.\n\n# Path Parameters\n\n- `name`: The account name to lock funds from\n\n# Request Body\n\nSee [`LockFundsRequest`] for the complete request schema.\n\n# Response\n\nReturns a [`LockFundsResult`] containing:\n- The selected UTXOs to use as inputs\n- Whether a change output is required\n- Total value of locked UTXOs\n- Fee estimates with and without change\n\n# Errors\n\n- [`ApiError::AccountNotFound`]: The specified account does not exist\n- [`ApiError::FailedToLockFunds`]: Insufficient funds or UTXO selection failure\n- [`ApiError::DbError`]: Database connection or query failure\n\n# Example\n\n```bash\ncurl -X POST http://localhost:8080/accounts/default/lock_funds \\\n -H \"Content-Type: application/json\" \\\n -d '{\"amount\": 1000000, \"num_outputs\": 1}'\n```\n\n# Notes\n\n- Locked UTXOs are automatically released after the configured timeout\n- Use the `idempotency_key` to safely retry failed requests\n- The actual locked amount may exceed the requested amount due to UTXO granularity",
"operationId": "api_lock_funds",
"parameters": [
{
"name": "name",
"in": "path",
"description": "Name of the account to lock funds from",
"required": true,
"schema": {
"type": "string"
}
}
],
"requestBody": {
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/LockFundsRequest"
}
}
},
"required": true
},
"responses": {
"200": {
"description": "Funds locked successfully",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/LockFundsResult"
}
}
}
},
"400": {
"description": "Bad request",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ApiError"
}
}
}
},
"404": {
"description": "Account not found",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ApiError"
}
}
}
},
"500": {
"description": "Internal server error",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ApiError"
}
}
}
}
}
}
},
"/accounts/{name}/scan_status": {
"get": {
"tags": [
"accounts"
],
"summary": "Retrieves the scan status for a specified account.",
"description": "Returns information about the last scanned block, including the block height,\nblock hash, and the timestamp when the scan occurred. This is useful for\nmonitoring the wallet's synchronization progress with the blockchain.\n\n# Path Parameters\n\n- `name`: The unique account name to query\n\n# Response\n\nReturns a [`ScanStatusResponse`] object containing:\n- Last scanned block height\n- Last scanned block hash (hex encoded)\n- Timestamp when the block was scanned\n\n# Errors\n\n- [`ApiError::AccountNotFound`]: The specified account does not exist\n- [`ApiError::NotFound`]: No blocks have been scanned yet for this account\n- [`ApiError::DbError`]: Database connection or query failure\n\n# Example Response\n\n```json\n{\n \"last_scanned_height\": 12345,\n \"last_scanned_block_hash\": \"abc123def456...\",\n \"scanned_at\": \"2024-01-15 10:30:00\"\n}\n```",
"operationId": "api_get_scan_status",
"parameters": [
{
"name": "name",
"in": "path",
"description": "Name of the account to retrieve scan status for",
"required": true,
"schema": {
"type": "string"
}
}
],
"responses": {
"200": {
"description": "Scan status retrieved successfully",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ScanStatusResponse"
}
}
}
},
"404": {
"description": "Account not found or no blocks scanned",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ApiError"
}
}
}
},
"500": {
"description": "Internal server error",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ApiError"
}
}
}
}
}
}
},
"/version": {
"get": {
"tags": [
"accounts"
],
"summary": "Retrieves the wallet version information.",
"description": "Returns the version and name of the wallet software. This endpoint does not\nrequire authentication and can be used for health checks or compatibility\nverification.\n\n# Response\n\nReturns a [`VersionResponse`] object containing:\n- The semantic version string\n- The package name\n\n# Example Response\n\n```json\n{\n \"version\": \"0.1.0\",\n \"name\": \"minotari\"\n}\n```",
"operationId": "api_get_version",
"responses": {
"200": {
"description": "Version information retrieved successfully",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/VersionResponse"
}
}
}
}
}
}
}
},
"components": {
"schemas": {
"AccountBalance": {
"type": "object",
"required": [
"total",
"available",
"locked",
"unconfirmed"
],
"properties": {
"available": {
"type": "object",
"properties": {
"amount": {
"type": "integer"
}
}
},
"locked": {
"type": "object",
"properties": {
"amount": {
"type": "integer"
}
}
},
"max_date": {
"type": [
"string",
"null"
],
"description": "The timestamp of the most recent transaction.\n\nThe string is in ISO 8601 format. Will be `None` if the\naccount has no transactions."
},
"max_height": {
"type": [
"integer",
"null"
],
"format": "int64",
"description": "The maximum blockchain height among all transactions for this account.\n\nWill be `None` if the account has no transactions."
},
"total": {
"type": "object",
"properties": {
"amount": {
"type": "integer"
}
}
},
"total_credits": {
"type": "object",
"properties": {
"amount": {
"type": "integer"
}
}
},
"total_debits": {
"type": "object",
"properties": {
"amount": {
"type": "integer"
}
}
},
"unconfirmed": {
"type": "object",
"properties": {
"amount": {
"type": "integer"
}
}
}
}
},
"AddressResponse": {
"type": "object",
"description": "API response type for an account address.\n\nContains the Tari address in Base58 format along with the emoji ID representation.\n\n# JSON Example\n\n```json\n{\n \"address\": \"f4FxMqKAPDMqAjh6hTpCnLKfEu3MmS7NRu2YmKZPvZHc2K\",\n \"emoji_id\": \"πππ...\"\n}\n```",
"required": [
"address",
"emoji_id"
],
"properties": {
"address": {
"type": "string",
"description": "The Tari address in Base58 encoding"
},
"emoji_id": {
"type": "string",
"description": "The emoji representation of the address"
}
}
},
"AddressWithPaymentIdResponse": {
"type": "object",
"description": "API response type for an address with payment ID.\n\nContains the Tari address with embedded payment ID in Base58 format,\nalong with the emoji ID representation and the original payment ID in hex.\n\n# JSON Example\n\n```json\n{\n \"address\": \"f4FxMqKAPDMqAjh6hTpCnLKfEu3MmS7NRu2YmKZPvZHc2K\",\n \"emoji_id\": \"πππ...\",\n \"payment_id_hex\": \"696e766f6963652d3132333435\"\n}\n```",
"required": [
"address",
"emoji_id",
"payment_id_hex"
],
"properties": {
"address": {
"type": "string",
"description": "The Tari address with embedded payment ID in Base58 encoding"
},
"emoji_id": {
"type": "string",
"description": "The emoji representation of the address"
},
"payment_id_hex": {
"type": "string",
"description": "The payment ID that was embedded in the address (hex encoded)"
}
}
},
"ApiError": {
"oneOf": [
{
"type": "object",
"description": "A general internal server error with a descriptive message.\n\nUsed for unexpected errors that don't fit other categories.\nReturns HTTP 500 Internal Server Error.",
"required": [
"InternalServerError"
],
"properties": {
"InternalServerError": {
"type": "string",
"description": "A general internal server error with a descriptive message.\n\nUsed for unexpected errors that don't fit other categories.\nReturns HTTP 500 Internal Server Error."
}
}
},
{
"type": "object",
"description": "A database operation failed.\n\nThis includes connection failures, query errors, and constraint\nviolations. Returns HTTP 500 Internal Server Error.\n\n# Example Causes\n\n- Database connection pool exhausted\n- SQL query syntax error\n- Foreign key constraint violation",
"required": [
"DbError"
],
"properties": {
"DbError": {
"type": "string",
"description": "A database operation failed.\n\nThis includes connection failures, query errors, and constraint\nviolations. Returns HTTP 500 Internal Server Error.\n\n# Example Causes\n\n- Database connection pool exhausted\n- SQL query syntax error\n- Foreign key constraint violation"
}
}
},
{
"type": "object",
"description": "The requested account was not found.\n\nThe contained string is the account name that was not found.\nReturns HTTP 404 Not Found.\n\n# Example\n\n```json\n{\n \"error\": \"Account 'nonexistent' not found\"\n}\n```",
"required": [
"AccountNotFound"
],
"properties": {
"AccountNotFound": {
"type": "string",
"description": "The requested account was not found.\n\nThe contained string is the account name that was not found.\nReturns HTTP 404 Not Found.\n\n# Example\n\n```json\n{\n \"error\": \"Account 'nonexistent' not found\"\n}\n```"
}
}