-
Notifications
You must be signed in to change notification settings - Fork 1
/
specification.yaml
1424 lines (1424 loc) · 43.7 KB
/
specification.yaml
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
swagger: "2.0"
info:
description: "This is an API for interacting with Liquid Securities.\n\nExamples of how to authenticate and call the API programmatically using Python and nodejs can be obtained by request.\n\nThe version of this specification should not be confused with the version of the API itself, which can be discovered using the /info path."
version: "1.0.2"
title: "Liquid Securities"
contact:
email: "[email protected]"
host: "securities.blockstream.com"
basePath: "/api"
tags:
- name: "general"
description: "General API operations"
- name: "user"
description: "Operations about user and user information"
- name: "investors"
description: "Operations about investors"
- name: "assets"
description: "Operations about assets"
schemes:
- "https"
paths:
/info:
get:
tags:
- "general"
summary: "Gets information about the API. Token authentication is not required by this endpoint."
description: "API version information. Not to be confused with the version of this specification. \nWhen the API version is incremented, any breaking changes to the previous API will be listed in the notes returned, as shown in the Response example below."
consumes:
- "application/json"
produces:
- "application/json"
responses:
200:
description: ""
schema:
required:
- version
properties:
version:
type: string
example: "1.0.1"
notes:
type: string
example: "Version 0.99 - a new mandatory field was added to the /investors/add path that breaks the previous api definition."
/user/obtain_token:
post:
tags:
- "user"
summary: "Returns a token used to authenticate all other API calls apart from /info."
description: "The username and password you provide should be the ones used to access Liquid Securties. The token returned can be used in subsequent API calls by setting the request header like so:\n\n { 'content-type': 'application/json', 'Authorization': 'token <returned_token>' } \n\nExamples of how to authenticate and call the API programmatically using Python and nodejs can be obtained by request."
consumes:
- "application/json"
produces:
- "application/json"
parameters:
- in: "body"
name: "body"
required: true
schema:
required:
- username
- password
properties:
username:
type: string
description: "The username used to access Liquid Securities."
password:
type: string
description: "The password used to access Liquid Securities."
responses:
200:
description: "Authentication token"
schema:
required:
- token
properties:
token:
type: string
description: "The token that can be used to authenticate subsequent API calls."
400:
description: "Invalid credentials"
/investors/:
get:
tags:
- "investors"
summary: "List of all Investors."
description: ""
responses:
200:
description: ""
schema:
type: array
items:
$ref: "#/definitions/InvestorResponse"
/investors/{investorId}:
get:
tags:
- "investors"
summary: "Details of the Investor requested."
description: ""
parameters:
- name: "investorId"
in: "path"
description: "ID of investor"
required: true
type: integer
responses:
200:
description: ""
schema:
$ref: "#/definitions/InvestorResponse"
403:
description: "Not authorized"
404:
description: "Investor not found"
/investors/add:
post:
tags:
- "investors"
summary: "Adds an Investor"
description: ""
parameters:
- in: "body"
name: "body"
required: true
schema:
$ref: "#/definitions/InvestorAdd"
responses:
200:
description: ""
schema:
$ref: "#/definitions/InvestorResponse"
403:
description: "Not authorized"
/investors/{investorId}/edit:
put:
tags:
- "investors"
summary: "Updates an Investor"
description: "is_company can't be modified"
parameters:
- name: "investorId"
in: "path"
description: "ID of investor"
required: true
type: integer
- in: "body"
name: "body"
required: true
schema:
$ref: "#/definitions/InvestorEdit"
responses:
200:
description: ""
schema:
$ref: "#/definitions/InvestorResponse"
403:
description: "Not authorized"
404:
description: "Investor not found"
/investors/{investorId}/delete:
delete:
tags:
- "investors"
summary: "Deletes an Investor"
parameters:
- name: "investorId"
in: "path"
description: "ID of investor"
required: true
type: integer
responses:
204:
description: "Successful delete"
400:
description: "Bad input"
403:
description: "Not authorized"
404:
description: "Investor not found"
/investors/categories:
get:
tags:
- "investors"
summary: "Lists all Categories that can be associated with Investors."
description: ""
responses:
200:
description: "List of all investor categories"
schema:
type: array
items:
$ref: "#/definitions/InvestorCategoryResponse"
/investors/categories/add:
post:
tags:
- "investors"
summary: "Adds a new Category"
description: "Adds a new category that can then be assigned to one or more Investors."
parameters:
- in: "body"
name: "body"
required: true
schema:
$ref: "#/definitions/InvestorCategoryAdd"
responses:
200:
description: "Investor Category"
schema:
$ref: "#/definitions/InvestorCategoryResponse"
403:
description: "Not authorized"
/investors/categories/{categoryId}:
get:
tags:
- "investors"
summary: "Gets the details of the provided investor category"
description: "Returns details of the category. The id can be used to associate investors with the category elsewhere."
parameters:
- name: "categoryId"
in: "path"
description: "ID of investor category"
required: true
type: integer
responses:
200:
description: "Investor Category"
schema:
$ref: "#/definitions/InvestorCategoryResponse"
403:
description: "Not authorized"
404:
description: "Investor category not found"
/investors/categories/{categoryId}/edit:
put:
tags:
- "investors"
summary: "Allows the update of the name and description of an investor category."
parameters:
- name: "categoryId"
in: "path"
description: "ID of investor category"
required: true
type: integer
- in: "body"
name: "body"
required: true
schema:
$ref: '#/definitions/InvestorCategoryEdit'
responses:
200:
description: "Investor Category"
schema:
$ref: "#/definitions/InvestorCategoryResponse"
400:
description: "Invalid data"
403:
description: "Not authorized"
404:
description: "Investor category not found"
/investors/categories/{categoryId}/delete:
delete:
tags:
- "investors"
summary: "Delete a category."
description: ""
parameters:
- name: "categoryId"
in: "path"
description: "ID of category"
required: true
type: integer
responses:
204:
description: "Successful delete"
404:
description: "Category not found"
403:
description: "Not authorized"
/investors/categories/{categoryId}/investors-add:
post:
tags:
- "investors"
description: "An Investor can be assigned to one or more investor categories using the categories array and providing the ids of the categories to associate with the Investor. \nThere must be Categories set up (you can use the /investors/categories/add API) before an Investor can be assigned to them.\nThe wallet id should be the Green wallet id that has been created for the Investor."
summary: "Add an array of investors to a category."
parameters:
- name: "categoryId"
in: "path"
description: "ID of investor category"
required: true
type: integer
- in: "body"
name: "body"
required: true
description: "Investor ID or array of Investor IDs"
schema:
properties:
investors:
type: array
example: [1, 2]
items:
type: integer
responses:
200:
description: "Investor Category"
schema:
$ref: "#/definitions/InvestorCategoryResponse"
400:
description: "Invalid input"
403:
description: "Not authorized"
/investors/categories/{categoryId}/investors-delete:
delete:
tags:
- "investors"
summary: "Remove an array of investors from a category."
description: ""
parameters:
- name: "categoryId"
in: "path"
description: "ID of investor category"
required: true
type: integer
- in: "body"
name: "body"
required: true
description: "Investor ID or array of Investor IDs"
schema:
properties:
investors:
type: array
example: [1, 2]
items:
type: integer
responses:
200:
description: "Investor Category"
schema:
$ref: "#/definitions/InvestorCategoryResponse"
400:
description: "Invalid input"
403:
description: "Not authorized"
/assets/:
get:
tags:
- "assets"
summary: "Returns a list of all assets"
responses:
200:
description: "List of assets"
schema:
required:
- name
- asset_uuid
- issuer
- amount
- asset_id
type: array
items:
$ref: "#/definitions/Asset"
403:
description: "Not authorized"
/assets/issue:
post:
tags:
- "assets"
summary: "Issues a new asset"
description: "Issue an asset on the Liquid Network. If is_reissuable is true then reissuance_amount and reissuance_address must be provided. Name, ticker, domain and pubkey are committed to the issuance transaction, thus they cannot be changed later."
consumes:
- "application/json"
produces:
- "application/json"
parameters:
- in: "body"
name: "body"
required: true
schema:
$ref: '#/definitions/Issuance'
responses:
201:
description: "Asset Issuance"
schema:
$ref: '#/definitions/IssuanceResponse'
400:
description: "Invalid input"
403:
description: "Not authorized"
/assets/{assetUuid}:
get:
tags:
- "assets"
summary: "Gets details of a given asset"
parameters:
- name: "assetUuid"
in: "path"
description: "UUID of asset"
required: true
type: "string"
format: "uuid"
responses:
200:
description: "Asset"
schema:
$ref: "#/definitions/Asset"
403:
description: "Not authorized"
404:
description: "Asset not found"
/assets/{assetUuid}/edit:
put:
tags:
- "assets"
summary: "Updates an existing asset"
description: "The only field that can be updated is the asset's authorization endpoint."
parameters:
- name: "assetUuid"
in: "path"
description: "UUID of asset"
required: true
type: "string"
format: "uuid"
- in: "body"
name: "body"
required: true
schema:
properties:
name:
type: string
responses:
200:
description: "Assets"
schema:
$ref: "#/definitions/Asset"
403:
description: "Not authorized"
404:
description: "Asset not found"
/assets/{assetUuid}/delete:
delete:
tags:
- "assets"
summary: "Deletes the given asset and any associated relational data."
description: "The deletion cannot be undone. Deletion does not affect the underlying asset on the Liquid blockchain, neither does it destroy an issued asset amount. Use with caution for assets accidentally issued."
parameters:
- name: "assetUuid"
in: "path"
description: "UUID of asset"
required: true
type: "string"
format: "uuid"
responses:
204:
description: "Successful delete"
403:
description: "Not authorized"
404:
description: "Asset not found"
/assets/{assetUuid}/categories-add:
post:
tags:
- "assets"
summary: "Add investor category or list of categories to an asset"
description: "An asset can be assigned one or more investor categories\nThere must be Categories set up (you can use the /investors/categories/add API) before they can be assigned to an asset."
parameters:
- name: "assetUuid"
in: "path"
description: "UUID of asset"
required: true
type: "string"
format: "uuid"
- in: "body"
name: "body"
required: true
description: "Category ID or array of Category IDs"
schema:
properties:
categories:
type: array
example: [1, 2]
items:
type: integer
responses:
200:
description: "Asset"
schema:
$ref: "#/definitions/Asset"
403:
description: "Not authorized"
404:
description: "Asset not found"
/assets/{assetUuid}/categories-delete:
delete:
tags:
- "assets"
summary: "Remove investor category or list of categories from asset"
description: "Used to remove existing investor categories from an asset."
parameters:
- name: "assetUuid"
in: "path"
description: "UUID of asset"
required: true
type: "string"
format: "uuid"
- in: "body"
name: "body"
required: true
description: "Category ID or array of Category IDs"
schema:
properties:
categories:
type: array
example: [1, 2]
items:
type: integer
responses:
200:
description: "Asset"
schema:
$ref: "#/definitions/Asset"
403:
description: "Not authorized"
404:
description: "Asset not found"
/assets/{assetUuid}/register:
get:
tags:
- "assets"
summary: "Registers the asset with the Blockstream Asset Registry"
description: "Registers the asset if the requirements are satisifed.\n\nThe asset registry allows you to register an asset and prove ownership against a domain name.\nThe asset needs to have a ticker, domain and pubkey.\nFor more information see: https://docs.blockstream.com/liquid/developer-guide/developer-guide-index.html#proof-of-issuance-blockstream-s-liquid-asset-registry"
parameters:
- name: "assetUuid"
in: "path"
description: "UUID of asset"
required: true
type: "string"
format: "uuid"
responses:
200:
description: "Asset"
schema:
$ref: "#/definitions/Asset"
403:
description: "Not authorized"
404:
description: "Asset not found"
/assets/{assetUuid}/register-authorized:
get:
tags:
- "assets"
summary: "Register authorization with Green Address"
description: "Authorizes the asset within Green to be handled by Green's wallet control features. Allows whitelisting etc."
parameters:
- name: "assetUuid"
in: "path"
description: "UUID of asset"
required: true
type: "string"
format: "uuid"
responses:
200:
description: "Asset"
schema:
$ref: "#/definitions/Asset"
403:
description: "Not authorized"
404:
description: "Asset not found"
/assets/{assetUuid}/reissue-request:
post:
tags:
- "assets"
summary: "Requests the script to reissue an asset"
description: "Request the command that can be used to reissue the given amount of the asset. The amount to be reissued should be provided and the return value will be in the form of a script that must be run locally against your Liquid node. The script will reissue the stated amount of the asset and post the resulting transaction data back to the Liquid Securities API reissue-confim endpoint to confirm and register the transaction and increase the available supply within Liquid Securities."
parameters:
- name: "assetUuid"
in: "path"
description: "UUID of asset"
required: true
type: "string"
format: "uuid"
- in: "body"
name: "body"
required: true
schema:
properties:
amount_to_reissue:
type: integer
responses:
200:
description: "Reissuance command in bash script"
schema:
properties:
reissuance_bash_command:
type: string
403:
description: "Not authorized"
404:
description: "Asset not found"
/assets/{assetUuid}/reissue-confirm:
post:
tags:
- "assets"
description: "Confirms the reissuance was made. Post the exact data returned from liquid-cli's 'gettransaction' method, including surrounding '{' and '}' marks. As such, no schema property is provided. Example post data: { 'amount': { 'bitcoin': 0, ... etc. You should not need to call this manually as the reissue-request API command provides a bash script that calls this API endpoint as part of its execution."
parameters:
- name: "assetUuid"
in: "path"
description: "UUID of asset"
required: true
type: "string"
format: "uuid"
- in: "body"
name: "body"
required: true
schema:
properties:
"":
type: string
responses:
200:
description: "Confirmation of the validity of the reissuance transaction."
schema:
properties:
txid:
type: string
vout:
type: integer
destination_address:
type: string
reissuance_amount:
type: integer
confirmed_in_block:
type: string
created:
type: string
format: 'date-time'
403:
description: "Not authorized"
404:
description: "Asset not found"
/assets/{assetUuid}/activities:
get:
tags:
- "assets"
summary: "List of asset activities"
description: "Returned activities can be of type: issuance, reissuance, distribution, transactions.
Results are paged and sortable. See parameter notes for details of use. The start parameter is 1 (not zero) based to make paging easier for clients.
start=1, count=50 should return activities list indexes 0 to 49.
start=51, count=50 should return activities list indexes 50 to 99.
a negative value can be provided to return from the end of the list."
parameters:
- name: "assetUuid"
in: "path"
description: "UUID of asset"
required: true
type: "string"
format: "uuid"
- in: "query"
name: "start"
type: "integer"
description: "Start index for pagination"
required: false
default: 1
- in: "query"
name: "count"
type: "integer"
description: "Number of results per call"
required: false
default: 100000
- in: "query"
name: "sortcolumn"
type: "string"
description: "The sortcolumn parameter can either be an index number (starting at 1) or the string name of the column. "
required: false
default: 1
- in: "query"
name: "sortorder"
type: "string"
description: "The sortorder parameter can either be asc (for ascending) or desc (for descending) and defaults to asc if the parameter is not included."
required: false
default: "asc"
responses:
200:
description: "List of Asset activities"
schema:
type: array
items:
$ref: "#/definitions/Activity"
400:
description: "Invalid input"
403:
description: "Not authorized"
404:
description: "Asset not found"
/assets/{assetUuid}/ownerships:
get:
tags:
- "assets"
summary: "List of asset ownership at a given point in time"
description: "Returns ownership distribution.\n\nOwnership point in time is based upon the confirmation datetime of the associated transaction."
parameters:
- name: "assetUuid"
in: "path"
description: "UUID of asset"
required: true
type: "string"
format: "uuid"
- in: "query"
name: "height"
type: "integer"
description: "If provided the height parameter must be a valid Liquid block height else height will be set to the last Liquid block. Example: height=100."
required: false
responses:
200:
description: "List of Asset ownerships based upon confirmed transactions."
schema:
type: array
items:
$ref: "#/definitions/Ownership"
400:
description: "Invalid input"
403:
description: "Not authorized"
404:
description: "Asset not found"
/assets/{assetUuid}/balance:
get:
tags:
- "assets"
summary: "Balance of asset"
description: "Returns the balance of an asset and the list of outputs that the server lost track of. Under normal circumstances, the list of lost outputs is empty."
parameters:
- name: "assetUuid"
in: "path"
description: "UUID of asset"
required: true
type: "string"
format: "uuid"
responses:
200:
description: "Balance of an assets."
schema:
$ref: "#/definitions/Balance"
400:
description: "Invalid input"
403:
description: "Not authorized"
404:
description: "Asset not found"
/assets/{assetUuid}/reissuances:
get:
tags:
- "assets"
summary: "List of asset reissuances"
description: "Details of each Liquid transaction where the associated asset was reissued. The reissuance itself would normally be carried out by the bash script returned from the reissue-request API endpoint."
parameters:
- name: "assetUuid"
in: "path"
description: "UUID of asset"
required: true
type: "string"
format: "uuid"
responses:
200:
description: "List of Asset reissuances"
schema:
type: array
items:
$ref: "#/definitions/Reissuance"
400:
description: "Invalid input"
403:
description: "Not authorized"
404:
description: "Asset not found"
/assets/{assetUuid}/assignments:
get:
tags:
- "assignments and distributions"
summary: "List of asset assignments"
description: "List of asset assignments.\n\nAn assignment is an allocation of an asset to an investor. An assignment can be updated to adjust the amount assigned and also to prepare an assignment for distribution using /assets/{assetUuid}/assignments/{assignmentId}/edit.\nIf you want to distribute a lesser amount than the amount already assigned, you must reduce the amount assigned (what will be the remaining amount assigned) and create another assignment entry for the investor that is flagged as ready_for_distribution and set the amount to the value you want to later distribute.\n\nAssignments flagged as ready_for_distribution that do not have a distribution_uuid value will be included in the distribution transaction script returned by /assets/{assetUuid}/distributions/create/, which will also assign and return a distribution_uuid which can be used in distribution related api calls.\n\nAssignments with a distribution_uuid and a status of pending can either be cancelled using /assets/{assetUuid}/distributions/{distributionUuid}/cancel or the transaction performing the distribution can be confirmed using /assets/{assetUuid}/distributions/{distributionUuid}/confirm.\n\nAssignements with a status of 'unconfirmed' or 'confirmed' can be viewed using /{assetUuid}/distributions/{distributionUuid}/details. The status refers to the Liquid transaction status.\n\nAn investor may only have one entry of status 'assigned' and one entry with a status of either 'pending' or 'unconfirmed'. An investor may have many rows with a status of 'confirmed'."
parameters:
- name: "assetUuid"
in: "path"
description: "UUID of asset"
required: true
type: "string"
format: "uuid"
responses:
200:
description: "List of Asset Assignments"
schema:
type: array
items:
$ref: "#/definitions/Assignment"
400:
description: "Invalid input"
403:
description: "Not authorized"
404:
description: "Asset not found"
/assets/{assetUuid}/assignments/{assignmentId}:
get:
tags:
- "assignments and distributions"
summary: "Gets the details of asset assignment"
description: "Details of the assignment. See /assets/{assetUuid}/assignments for description of returned fields and available actions."
parameters:
- name: "assetUuid"
in: "path"
description: "UUID of asset"
required: true
type: "string"
format: "uuid"
- name: "assignmentId"
in: "path"
description: "Id of assignment"
required: true
type: "integer"
responses:
200:
description: "Asset Assignment"
schema:
$ref: "#/definitions/Assignment"
400:
description: "Invalid input"
403:
description: "Not authorized"
404:
description: "Asset not found"
/assets/{assetUuid}/assignments/create:
post:
tags:
- "assignments and distributions"
summary: "Create an asset assignment"
description: "The investor parameter should be the id of the investor the assigment is being made against.\n\nYou can only set the 'ready_for_distribution' value to true if the investor has no currently 'pending' or 'unconfirmed' distributions. You can only have one entry with a 'ready_for_distribution' value of true and a null 'distribution_uuid' value. \n\nSee /assets/{assetUuid}/assignments for description of returned fields and available actions."
parameters:
- name: "assetUuid"
in: "path"
description: "UUID of asset"
required: true
type: "string"
format: "uuid"
- in: "body"
name: "body"
required: true
schema:
required:
- assignments
properties:
assignments:
type: array
items:
$ref: "#/definitions/AssignmentCreate"
responses:
200:
description: "Asset Assignments"
schema:
type: array
items:
$ref: "#/definitions/Assignment"
400:
description: "Invalid input"
403:
description: "Not authorized"
404:
description: "Asset not found"
/assets/{assetUuid}/assignments/{assignmentId}/edit:
put:
tags:
- "assignments and distributions"
summary: "Edit asset assignment"
description: "Allows the amount assigned and the ready_for_distribution flag to be amended. You can only have one entry with a 'ready_for_distribution' value of true and a null 'distribution_uuid' value.\n\nSee /assets/{assetUuid}/assignments for description of returned fields and available actions."
parameters:
- name: "assetUuid"
in: "path"
description: "UUID of asset"
required: true
type: "string"
format: "uuid"
- name: "assignmentId"
in: "path"
description: "Id of assignment"
required: true
type: "integer"
- in: "body"
name: "body"
required: true
schema:
properties:
amount:
type: integer
ready_for_distribution:
type: boolean
responses:
200:
description: "Asset Assignment"
schema:
$ref: "#/definitions/Assignment"
400:
description: "Invalid input"
403:
description: "Not authorized"
404:
description: "Asset not found"
/assets/{assetUuid}/assignments/{assignmentId}/delete:
delete:
tags:
- "assignments and distributions"
summary: "Deletes the given assignment."
description: "Sets the assignment to deleted so it will be excluded from future lists and details views etc."
parameters:
- name: "assetUuid"
in: "path"
description: "UUID of asset"
required: true
type: "string"
format: "uuid"
- name: "assignmentId"
in: "path"
description: "Id of assignment"
required: true
type: "integer"
responses:
204:
description: "Successful delete"
403:
description: "Not authorized"
404:
description: "Asset or assignment not found"
/assets/{assetUuid}/distributions:
get:
tags:
- "assignments and distributions"
summary: "List of asset distributions"
description: "Distributions of assigned amounts of an asset. A distribution represents the sending of an asset amount to one or more investors. One of more confirmed Liquid transactions represent the completion of a distribution. The returned data includes details of transaction data and is grouped by distribution_uuid. A distribution may span multiple transactions, depending on the number of outputs required. The distribution_status field is derived from the status of each transaction making up the distribution."
parameters:
- name: "assetUuid"
in: "path"
description: "UUID of asset"
required: true
type: "string"
format: "uuid"
responses:
200:
description: "List of Asset Distributions"
schema:
type: array
items:
$ref: "#/definitions/Distribution"
400:
description: "Invalid input"
403:
description: "Not authorized"
404:
description: "Asset not found"
/assets/{assetUuid}/distributions/{distributionUuid}:
get:
tags:
- "assignments and distributions"
summary: "Details of the asset distribution"
description: "Returns details of the Assets distribution.\n\nSee /assets/{assetUuid}/distributions for an exlanation of the structure of a distribution."
parameters:
- name: "assetUuid"
in: "path"
description: "UUID of asset"
required: true
type: "string"
format: "uuid"
- name: "distributionUuid"
in: "path"
description: "UUID of distribution"
required: true
type: string
responses:
200:
description: "Asset Distribution details"
schema:
$ref: "#/definitions/Distribution"
400:
description: "Invalid input"
403:
description: "Not authorized"
404:
description: "Asset not found"
/assets/{assetUuid}/distributions/create/:
get:
tags:
- "assignments and distributions"
summary: "Creates an asset distribution."
description: "Creates an asset distribution script that can be run locally against a Liquid node to distribute the asset to investors.\n\nAny assignments marked as 'ready_for_distribution' without an existing 'distribution_uuid' will be assigned a distribution_uuid and a script generated to perform the distribution transaction. When run, the script will also send the distribution_uuid and transaction details back to the /assets/{assetUuid}/distributions/{distributionUuid}/confirm api so Liquid Securities can monitor the transaction for confirmation."
parameters:
- name: "assetUuid"
in: "path"
description: "UUID of asset"
required: true
type: "string"
format: "uuid"
responses:
200: