diff --git a/.changeset/lovely-meals-occur.md b/.changeset/lovely-meals-occur.md new file mode 100644 index 0000000..29123f3 --- /dev/null +++ b/.changeset/lovely-meals-occur.md @@ -0,0 +1,6 @@ +--- +'@interledger/open-payments': patch +'@interledger/openapi': patch +--- + +Updating to v1.0.2 of the specs diff --git a/.github/workflows/lint-test-build.yaml b/.github/workflows/lint-test-build.yaml index 7f9d92e..c4f2283 100644 --- a/.github/workflows/lint-test-build.yaml +++ b/.github/workflows/lint-test-build.yaml @@ -24,6 +24,8 @@ jobs: timeout-minutes: 5 steps: - uses: actions/checkout@v3 + with: + submodules: true - uses: ./.github/workflows/env-setup - run: pnpm --filter openapi test @@ -33,6 +35,8 @@ jobs: timeout-minutes: 5 steps: - uses: actions/checkout@v3 + with: + submodules: true - uses: ./.github/workflows/env-setup - name: Generate open-payments types run: pnpm --filter open-payments generate:types diff --git a/.github/workflows/publish-packages.yaml b/.github/workflows/publish-packages.yaml index 881bf28..5ce8aa4 100644 --- a/.github/workflows/publish-packages.yaml +++ b/.github/workflows/publish-packages.yaml @@ -14,6 +14,8 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 + with: + submodules: true - uses: ./.github/workflows/env-setup - name: Create Release Pull Request/Publish to npm uses: changesets/action@v1 diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 0000000..907354e --- /dev/null +++ b/.gitmodules @@ -0,0 +1,3 @@ +[submodule "open-payments-specifications"] + path = open-payments-specifications + url = git@github.com:interledger/open-payments-specifications.git diff --git a/open-payments-specifications b/open-payments-specifications new file mode 160000 index 0000000..eda1687 --- /dev/null +++ b/open-payments-specifications @@ -0,0 +1 @@ +Subproject commit eda1687f0ba062a98ed311775d71255b7f1d2416 diff --git a/openapi/auth-server.yaml b/openapi/auth-server.yaml deleted file mode 100644 index be70301..0000000 --- a/openapi/auth-server.yaml +++ /dev/null @@ -1,691 +0,0 @@ -openapi: 3.1.0 -info: - title: Open Payments Authorization Server - version: '1.2' - license: - name: Apache 2.0 - identifier: Apache-2.0 - summary: Open Payments Authorization Server - description: 'The Open Payments API is secured via [GNAP](https://datatracker.ietf.org/doc/html/draft-ietf-gnap-core-protocol). This specification describes the Open Payments Authorization Server API, which is an opinionated GNAP Server API.' - contact: - email: tech@interledger.org -servers: - - url: 'https://auth.interledger-test.dev' -tags: - - name: grant - description: Grant operations - - name: token - description: Token operations -paths: - /: - post: - summary: Grant Request - operationId: post-request - responses: - '200': - description: OK - content: - application/json: - schema: - oneOf: - - properties: - interact: - $ref: '#/components/schemas/interact-response' - continue: - $ref: '#/components/schemas/continue' - required: - - interact - - continue - - properties: - access_token: - $ref: '#/components/schemas/access_token' - continue: - $ref: '#/components/schemas/continue' - required: - - access_token - - continue - type: object - examples: - Interaction instructions: - value: - interact: - redirect: 'https://auth.interledger-test.dev/4CF492MLVMSW9MKMXKHQ' - finish: 4105340a-05eb-4290-8739-f9e2b463bfa7 - continue: - access_token: - value: 33OMUKMKSKU80UPRY5NM - uri: 'https://auth.interledger-test.dev/continue/4CF492MLVMSW9MKMXKHQ' - wait: 30 - Grant: - value: - access_token: - value: OS9M2PMHKUR64TB8N6BW7OZB8CDFONP219RP1LT0 - manage: 'https://auth.interledger-test.dev/token/dd17a202-9982-4ed9-ae31-564947fb6379' - expires_in: 3600 - access: - - type: incoming-payment - actions: - - create - - read - identifier: 'https://ilp.interledger-test.dev/bob' - continue: - access_token: - value: 33OMUKMKSKU80UPRY5NM - uri: 'https://auth.interledger-test.dev/continue/4CF492MLVMSW9MKMXKHQ' - '400': - description: Bad Request - content: - application/json: - schema: - oneOf: - - $ref: '#/components/schemas/error-invalid-request' - - $ref: '#/components/schemas/error-invalid-client' - '401': - description: Unauthorized - content: - application/json: - schema: - $ref: '#/components/schemas/error-invalid-client' - '500': - description: Internal Server Error - content: - application/json: - schema: - $ref: '#/components/schemas/error-request-denied' - requestBody: - content: - application/json: - schema: - description: '' - type: object - properties: - access_token: - type: object - required: - - access - properties: - access: - $ref: '#/components/schemas/access' - client: - $ref: '#/components/schemas/client' - interact: - $ref: '#/components/schemas/interact-request' - required: - - access_token - - client - examples: - Grant request for creating and reading recurring fixed payment: - value: - access_token: - access: - - type: outgoing-payment - actions: - - create - - read - identifier: 'https://ilp.interledger-test.dev/alice' - limits: - receiver: 'https://ilp.interledger-test.dev/incoming-payments/45a0d0ee-26dc-4c66-89e0-01fbf93156f7' - interval: 'R12/2019-08-24T14:15:22Z/P1M' - debitAmount: - value: '500' - assetCode: USD - assetScale: 2 - client: 'https://webmonize.com/.well-known/pay' - interact: - start: - - redirect - finish: - method: redirect - uri: 'https://webmonize.com/return/876FGRD8VC' - nonce: 4edb2194-dbdf-46bb-9397-d5fd57b7c8a7 - Grant request for creating and reading incoming payments: - value: - access_token: - access: - - type: incoming-payment - actions: - - create - - read - identifier: 'http://ilp.interledger-test.dev/bob' - client: 'https://webmonize.com/.well-known/pay' - description: '' - required: true - description: Make a new grant request - security: [] - tags: - - grant - parameters: [] - '/continue/{id}': - parameters: - - schema: - type: string - name: id - in: path - required: true - post: - summary: Continuation Request - operationId: post-continue - responses: - '200': - description: Success - content: - application/json: - schema: - type: object - properties: - access_token: - $ref: '#/components/schemas/access_token' - continue: - $ref: '#/components/schemas/continue' - required: - - continue - examples: - Continuing After a Completed Interaction: - value: - access_token: - value: OS9M2PMHKUR64TB8N6BW7OZB8CDFONP219RP1LT0 - manage: 'https://auth.interledger-test.dev/token/dd17a202-9982-4ed9-ae31-564947fb6379' - expires_in: 3600 - access: - - type: outgoing-payment - actions: - - create - - read - identifier: 'https://ilp.interledger-test.dev/alice' - limits: - receiver: 'https://ilp.interledger-test.dev/bob/incoming-payments/48884225-b393-4872-90de-1b737e2491c2' - interval: 'R12/2019-08-24T14:15:22Z/P1M' - debitAmount: - value: '500' - assetCode: USD - assetScale: 2 - continue: - access_token: - value: 33OMUKMKSKU80UPRY5NM - uri: 'https://auth.interledger-test.dev/continue/4CF492MLVMSW9MKMXKHQ' - wait: 30 - Continuing During Pending Interaction: - value: - continue: - access_token: - value: 33OMUKMKSKU80UPRY5NM - uri: 'https://auth.interledger-test.dev/continue/4CF492MLVMSW9MKMXKHQ' - wait: 30 - '400': - description: Bad Request - content: - application/json: - schema: - oneOf: - - $ref: '#/components/schemas/error-too-fast' - - $ref: '#/components/schemas/error-invalid-client' - '401': - description: Unauthorized - content: - application/json: - schema: - oneOf: - - $ref: '#/components/schemas/error-invalid-client' - - $ref: '#/components/schemas/error-invalid-continuation' - - $ref: '#/components/schemas/error-request-denied' - '404': - description: Not Found - content: - application/json: - schema: - oneOf: - - $ref: '#/components/schemas/error-invalid-continuation' - - $ref: '#/components/schemas/error-invalid-request' - requestBody: - content: - application/json: - schema: - type: object - properties: - interact_ref: - type: string - description: |- - The interaction reference generated for this - interaction by the AS. - examples: - Interaction Reference: - value: - interact_ref: ad82597c-bbfa-4eb0-b72e-328e005b8689 - description: Continue a grant request during or after user interaction. - tags: - - grant - delete: - summary: Cancel Grant - operationId: delete-continue - responses: - '204': - description: No Content - '401': - description: Unauthorized - content: - application/json: - schema: - oneOf: - - $ref: '#/components/schemas/error-invalid-client' - - $ref: '#/components/schemas/error-invalid-continuation' - - $ref: '#/components/schemas/error-invalid-request' - '404': - description: Not Found - content: - application/json: - schema: - $ref: '#/components/schemas/error-invalid-request' - description: Cancel a grant request or delete a grant client side. - tags: - - grant - '/token/{id}': - parameters: - - schema: - type: string - name: id - in: path - required: true - post: - summary: Rotate Access Token - operationId: post-token - responses: - '200': - description: OK - content: - application/json: - schema: - type: object - properties: - access_token: - $ref: '#/components/schemas/access_token' - required: - - access_token - examples: - New access token: - value: - access_token: - value: OZB8CDFONP219RP1LT0OS9M2PMHKUR64TB8N6BW7 - manage: 'https://auth.interledger-test.dev/token/8f69de01-5bf9-4603-91ed-eeca101081f1' - expires_in: 3600 - access: - - type: outgoing-payment - actions: - - create - - read - identifier: 'https://ilp.interledger-test.dev/alice' - limits: - interval: 'R12/2019-08-24T14:15:22Z/P1M' - receiver: 'https://ilp.interledger-test.dev/bob/incoming-payments/48884225-b393-4872-90de-1b737e2491c2' - debitAmount: - value: '500' - assetCode: USD - assetScale: 2 - '400': - description: Bad Request - content: - application/json: - schema: - $ref: '#/components/schemas/error-invalid-rotation' - '401': - description: Unauthorized - content: - application/json: - schema: - $ref: '#/components/schemas/error-invalid-client' - '404': - description: Not Found - content: - application/json: - schema: - $ref: '#/components/schemas/error-invalid-rotation' - '500': - description: Internal Server Error - content: - application/json: - schema: - $ref: '#/components/schemas/error-request-denied' - description: Management endpoint to rotate access token. - tags: - - token - delete: - summary: Revoke Access Token - operationId: delete-token - description: Management endpoint to revoke access token. - responses: - '204': - description: No Content - '401': - description: Unauthorized - content: - application/json: - schema: - $ref: '#/components/schemas/error-invalid-client' - '500': - description: Internal Server Error - content: - application/json: - schema: - $ref: '#/components/schemas/error-request-denied' - tags: - - token -components: - schemas: - access: - type: array - description: A description of the rights associated with this access token. - items: - $ref: '#/components/schemas/access-item' - uniqueItems: true - maxItems: 3 - access-item: - oneOf: - - $ref: '#/components/schemas/access-incoming' - - $ref: '#/components/schemas/access-outgoing' - - $ref: '#/components/schemas/access-quote' - description: The access associated with the access token is described using objects that each contain multiple dimensions of access. - unevaluatedProperties: false - access-incoming: - title: access-incoming - type: object - properties: - type: - type: string - enum: - - incoming-payment - description: The type of resource request as a string. This field defines which other fields are allowed in the request object. - actions: - type: array - description: The types of actions the client instance will take at the RS as an array of strings. - items: - type: string - enum: - - create - - complete - - read - - read-all - - list - - list-all - uniqueItems: true - identifier: - type: string - format: uri - description: A string identifier indicating a specific resource at the RS. - required: - - type - - actions - access-outgoing: - title: access-outgoing - type: object - properties: - type: - type: string - enum: - - outgoing-payment - description: The type of resource request as a string. This field defines which other fields are allowed in the request object. - actions: - type: array - description: The types of actions the client instance will take at the RS as an array of strings. - items: - type: string - enum: - - create - - read - - read-all - - list - - list-all - uniqueItems: true - identifier: - type: string - format: uri - description: A string identifier indicating a specific resource at the RS. - limits: - $ref: '#/components/schemas/limits-outgoing' - required: - - type - - actions - - identifier - access-quote: - title: access-quote - type: object - properties: - type: - type: string - enum: - - quote - description: The type of resource request as a string. This field defines which other fields are allowed in the request object. - actions: - type: array - description: The types of actions the client instance will take at the RS as an array of strings. - items: - type: string - enum: - - create - - read - - read-all - uniqueItems: true - required: - - type - - actions - access_token: - title: access_token - type: object - description: A single access token or set of access tokens that the client instance can use to call the RS on behalf of the RO. - properties: - value: - type: string - description: The value of the access token as a string. The value is opaque to the client instance. The value SHOULD be limited to ASCII characters to facilitate transmission over HTTP headers within other protocols without requiring additional encoding. - manage: - type: string - format: uri - description: The management URI for this access token. This URI MUST NOT include the access token value and SHOULD be different for each access token issued in a request. - expires_in: - type: integer - description: The number of seconds in which the access will expire. The client instance MUST NOT use the access token past this time. An RS MUST NOT accept an access token past this time. - access: - $ref: '#/components/schemas/access' - required: - - value - - manage - - access - additionalProperties: false - client: - title: client - type: string - description: |- - Wallet address of the client instance that is making this request. - - When sending a non-continuation request to the AS, the client instance MUST identify itself by including the client field of the request and by signing the request. - - A JSON Web Key Set document, including the public key that the client instance will use to protect this request and any continuation requests at the AS and any user-facing information about the client instance used in interactions, MUST be available at the wallet address + `/jwks.json` url. - - If sending a grant initiation request that requires RO interaction, the wallet address MUST serve necessary client display information. - continue: - title: continue - type: object - description: 'If the AS determines that the request can be continued with additional requests, it responds with the continue field.' - properties: - access_token: - type: object - description: 'A unique access token for continuing the request, called the "continuation access token".' - required: - - value - properties: - value: - type: string - uri: - type: string - format: uri - description: The URI at which the client instance can make continuation requests. - wait: - type: integer - description: The amount of time in integer seconds the client instance MUST wait after receiving this request continuation response and calling the continuation URI. - required: - - access_token - - uri - interact-request: - title: interact - type: object - properties: - start: - type: array - description: Indicates how the client instance can start an interaction. - items: - type: string - enum: - - redirect - finish: - type: object - description: Indicates how the client instance can receive an indication that interaction has finished at the AS. - properties: - method: - type: string - enum: - - redirect - description: The callback method that the AS will use to contact the client instance. - uri: - type: string - format: uri - description: Indicates the URI that the AS will either send the RO to after interaction or send an HTTP POST request. - nonce: - type: string - description: 'Unique value to be used in the calculation of the "hash" query parameter sent to the callback URI, must be sufficiently random to be unguessable by an attacker. MUST be generated by the client instance as a unique value for this request.' - required: - - method - - uri - - nonce - required: - - start - description: The client instance declares the parameters for interaction methods that it can support using the interact field. - interact-response: - title: interact-response - type: object - properties: - redirect: - type: string - format: uri - description: The URI to direct the end user to. - finish: - type: string - description: Unique key to secure the callback. - required: - - redirect - - finish - interval: - title: Interval - type: string - description: '[ISO8601 repeating interval](https://en.wikipedia.org/wiki/ISO_8601#Repeating_intervals)' - examples: - - 'R11/2022-08-24T14:15:22Z/P1M' - - 'R/2017-03-01T13:00:00Z/2018-05-11T15:30:00Z' - - 'R-1/P1Y2M10DT2H30M/2022-05-11T15:30:00Z' - limits-outgoing: - title: limits-outgoing - description: Open Payments specific property that defines the limits under which outgoing payments can be created. - anyOf: - - type: object - properties: - receiver: - $ref: ./schemas.yaml#/components/schemas/receiver - interval: - $ref: '#/components/schemas/interval' - - type: object - properties: - receiver: - $ref: ./schemas.yaml#/components/schemas/receiver - interval: - $ref: '#/components/schemas/interval' - debitAmount: - description: 'All amounts are maxima, i.e. multiple payments can be created under a grant as long as the total amounts of these payments do not exceed the maximum amount per interval as specified in the grant.' - $ref: ./schemas.yaml#/components/schemas/amount - required: - - debitAmount - - type: object - properties: - receiver: - $ref: ./schemas.yaml#/components/schemas/receiver - interval: - $ref: '#/components/schemas/interval' - receiveAmount: - description: 'All amounts are maxima, i.e. multiple payments can be created under a grant as long as the total amounts of these payments do not exceed the maximum amount per interval as specified in the grant.' - $ref: ./schemas.yaml#/components/schemas/amount - required: - - receiveAmount - error-invalid-client: - type: object - properties: - error: - type: object - properties: - description: - type: string - code: - type: string - enum: - - invalid_client - error-invalid-request: - type: object - properties: - error: - type: object - properties: - description: - type: string - code: - type: string - enum: - - invalid_request - error-request-denied: - type: object - properties: - error: - type: object - properties: - description: - type: string - code: - type: string - enum: - - request_denied - error-too-fast: - type: object - properties: - error: - type: object - properties: - description: - type: string - code: - type: string - enum: - - too_fast - error-invalid-continuation: - type: object - properties: - error: - type: object - properties: - description: - type: string - code: - type: string - enum: - - invalid_continuation - error-invalid-rotation: - type: object - properties: - error: - type: object - properties: - description: - type: string - code: - type: string - enum: - - invalid_rotation - securitySchemes: - GNAP: - name: Authorization - type: apiKey - in: header -security: - - GNAP: [] diff --git a/openapi/resource-server.yaml b/openapi/resource-server.yaml deleted file mode 100644 index 5f11d15..0000000 --- a/openapi/resource-server.yaml +++ /dev/null @@ -1,1403 +0,0 @@ -openapi: 3.1.0 -info: - title: Open Payments - version: '1.4' - license: - name: Apache 2.0 - identifier: Apache-2.0 - description: |- - The Open Payments API is a simple REST API with 4 resource types: **wallet address**, **quote**, **incoming payment** and **outgoing payment**. - - The *service endpoint* for the API is always the URL of the wallet address resource and all other resources are sub-resources of the wallet address. - - An incoming payment defines meta data that is automatically attached to payments made into the wallet address under that incoming payment. This facilitates automation of processes like reconciliation of payment into the wallet address with external systems. - - An outgoing payment is an instruction to make a payment out of the wallet address. - - A quote is a commitment from the Account Servicing Entity to deliver a particular amount to a receiver when sending a particular amount from the wallet address. It is only valid for a limited time. - - All resource and collection resource representations use JSON and the media-type `application/json`. - - The `wallet address` resource has three collections of sub-resources: - 1. `/incoming-payments` contains the **incoming payment** sub-resources - 2. `/outgoing-payments` contains the **outgoing payment** sub-resources - 3. `/quotes` contains the **quote** sub-resources - - Access to resources and permission to execute the methods exposed by the API is determined by the grants given to the client represented by an access token used in API requests. - summary: An API for open access to financial accounts to send and receive payments. - contact: - email: tech@interledger.org -servers: - - url: 'https://ilp.interledger-test.dev' - description: 'Server for wallet address subresources (ie https://ilp.interledger-test.dev/alice)' - - url: 'https://ilp.interledger-test.dev/.well-known/pay' - description: 'Server for when the wallet address has no pathname (ie https://ilp.interledger-test.dev)' -tags: - - name: wallet-address - description: wallet address operations - - name: incoming-payment - description: incoming payment operations - - name: outgoing-payment - description: outgoing payment operations - - name: quote - description: quote operations -paths: - /incoming-payments: - post: - summary: Create an Incoming Payment - tags: - - incoming-payment - operationId: create-incoming-payment - responses: - '201': - description: Incoming Payment Created - content: - application/json: - schema: - $ref: '#/components/schemas/incoming-payment-with-methods' - examples: - New Incoming Payment for $25: - value: - id: 'https://ilp.interledger-test.dev/incoming-payments/08394f02-7b7b-45e2-b645-51d04e7c330c' - walletAddress: 'https://ilp.interledger-test.dev/alice/' - incomingAmount: - value: '2500' - assetCode: USD - assetScale: 2 - receivedAmount: - value: '0' - assetCode: USD - assetScale: 2 - completed: false - expiresAt: '2022-02-03T23:20:50.52Z' - metadata: - externalRef: INV2022-02-0137 - createdAt: '2022-03-12T23:20:50.52Z' - methods: - - type: ilp - ilpAddress: g.ilp.iwuyge987y.98y08y - sharedSecret: 1c7eaXa4rd2fFOBl1iydvCT1tV5TbM3RW1WLCafu_JA - '401': - $ref: '#/components/responses/401' - '403': - $ref: '#/components/responses/403' - requestBody: - content: - application/json: - schema: - type: object - additionalProperties: false - properties: - walletAddress: - $ref: ./schemas.yaml#/components/schemas/walletAddress - incomingAmount: - $ref: ./schemas.yaml#/components/schemas/amount - description: The maximum amount that should be paid into the wallet address under this incoming payment. - expiresAt: - type: string - description: The date and time when payments into the incoming payment must no longer be accepted. - format: date-time - writeOnly: true - metadata: - type: object - additionalProperties: true - description: Additional metadata associated with the incoming payment. (Optional) - required: - - walletAddress - examples: - Create incoming payment for $25 to pay invoice INV2022-02-0137: - value: - walletAddress: 'https://openpayments.guide/alice/' - incomingAmount: - value: '2500' - assetCode: USD - assetScale: 2 - metadata: - externalRef: INV2022-02-0137 - description: |- - A subset of the incoming payments schema is accepted as input to create a new incoming payment. - - The `incomingAmount` must use the same `assetCode` and `assetScale` as the wallet address. - required: true - description: |- - A client MUST create an **incoming payment** resource before it is possible to send any payments to the wallet address. - - When a client creates an **incoming payment** the receiving Account Servicing Entity generates unique payment details that can be used to address payments to the account and returns these details to the client as properties of the new **incoming payment**. Any payments received using those details are then associated with the **incoming payment**. - - All of the input parameters are _optional_. - - For example, the client could use the `metadata` property to store an external reference on the **incoming payment** and this can be shared with the account holder to assist with reconciliation. - - If `incomingAmount` is specified and the total received using the payment details equals or exceeds the specified `incomingAmount`, then the receiving Account Servicing Entity MUST reject any further payments and set `completed` to `true`. - - If an `expiresAt` value is defined, and the current date and time on the receiving Account Servicing Entity's systems exceeds that value, the receiving Account Servicing Entity MUST reject any further payments. - parameters: - - $ref: '#/components/parameters/signature-input' - - $ref: '#/components/parameters/signature' - get: - summary: List Incoming Payments - operationId: list-incoming-payments - responses: - '200': - description: OK - content: - application/json: - schema: - type: object - properties: - pagination: - $ref: '#/components/schemas/page-info' - result: - type: array - items: - $ref: '#/components/schemas/incoming-payment' - additionalProperties: false - examples: - forward pagination: - value: - pagination: - startCursor: 241de237-f989-42be-926d-c0c1fca57708 - endCursor: 315581f8-9967-45a0-9cd3-87b60b6d6414 - hasPreviousPage: false - hasNextPage: true - result: - - id: 'https://ilp.interledger-test.dev/incoming-payments/016da9d5-c9a4-4c80-a354-86b915a04ff8' - walletAddress: 'https://ilp.interledger-test.dev/alice/' - incomingAmount: - value: '250' - assetCode: USD - assetScale: 2 - receivedAmount: - value: '250' - assetCode: USD - assetScale: 2 - metadata: - description: 'Hi Mo, this is for the cappuccino I bought for you the other day.' - externalRef: Coffee w/ Mo on 10 March 22 - expiresAt: '2022-04-12T23:20:50.52Z' - createdAt: '2022-03-12T23:20:50.52Z' - completed: true - - id: 'https://ilp.interledger-test.dev/incoming-payments/32abc219-3dc3-44ec-a225-790cacfca8fa' - walletAddress: 'https://ilp.interledger-test.dev/alice/' - receivedAmount: - value: '100' - assetCode: USD - assetScale: 2 - expiresAt: '2022-04-12T23:20:50.52Z' - createdAt: '2022-03-12T23:20:50.52Z' - metadata: - description: 'I love your website, Alice! Thanks for the great content' - completed: false - backward pagination: - value: - pagination: - startCursor: 241de237-f989-42be-926d-c0c1fca57708 - endCursor: 315581f8-9967-45a0-9cd3-87b60b6d6414 - hasPreviousPage: true - hasNextPage: false - result: - - id: 'https://ilp.interledger-test.dev/incoming-payments/32abc219-3dc3-44ec-a225-790cacfca8fa' - walletAddress: 'https://ilp.interledger-test.dev/alice/' - receivedAmount: - value: '100' - assetCode: USD - assetScale: 2 - completed: true - expiresAt: '2022-04-12T23:20:50.52Z' - createdAt: '2022-03-12T23:20:50.52Z' - metadata: - description: 'I love your website, Alice! Thanks for the great content' - - id: 'https://ilp.interledger-test.dev/incoming-payments/016da9d5-c9a4-4c80-a354-86b915a04ff8' - walletAddress: 'https://ilp.interledger-test.dev/alice/' - incomingAmount: - value: '250' - assetCode: USD - assetScale: 2 - receivedAmount: - value: '250' - assetCode: USD - assetScale: 2 - completed: true - expiresAt: '2022-04-12T23:20:50.52Z' - createdAt: '2022-03-12T23:20:50.52Z' - metadata: - description: 'Hi Mo, this is for the cappuccino I bought for you the other day.' - externalRef: Coffee w/ Mo on 10 March 22 - '401': - $ref: '#/components/responses/401' - '403': - $ref: '#/components/responses/403' - description: List all incoming payments on the wallet address - parameters: - - $ref: '#/components/parameters/wallet-address' - - $ref: '#/components/parameters/cursor' - - $ref: '#/components/parameters/first' - - $ref: '#/components/parameters/last' - - $ref: '#/components/parameters/signature-input' - - $ref: '#/components/parameters/signature' - tags: - - incoming-payment - /outgoing-payments: - post: - summary: Create an Outgoing Payment - tags: - - outgoing-payment - operationId: create-outgoing-payment - responses: - '201': - description: Outgoing Payment Created - content: - application/json: - schema: - $ref: '#/components/schemas/outgoing-payment-with-spent-amounts' - examples: - New Fixed Send Outgoing Payment for $25: - value: - id: 'https://ilp.interledger-test.dev/outgoing-payments/8c68d3cc-0a0f-4216-98b4-4fa44a6c88cf' - walletAddress: 'https://ilp.interledger-test.dev/alice/' - failed: false - receiver: 'https://ilp.interledger-test.dev/bob/incoming-payments/48884225-b393-4872-90de-1b737e2491c2' - debitAmount: - value: '2600' - assetCode: USD - assetScale: 2 - receiveAmount: - value: '2500' - assetCode: USD - assetScale: 2 - sentAmount: - value: '0' - assetCode: USD - assetScale: 2 - grantSpentDebitAmount: - value: '2600' - assetCode: USD - assetScale: 2 - grantSpentReceiveAmount: - value: '2500' - assetCode: USD - assetScale: 2 - metadata: - description: Thank you for the shoes. - createdAt: '2022-03-12T23:20:50.52Z' - '401': - $ref: '#/components/responses/401' - '403': - $ref: '#/components/responses/403' - requestBody: - content: - application/json: - examples: - Create an outgoing payment based on a quote: - value: - walletAddress: 'https://ilp.interledger-test.dev/alice/' - quoteId: 'https://ilp.interledger-test.dev/quotes/ab03296b-0c8b-4776-b94e-7ee27d868d4d' - metadata: - externalRef: INV2022-02-0137 - Create an outgoing payment based on an incoming payment: - value: - walletAddress: 'https://ilp.interledger-test.dev/alice/' - incomingPayment: 'https://ilp.interledger-test.dev/incoming-payments/8d4e4776-2e55-4e5a-bcbe-8348ed1e86de' - debitAmount: - value: '2500' - assetCode: USD - assetScale: 2 - metadata: - externalRef: INV2022-02-0137 - schema: - oneOf: - - type: object - properties: - walletAddress: - $ref: ./schemas.yaml#/components/schemas/walletAddress - quoteId: - type: string - format: uri - description: The URL of the quote defining this payment's amounts. - metadata: - type: object - additionalProperties: true - description: Additional metadata associated with the outgoing payment. (Optional) - required: - - quoteId - - walletAddress - additionalProperties: false - - type: object - properties: - walletAddress: - $ref: ./schemas.yaml#/components/schemas/walletAddress - incomingPayment: - type: string - format: uri - description: The URL of the incoming payment this outgoing payment will fulfill. - debitAmount: - description: The fixed amount that would be sent from the sending wallet address given a successful outgoing payment. - $ref: ./schemas.yaml#/components/schemas/amount - metadata: - type: object - additionalProperties: true - description: Additional metadata associated with the outgoing payment. (Optional) - required: - - incomingPayment - - debitAmount - - walletAddress - additionalProperties: false - description: |- - A subset of the outgoing payments schema is accepted as input to create a new outgoing payment. - - The `debitAmount` must use the same `assetCode` and `assetScale` as the wallet address. - - Either provide a `quoteId` to create an outgoing payment based on a quote or provide `incomingPayment` and `debitAmount` to create an outgoing payment directly from an incoming payment. - required: true - description: |- - An **outgoing payment** is a sub-resource of a wallet address. It represents a payment from the wallet address. - - Once created, it is already authorized and SHOULD be processed immediately. If payment fails, the Account Servicing Entity must mark the **outgoing payment** as `failed`. - parameters: - - $ref: '#/components/parameters/signature-input' - - $ref: '#/components/parameters/signature' - description: Create a new outgoing payment at the wallet address. - get: - summary: List Outgoing Payments - operationId: list-outgoing-payments - responses: - '200': - description: OK - content: - application/json: - schema: - type: object - properties: - pagination: - $ref: '#/components/schemas/page-info' - result: - type: array - items: - $ref: '#/components/schemas/outgoing-payment' - examples: - forward pagination: - value: - pagination: - startCursor: 241de237-f989-42be-926d-c0c1fca57708 - endCursor: 315581f8-9967-45a0-9cd3-87b60b6d6414 - hasPreviousPage: false - hasNextPage: true - result: - - id: 'https://ilp.interledger-test.dev/outgoing-payments/8c68d3cc-0a0f-4216-98b4-4fa44a6c88cf' - walletAddress: 'https://ilp.interledger-test.dev/alice/' - failed: false - receiver: 'https://ilp.interledger-test.dev/aplusvideo/incoming-payments/45d495ad-b763-4882-88d7-aa14d261686e' - receiveAmount: - value: '2500' - assetCode: USD - assetScale: 2 - debitAmount: - value: '2600' - assetCode: USD - assetScale: 2 - sentAmount: - value: '2500' - assetCode: USD - assetScale: 2 - createdAt: '2022-03-12T23:20:50.52Z' - metadata: - description: APlusVideo subscription - externalRef: 'customer: 847458475' - - id: 'https://ilp.interledger-test.dev/outgoing-payments/0cffa5a4-58fd-4cc8-8e01-7145c72bf07c' - walletAddress: 'https://ilp.interledger-test.dev/alice/' - failed: false - receiver: 'https://ilp.interledger-test.dev/shoeshop/incoming-payments/2fe92c6f-ef0d-487c-8759-3784eae6bce9' - debitAmount: - value: '7126' - assetCode: USD - assetScale: 2 - receiveAmount: - value: '7026' - assetCode: USD - assetScale: 2 - sentAmount: - value: '7026' - assetCode: USD - assetScale: 2 - createdAt: '2022-03-12T23:20:50.52Z' - metadata: - description: Thank you for your purchase at ShoeShop! - externalRef: INV2022-8943756 - backward pagination: - value: - pagination: - startCursor: 241de237-f989-42be-926d-c0c1fca57708 - endCursor: 315581f8-9967-45a0-9cd3-87b60b6d6414 - hasPreviousPage: true - hasNextPage: false - result: - - id: 'https://ilp.interledger-test.dev/outgoing-payments/0cffa5a4-58fd-4cc8-8e01-7145c72bf07c' - walletAddress: 'https://ilp.interledger-test.dev/alice/' - failed: false - receiver: 'https://ilp.interledger-test.dev/shoeshop/incoming-payments/2fe92c6f-ef0d-487c-8759-3784eae6bce9' - debitAmount: - value: '7126' - assetCode: USD - assetScale: 2 - receiveAmount: - value: '7026' - assetCode: USD - assetScale: 2 - sentAmount: - value: '7026' - assetCode: USD - assetScale: 2 - createdAt: '2022-03-12T23:20:50.52Z' - metadata: - description: Thank you for your purchase at ShoeShop! - externalRef: INV2022-8943756 - - id: 'https://ilp.interledger-test.dev/outgoing-payments/8c68d3cc-0a0f-4216-98b4-4fa44a6c88cf' - walletAddress: 'https://ilp.interledger-test.dev/alice/' - failed: false - receiver: 'https://ilp.interledger-test.dev/aplusvideo/incoming-payments/45d495ad-b763-4882-88d7-aa14d261686e' - receiveAmount: - value: '2500' - assetCode: USD - assetScale: 2 - debitAmount: - value: '2600' - assetCode: USD - assetScale: 2 - sentAmount: - value: '2500' - assetCode: USD - assetScale: 2 - createdAt: '2022-03-12T23:20:50.52Z' - metadata: - description: APlusVideo subscription - externalRef: 'customer: 847458475' - '401': - $ref: '#/components/responses/401' - '403': - $ref: '#/components/responses/403' - description: List all outgoing payments on the wallet address - parameters: - - $ref: '#/components/parameters/wallet-address' - - $ref: '#/components/parameters/cursor' - - $ref: '#/components/parameters/first' - - $ref: '#/components/parameters/last' - - $ref: '#/components/parameters/signature-input' - - $ref: '#/components/parameters/signature' - tags: - - outgoing-payment - /quotes: - post: - summary: Create a Quote - tags: - - quote - operationId: create-quote - responses: - '201': - description: Quote Created - content: - application/json: - schema: - $ref: '#/components/schemas/quote' - examples: - New Fixed Send Quote for $25: - value: - id: 'https://ilp.interledger-test.dev/quotes/8c68d3cc-0a0f-4216-98b4-4fa44a6c88cf' - walletAddress: 'https://ilp.interledger-test.dev/alice/' - receiver: 'https://ilp.interledger-test.dev/aplusvideo/incoming-payments/45d495ad-b763-4882-88d7-aa14d261686e' - debitAmount: - value: '2500' - assetCode: USD - assetScale: 2 - receiveAmount: - value: '2198' - assetCode: EUR - assetScale: 2 - method: ilp - createdAt: '2022-03-12T23:20:50.52Z' - expiresAt: '2022-04-12T23:20:50.52Z' - '400': - description: No amount was provided and no amount could be inferred from the receiver. - $ref: '#/components/responses/400' - '401': - $ref: '#/components/responses/401' - '403': - $ref: '#/components/responses/403' - requestBody: - content: - application/json: - examples: - Create quote for an `receiver` that is an Incoming Payment with an `incomingAmount`: - value: - walletAddress: 'https://ilp.interledger-test.dev/alice' - receiver: 'https://ilp.interledger-test.dev/incoming-payments/37a0d0ee-26dc-4c66-89e0-01fbf93156f7' - method: ilp - Create fixed-send amount quote for $25: - value: - walletAddress: 'https://ilp.interledger-test.dev/alice' - receiver: 'https://ilp.interledger-test.dev/incoming-payments/37a0d0ee-26dc-4c66-89e0-01fbf93156f7' - method: ilp - debitAmount: - value: '2500' - assetCode: USD - assetScale: 2 - Create fixed-receive amount quote for $25: - value: - walletAddress: 'https://ilp.interledger-test.dev/alice' - receiver: 'https://ilp.interledger-test.dev/incoming-payments/37a0d0ee-26dc-4c66-89e0-01fbf93156f7' - method: ilp - receiveAmount: - value: '2500' - assetCode: USD - assetScale: 2 - schema: - oneOf: - - description: Create quote for an `receiver` that is an Incoming Payment with an `incomingAmount` - properties: - walletAddress: - $ref: ./schemas.yaml#/components/schemas/walletAddress - receiver: - $ref: ./schemas.yaml#/components/schemas/receiver - method: - $ref: '#/components/schemas/payment-method' - required: - - walletAddress - - receiver - - method - additionalProperties: false - - description: Create a quote with a fixed-receive amount - properties: - walletAddress: - $ref: ./schemas.yaml#/components/schemas/walletAddress - receiver: - $ref: ./schemas.yaml#/components/schemas/receiver - method: - $ref: '#/components/schemas/payment-method' - receiveAmount: - description: The fixed amount that would be paid into the receiving wallet address given a successful outgoing payment. - $ref: ./schemas.yaml#/components/schemas/amount - required: - - walletAddress - - receiver - - method - - receiveAmount - additionalProperties: false - - description: Create a quote with a fixed-send amount - properties: - walletAddress: - $ref: ./schemas.yaml#/components/schemas/walletAddress - receiver: - $ref: ./schemas.yaml#/components/schemas/receiver - method: - $ref: '#/components/schemas/payment-method' - debitAmount: - description: The fixed amount that would be sent from the sending wallet address given a successful outgoing payment. - $ref: ./schemas.yaml#/components/schemas/amount - required: - - walletAddress - - receiver - - method - - debitAmount - additionalProperties: false - description: |- - A subset of the quotes schema is accepted as input to create a new quote. - - The quote must be created with a (`debitAmount` xor `receiveAmount`) unless the `receiver` is an Incoming Payment which has an `incomingAmount`. - required: true - description: A **quote** is a sub-resource of a wallet address. It represents a quote for a payment from the wallet address. - parameters: - - $ref: '#/components/parameters/signature-input' - - $ref: '#/components/parameters/signature' - description: Create a new quote at the wallet address. - '/incoming-payments/{id}': - get: - summary: Get an Incoming Payment - tags: - - incoming-payment - operationId: get-incoming-payment - responses: - '200': - description: Incoming Payment Found - content: - application/json: - schema: - anyOf: - - $ref: '#/components/schemas/incoming-payment-with-methods' - - $ref: '#/components/schemas/public-incoming-payment' - examples: - Incoming Payment for $25 with $12.34 received so far: - value: - id: 'https://ilp.interledger-test.dev/incoming-payments/2f1b0150-db73-49e8-8713-628baa4a17ff' - walletAddress: 'https://ilp.interledger-test.dev/alice/' - incomingAmount: - value: '2500' - assetCode: USD - assetScale: 2 - receivedAmount: - value: '1234' - assetCode: USD - assetScale: 2 - completed: false - expiresAt: '2022-04-12T23:20:50.52Z' - createdAt: '2022-03-12T23:20:50.52Z' - metadata: - description: Thanks for the flowers! - externalRef: INV-12876 - methods: - - type: ilp - ilpAddress: g.ilp.iwuyge987y.98y08y - sharedSecret: 1c7eaXa4rd2fFOBl1iydvCT1tV5TbM3RW1WLCafu_JA - '401': - $ref: '#/components/responses/401' - '403': - $ref: '#/components/responses/403' - '404': - $ref: '#/components/responses/404' - description: Incoming Payment Not Found - parameters: - - $ref: '#/components/parameters/optional-signature-input' - - $ref: '#/components/parameters/optional-signature' - description: A client can fetch the latest state of an incoming payment to determine the amount received into the wallet address. - parameters: - - $ref: '#/components/parameters/id' - '/incoming-payments/{id}/complete': - post: - summary: Complete an Incoming Payment - tags: - - incoming-payment - operationId: complete-incoming-payment - responses: - '200': - description: OK - content: - application/json: - schema: - $ref: '#/components/schemas/incoming-payment' - additionalProperties: false - examples: - Completed Incoming Payment: - value: - id: 'https://ilp.interledger-test.dev/incoming-payments/016da9d5-c9a4-4c80-a354-86b915a04ff8' - walletAddress: 'https://ilp.interledger-test.dev/alice/' - incomingAmount: - value: '250' - assetCode: USD - assetScale: 2 - receivedAmount: - value: '250' - assetCode: USD - assetScale: 2 - completed: true - expiresAt: '2022-04-12T23:20:50.52Z' - createdAt: '2022-03-12T23:20:50.52Z' - metadata: - description: 'Hi Mo, this is for the cappuccino I bought for you the other day.' - externalRef: Coffee w/ Mo on 10 March 2 - '401': - $ref: '#/components/responses/401' - '403': - $ref: '#/components/responses/403' - '404': - $ref: '#/components/responses/404' - description: Incoming Payment Not Found - description: |- - A client with the appropriate permissions MAY mark a non-expired **incoming payment** as `completed` indicating that the client is not going to make any further payments toward this **incoming payment**, even though the full `incomingAmount` may not have been received. - - This indicates to the receiving Account Servicing Entity that it can begin any post processing of the payment such as generating account statements or notifying the account holder of the completed payment. - parameters: - - $ref: '#/components/parameters/signature-input' - - $ref: '#/components/parameters/signature' - parameters: - - $ref: '#/components/parameters/id' - '/outgoing-payments/{id}': - get: - summary: Get an Outgoing Payment - tags: - - outgoing-payment - operationId: get-outgoing-payment - responses: - '200': - description: Outgoing Payment Found - content: - application/json: - schema: - $ref: '#/components/schemas/outgoing-payment' - examples: - Outgoing Payment with a fixed send amount of $25: - value: - id: 'https://ilp.interledger-test.dev/bob/outgoing-payments/3859b39e-4666-4ce5-8745-72f1864c5371' - walletAddress: 'https://ilp.interledger-test.dev/bob/' - failed: false - receiver: 'https://ilp.interledger-test.dev/incoming-payments/2f1b0150-db73-49e8-8713-628baa4a17ff' - debitAmount: - value: '2500' - assetCode: USD - assetScale: 2 - receiveAmount: - value: '2198' - assetCode: EUR - assetScale: 2 - sentAmount: - value: '1205' - assetCode: USD - assetScale: 2 - createdAt: '2022-03-12T23:20:50.52Z' - metadata: - description: Thanks for the flowers! - externalRef: INV-12876 - '401': - $ref: '#/components/responses/401' - '403': - $ref: '#/components/responses/403' - '404': - $ref: '#/components/responses/404' - description: Outgoing Payment Not Found - description: A client can fetch the latest state of an outgoing payment. - parameters: - - $ref: '#/components/parameters/signature-input' - - $ref: '#/components/parameters/signature' - parameters: - - $ref: '#/components/parameters/id' - '/quotes/{id}': - get: - summary: Get a Quote - tags: - - quote - operationId: get-quote - responses: - '200': - description: Quote Found - content: - application/json: - schema: - $ref: '#/components/schemas/quote' - examples: - Quote with a fixed send amount of $25: - value: - id: 'https://ilp.interledger-test.dev/bob/quotes/3859b39e-4666-4ce5-8745-72f1864c5371' - walletAddress: 'https://ilp.interledger-test.dev/bob/' - receiver: 'https://ilp.interledger-test.dev/incoming-payments/2f1b0150-db73-49e8-8713-628baa4a17ff' - debitAmount: - value: '2500' - assetCode: USD - assetScale: 2 - receiveAmount: - value: '2198' - assetCode: EUR - assetScale: 2 - method: ilp - createdAt: '2022-03-12T23:20:50.52Z' - expiresAt: '2022-04-12T23:20:50.52Z' - '401': - $ref: '#/components/responses/401' - '403': - $ref: '#/components/responses/403' - '404': - $ref: '#/components/responses/404' - description: Quote Not Found - description: A client can fetch the latest state of a quote. - parameters: - - $ref: '#/components/parameters/signature-input' - - $ref: '#/components/parameters/signature' - parameters: - - $ref: '#/components/parameters/id' -components: - schemas: - incoming-payment: - title: Incoming Payment - description: 'An **incoming payment** resource represents a payment that will be, is currently being, or has been received by the account.' - type: object - examples: - - id: 'https://ilp.interledger-test.dev/incoming-payments/016da9d5-c9a4-4c80-a354-86b915a04ff8' - walletAddress: 'https://ilp.interledger-test.dev/alice/' - incomingAmount: - value: '250' - assetCode: USD - assetScale: 2 - receivedAmount: - value: '250' - assetCode: USD - assetScale: 2 - completed: true - expiresAt: '2022-04-12T23:20:50.52Z' - createdAt: '2022-03-12T23:20:50.52Z' - metadata: - description: 'Hi Mo, this is for the cappuccino I bought for you the other day.' - externalRef: Coffee w/ Mo on 10 March 22 - - id: 'https://ilp.interledger-test.dev/incoming-payments/456da9d5-c9a4-4c80-a354-86b915a04ff8' - walletAddress: 'https://ilp.interledger-test.dev/alice/' - incomingAmount: - value: '2500' - assetCode: USD - assetScale: 2 - receivedAmount: - value: '0' - assetCode: USD - assetScale: 2 - expiresAt: '2022-04-12T23:20:50.52Z' - createdAt: '2022-03-12T23:20:50.52Z' - properties: - id: - type: string - format: uri - description: The URL identifying the incoming payment. - readOnly: true - walletAddress: - type: string - format: uri - description: The URL of the wallet address this payment is being made into. - readOnly: true - completed: - type: boolean - description: Describes whether the incoming payment has completed receiving fund. - default: false - incomingAmount: - $ref: ./schemas.yaml#/components/schemas/amount - description: The maximum amount that should be paid into the wallet address under this incoming payment. - receivedAmount: - $ref: ./schemas.yaml#/components/schemas/amount - description: The total amount that has been paid into the wallet address under this incoming payment. - expiresAt: - type: string - description: The date and time when payments under this incoming payment will no longer be accepted. - format: date-time - metadata: - type: object - additionalProperties: true - description: Additional metadata associated with the incoming payment. (Optional) - createdAt: - type: string - format: date-time - description: The date and time when the incoming payment was created. - required: - - id - - walletAddress - - completed - - receivedAmount - - createdAt - incoming-payment-with-methods: - title: Incoming Payment with payment methods - description: An **incoming payment** resource with public details. - allOf: - - $ref: '#/components/schemas/incoming-payment' - - type: object - properties: - methods: - description: The list of payment methods supported by this incoming payment. - type: array - uniqueItems: true - minItems: 0 - items: - anyOf: - - $ref: '#/components/schemas/ilp-payment-method' - required: - - methods - public-incoming-payment: - title: Public Incoming Payment - description: An **incoming payment** resource with public details. - type: object - examples: - - receivedAmount: - value: '0' - assetCode: USD - assetScale: 2 - - authServer: 'https://auth.ilp.interledger-test.dev' - properties: - receivedAmount: - $ref: ./schemas.yaml#/components/schemas/amount - authServer: - type: string - format: uri - description: The URL of the authorization server endpoint for getting grants and access tokens for this wallet address. - required: - - authServer - unresolvedProperites: false - outgoing-payment: - title: Outgoing Payment - description: 'An **outgoing payment** resource represents a payment that will be, is currently being, or has previously been, sent from the wallet address.' - type: object - examples: - - id: 'https://ilp.interledger-test.dev/outgoing-payments/8c68d3cc-0a0f-4216-98b4-4fa44a6c88cf' - walletAddress: 'https://ilp.interledger-test.dev/alice/' - failed: false - receiver: 'https://ilp.interledger-test.dev/aplusvideo/incoming-payments/45d495ad-b763-4882-88d7-aa14d261686e' - receiveAmount: - value: '2500' - assetCode: USD - assetScale: 2 - debitAmount: - value: '2600' - assetCode: USD - assetScale: 2 - sentAmount: - value: '2500' - assetCode: USD - assetScale: 2 - createdAt: '2022-03-12T23:20:50.52Z' - metadata: - description: APlusVideo subscription - externalRef: 'customer: 847458475' - - id: 'https://ilp.interledger-test.dev/outgoing-payments/0cffa5a4-58fd-4cc8-8e01-7145c72bf07c' - walletAddress: 'https://ilp.interledger-test.dev/alice/' - failed: false - receiver: 'https://ilp.interledger-test.dev/shoeshop/2fe92c6f-ef0d-487c-8759-3784eae6bce9' - debitAmount: - value: '7126' - assetCode: USD - assetScale: 2 - sentAmount: - value: '7026' - assetCode: USD - assetScale: 2 - createdAt: '2022-03-12T23:20:50.52Z' - metadata: - description: Thank you for your purchase at ShoeShop! - externalRef: INV2022-8943756 - additionalProperties: false - properties: - id: - type: string - format: uri - description: The URL identifying the outgoing payment. - readOnly: true - walletAddress: - type: string - format: uri - description: The URL of the wallet address from which this payment is sent. - readOnly: true - quoteId: - type: string - format: uri - description: The URL of the quote defining this payment's amounts. - readOnly: true - failed: - type: boolean - description: Describes whether the payment failed to send its full amount. - default: false - receiver: - $ref: ./schemas.yaml#/components/schemas/receiver - description: The URL of the incoming payment that is being paid. - receiveAmount: - $ref: ./schemas.yaml#/components/schemas/amount - description: The total amount that should be received by the receiver when this outgoing payment has been paid. - debitAmount: - $ref: ./schemas.yaml#/components/schemas/amount - description: The total amount that should be deducted from the sender's account when this outgoing payment has been paid. - sentAmount: - $ref: ./schemas.yaml#/components/schemas/amount - description: The total amount that has been sent under this outgoing payment. - metadata: - type: object - additionalProperties: true - description: Additional metadata associated with the outgoing payment. (Optional) - createdAt: - type: string - format: date-time - description: The date and time when the outgoing payment was created. - required: - - id - - walletAddress - - receiver - - receiveAmount - - debitAmount - - sentAmount - - createdAt - outgoing-payment-with-spent-amounts: - title: Outgoing Payment With Grant Spent Amounts - description: 'An **outgoing payment** resource represents a payment that will be, is currently being, or has previously been, sent from the wallet address.' - type: object - examples: - - id: 'https://ilp.interledger-test.dev/outgoing-payments/8c68d3cc-0a0f-4216-98b4-4fa44a6c88cf' - walletAddress: 'https://ilp.interledger-test.dev/alice/' - failed: false - receiver: 'https://ilp.interledger-test.dev/aplusvideo/incoming-payments/45d495ad-b763-4882-88d7-aa14d261686e' - receiveAmount: - value: '2500' - assetCode: USD - assetScale: 2 - debitAmount: - value: '2600' - assetCode: USD - assetScale: 2 - sentAmount: - value: '2500' - assetCode: USD - assetScale: 2 - grantSpentDebitAmount: - value: '2600' - assetCode: USD - assetScale: 2 - createdAt: '2022-03-12T23:20:50.52Z' - metadata: - description: APlusVideo subscription - externalRef: 'customer: 847458475' - - id: 'https://ilp.interledger-test.dev/outgoing-payments/8c68d3cc-0a0f-4216-98b4-4fa44a6c88cf' - walletAddress: 'https://ilp.interledger-test.dev/alice/' - failed: false - receiver: 'https://ilp.interledger-test.dev/aplusvideo/incoming-payments/45d495ad-b763-4882-88d7-aa14d261686e' - receiveAmount: - value: '2500' - assetCode: USD - assetScale: 2 - debitAmount: - value: '2600' - assetCode: USD - assetScale: 2 - sentAmount: - value: '2500' - assetCode: USD - assetScale: 2 - grantSpentReceiveAmount: - value: '2500' - assetCode: USD - assetScale: 2 - createdAt: '2022-03-12T23:20:50.52Z' - metadata: - description: APlusVideo subscription - externalRef: 'customer: 847458475' - properties: - id: - type: string - format: uri - description: The URL identifying the outgoing payment. - readOnly: true - walletAddress: - type: string - format: uri - description: The URL of the wallet address from which this payment is sent. - readOnly: true - quoteId: - type: string - format: uri - description: The URL of the quote defining this payment's amounts. - readOnly: true - failed: - type: boolean - description: Describes whether the payment failed to send its full amount. - default: false - receiver: - $ref: ./schemas.yaml#/components/schemas/receiver - description: The URL of the incoming payment that is being paid. - receiveAmount: - $ref: ./schemas.yaml#/components/schemas/amount - description: The total amount that should be received by the receiver when this outgoing payment has been paid. - debitAmount: - $ref: ./schemas.yaml#/components/schemas/amount - description: The total amount that should be deducted from the sender's account when this outgoing payment has been paid. - sentAmount: - $ref: ./schemas.yaml#/components/schemas/amount - description: The total amount that has been sent under this outgoing payment. - grantSpentDebitAmount: - $ref: './schemas.yaml#/components/schemas/amount' - description: The total amount successfully deducted from the sender's account using the current outgoing payment grant. - grantSpentReceiveAmount: - $ref: './schemas.yaml#/components/schemas/amount' - description: The total amount successfully received (by all receivers) using the current outgoing payment grant. - metadata: - type: object - additionalProperties: true - description: Additional metadata associated with the outgoing payment. (Optional) - createdAt: - type: string - format: date-time - description: The date and time when the outgoing payment was created. - required: - - id - - walletAddress - - receiver - - receiveAmount - - debitAmount - - sentAmount - - createdAt - quote: - title: Quote - description: A **quote** resource represents the quoted amount details with which an Outgoing Payment may be created. - type: object - examples: - - id: 'https://ilp.interledger-test.dev/quotes/ab03296b-0c8b-4776-b94e-7ee27d868d4d' - walletAddress: 'https://ilp.interledger-test.dev/alice/' - receiver: 'https://ilp.interledger-test.dev/shoeshop/incoming-payments/2fe92c6f-ef0d-487c-8759-3784eae6bce9' - receiveAmount: - value: '2500' - assetCode: USD - assetScale: 2 - debitAmount: - value: '2600' - assetCode: USD - assetScale: 2 - sentAmount: - value: '2500' - assetCode: USD - assetScale: 2 - method: ilp - createdAt: '2022-03-12T23:20:50.52Z' - expiresAt: '2022-04-12T23:20:50.52Z' - - id: 'https://ilp.interledger-test.dev/quotes/8c68d3cc-0a0f-4216-98b4-4fa44a6c88cf' - walletAddress: 'https://ilp.interledger-test.dev/alice/' - receiver: 'https://ilp.interledger-test.dev/aplusvideo/incoming-payments/45d495ad-b763-4882-88d7-aa14d261686e' - debitAmount: - value: '7126' - assetCode: USD - assetScale: 2 - sentAmount: - value: '7026' - assetCode: USD - assetScale: 2 - method: ilp - createdAt: '2022-03-12T23:20:50.52Z' - expiresAt: '2022-04-12T23:20:50.52Z' - additionalProperties: false - properties: - id: - type: string - format: uri - description: The URL identifying the quote. - readOnly: true - walletAddress: - type: string - format: uri - description: The URL of the wallet address from which this quote's payment would be sent. - readOnly: true - receiver: - $ref: ./schemas.yaml#/components/schemas/receiver - description: The URL of the incoming payment that the quote is created for. - receiveAmount: - $ref: ./schemas.yaml#/components/schemas/amount - description: The total amount that should be received by the receiver when the corresponding outgoing payment has been paid. - debitAmount: - $ref: ./schemas.yaml#/components/schemas/amount - description: "The total amount that should be deducted from the sender's account when the corresponding outgoing payment has been paid. " - method: - $ref: '#/components/schemas/payment-method' - expiresAt: - type: string - description: The date and time when the calculated `debitAmount` is no longer valid. - readOnly: true - createdAt: - type: string - format: date-time - description: The date and time when the quote was created. - required: - - id - - walletAddress - - receiver - - receiveAmount - - debitAmount - - createdAt - - method - page-info: - description: '' - type: object - examples: - - startCursor: 241de237-f989-42be-926d-c0c1fca57708 - endCursor: 315581f8-9967-45a0-9cd3-87b60b6d6414 - hasNextPage: true - hasPreviousPage: true - properties: - startCursor: - type: string - minLength: 1 - description: Cursor corresponding to the first element in the result array. - endCursor: - type: string - minLength: 1 - description: Cursor corresponding to the last element in the result array. - hasNextPage: - type: boolean - description: Describes whether the data set has further entries. - hasPreviousPage: - type: boolean - description: Describes whether the data set has previous entries. - required: - - hasNextPage - - hasPreviousPage - additionalProperties: false - payment-method: - type: string - enum: - - ilp - ilp-payment-method: - type: object - additionalProperties: false - properties: - type: - type: string - enum: - - ilp - ilpAddress: - type: string - maxLength: 1023 - pattern: '^(g|private|example|peer|self|test[1-3]?|local)([.][a-zA-Z0-9_~-]+)+$' - description: The ILP address to use when establishing a STREAM connection. - sharedSecret: - type: string - pattern: '^[a-zA-Z0-9-_]+$' - description: The base64 url-encoded shared secret to use when establishing a STREAM connection. - required: - - type - - ilpAddress - - sharedSecret - examples: - - type: string - ilpAddress: string - sharedSecret: string - error-response: - type: object - properties: - error: - type: object - properties: - code: - type: string - description: - type: string - details: - type: object - additionalProperties: true - description: Additional details about the error. - required: - - description - - code - required: - - error - examples: - error-response-minimal: - value: - error: - code: 'invalid_request' - description: Error description - error-response-full: - value: - error: - code: 'invalid_request' - description: Error description - details: - anyKey: anyValue - securitySchemes: - GNAP: - name: Authorization - type: apiKey - in: header - description: |- - The API uses the Grant Negotiation and Authorization Protocol for authorization. An access token must be acquired from an authorization server before accessing the API and then provided in the request headers using the prefix `GNAP`. - - All requests must also be signed using a client key over some select headers and a digest of the request body. - responses: - '400': - description: Bad Request - content: - application/json: - schema: - $ref: '#/components/schemas/error-response' - examples: - Detailed error response: - $ref: '#/components/examples/error-response-full' - Standard error response: - $ref: '#/components/examples/error-response-minimal' - '401': - description: Authorization required - headers: - WWW-Authenticate: - schema: - type: string - description: The address of the authorization server for grant requests in the format `GNAP as_uri=` - content: - application/json: - schema: - $ref: '#/components/schemas/error-response' - examples: - Detailed error response: - $ref: '#/components/examples/error-response-full' - Standard error response: - $ref: '#/components/examples/error-response-minimal' - '403': - description: Forbidden - content: - application/json: - schema: - $ref: '#/components/schemas/error-response' - examples: - Detailed error response: - $ref: '#/components/examples/error-response-full' - Standard error response: - $ref: '#/components/examples/error-response-minimal' - '404': - description: Not Found - content: - application/json: - schema: - $ref: '#/components/schemas/error-response' - examples: - Detailed error response: - $ref: '#/components/examples/error-response-full' - Standard error response: - $ref: '#/components/examples/error-response-minimal' - parameters: - cursor: - schema: - type: string - minLength: 1 - name: cursor - in: query - description: The cursor key to list from. - first: - schema: - type: integer - minimum: 1 - maximum: 100 - name: first - in: query - description: The number of items to return after the cursor. - last: - schema: - type: integer - minimum: 1 - maximum: 100 - name: last - in: query - description: The number of items to return before the cursor. - id: - name: id - in: path - schema: - type: string - description: Sub-resource identifier - required: true - wallet-address: - name: wallet-address - in: query - schema: - type: string - description: 'URL of a wallet address hosted by a Rafiki instance.' - required: true - signature: - name: Signature - in: header - schema: - $ref: '#/components/parameters/optional-signature' - description: 'The signature generated based on the Signature-Input, using the signing algorithm specified in the "alg" field of the JWK.' - required: true - signature-input: - name: Signature-Input - in: header - schema: - $ref: '#/components/parameters/optional-signature-input' - description: 'The Signature-Input field is a Dictionary structured field containing the metadata for one or more message signatures generated from components within the HTTP message. Each member describes a single message signature. The member''s key is the label that uniquely identifies the message signature within the context of the HTTP message. The member''s value is the serialization of the covered components Inner List plus all signature metadata parameters identified by the label. The following components MUST be included: - "@method" - "@target-uri" - "authorization". When the message contains a request body, the covered components MUST also include the following: - "content-digest" The keyid parameter of the signature MUST be set to the kid value of the JWK. See [ietf-httpbis-message-signatures](https://datatracker.ietf.org/doc/html/draft-ietf-httpbis-message-signatures#section-4.1) for more details.' - required: true - optional-signature: - name: Signature - in: header - schema: - type: string - examples: - - 'Signature: sig1=:EWJgAONk3D6542Scj8g51rYeMHw96cH2XiCMxcyL511wyemGcw==:' - description: 'The signature generated based on the Signature-Input, using the signing algorithm specified in the "alg" field of the JWK.' - optional-signature-input: - name: Signature-Input - in: header - schema: - type: string - examples: - - 'Signature-Input: sig1=("@method" "@target-uri" "content-digest" "content-length" "content-type");created=1618884473;keyid="gnap-rsa"' - description: 'The Signature-Input field is a Dictionary structured field containing the metadata for one or more message signatures generated from components within the HTTP message. Each member describes a single message signature. The member''s key is the label that uniquely identifies the message signature within the context of the HTTP message. The member''s value is the serialization of the covered components Inner List plus all signature metadata parameters identified by the label. The following components MUST be included: - "@method" - "@target-uri" - "authorization". When the message contains a request body, the covered components MUST also include the following: - "content-digest" The keyid parameter of the signature MUST be set to the kid value of the JWK. See [ietf-httpbis-message-signatures](https://datatracker.ietf.org/doc/html/draft-ietf-httpbis-message-signatures#section-4.1) for more details.' -security: - - GNAP: [] diff --git a/openapi/schemas.yaml b/openapi/schemas.yaml deleted file mode 100644 index 119f7ea..0000000 --- a/openapi/schemas.yaml +++ /dev/null @@ -1,54 +0,0 @@ -openapi: 3.1.0 -info: - title: Open Payments - Shared schemas - version: '1.0' - license: - name: Apache 2.0 - identifier: Apache-2.0 - summary: Open Payments - Shared schemas - description: 'Shared schemas used across Open Payments APIs' - contact: - email: tech@interledger.org -components: - schemas: - amount: - title: amount - type: object - properties: - value: - type: string - format: uint64 - description: 'The value is an unsigned 64-bit integer amount, represented as a string.' - assetCode: - $ref: '#/components/schemas/assetCode' - assetScale: - $ref: '#/components/schemas/assetScale' - required: - - value - - assetCode - - assetScale - assetCode: - title: Asset code - type: string - description: The assetCode is a code that indicates the underlying asset. This SHOULD be an ISO4217 currency code. - assetScale: - title: Asset scale - type: integer - minimum: 0 - maximum: 255 - description: The scale of amounts denoted in the corresponding asset code. - receiver: - title: Receiver - type: string - description: The URL of the incoming payment that is being paid. - format: uri - pattern: '^(https|http)://(.+)/incoming-payments/(.+)$' - examples: - - 'https://ilp.interledger-test.dev/incoming-payments/08394f02-7b7b-45e2-b645-51d04e7c330c' - - 'http://ilp.interledger-test.dev/incoming-payments/08394f02-7b7b-45e2-b645-51d04e7c330c' - - 'https://ilp.interledger-test.dev/incoming-payments/1' - walletAddress: - title: Wallet Address - type: string - description: 'URL of a wallet address hosted by a Rafiki instance.' - format: uri diff --git a/openapi/wallet-address-server.yaml b/openapi/wallet-address-server.yaml deleted file mode 100644 index e55e156..0000000 --- a/openapi/wallet-address-server.yaml +++ /dev/null @@ -1,209 +0,0 @@ -openapi: 3.1.0 -info: - title: Wallet Address API - version: '1.4' - license: - name: Apache 2.0 - identifier: Apache-2.0 - description: |- - The Wallet Address API is a simple REST API to get basic details about a wallet address. - contact: - email: tech@interledger.org -servers: - - url: 'https://ilp.interledger-test.dev/alice' - description: "Server for Alice's wallet address" - - url: 'https://ilp.interledger-test.dev/bob' - description: "Server for Bob's wallet address" -tags: - - name: wallet-address - description: wallet address operations -paths: - /: - get: - summary: Get a Wallet Address - tags: - - wallet-address - responses: - '200': - description: Wallet Address Found - content: - application/json: - schema: - $ref: '#/components/schemas/wallet-address' - examples: - Get wallet address for $ilp.interledger-test.dev/alice: - value: - id: 'https://ilp.interledger-test.dev/alice' - publicName: Alice - assetCode: USD - assetScale: 2 - authServer: 'https://ilp.interledger-test.dev/auth' - resourceServer: 'https://ilp.interledger-test.dev/op' - '302': - description: If the `Accept` header is `text/html` in the request, the server may choose to redirect to an HTML page for the given wallet address. - headers: - Location: - description: 'The URL of the wallet address webpage.' - schema: - type: string - '404': - description: Wallet Address Not Found - operationId: get-wallet-address - description: |- - Retrieve the public information of the Wallet Address. - - This end-point should be open to anonymous requests as it allows clients to verify a Wallet Address URL and get the basic information required to construct new transactions and discover the grant request URL. - - The content should be slow changing and cacheable for long periods. Servers SHOULD use cache control headers. - security: [] - x-internal: false - /jwks.json: - get: - summary: Get the keys bound to a Wallet Address - tags: - - wallet-address - responses: - '200': - description: JWKS Document Found - content: - application/json: - schema: - $ref: '#/components/schemas/json-web-key-set' - examples: {} - '404': - description: JWKS Document Not Found - operationId: get-wallet-address-keys - description: Retrieve the public keys of the Wallet Address. - security: [] - /did.json: - get: - summary: Get the DID Document for this wallet - tags: - - wallet-address - responses: - '200': - description: DID Document Found - content: - application/json: - schema: - $ref: '#/components/schemas/did-document' - '500': - description: DID Document not yet implemented - operationId: get-wallet-address-did-document - description: Retrieve the DID Document of the Wallet Address. - security: [] -components: - schemas: - wallet-address: - title: Wallet Address - type: object - description: A **wallet address** resource is the root of the API and contains the public details of the financial account represented by the Wallet Address that is also the service endpoint URL. - additionalProperties: true - examples: - - id: 'https://ilp.interledger-test.dev/alice' - publicName: Alice - assetCode: USD - assetScale: 2 - authServer: 'https://ilp.interledger-test.dev/auth' - resourceServer: 'https://ilp.interledger-test.dev/op' - properties: - id: - type: string - format: uri - description: The URL identifying the wallet address. - readOnly: true - publicName: - type: string - description: A public name for the account. This should be set by the account holder with their provider to provide a hint to counterparties as to the identity of the account holder. - readOnly: true - assetCode: - $ref: ./schemas.yaml#/components/schemas/assetCode - assetScale: - $ref: ./schemas.yaml#/components/schemas/assetScale - authServer: - type: string - format: uri - description: The URL of the authorization server endpoint for getting grants and access tokens for this wallet address. - readOnly: true - resourceServer: - type: string - format: uri - description: The URL of the resource server endpoint for performing Open Payments with this wallet address. - readOnly: true - required: - - id - - assetCode - - assetScale - - authServer - - resourceServer - json-web-key-set: - title: JSON Web Key Set document - type: object - description: 'A JSON Web Key Set document according to [rfc7517](https://datatracker.ietf.org/doc/html/rfc7517) listing the keys associated with this wallet address. These keys are used to sign requests made by this wallet address.' - additionalProperties: false - properties: - keys: - type: array - items: - $ref: '#/components/schemas/json-web-key' - readOnly: true - required: - - keys - examples: - - keys: - - kid: key-1 - alg: EdDSA - use: sig - kty: OKP - crv: Ed25519 - x: 11qYAYKxCrfVS_7TyWQHOg7hcvPapiMlrwIaaPcHURo - json-web-key: - type: object - properties: - kid: - type: string - alg: - type: string - description: 'The cryptographic algorithm family used with the key. The only allowed value is `EdDSA`. ' - enum: - - EdDSA - use: - type: string - enum: - - sig - kty: - type: string - enum: - - OKP - crv: - type: string - enum: - - Ed25519 - x: - type: string - pattern: '^[a-zA-Z0-9-_]+$' - description: The base64 url-encoded public key. - required: - - kid - - alg - - kty - - crv - - x - title: Ed25519 Public Key - description: A JWK representation of an Ed25519 Public Key - examples: - - kid: key-1 - use: sig - kty: OKP - crv: Ed25519 - x: 11qYAYKxCrfVS_7TyWQHOg7hcvPapiMlrwIaaPcHURo - - kid: '2022-09-02' - use: sig - kty: OKP - crv: Ed25519 - x: oy0L_vTygNE4IogRyn_F5GmHXdqYVjIXkWs2jky7zsI - did-document: - type: object - additionalProperties: true - title: DID Document - description: A DID Document using JSON encoding diff --git a/packages/open-payments/src/openapi/generated/auth-server-types.ts b/packages/open-payments/src/openapi/generated/auth-server-types.ts index 608f0d3..db77e3c 100644 --- a/packages/open-payments/src/openapi/generated/auth-server-types.ts +++ b/packages/open-payments/src/openapi/generated/auth-server-types.ts @@ -80,6 +80,30 @@ export interface paths { export type webhooks = Record; export interface components { schemas: { + /** amount */ + amount: { + /** + * Format: uint64 + * @description The value is an unsigned 64-bit integer amount, represented as a string. + */ + value: string; + /** + * Asset code + * @description The assetCode is a code that indicates the underlying asset. An ISO4217 currency code should be used whenever possible. The ISO4217 representation of the US Dollar is USD. + */ + assetCode: string; + /** + * Asset scale + * @description The number of decimal places that defines the scale of the smallest divisible unit for the given asset code. It determines how an integer amount is scaled to derive the actual monetary value. For example, USD has an asset scale of 2 with the smallest unit being 0.01. An integer amount of `1000` with an `assetCode` of `USD` and `assetScale` of `2` translates to $10.00. + */ + assetScale: number; + }; + /** + * Receiver + * Format: uri + * @description The URL of the incoming payment that is being paid. + */ + receiver: string; /** @description A description of the rights associated with this access token. */ access: components["schemas"]["access-item"][]; /** @description The access associated with the access token is described using objects that each contain multiple dimensions of access. */ @@ -267,32 +291,6 @@ export interface components { code?: "invalid_rotation"; }; }; - /** - * Receiver - * Format: uri - * @description The URL of the incoming payment that is being paid. - */ - receiver: string; - /** - * Asset code - * @description The assetCode is a code that indicates the underlying asset. This SHOULD be an ISO4217 currency code. - */ - assetCode: string; - /** - * Asset scale - * @description The scale of amounts denoted in the corresponding asset code. - */ - assetScale: number; - /** amount */ - amount: { - /** - * Format: uint64 - * @description The value is an unsigned 64-bit integer amount, represented as a string. - */ - value: string; - assetCode: components["schemas"]["assetCode"]; - assetScale: components["schemas"]["assetScale"]; - }; }; responses: never; parameters: never; diff --git a/packages/open-payments/src/openapi/generated/resource-server-types.ts b/packages/open-payments/src/openapi/generated/resource-server-types.ts index 355080c..ded0e5d 100644 --- a/packages/open-payments/src/openapi/generated/resource-server-types.ts +++ b/packages/open-payments/src/openapi/generated/resource-server-types.ts @@ -182,6 +182,36 @@ export interface paths { export type webhooks = Record; export interface components { schemas: { + /** amount */ + amount: { + /** + * Format: uint64 + * @description The value is an unsigned 64-bit integer amount, represented as a string. + */ + value: string; + /** + * Asset code + * @description The assetCode is a code that indicates the underlying asset. An ISO4217 currency code should be used whenever possible. The ISO4217 representation of the US Dollar is USD. + */ + assetCode: string; + /** + * Asset scale + * @description The number of decimal places that defines the scale of the smallest divisible unit for the given asset code. It determines how an integer amount is scaled to derive the actual monetary value. For example, USD has an asset scale of 2 with the smallest unit being 0.01. An integer amount of `1000` with an `assetCode` of `USD` and `assetScale` of `2` translates to $10.00. + */ + assetScale: number; + }; + /** + * Wallet Address + * Format: uri + * @description The URL of an Open Payments wallet address + */ + walletAddress: string; + /** + * Receiver + * Format: uri + * @description The URL of the incoming payment that is being paid. + */ + receiver: string; /** * Incoming Payment * @description An **incoming payment** resource represents a payment that will be, is currently being, or has been received by the account. @@ -391,38 +421,6 @@ export interface components { }; }; }; - /** - * Asset code - * @description The assetCode is a code that indicates the underlying asset. This SHOULD be an ISO4217 currency code. - */ - assetCode: string; - /** - * Asset scale - * @description The scale of amounts denoted in the corresponding asset code. - */ - assetScale: number; - /** amount */ - amount: { - /** - * Format: uint64 - * @description The value is an unsigned 64-bit integer amount, represented as a string. - */ - value: string; - assetCode: components["schemas"]["assetCode"]; - assetScale: components["schemas"]["assetScale"]; - }; - /** - * Wallet Address - * Format: uri - * @description URL of a wallet address hosted by a Rafiki instance. - */ - walletAddress: string; - /** - * Receiver - * Format: uri - * @description The URL of the incoming payment that is being paid. - */ - receiver: string; }; responses: { /** @description Bad Request */ diff --git a/packages/open-payments/src/openapi/generated/wallet-address-server-types.ts b/packages/open-payments/src/openapi/generated/wallet-address-server-types.ts index 3952edd..ff42b6e 100644 --- a/packages/open-payments/src/openapi/generated/wallet-address-server-types.ts +++ b/packages/open-payments/src/openapi/generated/wallet-address-server-types.ts @@ -84,8 +84,16 @@ export interface components { readonly id: string; /** @description A public name for the account. This should be set by the account holder with their provider to provide a hint to counterparties as to the identity of the account holder. */ readonly publicName?: string; - assetCode: components["schemas"]["assetCode"]; - assetScale: components["schemas"]["assetScale"]; + /** + * Asset code + * @description The assetCode is a code that indicates the underlying asset. An ISO4217 currency code should be used whenever possible. The ISO4217 representation of the US Dollar is USD. + */ + assetCode: string; + /** + * Asset scale + * @description The number of decimal places that defines the scale of the smallest divisible unit for the given asset code. It determines how an integer amount is scaled to derive the actual monetary value. For example, USD has an asset scale of 2 with the smallest unit being 0.01. An integer amount of `1000` with an `assetCode` of `USD` and `assetScale` of `2` translates to $10.00. + */ + assetScale: number; /** * Format: uri * @description The URL of the authorization server endpoint for getting grants and access tokens for this wallet address. @@ -133,16 +141,6 @@ export interface components { "did-document": { [key: string]: unknown; }; - /** - * Asset code - * @description The assetCode is a code that indicates the underlying asset. This SHOULD be an ISO4217 currency code. - */ - assetCode: string; - /** - * Asset scale - * @description The scale of amounts denoted in the corresponding asset code. - */ - assetScale: number; }; responses: never; parameters: never; diff --git a/packages/open-payments/src/openapi/specs/auth-server.yaml b/packages/open-payments/src/openapi/specs/auth-server.yaml index 21dea68..0dd01f1 120000 --- a/packages/open-payments/src/openapi/specs/auth-server.yaml +++ b/packages/open-payments/src/openapi/specs/auth-server.yaml @@ -1 +1 @@ -../../../../../openapi/auth-server.yaml \ No newline at end of file +../../../../../open-payments-specifications/openapi/auth-server.yaml \ No newline at end of file diff --git a/packages/open-payments/src/openapi/specs/resource-server.yaml b/packages/open-payments/src/openapi/specs/resource-server.yaml index d086cf2..126d67c 120000 --- a/packages/open-payments/src/openapi/specs/resource-server.yaml +++ b/packages/open-payments/src/openapi/specs/resource-server.yaml @@ -1 +1 @@ -../../../../../openapi/resource-server.yaml \ No newline at end of file +../../../../../open-payments-specifications/openapi/resource-server.yaml \ No newline at end of file diff --git a/packages/open-payments/src/openapi/specs/schemas.yaml b/packages/open-payments/src/openapi/specs/schemas.yaml deleted file mode 120000 index aa9cf9f..0000000 --- a/packages/open-payments/src/openapi/specs/schemas.yaml +++ /dev/null @@ -1 +0,0 @@ -../../../../../openapi/schemas.yaml \ No newline at end of file diff --git a/packages/open-payments/src/openapi/specs/wallet-address-server.yaml b/packages/open-payments/src/openapi/specs/wallet-address-server.yaml index eba3c86..88ab20a 120000 --- a/packages/open-payments/src/openapi/specs/wallet-address-server.yaml +++ b/packages/open-payments/src/openapi/specs/wallet-address-server.yaml @@ -1 +1 @@ -../../../../../openapi/wallet-address-server.yaml \ No newline at end of file +../../../../../open-payments-specifications/openapi/wallet-address-server.yaml \ No newline at end of file diff --git a/packages/openapi/src/middleware.test.ts b/packages/openapi/src/middleware.test.ts index 7880019..2410e7c 100644 --- a/packages/openapi/src/middleware.test.ts +++ b/packages/openapi/src/middleware.test.ts @@ -45,7 +45,10 @@ export function createContext( } const PATH = '/incoming-payments' -const SPEC = path.resolve(__dirname, '../../../openapi/resource-server.yaml') +const SPEC = path.resolve( + __dirname, + '../../../open-payments-specifications/openapi/resource-server.yaml' +) const WALLET_ADDRESS = 'https://openpayments.dev/alice' describe('OpenAPI Validator', (): void => {