Skip to content

Commit

Permalink
feat: updated api spec for transfers and wallets
Browse files Browse the repository at this point in the history
  • Loading branch information
pranavkparti committed Aug 10, 2023
1 parent c459281 commit 9803c2c
Showing 1 changed file with 143 additions and 27 deletions.
170 changes: 143 additions & 27 deletions docs/api/spec/treetracker-wallet-api-v1-10.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -47,16 +47,17 @@ paths:
type: integer
format: int32
example: 100
- name: start
- name: offset
in: query
description: 'Where does the list start, 1 means start from the beginning of the list'
description: 'Where does the list start, 0 means start from the beginning of the list'
required: false
style: form
explode: true
schema:
type: integer
format: int32
example: 1
default: 0
- name: wallet
description: Wallet id or name can be specified if the authenticated wallet manages other wallets. The default is to return tokens matching the authenticated wallet
in: query
Expand Down Expand Up @@ -118,17 +119,17 @@ paths:
format: int32
example: 100
default: 100
- name: start
- name: offset
in: query
description: 'Where does the list start, 1 means start from the beginning of the list'
description: 'Where does the list start, 0 means start from the beginning of the list'
required: false
style: form
explode: true
schema:
type: integer
format: int32
example: 1
default: 1
default: 0
responses:
'200':
description: ''
Expand Down Expand Up @@ -237,19 +238,35 @@ paths:
type: integer
format: int32
example: 100
- name: start
- name: offset
in: query
description: 'Where does the list start, 1 means start from the beginning of the list'
description: 'Where does the list start, 0 means start from the beginning of the list'
required: false
style: form
explode: true
schema:
type: integer
format: int32
example: 1
default: 0
responses:
'200':
description: Return array of matching transfers
content:
application/json:
schema:
type: object
properties:
transfers:
type: array
items:
$ref: '#/components/schemas/transferItem'
limit:
type: integer
offset:
type: integer
total:
type: integer
'401':
$ref: '#/components/responses/UnauthorizedError'
'/tokens/{token_uuid}/transactions':
Expand Down Expand Up @@ -278,16 +295,17 @@ paths:
type: integer
format: int32
example: 100
- name: start
- name: offset
in: query
description: 'Where does the list start, 1 means start from the beginning of the list'
description: 'Where does the list start, 0 means start from the beginning of the list'
required: false
style: form
explode: true
schema:
type: integer
format: int32
example: 1
default: 0
responses:
'200':
description: ''
Expand All @@ -313,6 +331,10 @@ paths:
responses:
'200':
description: ''
content:
application/json:
schema:
$ref: '#/components/schemas/transferItem'
'401':
$ref: '#/components/responses/UnauthorizedError'
delete:
Expand Down Expand Up @@ -429,16 +451,17 @@ paths:
type: integer
format: int32
example: 100
- name: start
- name: offset
in: query
description: 'Where does the list start, 1 means start from the beginning of the list'
description: 'Where does the list start, 0 means start from the beginning of the list'
required: false
style: form
explode: true
schema:
type: integer
format: int32
example: 1
default: 0
responses:
'200':
description: ''
Expand All @@ -462,16 +485,17 @@ paths:
type: integer
format: int32
example: 100
- name: start
- name: offset
in: query
description: 'Where does the list start, 1 means start from the beginning of the list'
description: 'Where does the list start, 0 means start from the beginning of the list'
required: false
style: form
explode: true
schema:
type: integer
format: int32
example: 1
default: 0
- name: state
in: query
description: Filter by state of the trust relationship
Expand Down Expand Up @@ -684,7 +708,7 @@ components:
type: array
items:
$ref: '#/components/schemas/tokenItem'
tokenItems:
tokenItem:
title: Token Item
type: object
properties:
Expand Down Expand Up @@ -742,17 +766,109 @@ components:
type: array
items:
$ref: '#/components/schemas/walletItem'
total:
type: integer
description: total count of wallets satisfying the query condition
example: 1
query:
type: object
properties:
offset:
type: integer
example: 0
limit:
type: integer
example: 5
walletItem:
title: Wallet Details
properties:
wallet:
id:
type: string
email:
format: uuid
example: 482bf306-30c7-4cea-833a-1cdda3d96573
name:
type: string
phone:
example: test11
logo_url:
type: string
format: url
example: https://www.placehold.co/192x192
created_at:
type: string
format: date-time
example: 2023-08-08T06:28:39.766Z
tokens_in_wallet:
type: integer
example: 12
transferItem:
title: Transfer Details
properties:
id:
type: string
format: uuid
description: Transfer ID
example: cf0ce129-8c12-45cf-b914-a8f1cb6b7dc5
type:
type: string
enum:
- send
- deduct
- managed
description: Transfer type
example: send
parameters:
type: object
oneOf:
- properties:
bundle:
type: object
properties:
bundleSize:
type: integer
description: Number of tokens associated with the transfer
example: 2
required:
- bundleSize
- properties:
tokens:
type: array
items:
$ref: '#/components/schemas/tokenItem'
state:
type: string
enum:
- pending
- completed
- requested
- cancelled
- failed
example: completed
created_at:
type: string
format: date-time
example: 2023-08-02T21:46:35.134Z
closed_at:
type: string
format: date-time
example: 2023-08-02T21:46:35.134Z
active:
type: boolean
example: true
claim:
type: boolean
example: false
originating_wallet:
type: string
example: testuser
source_wallet:
type: string
example: testuser
destination_wallet:
type: string
example: wallet22
token_count:
type: integer
example: 1
transferrequest:
title: transferrequest
oneOf:
Expand Down Expand Up @@ -843,35 +959,35 @@ components:
properties:
id:
type: string
format: uuid
description: The unique ID for this transfer
originating_wallet:
type: string
example: johnwallet1
source_wallet:
type: string
example: planeter
destination_wallet:
type: string
example: just.a.guy
type:
type: string
description: 'the type of transfer. send, deduct, or managed. the value is computed by the server based on the submitted request'
example: send
parameters:
$ref: '#/components/schemas/requestBundleRequestParameters'
state:
type: string
description: 'the state of the transfer. requested, pending, completed, cancelled, or failed'
example: completed
created_at:
type: string
format: date-time
example: 2020-07-09T00:41:49+00:00
closed_at:
type: string
example:
originating_wallet: johnwallet1
source_wallet: planeter
destination_wallet: just.a.guy
type: send
parameters:
$ref: '#/components/schemas/requestBundleRequestParameters'
state: completed
created_at: '2020-07-09T00:41:49+00:00'
closed_at: '2020-07-09T00:41:49+00:00'
format: date-time
example: 2020-07-09T00:41:49+00:00
sendRequestPendingResponse:
title: sendRequestPendingResponse
sendBundleRequest:
Expand Down

0 comments on commit 9803c2c

Please sign in to comment.