-
Notifications
You must be signed in to change notification settings - Fork 282
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor(cbdc-example): using sdk for the oapi requests to the gatewa…
…ys, readme update, package.json, dockerfiles update, frontend does requests to the backend, rename destiny to receipient, fix bugs Signed-off-by: Carlos Amaro <carlosrscamaro@tecnico.ulisboa.pt>
- Loading branch information
1 parent
34c81e7
commit 078f0d9
Showing
283 changed files
with
11,882 additions
and
42,867 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
7 changes: 7 additions & 0 deletions
7
examples/cactus-example-cbdc-bridging-backend/openapitools.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
{ | ||
"$schema": "./node_modules/@openapitools/openapi-generator-cli/config.schema.json", | ||
"spaces": 2, | ||
"generator-cli": { | ||
"version": "7.8.0" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
53 changes: 53 additions & 0 deletions
53
...ctus-example-cbdc-bridging-backend/src/main/go/generated/openapi/.openapi-generator/FILES
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
.gitignore | ||
.openapi-generator-ignore | ||
.travis.yml | ||
README.md | ||
api/openapi.yaml | ||
api_approve.go | ||
api_get_amount_approved.go | ||
api_get_balance.go | ||
api_get_sessions_references.go | ||
api_mint.go | ||
api_transact.go | ||
api_transfer.go | ||
client.go | ||
configuration.go | ||
docs/APIError.md | ||
docs/ApproveAPI.md | ||
docs/ApproveRequest.md | ||
docs/AssetType.md | ||
docs/BalanceResponse.md | ||
docs/GetAmountApprovedAPI.md | ||
docs/GetBalanceAPI.md | ||
docs/GetSessionsReferencesAPI.md | ||
docs/MintAPI.md | ||
docs/MintRequest.md | ||
docs/SessionReference.md | ||
docs/StatusResponse.md | ||
docs/TransactAPI.md | ||
docs/TransactRequest.md | ||
docs/TransactResponse.md | ||
docs/TransferAPI.md | ||
docs/TransferRequest.md | ||
git_push.sh | ||
go.mod | ||
go.sum | ||
model_api_error.go | ||
model_approve_request.go | ||
model_asset_type.go | ||
model_balance_response.go | ||
model_mint_request.go | ||
model_session_reference.go | ||
model_status_response.go | ||
model_transact_request.go | ||
model_transact_response.go | ||
model_transfer_request.go | ||
response.go | ||
test/api_approve_test.go | ||
test/api_get_amount_approved_test.go | ||
test/api_get_balance_test.go | ||
test/api_get_sessions_references_test.go | ||
test/api_mint_test.go | ||
test/api_transact_test.go | ||
test/api_transfer_test.go | ||
utils.go |
1 change: 1 addition & 0 deletions
1
...us-example-cbdc-bridging-backend/src/main/go/generated/openapi/.openapi-generator/VERSION
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
7.8.0 |
File renamed without changes.
129 changes: 129 additions & 0 deletions
129
...es/cactus-example-cbdc-bridging-backend/src/main/go/generated/openapi/README.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,129 @@ | ||
# Go API client for generated | ||
|
||
Cactus-Example | ||
|
||
|
||
## Overview | ||
This API client was generated by the [OpenAPI Generator](https://openapi-generator.tech) project. By using the [OpenAPI-spec](https://www.openapis.org/) from a remote server, you can easily generate an API client. | ||
|
||
- API version: 0.0.2 | ||
- Package version: v0.0.1 | ||
- Generator version: 7.8.0 | ||
- Build package: org.openapitools.codegen.languages.GoClientCodegen | ||
|
||
## Installation | ||
|
||
Install the following dependencies: | ||
|
||
```sh | ||
go get github.com/stretchr/testify/assert | ||
go get golang.org/x/net/context | ||
``` | ||
|
||
Put the package under your project folder and add the following in import: | ||
|
||
```go | ||
import generated "github.com/hyperledger/cacti/examples/cactus-example-cbdc-bridging-backend/src/main/go/generated" | ||
``` | ||
|
||
To use a proxy, set the environment variable `HTTP_PROXY`: | ||
|
||
```go | ||
os.Setenv("HTTP_PROXY", "http://proxy_name:proxy_port") | ||
``` | ||
|
||
## Configuration of Server URL | ||
|
||
Default configuration comes with `Servers` field that contains server objects as defined in the OpenAPI specification. | ||
|
||
### Select Server Configuration | ||
|
||
For using other server than the one defined on index 0 set context value `generated.ContextServerIndex` of type `int`. | ||
|
||
```go | ||
ctx := context.WithValue(context.Background(), generated.ContextServerIndex, 1) | ||
``` | ||
|
||
### Templated Server URL | ||
|
||
Templated server URL is formatted using default variables from configuration or from context value `generated.ContextServerVariables` of type `map[string]string`. | ||
|
||
```go | ||
ctx := context.WithValue(context.Background(), generated.ContextServerVariables, map[string]string{ | ||
"basePath": "v2", | ||
}) | ||
``` | ||
|
||
Note, enum values are always validated and all unused variables are silently ignored. | ||
|
||
### URLs Configuration per Operation | ||
|
||
Each operation can use different server URL defined using `OperationServers` map in the `Configuration`. | ||
An operation is uniquely identified by `"{classname}Service.{nickname}"` string. | ||
Similar rules for overriding default operation server index and variables applies by using `generated.ContextOperationServerIndices` and `generated.ContextOperationServerVariables` context maps. | ||
|
||
```go | ||
ctx := context.WithValue(context.Background(), generated.ContextOperationServerIndices, map[string]int{ | ||
"{classname}Service.{nickname}": 2, | ||
}) | ||
ctx = context.WithValue(context.Background(), generated.ContextOperationServerVariables, map[string]map[string]string{ | ||
"{classname}Service.{nickname}": { | ||
"port": "8443", | ||
}, | ||
}) | ||
``` | ||
|
||
## Documentation for API Endpoints | ||
|
||
All URIs are relative to *http://localhost* | ||
|
||
Class | Method | HTTP request | Description | ||
------------ | ------------- | ------------- | ------------- | ||
*ApproveAPI* | [**Approve**](docs/ApproveAPI.md#approve) | **Post** /api/v1/@hyperledger/cactus-example-cbdc/approve-tokens | Submit a transaction intent | ||
*GetAmountApprovedAPI* | [**GetAmountApproved**](docs/GetAmountApprovedAPI.md#getamountapproved) | **Get** /api/v1/@hyperledger/cactus-example-cbdc/get-amount-approved | Get the amount approved for a transaction | ||
*GetBalanceAPI* | [**GetBalance**](docs/GetBalanceAPI.md#getbalance) | **Get** /api/v1/@hyperledger/cactus-example-cbdc/get-balance | | ||
*GetSessionsReferencesAPI* | [**GetSessionsReferences**](docs/GetSessionsReferencesAPI.md#getsessionsreferences) | **Get** /api/v1/@hyperledger/cactus-example-cbdc/get-sessions-references | Get SATP current sessions data | ||
*MintAPI* | [**Mint**](docs/MintAPI.md#mint) | **Post** /api/v1/@hyperledger/cactus-example-cbdc/mint-tokens | Submit a transaction intent | ||
*TransactAPI* | [**Transact**](docs/TransactAPI.md#transact) | **Post** /api/v1/@hyperledger/cactus-example-cbdc/transact | Submit a transaction intent | ||
*TransferAPI* | [**Transfer**](docs/TransferAPI.md#transfer) | **Post** /api/v1/@hyperledger/cactus-example-cbdc/transfer-tokens | Submit a transaction intent | ||
|
||
|
||
## Documentation For Models | ||
|
||
- [APIError](docs/APIError.md) | ||
- [ApproveRequest](docs/ApproveRequest.md) | ||
- [AssetType](docs/AssetType.md) | ||
- [BalanceResponse](docs/BalanceResponse.md) | ||
- [MintRequest](docs/MintRequest.md) | ||
- [SessionReference](docs/SessionReference.md) | ||
- [StatusResponse](docs/StatusResponse.md) | ||
- [TransactRequest](docs/TransactRequest.md) | ||
- [TransactResponse](docs/TransactResponse.md) | ||
- [TransferRequest](docs/TransferRequest.md) | ||
|
||
|
||
## Documentation For Authorization | ||
|
||
Endpoints do not require authorization. | ||
|
||
|
||
## Documentation for Utility Methods | ||
|
||
Due to the fact that model structure members are all pointers, this package contains | ||
a number of utility functions to easily obtain pointers to values of basic types. | ||
Each of these functions takes a value of the given basic type and returns a pointer to it: | ||
|
||
* `PtrBool` | ||
* `PtrInt` | ||
* `PtrInt32` | ||
* `PtrInt64` | ||
* `PtrFloat` | ||
* `PtrFloat32` | ||
* `PtrFloat64` | ||
* `PtrString` | ||
* `PtrTime` | ||
|
||
## Author | ||
|
||
|
||
|
Oops, something went wrong.