diff --git a/.github/workflows/api-docs-update-v2.yaml b/.github/workflows/api-docs-update-v2.yaml index 59d4d15..4b1857a 100644 --- a/.github/workflows/api-docs-update-v2.yaml +++ b/.github/workflows/api-docs-update-v2.yaml @@ -5,15 +5,22 @@ on: branches: - main paths: - - 'protobuff/qubic.swagger.json' # Only trigger if the swagger file changed + - 'protobuff/qubic.openapi.yaml' # Only trigger if the OpenAPI file changed jobs: api-docs-update-trigger: runs-on: ubuntu-latest steps: - - name: Dispatch Event + - name: Dispatch to Integration uses: peter-evans/repository-dispatch@v3 with: token: ${{ secrets.GH_PAT }} repository: qubic/integration - event-type: api-docs-update \ No newline at end of file + event-type: api-docs-update + + - name: Dispatch to Docs + uses: peter-evans/repository-dispatch@v3 + with: + token: ${{ secrets.GH_PAT }} + repository: qubic/docs + event-type: live-api-update \ No newline at end of file diff --git a/protobuff/Makefile b/protobuff/Makefile index bee159e..666cadf 100644 --- a/protobuff/Makefile +++ b/protobuff/Makefile @@ -33,6 +33,8 @@ all: $(GO) openapi-v3 openapi-v3: protoc -I=. --openapi_out=output_mode=source_relative,default_response=false:. *.proto + @# Add x-scalar-ignore to auto-generated QubicLiveService tag + yq -i '(.tags[] | select(.name == "QubicLiveService")).x-scalar-ignore = true' qubic.openapi.yaml clean: rm -f *.pb.go diff --git a/protobuff/qubic.openapi.yaml b/protobuff/qubic.openapi.yaml index 066b47d..1a520aa 100644 --- a/protobuff/qubic.openapi.yaml +++ b/protobuff/qubic.openapi.yaml @@ -3,727 +3,747 @@ openapi: 3.0.3 info: - title: Qubic HTTP API - description: Bridge service for Qubic network operations. - version: 1.0.0 + title: Qubic Live API + description: Bridge service for Qubic network operations. + version: 1.0.0 servers: - - url: https://rpc.qubic.org/live/v1 + - url: https://rpc.qubic.org/live/v1 paths: - /assets/issuances: - get: - tags: - - QubicLiveService - summary: Search Asset Issuances - description: Returns a list of issued assets filtered by issuer identity and asset name. - operationId: QubicLiveService_GetIssuedAssetsByFilter - parameters: - - name: issuerIdentity - in: query - schema: - type: string - - name: assetName - in: query - schema: - type: string - responses: - "200": - description: OK - content: - application/json: - schema: - $ref: '#/components/schemas/AssetIssuances' - /assets/issuances/{index}: - get: - tags: - - QubicLiveService - summary: Get Asset Issuance By Index - description: Returns an asset issuance by universe index. - operationId: QubicLiveService_GetIssuedAssetByUniverseIndex - parameters: - - name: index - in: path - required: true - schema: - type: integer - format: uint32 - responses: - "200": - description: OK - content: - application/json: - schema: - $ref: '#/components/schemas/AssetIssuance' - /assets/ownerships: - get: - tags: - - QubicLiveService - summary: Search Asset Ownerships - description: Returns a list of asset ownerships filtered by issuer, asset name, owner and managing contract. - operationId: QubicLiveService_GetOwnedAssetsByFilter - parameters: - - name: issuerIdentity - in: query - description: Identity of the issuer. Defaults to the zero address (smart contract shares). - schema: - type: string - - name: assetName - in: query - description: Name of the asset (required). - schema: - type: string - - name: ownerIdentity - in: query - description: Identity of the owner of the asset (optional). - schema: - type: string - - name: ownershipManagingContract - in: query - description: Index of the contract that manages the ownership (optional). - schema: - type: integer - format: uint32 - responses: - "200": - description: OK - content: - application/json: - schema: - $ref: '#/components/schemas/AssetOwnerships' - /assets/ownerships/{index}: - get: - tags: - - QubicLiveService - summary: Get Asset Ownership By Index - description: Returns an asset ownership by universe index. - operationId: QubicLiveService_GetOwnedAssetByUniverseIndex - parameters: - - name: index - in: path - required: true - schema: - type: integer - format: uint32 - responses: - "200": - description: OK - content: - application/json: - schema: - $ref: '#/components/schemas/AssetOwnership' - /assets/possessions: - get: - tags: - - QubicLiveService - summary: Search Asset Possessions - description: Returns a list of asset possessions filtered by issuer, asset name, owner, possessor and managing contracts. - operationId: QubicLiveService_GetPossessedAssetsByFilter - parameters: - - name: issuerIdentity - in: query - description: Identity of the issuer (required). Defaults to the zero address (smart contract shares). - schema: - type: string - - name: assetName - in: query - description: Name of the asset (required). - schema: - type: string - - name: ownerIdentity - in: query - description: Identity of the owner of the asset (optional). - schema: - type: string - - name: possessorIdentity - in: query - description: Identity of the possessor of the asset (optional). - schema: - type: string - - name: ownershipManagingContract - in: query - description: Index of the contract that manages the ownership (optional). - schema: - type: integer - format: uint32 - - name: possessionManagingContract - in: query - description: Index of the contract that manages the possession (optional). - schema: - type: integer - format: uint32 - responses: - "200": - description: OK - content: - application/json: - schema: - $ref: '#/components/schemas/AssetPossessions' - /assets/possessions/{index}: - get: - tags: - - QubicLiveService - summary: Get Asset Possession By Index - description: Returns an asset possession by universe index. - operationId: QubicLiveService_GetPossessedAssetByUniverseIndex - parameters: - - name: index - in: path - required: true - schema: - type: integer - format: uint32 - responses: - "200": - description: OK - content: - application/json: - schema: - $ref: '#/components/schemas/AssetPossession' - /assets/{identity}/issued: - get: - tags: - - QubicLiveService - summary: List Issued Assets - description: Gets assets issued by the specified identity. - operationId: QubicLiveService_GetIssuedAssets - parameters: - - name: identity - in: path - required: true - schema: - type: string - responses: - "200": - description: OK - content: - application/json: - schema: - $ref: '#/components/schemas/IssuedAssetsResponse' - /assets/{identity}/owned: - get: - tags: - - QubicLiveService - summary: List Owned Assets - description: Gets assets that are owned by the specified identity. - operationId: QubicLiveService_GetOwnedAssets - parameters: - - name: identity - in: path - required: true - schema: - type: string - responses: - "200": - description: OK - content: - application/json: - schema: - $ref: '#/components/schemas/OwnedAssetsResponse' - /assets/{identity}/possessed: - get: - tags: - - QubicLiveService - summary: List Possessed Assets - description: Gets assets that are possessed by the specified identity. - operationId: QubicLiveService_GetPossessedAssets - parameters: - - name: identity - in: path - required: true - schema: - type: string - responses: - "200": - description: OK - content: - application/json: - schema: - $ref: '#/components/schemas/PossessedAssetsResponse' - /balances/{id}: - get: - tags: - - QubicLiveService - summary: Get Balance - description: Gets the balance of the specified identity. - operationId: QubicLiveService_GetBalance - parameters: - - name: id - in: path - required: true - schema: - type: string - responses: - "200": - description: OK - content: - application/json: - schema: - $ref: '#/components/schemas/GetBalanceResponse' - /block-height: - get: - tags: - - QubicLiveService - summary: Get Block Height - description: 'Deprecated: use /tick-info instead.' - operationId: QubicLiveService_GetBlockHeight - responses: - "200": - description: OK - content: - application/json: - schema: - $ref: '#/components/schemas/GetBlockHeightResponse' - deprecated: true - /broadcast-transaction: - post: - tags: - - QubicLiveService - summary: Broadcast Transaction - description: Broadcasts a transaction to the network. - operationId: QubicLiveService_BroadcastTransaction - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/BroadcastTransactionRequest' - required: true - responses: - "200": - description: OK - content: - application/json: - schema: - $ref: '#/components/schemas/BroadcastTransactionResponse' - /ipos/active: - get: - tags: - - QubicLiveService - summary: Get Active IPOs - description: Returns a list of IPOs that are active in the current epoch. - operationId: QubicLiveService_GetActiveIpos - responses: - "200": - description: OK - content: - application/json: - schema: - $ref: '#/components/schemas/GetActiveIposResponse' - /querySmartContract: - post: - tags: - - QubicLiveService - summary: Query Smart Contract - description: Queries a smart contract function. - operationId: QubicLiveService_QuerySmartContract - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/QuerySmartContractRequest' - required: true - responses: - "200": - description: OK - content: - application/json: - schema: - $ref: '#/components/schemas/QuerySmartContractResponse' - /tick-info: - get: - tags: - - QubicLiveService - summary: Get Tick Info - description: Gets the current tick information. - operationId: QubicLiveService_GetTickInfo - responses: - "200": - description: OK - content: - application/json: - schema: - $ref: '#/components/schemas/GetTickInfoResponse' + /assets/issuances: + get: + tags: + - QubicLiveService + - Assets + summary: Search Asset Issuances + description: Returns a list of issued assets filtered by issuer identity and asset name. + operationId: QubicLiveService_GetIssuedAssetsByFilter + parameters: + - name: issuerIdentity + in: query + schema: + type: string + - name: assetName + in: query + schema: + type: string + responses: + "200": + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AssetIssuances' + /assets/issuances/{index}: + get: + tags: + - QubicLiveService + - Assets + summary: Get Asset Issuance By Index + description: Returns an asset issuance by universe index. + operationId: QubicLiveService_GetIssuedAssetByUniverseIndex + parameters: + - name: index + in: path + required: true + schema: + type: integer + format: uint32 + responses: + "200": + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AssetIssuance' + /assets/ownerships: + get: + tags: + - QubicLiveService + - Assets + summary: Search Asset Ownerships + description: Returns a list of asset ownerships filtered by issuer, asset name, owner and managing contract. + operationId: QubicLiveService_GetOwnedAssetsByFilter + parameters: + - name: issuerIdentity + in: query + description: Identity of the issuer. Defaults to the zero address (smart contract shares). + schema: + type: string + - name: assetName + in: query + description: Name of the asset (required). + schema: + type: string + - name: ownerIdentity + in: query + description: Identity of the owner of the asset (optional). + schema: + type: string + - name: ownershipManagingContract + in: query + description: Index of the contract that manages the ownership (optional). + schema: + type: integer + format: uint32 + responses: + "200": + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AssetOwnerships' + /assets/ownerships/{index}: + get: + tags: + - QubicLiveService + - Assets + summary: Get Asset Ownership By Index + description: Returns an asset ownership by universe index. + operationId: QubicLiveService_GetOwnedAssetByUniverseIndex + parameters: + - name: index + in: path + required: true + schema: + type: integer + format: uint32 + responses: + "200": + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AssetOwnership' + /assets/possessions: + get: + tags: + - QubicLiveService + - Assets + summary: Search Asset Possessions + description: Returns a list of asset possessions filtered by issuer, asset name, owner, possessor and managing contracts. + operationId: QubicLiveService_GetPossessedAssetsByFilter + parameters: + - name: issuerIdentity + in: query + description: Identity of the issuer (required). Defaults to the zero address (smart contract shares). + schema: + type: string + - name: assetName + in: query + description: Name of the asset (required). + schema: + type: string + - name: ownerIdentity + in: query + description: Identity of the owner of the asset (optional). + schema: + type: string + - name: possessorIdentity + in: query + description: Identity of the possessor of the asset (optional). + schema: + type: string + - name: ownershipManagingContract + in: query + description: Index of the contract that manages the ownership (optional). + schema: + type: integer + format: uint32 + - name: possessionManagingContract + in: query + description: Index of the contract that manages the possession (optional). + schema: + type: integer + format: uint32 + responses: + "200": + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AssetPossessions' + /assets/possessions/{index}: + get: + tags: + - QubicLiveService + - Assets + summary: Get Asset Possession By Index + description: Returns an asset possession by universe index. + operationId: QubicLiveService_GetPossessedAssetByUniverseIndex + parameters: + - name: index + in: path + required: true + schema: + type: integer + format: uint32 + responses: + "200": + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AssetPossession' + /assets/{identity}/issued: + get: + tags: + - QubicLiveService + - Assets + summary: List Issued Assets + description: Gets assets issued by the specified identity. + operationId: QubicLiveService_GetIssuedAssets + parameters: + - name: identity + in: path + required: true + schema: + type: string + responses: + "200": + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/IssuedAssetsResponse' + /assets/{identity}/owned: + get: + tags: + - QubicLiveService + - Assets + summary: List Owned Assets + description: Gets assets that are owned by the specified identity. + operationId: QubicLiveService_GetOwnedAssets + parameters: + - name: identity + in: path + required: true + schema: + type: string + responses: + "200": + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/OwnedAssetsResponse' + /assets/{identity}/possessed: + get: + tags: + - QubicLiveService + - Assets + summary: List Possessed Assets + description: Gets assets that are possessed by the specified identity. + operationId: QubicLiveService_GetPossessedAssets + parameters: + - name: identity + in: path + required: true + schema: + type: string + responses: + "200": + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/PossessedAssetsResponse' + /balances/{id}: + get: + tags: + - QubicLiveService + - Accounts + summary: Get Balance + description: Gets the balance of the specified identity. + operationId: QubicLiveService_GetBalance + parameters: + - name: id + in: path + required: true + schema: + type: string + responses: + "200": + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/GetBalanceResponse' + /block-height: + get: + tags: + - QubicLiveService + - Network + summary: Get Block Height + description: 'Deprecated: use /tick-info instead.' + operationId: QubicLiveService_GetBlockHeight + responses: + "200": + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/GetBlockHeightResponse' + deprecated: true + /broadcast-transaction: + post: + tags: + - QubicLiveService + - Transactions + summary: Broadcast Transaction + description: Broadcasts a transaction to the network. + operationId: QubicLiveService_BroadcastTransaction + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/BroadcastTransactionRequest' + required: true + responses: + "200": + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/BroadcastTransactionResponse' + /ipos/active: + get: + tags: + - QubicLiveService + - Smart Contracts + summary: Get Active IPOs + description: Returns a list of IPOs that are active in the current epoch. + operationId: QubicLiveService_GetActiveIpos + responses: + "200": + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/GetActiveIposResponse' + /querySmartContract: + post: + tags: + - QubicLiveService + - Smart Contracts + summary: Query Smart Contract + description: Queries a smart contract function. + operationId: QubicLiveService_QuerySmartContract + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/QuerySmartContractRequest' + required: true + responses: + "200": + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/QuerySmartContractResponse' + /tick-info: + get: + tags: + - QubicLiveService + - Network + summary: Get Tick Info + description: Gets the current tick information. + operationId: QubicLiveService_GetTickInfo + responses: + "200": + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/GetTickInfoResponse' components: - schemas: - AssetInfo: - type: object - properties: - tick: - type: integer - format: uint32 - universeIndex: - type: integer - format: uint32 - description: AssetInfo - AssetIssuance: - type: object - properties: - data: - $ref: '#/components/schemas/AssetIssuanceData' - tick: - type: integer - format: uint32 - universeIndex: - type: integer - format: uint32 - description: AssetIssuance - AssetIssuanceData: - type: object - properties: - issuerIdentity: - type: string - type: - type: integer - format: uint32 - name: - type: string - numberOfDecimalPlaces: - type: integer - format: int32 - unitOfMeasurement: - type: array - items: - type: integer - format: int32 - description: AssetIssuanceData - AssetIssuances: - type: object - properties: - assets: - type: array - items: - $ref: '#/components/schemas/AssetIssuance' - description: AssetIssuances - AssetOwnership: - type: object - properties: - data: - $ref: '#/components/schemas/AssetOwnershipData' - tick: - type: integer - format: uint32 - universeIndex: - type: integer - format: uint32 - description: AssetOwnership - AssetOwnershipData: - type: object - properties: - ownerIdentity: - type: string - type: - type: integer - format: uint32 - managingContractIndex: - type: integer - format: uint32 - issuanceIndex: - type: integer - format: uint32 - numberOfUnits: - type: string - description: AssetOwnershipData - AssetOwnerships: - type: object - properties: - assets: - type: array - items: - $ref: '#/components/schemas/AssetOwnership' - description: AssetOwnerships - AssetPossession: - type: object - properties: - data: - $ref: '#/components/schemas/AssetPossessionData' - tick: - type: integer - format: uint32 - universeIndex: - type: integer - format: uint32 - description: AssetPossession - AssetPossessionData: - type: object - properties: - possessorIdentity: - type: string - type: - type: integer - format: uint32 - managingContractIndex: - type: integer - format: uint32 - ownershipIndex: - type: integer - format: uint32 - numberOfUnits: - type: string - description: AssetPossessionData - AssetPossessions: - type: object - properties: - assets: - type: array - items: - $ref: '#/components/schemas/AssetPossession' - description: AssetPossessions - Balance: - type: object - properties: - id: - type: string - description: The identity relevant to this balance. - balance: - type: string - description: The amount of funds the identity holds. - validForTick: - type: integer - description: The tick that this balance is valid for. - format: uint32 - latestIncomingTransferTick: - type: integer - description: The last tick when this identity received funds through a transfer. - format: uint32 - latestOutgoingTransferTick: - type: integer - description: The last tick when this identity sent funds through a transfer. - format: uint32 - incomingAmount: - type: string - description: The total sum of received funds over time. - outgoingAmount: - type: string - description: The total sum of sent funds over time. - numberOfIncomingTransfers: - type: integer - description: The number of incoming transfers. - format: uint32 - numberOfOutgoingTransfers: - type: integer - description: The number of outgoing transfers. - format: uint32 - description: Balance - BroadcastTransactionRequest: - type: object - properties: - encodedTransaction: - type: string - description: Base64 encoded binary transaction data. - description: BroadcastTransactionRequest - BroadcastTransactionResponse: - type: object - properties: - peersBroadcasted: - type: integer - description: The number of Qubic node peers this transactions has been broadcast to. - format: int32 - encodedTransaction: - type: string - description: The Base 64 encoded binary transaction from the request. - transactionId: - type: string - description: The id / hash of the transaction. - description: BroadcastTransactionResponse - GetActiveIposResponse: - type: object - properties: - ipos: - type: array - items: - $ref: '#/components/schemas/Ipo' - description: GetActiveIposResponse - GetBalanceResponse: - type: object - properties: - balance: - $ref: '#/components/schemas/Balance' - description: GetBalanceResponse - GetBlockHeightResponse: - type: object - properties: - blockHeight: - $ref: '#/components/schemas/TickInfo' - description: GetBlockHeightResponse - GetTickInfoResponse: - type: object - properties: - tickInfo: - $ref: '#/components/schemas/TickInfo' - description: GetTickInfoResponse - Ipo: - type: object - properties: - contractIndex: - type: integer - description: The index of the related contract (contract address). - format: uint32 - assetName: - type: string - description: The name of the related asset. - description: IPO - IssuedAsset: - type: object - properties: - data: - $ref: '#/components/schemas/IssuedAssetData' - info: - $ref: '#/components/schemas/AssetInfo' - description: IssuedAsset - IssuedAssetData: - type: object - properties: - issuerIdentity: - type: string - type: - type: integer - format: uint32 - name: - type: string - numberOfDecimalPlaces: - type: integer - format: int32 - unitOfMeasurement: - type: array - items: - type: integer - format: int32 - description: IssuedAssetData - IssuedAssetsResponse: - type: object - properties: - issuedAssets: - type: array - items: - $ref: '#/components/schemas/IssuedAsset' - description: IssuedAssetsResponse - OwnedAsset: - type: object - properties: - data: - $ref: '#/components/schemas/OwnedAssetData' - info: - $ref: '#/components/schemas/AssetInfo' - description: OwnedAsset - OwnedAssetData: - type: object - properties: - ownerIdentity: - type: string - type: - type: integer - format: uint32 - padding: - type: integer - format: int32 - managingContractIndex: - type: integer - format: uint32 - issuanceIndex: - type: integer - format: uint32 - numberOfUnits: - type: string - issuedAsset: - $ref: '#/components/schemas/IssuedAssetData' - description: OwnedAssetData - OwnedAssetsResponse: - type: object - properties: - ownedAssets: - type: array - items: - $ref: '#/components/schemas/OwnedAsset' - description: OwnedAssetsResponse - PossessedAsset: - type: object - properties: - data: - $ref: '#/components/schemas/PossessedAssetData' - info: - $ref: '#/components/schemas/AssetInfo' - description: PossessedAsset - PossessedAssetData: - type: object - properties: - possessorIdentity: - type: string - type: - type: integer - format: uint32 - padding: - type: integer - format: int32 - managingContractIndex: - type: integer - format: uint32 - issuanceIndex: - type: integer - format: uint32 - numberOfUnits: - type: string - ownedAsset: - $ref: '#/components/schemas/OwnedAssetData' - description: PossessedAssetData - PossessedAssetsResponse: - type: object - properties: - possessedAssets: - type: array - items: - $ref: '#/components/schemas/PossessedAsset' - description: PossessedAssetsResponse - QuerySmartContractRequest: - type: object - properties: - contractIndex: - type: integer - description: identifies the smart contract - format: uint32 - inputType: - type: integer - description: identifies the function to be queried - format: uint32 - inputSize: - type: integer - description: the size of the input data (request data) - format: uint32 - requestData: - type: string - description: base64 encoded input data - description: QuerySmartContractRequest - QuerySmartContractResponse: - type: object - properties: - responseData: - type: string - description: Binary data encoded as Base64. This data is returned directly from the called SC function. - description: QuerySmartContractResponse - TickInfo: - type: object - properties: - tick: - type: integer - description: current network tick - format: uint32 - duration: - type: integer - format: uint32 - epoch: - type: integer - description: current epoch - format: uint32 - initialTick: - type: integer - description: initial tick of epoch - format: uint32 - description: TickInfo + schemas: + AssetInfo: + type: object + properties: + tick: + type: integer + format: uint32 + universeIndex: + type: integer + format: uint32 + description: AssetInfo + AssetIssuance: + type: object + properties: + data: + $ref: '#/components/schemas/AssetIssuanceData' + tick: + type: integer + format: uint32 + universeIndex: + type: integer + format: uint32 + description: AssetIssuance + AssetIssuanceData: + type: object + properties: + issuerIdentity: + type: string + type: + type: integer + format: uint32 + name: + type: string + numberOfDecimalPlaces: + type: integer + format: int32 + unitOfMeasurement: + type: array + items: + type: integer + format: int32 + description: AssetIssuanceData + AssetIssuances: + type: object + properties: + assets: + type: array + items: + $ref: '#/components/schemas/AssetIssuance' + description: AssetIssuances + AssetOwnership: + type: object + properties: + data: + $ref: '#/components/schemas/AssetOwnershipData' + tick: + type: integer + format: uint32 + universeIndex: + type: integer + format: uint32 + description: AssetOwnership + AssetOwnershipData: + type: object + properties: + ownerIdentity: + type: string + type: + type: integer + format: uint32 + managingContractIndex: + type: integer + format: uint32 + issuanceIndex: + type: integer + format: uint32 + numberOfUnits: + type: string + description: AssetOwnershipData + AssetOwnerships: + type: object + properties: + assets: + type: array + items: + $ref: '#/components/schemas/AssetOwnership' + description: AssetOwnerships + AssetPossession: + type: object + properties: + data: + $ref: '#/components/schemas/AssetPossessionData' + tick: + type: integer + format: uint32 + universeIndex: + type: integer + format: uint32 + description: AssetPossession + AssetPossessionData: + type: object + properties: + possessorIdentity: + type: string + type: + type: integer + format: uint32 + managingContractIndex: + type: integer + format: uint32 + ownershipIndex: + type: integer + format: uint32 + numberOfUnits: + type: string + description: AssetPossessionData + AssetPossessions: + type: object + properties: + assets: + type: array + items: + $ref: '#/components/schemas/AssetPossession' + description: AssetPossessions + Balance: + type: object + properties: + id: + type: string + description: The identity relevant to this balance. + balance: + type: string + description: The amount of funds the identity holds. + validForTick: + type: integer + description: The tick that this balance is valid for. + format: uint32 + latestIncomingTransferTick: + type: integer + description: The last tick when this identity received funds through a transfer. + format: uint32 + latestOutgoingTransferTick: + type: integer + description: The last tick when this identity sent funds through a transfer. + format: uint32 + incomingAmount: + type: string + description: The total sum of received funds over time. + outgoingAmount: + type: string + description: The total sum of sent funds over time. + numberOfIncomingTransfers: + type: integer + description: The number of incoming transfers. + format: uint32 + numberOfOutgoingTransfers: + type: integer + description: The number of outgoing transfers. + format: uint32 + description: Balance + BroadcastTransactionRequest: + type: object + properties: + encodedTransaction: + type: string + description: Base64 encoded binary transaction data. + description: BroadcastTransactionRequest + BroadcastTransactionResponse: + type: object + properties: + peersBroadcasted: + type: integer + description: The number of Qubic node peers this transactions has been broadcast to. + format: int32 + encodedTransaction: + type: string + description: The Base 64 encoded binary transaction from the request. + transactionId: + type: string + description: The id / hash of the transaction. + description: BroadcastTransactionResponse + GetActiveIposResponse: + type: object + properties: + ipos: + type: array + items: + $ref: '#/components/schemas/Ipo' + description: GetActiveIposResponse + GetBalanceResponse: + type: object + properties: + balance: + $ref: '#/components/schemas/Balance' + description: GetBalanceResponse + GetBlockHeightResponse: + type: object + properties: + blockHeight: + $ref: '#/components/schemas/TickInfo' + description: GetBlockHeightResponse + GetTickInfoResponse: + type: object + properties: + tickInfo: + $ref: '#/components/schemas/TickInfo' + description: GetTickInfoResponse + Ipo: + type: object + properties: + contractIndex: + type: integer + description: The index of the related contract (contract address). + format: uint32 + assetName: + type: string + description: The name of the related asset. + description: IPO + IssuedAsset: + type: object + properties: + data: + $ref: '#/components/schemas/IssuedAssetData' + info: + $ref: '#/components/schemas/AssetInfo' + description: IssuedAsset + IssuedAssetData: + type: object + properties: + issuerIdentity: + type: string + type: + type: integer + format: uint32 + name: + type: string + numberOfDecimalPlaces: + type: integer + format: int32 + unitOfMeasurement: + type: array + items: + type: integer + format: int32 + description: IssuedAssetData + IssuedAssetsResponse: + type: object + properties: + issuedAssets: + type: array + items: + $ref: '#/components/schemas/IssuedAsset' + description: IssuedAssetsResponse + OwnedAsset: + type: object + properties: + data: + $ref: '#/components/schemas/OwnedAssetData' + info: + $ref: '#/components/schemas/AssetInfo' + description: OwnedAsset + OwnedAssetData: + type: object + properties: + ownerIdentity: + type: string + type: + type: integer + format: uint32 + padding: + type: integer + format: int32 + managingContractIndex: + type: integer + format: uint32 + issuanceIndex: + type: integer + format: uint32 + numberOfUnits: + type: string + issuedAsset: + $ref: '#/components/schemas/IssuedAssetData' + description: OwnedAssetData + OwnedAssetsResponse: + type: object + properties: + ownedAssets: + type: array + items: + $ref: '#/components/schemas/OwnedAsset' + description: OwnedAssetsResponse + PossessedAsset: + type: object + properties: + data: + $ref: '#/components/schemas/PossessedAssetData' + info: + $ref: '#/components/schemas/AssetInfo' + description: PossessedAsset + PossessedAssetData: + type: object + properties: + possessorIdentity: + type: string + type: + type: integer + format: uint32 + padding: + type: integer + format: int32 + managingContractIndex: + type: integer + format: uint32 + issuanceIndex: + type: integer + format: uint32 + numberOfUnits: + type: string + ownedAsset: + $ref: '#/components/schemas/OwnedAssetData' + description: PossessedAssetData + PossessedAssetsResponse: + type: object + properties: + possessedAssets: + type: array + items: + $ref: '#/components/schemas/PossessedAsset' + description: PossessedAssetsResponse + QuerySmartContractRequest: + type: object + properties: + contractIndex: + type: integer + description: identifies the smart contract + format: uint32 + inputType: + type: integer + description: identifies the function to be queried + format: uint32 + inputSize: + type: integer + description: the size of the input data (request data) + format: uint32 + requestData: + type: string + description: base64 encoded input data + description: QuerySmartContractRequest + QuerySmartContractResponse: + type: object + properties: + responseData: + type: string + description: Binary data encoded as Base64. This data is returned directly from the called SC function. + description: QuerySmartContractResponse + TickInfo: + type: object + properties: + tick: + type: integer + description: current network tick + format: uint32 + duration: + type: integer + format: uint32 + epoch: + type: integer + description: current epoch + format: uint32 + initialTick: + type: integer + description: initial tick of epoch + format: uint32 + description: TickInfo tags: - - name: QubicLiveService - description: Query live data from the Qubic network - externalDocs: - description: GitHub repository - url: https://github.com/qubic/qubic-http/ - x-displayName: Live API - - name: QubicLiveService + - name: Accounts + description: Check account balances and transfer history. + - name: Assets + description: Query and manage assets including issuances, ownerships, and possessions. + - name: Network + description: Network status and tick information. + - name: QubicLiveService + x-scalar-ignore: true + - name: Smart Contracts + description: Query smart contracts and view active IPOs. + - name: Transactions + description: Broadcast transactions to the network. externalDocs: - description: GitHub - url: https://github.com/qubic/qubic-http + description: GitHub + url: https://github.com/qubic/qubic-http diff --git a/protobuff/qubic.proto b/protobuff/qubic.proto index 1af73ba..de83889 100644 --- a/protobuff/qubic.proto +++ b/protobuff/qubic.proto @@ -10,7 +10,7 @@ import "openapiv3/annotations.proto"; option (openapi.v3.document) = { info: { - title: "Qubic HTTP API" + title: "Qubic Live API" description: "Bridge service for Qubic network operations." version: "1.0.0" } @@ -26,19 +26,24 @@ option (openapi.v3.document) = { tags: [ { - name: "QubicLiveService" - description: "Query live data from the Qubic network" - external_docs: { - description: "GitHub repository" - url: "https://github.com/qubic/qubic-http/" - } - specification_extension: { - name: "x-displayName" - value: { - yaml: "Live API" - - } - } + name: "Assets" + description: "Query and manage assets including issuances, ownerships, and possessions." + }, + { + name: "Accounts" + description: "Check account balances and transfer history." + }, + { + name: "Network" + description: "Network status and tick information." + }, + { + name: "Transactions" + description: "Broadcast transactions to the network." + }, + { + name: "Smart Contracts" + description: "Query smart contracts and view active IPOs." } ] }; @@ -321,6 +326,7 @@ service QubicLiveService { rpc GetBalance(GetBalanceRequest) returns (GetBalanceResponse) { option (openapi.v3.operation) = { + tags: ["Accounts"] summary: "Get Balance" description: "Gets the balance of the specified identity." }; @@ -331,6 +337,7 @@ service QubicLiveService { rpc QuerySmartContract(QuerySmartContractRequest) returns (QuerySmartContractResponse) { option (openapi.v3.operation) = { + tags: ["Smart Contracts"] summary: "Query Smart Contract" description: "Queries a smart contract function." }; @@ -342,6 +349,7 @@ service QubicLiveService { rpc BroadcastTransaction(BroadcastTransactionRequest) returns (BroadcastTransactionResponse) { option (openapi.v3.operation) = { + tags: ["Transactions"] summary: "Broadcast Transaction" description: "Broadcasts a transaction to the network." }; @@ -353,6 +361,7 @@ service QubicLiveService { rpc GetTickInfo(google.protobuf.Empty) returns (GetTickInfoResponse) { option (openapi.v3.operation) = { + tags: ["Network"] summary: "Get Tick Info" description: "Gets the current tick information." }; @@ -363,6 +372,7 @@ service QubicLiveService { rpc GetBlockHeight(google.protobuf.Empty) returns (GetBlockHeightResponse) { option (openapi.v3.operation) = { + tags: ["Network"] summary: "Get Block Height" description: "Deprecated: use /tick-info instead." deprecated: true @@ -374,6 +384,7 @@ service QubicLiveService { rpc GetIssuedAssets(IssuedAssetsRequest) returns (IssuedAssetsResponse) { option (openapi.v3.operation) = { + tags: ["Assets"] summary: "List Issued Assets" description: "Gets assets issued by the specified identity." }; @@ -384,6 +395,7 @@ service QubicLiveService { rpc GetOwnedAssets(OwnedAssetsRequest) returns (OwnedAssetsResponse) { option (openapi.v3.operation) = { + tags: ["Assets"] summary: "List Owned Assets" description: "Gets assets that are owned by the specified identity." }; @@ -395,6 +407,7 @@ service QubicLiveService { rpc GetPossessedAssets(PossessedAssetsRequest) returns (PossessedAssetsResponse) { option (openapi.v3.operation) = { + tags: ["Assets"] summary: "List Possessed Assets" description: "Gets assets that are possessed by the specified identity." }; @@ -405,6 +418,7 @@ service QubicLiveService { rpc GetIssuedAssetsByFilter(GetIssuedAssetsByFilterRequest) returns (AssetIssuances) { option (openapi.v3.operation) = { + tags: ["Assets"] summary: "Search Asset Issuances" description: "Returns a list of issued assets filtered by issuer identity and asset name." }; @@ -415,6 +429,7 @@ service QubicLiveService { rpc GetIssuedAssetByUniverseIndex(GetByUniverseIndexRequest) returns (AssetIssuance) { option (openapi.v3.operation) = { + tags: ["Assets"] summary: "Get Asset Issuance By Index" description: "Returns an asset issuance by universe index." }; @@ -425,6 +440,7 @@ service QubicLiveService { rpc GetOwnedAssetsByFilter(GetOwnedAssetsByFilterRequest) returns (AssetOwnerships) { option (openapi.v3.operation) = { + tags: ["Assets"] summary: "Search Asset Ownerships" description: "Returns a list of asset ownerships filtered by issuer, asset name, owner and managing contract." }; @@ -435,6 +451,7 @@ service QubicLiveService { rpc GetOwnedAssetByUniverseIndex(GetByUniverseIndexRequest) returns (AssetOwnership) { option (openapi.v3.operation) = { + tags: ["Assets"] summary: "Get Asset Ownership By Index" description: "Returns an asset ownership by universe index." }; @@ -445,6 +462,7 @@ service QubicLiveService { rpc GetPossessedAssetsByFilter(GetPossessedAssetsByFilterRequest) returns (AssetPossessions) { option (openapi.v3.operation) = { + tags: ["Assets"] summary: "Search Asset Possessions" description: "Returns a list of asset possessions filtered by issuer, asset name, owner, possessor and managing contracts." }; @@ -455,6 +473,7 @@ service QubicLiveService { rpc GetPossessedAssetByUniverseIndex(GetByUniverseIndexRequest) returns (AssetPossession) { option (openapi.v3.operation) = { + tags: ["Assets"] summary: "Get Asset Possession By Index" description: "Returns an asset possession by universe index." }; @@ -465,6 +484,7 @@ service QubicLiveService { rpc GetActiveIpos(google.protobuf.Empty) returns (GetActiveIposResponse) { option (openapi.v3.operation) = { + tags: ["Smart Contracts"] summary: "Get Active IPOs" description: "Returns a list of IPOs that are active in the current epoch." };