Skip to content

Commit 4c41254

Browse files
authored
AP: Copy over commits from ap-v3 branch (#969)
* [ANCHOR-417] Remove /fee callbacks * [ANCHOR-443] Remove transaction_erropr event type * [ANCHOR-442] Unify platform txn schemas * Regenerate * Remove dead link
1 parent 6079633 commit 4c41254

12 files changed

Lines changed: 1384 additions & 700 deletions

File tree

openapi/anchor-platform/bundled-callbacks.yaml

Lines changed: 67 additions & 138 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,6 @@ servers:
1515
tags:
1616
- name: Unique Address
1717
description: (optional) Provide a unique `stellar_address:memo` pair that will be used to correlate a Stellar payment 1-to-1 with a Platform resource such as a [SEP-31](https://stellar.org/protocol/sep-31) transaction.
18-
- name: Fees
19-
description: Requests containing data that can be used to calculate transaction fees.
2018
- name: Rates
2119
description: Requests containing data that can be used to provide exchange rates between on & off-chain assets.
2220
- name: Customers
@@ -85,104 +83,6 @@ paths:
8583
application/json:
8684
schema:
8785
$ref: '#/components/schemas/Error'
88-
/fee:
89-
get:
90-
description: |
91-
The Platform will make this request to the anchor every time a transaction is initiated by a client application
92-
without a `quote_id`.
93-
94-
The Anchor must ensure that the sending and receiving customers specified in the request meet the KYC requirements
95-
necessary to partake in the transaction described in the request.
96-
97-
The anchor must return the fee it will charge for the transaction.
98-
99-
In the future, this endpoint may be used to provide estimated fees to client applications prior to initiating transactions.
100-
When this change is made, the request schema will be adapted to support the use case.
101-
tags:
102-
- Fees
103-
x-seps:
104-
- SEP-31
105-
summary: Retrieve Fees
106-
operationId: getFee
107-
parameters:
108-
- in: query
109-
name: send_asset
110-
description: |
111-
The asset the client application will send to the anchor in exchange for `receive_asset` in
112-
[Asset Identification Format](https://github.com/stellar/stellar-protocol/blob/master/ecosystem/sep-0038.md#asset-identification-format).
113-
schema:
114-
type: string
115-
required: true
116-
- in: query
117-
name: receive_asset
118-
description: |
119-
The asset the that the anchor will send in exchange for `send_asset` in
120-
[Asset Identification Format](https://github.com/stellar/stellar-protocol/blob/master/ecosystem/sep-0038.md#asset-identification-format).
121-
schema:
122-
type: string
123-
required: true
124-
- in: query
125-
name: send_amount
126-
description: |
127-
The amount of `send_asset` the client application will send in exchange for `receive_asset`. One of `send_amount`
128-
or `receive_amount` will always be included in the request. If the client application specified a `quote_id` in
129-
its transaction creation request, both amounts specified in the referenced quote will be passed.
130-
schema:
131-
type: string
132-
- in: query
133-
name: receive_amount
134-
description: |
135-
The amount of `receive_asset` the anchor will send in exchange for `send_asset`. One of `send_amount` or
136-
`receive_amount` will always be included in the request. If the client application specified a `quote_id` in its
137-
transaction creation request, both amounts specified in the referenced quote will be passed.
138-
schema:
139-
type: string
140-
- in: query
141-
name: client_id
142-
description: |
143-
An identifier for the client application making the request. This ID can be used to offer different fees to different clients.
144-
A client ID it the Stellar account of a sending anchor: In SEP-31, the `client_id` should match the account of a known SEP-31 sending anchor match the one used to authenticate via SEP-10.
145-
schema:
146-
type: string
147-
required: true
148-
- in: query
149-
name: sender_id
150-
description: |
151-
The SEP-12 customer ID of the sending user.
152-
schema:
153-
type: string
154-
required: true
155-
- in: query
156-
name: receiver_id
157-
description: |
158-
The SEP-12 customer ID of the receiving user.
159-
schema:
160-
type: string
161-
required: true
162-
responses:
163-
'200':
164-
description: Success.
165-
content:
166-
application/json:
167-
schema:
168-
$ref: '#/components/schemas/FeeResponse'
169-
'422':
170-
description: |
171-
Unprocessable Entity. This status should be returned when the anchor understood the request but cannot
172-
return a success response. An example for when this response code would be appropriate is if the sender
173-
and/or receiver is not permitted to initiate a transaction with the specified amounts. In these cases,
174-
the Platform will respond to the client application's request with a `400 Bad Request` and include the
175-
error message provided by the anchor in the response body.
176-
content:
177-
application/json:
178-
schema:
179-
$ref: '#/components/schemas/Error'
180-
'500':
181-
description: Error. The Platform will respond to the client application with the same response code and body.
182-
content:
183-
application/json:
184-
schema:
185-
$ref: '#/components/schemas/Error'
18686
/rate:
18787
get:
18888
description: |
@@ -542,21 +442,6 @@ components:
542442
type: string
543443
required:
544444
- error
545-
Amount:
546-
type: object
547-
required:
548-
- amount
549-
- asset
550-
properties:
551-
amount:
552-
type: string
553-
asset:
554-
type: string
555-
FeeResponse:
556-
type: object
557-
properties:
558-
fee:
559-
$ref: '#/components/schemas/Amount'
560445
RateFeeDetailResponse:
561446
type: object
562447
properties:
@@ -956,6 +841,16 @@ components:
956841
- no_market
957842
- too_small
958843
- too_large
844+
Amount:
845+
type: object
846+
required:
847+
- amount
848+
- asset
849+
properties:
850+
amount:
851+
type: string
852+
asset:
853+
type: string
959854
FeeDescription:
960855
type: object
961856
required:
@@ -1073,6 +968,26 @@ components:
1073968
description: The memo type of the transaction in the Stellar network. Should be present if memo is not null.
1074969
enum:
1075970
- text id hash
971+
StellarId:
972+
type: object
973+
description: |
974+
StellarId's are objects that identify end-users and SEP-31 Sending Anchors, but not SEP-31 Receiving Anchors.
975+
976+
For a SEP-12 customer, the `id` field should be sufficient to fully identify the customer in the business' Backend.
977+
978+
For a SEP-31 Sending Anchor, the `account` and `memo` fields should be used.
979+
980+
For a SEP-6 or SEP-24 Anchor, the `account` and `memo` fields should be used.
981+
properties:
982+
id:
983+
type: string
984+
description: The `id` of the customer registered through SEP-12.
985+
account:
986+
type: string
987+
description: Either the Stellar account or Muxed account address of the on-chain entity.
988+
memo:
989+
type: string
990+
description: The memo value identifying a customer with a shared account, where the shared account is `account`.
1076991
TransactionSEP24:
1077992
type: object
1078993
required:
@@ -1097,6 +1012,9 @@ components:
10971012
- withdrawal
10981013
status:
10991014
$ref: '#/components/schemas/StatusSEP24'
1015+
type:
1016+
type: string
1017+
description: This field is always empty for SEP-24 transactions.
11001018
amount_expected:
11011019
$ref: '#/components/schemas/Amount'
11021020
amount_in:
@@ -1119,6 +1037,9 @@ components:
11191037
transfer_received_at:
11201038
type: string
11211039
format: date-time
1040+
user_action_required_by:
1041+
type: string
1042+
format: date-time
11221043
message:
11231044
type: string
11241045
refunds:
@@ -1138,14 +1059,25 @@ components:
11381059
memo_type:
11391060
$ref: '#/components/schemas/MemoType'
11401061
refund_memo:
1141-
description: if provided, this memo should be used for refund transactions
1062+
description: If provided, this memo should be used for refund transactions.
11421063
type: string
11431064
refund_memo_type:
11441065
$ref: '#/components/schemas/MemoType'
11451066
client_domain:
11461067
type: string
11471068
client_name:
11481069
type: string
1070+
customers:
1071+
type: object
1072+
description: |
1073+
The user that initiated the transaction is both the sender and receiver.
1074+
properties:
1075+
sender:
1076+
$ref: '#/components/schemas/StellarId'
1077+
receiver:
1078+
$ref: '#/components/schemas/StellarId'
1079+
creator:
1080+
$ref: '#/components/schemas/StellarId'
11491081
StatusSEP31:
11501082
type: string
11511083
description: Possible status value for SEP-31 transactions
@@ -1161,26 +1093,6 @@ components:
11611093
- pending_receiver
11621094
- pending_transaction_info_update
11631095
- pending_customer_info_update
1164-
StellarId:
1165-
type: object
1166-
description: |
1167-
StellarId's are objects that identify end-users and SEP-31 Sending Anchors, but not SEP-31 Receiving Anchors.
1168-
1169-
For a SEP-12 customer, the `id` field should be sufficient to fully identify the customer in the business' Backend.
1170-
1171-
For a SEP-31 Sending Anchor, the `account` and `memo` fields should be used.
1172-
1173-
For a SEP-6 Anchor, the `account` and `memo` fields should be used.
1174-
properties:
1175-
id:
1176-
type: string
1177-
description: The `id` of the customer registered through SEP-12.
1178-
account:
1179-
type: string
1180-
description: Either the Stellar account or Muxed account address of the on-chain entity.
1181-
memo:
1182-
type: string
1183-
description: The memo value identifying a customer with a shared account, where the shared account is `account`.
11841096
TransactionSEP31:
11851097
type: object
11861098
required:
@@ -1202,6 +1114,9 @@ components:
12021114
- receive
12031115
status:
12041116
$ref: '#/components/schemas/StatusSEP31'
1117+
type:
1118+
type: string
1119+
description: This field is always empty for SEP-31 transactions.
12051120
amount_expected:
12061121
$ref: '#/components/schemas/Amount'
12071122
amount_in:
@@ -1224,6 +1139,9 @@ components:
12241139
transfer_received_at:
12251140
type: string
12261141
format: date-time
1142+
user_action_required_by:
1143+
type: string
1144+
format: date-time
12271145
message:
12281146
type: string
12291147
refunds:
@@ -1232,8 +1150,21 @@ components:
12321150
type: array
12331151
items:
12341152
$ref: '#/components/schemas/StellarTransaction'
1153+
source_account:
1154+
type: string
1155+
destination_account:
1156+
type: string
12351157
external_transaction_id:
12361158
type: string
1159+
memo:
1160+
type: string
1161+
memo_type:
1162+
$ref: '#/components/schemas/MemoType'
1163+
refund_memo:
1164+
description: if provided, this memo should be used for refund transactions.
1165+
type: string
1166+
refund_memo_type:
1167+
$ref: '#/components/schemas/MemoType'
12371168
client_domain:
12381169
type: string
12391170
client_name:
@@ -1292,14 +1223,12 @@ components:
12921223
enum:
12931224
- transaction_created
12941225
- transaction_status_changed
1295-
- transaction_error
12961226
- quote_created
12971227
- customer_updated
12981228
description: |
12991229
The transaction event type. Can be one of the following:
13001230
- `transaction_created` - a transaction was created through the SEP endpoints. The payload is in the `transaction` field.
13011231
- `transaction_status_changed` - the status of a transaction has changed. The payload is in the `transaction` field.
1302-
- `transaction_error` - error processing the transaction. The payload is in the `transaction` field.
13031232
- `quote_created` - a quote was created via the SEP38 API. The payload is in the `quote` field.
13041233
timestamp:
13051234
type: string

0 commit comments

Comments
 (0)