1
0
Fork 0
forked from lthn/blockchain

Refactor Go SDK API service names and add Java SDK

Renamed Go SDK API services and documentation from BlockAPI/InfoAPI to BlockUtilsSdkClientGo/InfoUtilsSdkClientGo for consistency. Updated all references, method receivers, and usage examples accordingly. Added new Java SDK client, models, API, documentation, and build files under utils/sdk/client/java. Updated Go module dependencies and added go.sum. Enhanced Go models to support additional properties in JSON unmarshalling.
This commit is contained in:
Snider 2025-10-19 18:02:02 +01:00
parent 7a751142e8
commit 42368f3b4d
178 changed files with 29927 additions and 196 deletions

View file

@ -4,15 +4,15 @@ api_block.go
api_info.go
client.go
configuration.go
docs/BlockAPI.md
docs/BlockDetailsModel.md
docs/BlockProcessingPerformanceModel.md
docs/BlockTemplateModel.md
docs/BlockTemplateRequestModel.md
docs/BlockUtilsSdkClientGo.md
docs/DbStatInfoModel.md
docs/HeightModel.md
docs/InfoAPI.md
docs/InfoModel.md
docs/InfoUtilsSdkClientGo.md
docs/MaintainersInfoModel.md
docs/PerformanceModel.md
docs/PosEntryModel.md

View file

@ -20,76 +20,12 @@ import (
)
type BlockAPI interface {
/*
CreateBlockTemplate Create a block template for mining
@param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
@return ApiCreateBlockTemplateRequest
*/
CreateBlockTemplate(ctx context.Context) ApiCreateBlockTemplateRequest
// CreateBlockTemplateExecute executes the request
// @return BlockTemplateModel
CreateBlockTemplateExecute(r ApiCreateBlockTemplateRequest) (*BlockTemplateModel, *http.Response, error)
/*
GetBlock Get a block by its hash or height (ID)
@param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
@param identifier The hash (hex string) or height (integer) of the block to retrieve.
@return ApiGetBlockRequest
*/
GetBlock(ctx context.Context, identifier string) ApiGetBlockRequest
// GetBlockExecute executes the request
// @return BlockDetailsModel
GetBlockExecute(r ApiGetBlockRequest) (*BlockDetailsModel, *http.Response, error)
/*
GetBlocks Get one or more blocks, with optional pagination.
@param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
@return ApiGetBlocksRequest
*/
GetBlocks(ctx context.Context) ApiGetBlocksRequest
// GetBlocksExecute executes the request
// @return []BlockDetailsModel
GetBlocksExecute(r ApiGetBlocksRequest) ([]BlockDetailsModel, *http.Response, error)
/*
GetHeight Get the current blockchain height
@param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
@return ApiGetHeightRequest
*/
GetHeight(ctx context.Context) ApiGetHeightRequest
// GetHeightExecute executes the request
// @return HeightModel
GetHeightExecute(r ApiGetHeightRequest) (*HeightModel, *http.Response, error)
/*
SubmitBlock Submit a new block to the network
@param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
@return ApiSubmitBlockRequest
*/
SubmitBlock(ctx context.Context) ApiSubmitBlockRequest
// SubmitBlockExecute executes the request
// @return SubmitBlockResponseModel
SubmitBlockExecute(r ApiSubmitBlockRequest) (*SubmitBlockResponseModel, *http.Response, error)
}
// BlockAPIService BlockAPI service
type BlockAPIService service
// BlockUtilsSdkClientGoService BlockUtilsSdkClientGo service
type BlockUtilsSdkClientGoService service
type ApiCreateBlockTemplateRequest struct {
ctx context.Context
ApiService BlockAPI
ApiService *BlockUtilsSdkClientGoService
blockTemplateRequestModel *BlockTemplateRequestModel
}
@ -108,7 +44,7 @@ CreateBlockTemplate Create a block template for mining
@param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
@return ApiCreateBlockTemplateRequest
*/
func (a *BlockAPIService) CreateBlockTemplate(ctx context.Context) ApiCreateBlockTemplateRequest {
func (a *BlockUtilsSdkClientGoService) CreateBlockTemplate(ctx context.Context) ApiCreateBlockTemplateRequest {
return ApiCreateBlockTemplateRequest{
ApiService: a,
ctx: ctx,
@ -117,7 +53,7 @@ func (a *BlockAPIService) CreateBlockTemplate(ctx context.Context) ApiCreateBloc
// Execute executes the request
// @return BlockTemplateModel
func (a *BlockAPIService) CreateBlockTemplateExecute(r ApiCreateBlockTemplateRequest) (*BlockTemplateModel, *http.Response, error) {
func (a *BlockUtilsSdkClientGoService) CreateBlockTemplateExecute(r ApiCreateBlockTemplateRequest) (*BlockTemplateModel, *http.Response, error) {
var (
localVarHTTPMethod = http.MethodPost
localVarPostBody interface{}
@ -125,7 +61,7 @@ func (a *BlockAPIService) CreateBlockTemplateExecute(r ApiCreateBlockTemplateReq
localVarReturnValue *BlockTemplateModel
)
localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "BlockAPIService.CreateBlockTemplate")
localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "BlockUtilsSdkClientGoService.CreateBlockTemplate")
if err != nil {
return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()}
}
@ -197,7 +133,7 @@ func (a *BlockAPIService) CreateBlockTemplateExecute(r ApiCreateBlockTemplateReq
type ApiGetBlockRequest struct {
ctx context.Context
ApiService BlockAPI
ApiService *BlockUtilsSdkClientGoService
identifier string
}
@ -212,7 +148,7 @@ GetBlock Get a block by its hash or height (ID)
@param identifier The hash (hex string) or height (integer) of the block to retrieve.
@return ApiGetBlockRequest
*/
func (a *BlockAPIService) GetBlock(ctx context.Context, identifier string) ApiGetBlockRequest {
func (a *BlockUtilsSdkClientGoService) GetBlock(ctx context.Context, identifier string) ApiGetBlockRequest {
return ApiGetBlockRequest{
ApiService: a,
ctx: ctx,
@ -222,7 +158,7 @@ func (a *BlockAPIService) GetBlock(ctx context.Context, identifier string) ApiGe
// Execute executes the request
// @return BlockDetailsModel
func (a *BlockAPIService) GetBlockExecute(r ApiGetBlockRequest) (*BlockDetailsModel, *http.Response, error) {
func (a *BlockUtilsSdkClientGoService) GetBlockExecute(r ApiGetBlockRequest) (*BlockDetailsModel, *http.Response, error) {
var (
localVarHTTPMethod = http.MethodGet
localVarPostBody interface{}
@ -230,7 +166,7 @@ func (a *BlockAPIService) GetBlockExecute(r ApiGetBlockRequest) (*BlockDetailsMo
localVarReturnValue *BlockDetailsModel
)
localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "BlockAPIService.GetBlock")
localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "BlockUtilsSdkClientGoService.GetBlock")
if err != nil {
return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()}
}
@ -298,7 +234,7 @@ func (a *BlockAPIService) GetBlockExecute(r ApiGetBlockRequest) (*BlockDetailsMo
type ApiGetBlocksRequest struct {
ctx context.Context
ApiService BlockAPI
ApiService *BlockUtilsSdkClientGoService
}
func (r ApiGetBlocksRequest) Execute() ([]BlockDetailsModel, *http.Response, error) {
@ -311,7 +247,7 @@ GetBlocks Get one or more blocks, with optional pagination.
@param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
@return ApiGetBlocksRequest
*/
func (a *BlockAPIService) GetBlocks(ctx context.Context) ApiGetBlocksRequest {
func (a *BlockUtilsSdkClientGoService) GetBlocks(ctx context.Context) ApiGetBlocksRequest {
return ApiGetBlocksRequest{
ApiService: a,
ctx: ctx,
@ -320,7 +256,7 @@ func (a *BlockAPIService) GetBlocks(ctx context.Context) ApiGetBlocksRequest {
// Execute executes the request
// @return []BlockDetailsModel
func (a *BlockAPIService) GetBlocksExecute(r ApiGetBlocksRequest) ([]BlockDetailsModel, *http.Response, error) {
func (a *BlockUtilsSdkClientGoService) GetBlocksExecute(r ApiGetBlocksRequest) ([]BlockDetailsModel, *http.Response, error) {
var (
localVarHTTPMethod = http.MethodGet
localVarPostBody interface{}
@ -328,7 +264,7 @@ func (a *BlockAPIService) GetBlocksExecute(r ApiGetBlocksRequest) ([]BlockDetail
localVarReturnValue []BlockDetailsModel
)
localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "BlockAPIService.GetBlocks")
localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "BlockUtilsSdkClientGoService.GetBlocks")
if err != nil {
return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()}
}
@ -395,7 +331,7 @@ func (a *BlockAPIService) GetBlocksExecute(r ApiGetBlocksRequest) ([]BlockDetail
type ApiGetHeightRequest struct {
ctx context.Context
ApiService BlockAPI
ApiService *BlockUtilsSdkClientGoService
}
func (r ApiGetHeightRequest) Execute() (*HeightModel, *http.Response, error) {
@ -408,7 +344,7 @@ GetHeight Get the current blockchain height
@param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
@return ApiGetHeightRequest
*/
func (a *BlockAPIService) GetHeight(ctx context.Context) ApiGetHeightRequest {
func (a *BlockUtilsSdkClientGoService) GetHeight(ctx context.Context) ApiGetHeightRequest {
return ApiGetHeightRequest{
ApiService: a,
ctx: ctx,
@ -417,7 +353,7 @@ func (a *BlockAPIService) GetHeight(ctx context.Context) ApiGetHeightRequest {
// Execute executes the request
// @return HeightModel
func (a *BlockAPIService) GetHeightExecute(r ApiGetHeightRequest) (*HeightModel, *http.Response, error) {
func (a *BlockUtilsSdkClientGoService) GetHeightExecute(r ApiGetHeightRequest) (*HeightModel, *http.Response, error) {
var (
localVarHTTPMethod = http.MethodGet
localVarPostBody interface{}
@ -425,7 +361,7 @@ func (a *BlockAPIService) GetHeightExecute(r ApiGetHeightRequest) (*HeightModel,
localVarReturnValue *HeightModel
)
localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "BlockAPIService.GetHeight")
localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "BlockUtilsSdkClientGoService.GetHeight")
if err != nil {
return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()}
}
@ -492,7 +428,7 @@ func (a *BlockAPIService) GetHeightExecute(r ApiGetHeightRequest) (*HeightModel,
type ApiSubmitBlockRequest struct {
ctx context.Context
ApiService BlockAPI
ApiService *BlockUtilsSdkClientGoService
submitBlockRequestModel *SubmitBlockRequestModel
}
@ -511,7 +447,7 @@ SubmitBlock Submit a new block to the network
@param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
@return ApiSubmitBlockRequest
*/
func (a *BlockAPIService) SubmitBlock(ctx context.Context) ApiSubmitBlockRequest {
func (a *BlockUtilsSdkClientGoService) SubmitBlock(ctx context.Context) ApiSubmitBlockRequest {
return ApiSubmitBlockRequest{
ApiService: a,
ctx: ctx,
@ -520,7 +456,7 @@ func (a *BlockAPIService) SubmitBlock(ctx context.Context) ApiSubmitBlockRequest
// Execute executes the request
// @return SubmitBlockResponseModel
func (a *BlockAPIService) SubmitBlockExecute(r ApiSubmitBlockRequest) (*SubmitBlockResponseModel, *http.Response, error) {
func (a *BlockUtilsSdkClientGoService) SubmitBlockExecute(r ApiSubmitBlockRequest) (*SubmitBlockResponseModel, *http.Response, error) {
var (
localVarHTTPMethod = http.MethodPost
localVarPostBody interface{}
@ -528,7 +464,7 @@ func (a *BlockAPIService) SubmitBlockExecute(r ApiSubmitBlockRequest) (*SubmitBl
localVarReturnValue *SubmitBlockResponseModel
)
localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "BlockAPIService.SubmitBlock")
localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "BlockUtilsSdkClientGoService.SubmitBlock")
if err != nil {
return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()}
}

View file

@ -19,41 +19,12 @@ import (
)
type InfoAPI interface {
/*
GetInfo Get detailed information about the blockchain and daemon state
@param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
@return ApiGetInfoRequest
*/
GetInfo(ctx context.Context) ApiGetInfoRequest
// GetInfoExecute executes the request
// @return InfoModel
GetInfoExecute(r ApiGetInfoRequest) (*InfoModel, *http.Response, error)
/*
Version Get API version
Returns the current version of the API.
@param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
@return ApiVersionRequest
*/
Version(ctx context.Context) ApiVersionRequest
// VersionExecute executes the request
// @return VersionModel
VersionExecute(r ApiVersionRequest) (*VersionModel, *http.Response, error)
}
// InfoAPIService InfoAPI service
type InfoAPIService service
// InfoUtilsSdkClientGoService InfoUtilsSdkClientGo service
type InfoUtilsSdkClientGoService service
type ApiGetInfoRequest struct {
ctx context.Context
ApiService InfoAPI
ApiService *InfoUtilsSdkClientGoService
flags *string
}
@ -73,7 +44,7 @@ GetInfo Get detailed information about the blockchain and daemon state
@param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
@return ApiGetInfoRequest
*/
func (a *InfoAPIService) GetInfo(ctx context.Context) ApiGetInfoRequest {
func (a *InfoUtilsSdkClientGoService) GetInfo(ctx context.Context) ApiGetInfoRequest {
return ApiGetInfoRequest{
ApiService: a,
ctx: ctx,
@ -82,7 +53,7 @@ func (a *InfoAPIService) GetInfo(ctx context.Context) ApiGetInfoRequest {
// Execute executes the request
// @return InfoModel
func (a *InfoAPIService) GetInfoExecute(r ApiGetInfoRequest) (*InfoModel, *http.Response, error) {
func (a *InfoUtilsSdkClientGoService) GetInfoExecute(r ApiGetInfoRequest) (*InfoModel, *http.Response, error) {
var (
localVarHTTPMethod = http.MethodGet
localVarPostBody interface{}
@ -90,7 +61,7 @@ func (a *InfoAPIService) GetInfoExecute(r ApiGetInfoRequest) (*InfoModel, *http.
localVarReturnValue *InfoModel
)
localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "InfoAPIService.GetInfo")
localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "InfoUtilsSdkClientGoService.GetInfo")
if err != nil {
return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()}
}
@ -160,7 +131,7 @@ func (a *InfoAPIService) GetInfoExecute(r ApiGetInfoRequest) (*InfoModel, *http.
type ApiVersionRequest struct {
ctx context.Context
ApiService InfoAPI
ApiService *InfoUtilsSdkClientGoService
}
func (r ApiVersionRequest) Execute() (*VersionModel, *http.Response, error) {
@ -175,7 +146,7 @@ Returns the current version of the API.
@param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
@return ApiVersionRequest
*/
func (a *InfoAPIService) Version(ctx context.Context) ApiVersionRequest {
func (a *InfoUtilsSdkClientGoService) Version(ctx context.Context) ApiVersionRequest {
return ApiVersionRequest{
ApiService: a,
ctx: ctx,
@ -184,7 +155,7 @@ func (a *InfoAPIService) Version(ctx context.Context) ApiVersionRequest {
// Execute executes the request
// @return VersionModel
func (a *InfoAPIService) VersionExecute(r ApiVersionRequest) (*VersionModel, *http.Response, error) {
func (a *InfoUtilsSdkClientGoService) VersionExecute(r ApiVersionRequest) (*VersionModel, *http.Response, error) {
var (
localVarHTTPMethod = http.MethodGet
localVarPostBody interface{}
@ -192,7 +163,7 @@ func (a *InfoAPIService) VersionExecute(r ApiVersionRequest) (*VersionModel, *ht
localVarReturnValue *VersionModel
)
localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "InfoAPIService.Version")
localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "InfoUtilsSdkClientGoService.Version")
if err != nil {
return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()}
}

View file

@ -49,9 +49,9 @@ type APIClient struct {
// API Services
BlockAPI BlockAPI
BlockUtilsSdkClientGo *BlockUtilsSdkClientGoService
InfoAPI InfoAPI
InfoUtilsSdkClientGo *InfoUtilsSdkClientGoService
}
type service struct {
@ -70,8 +70,8 @@ func NewAPIClient(cfg *Configuration) *APIClient {
c.common.client = c
// API Services
c.BlockAPI = (*BlockAPIService)(&c.common)
c.InfoAPI = (*InfoAPIService)(&c.common)
c.BlockUtilsSdkClientGo = (*BlockUtilsSdkClientGoService)(&c.common)
c.InfoUtilsSdkClientGo = (*InfoUtilsSdkClientGoService)(&c.common)
return c
}

View file

@ -1,14 +1,14 @@
# \BlockAPI
# \BlockUtilsSdkClientGo
All URIs are relative to *http://127.0.0.1:36943*
Method | HTTP request | Description
------------- | ------------- | -------------
[**CreateBlockTemplate**](BlockAPI.md#CreateBlockTemplate) | **Post** /block/template | Create a block template for mining
[**GetBlock**](BlockAPI.md#GetBlock) | **Get** /block/{identifier} | Get a block by its hash or height (ID)
[**GetBlocks**](BlockAPI.md#GetBlocks) | **Get** /block | Get one or more blocks, with optional pagination.
[**GetHeight**](BlockAPI.md#GetHeight) | **Get** /block/height | Get the current blockchain height
[**SubmitBlock**](BlockAPI.md#SubmitBlock) | **Post** /block/submit | Submit a new block to the network
[**CreateBlockTemplate**](BlockUtilsSdkClientGo.md#CreateBlockTemplate) | **Post** /block/template | Create a block template for mining
[**GetBlock**](BlockUtilsSdkClientGo.md#GetBlock) | **Get** /block/{identifier} | Get a block by its hash or height (ID)
[**GetBlocks**](BlockUtilsSdkClientGo.md#GetBlocks) | **Get** /block | Get one or more blocks, with optional pagination.
[**GetHeight**](BlockUtilsSdkClientGo.md#GetHeight) | **Get** /block/height | Get the current blockchain height
[**SubmitBlock**](BlockUtilsSdkClientGo.md#SubmitBlock) | **Post** /block/submit | Submit a new block to the network
@ -27,7 +27,7 @@ import (
"context"
"fmt"
"os"
openapiclient "github.com/letheanVPN/blockchain/lthn"
openapiclient "github.com/letheanVPN/blockchain/utils/sdk/client/go"
)
func main() {
@ -35,13 +35,13 @@ func main() {
configuration := openapiclient.NewConfiguration()
apiClient := openapiclient.NewAPIClient(configuration)
resp, r, err := apiClient.BlockAPI.CreateBlockTemplate(context.Background()).BlockTemplateRequestModel(blockTemplateRequestModel).Execute()
resp, r, err := apiClient.BlockUtilsSdkClientGo.CreateBlockTemplate(context.Background()).BlockTemplateRequestModel(blockTemplateRequestModel).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `BlockAPI.CreateBlockTemplate``: %v\n", err)
fmt.Fprintf(os.Stderr, "Error when calling `BlockUtilsSdkClientGo.CreateBlockTemplate``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `CreateBlockTemplate`: BlockTemplateModel
fmt.Fprintf(os.Stdout, "Response from `BlockAPI.CreateBlockTemplate`: %v\n", resp)
fmt.Fprintf(os.Stdout, "Response from `BlockUtilsSdkClientGo.CreateBlockTemplate`: %v\n", resp)
}
```
@ -91,7 +91,7 @@ import (
"context"
"fmt"
"os"
openapiclient "github.com/letheanVPN/blockchain/lthn"
openapiclient "github.com/letheanVPN/blockchain/utils/sdk/client/go"
)
func main() {
@ -99,13 +99,13 @@ func main() {
configuration := openapiclient.NewConfiguration()
apiClient := openapiclient.NewAPIClient(configuration)
resp, r, err := apiClient.BlockAPI.GetBlock(context.Background(), identifier).Execute()
resp, r, err := apiClient.BlockUtilsSdkClientGo.GetBlock(context.Background(), identifier).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `BlockAPI.GetBlock``: %v\n", err)
fmt.Fprintf(os.Stderr, "Error when calling `BlockUtilsSdkClientGo.GetBlock``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `GetBlock`: BlockDetailsModel
fmt.Fprintf(os.Stdout, "Response from `BlockAPI.GetBlock`: %v\n", resp)
fmt.Fprintf(os.Stdout, "Response from `BlockUtilsSdkClientGo.GetBlock`: %v\n", resp)
}
```
@ -159,20 +159,20 @@ import (
"context"
"fmt"
"os"
openapiclient "github.com/letheanVPN/blockchain/lthn"
openapiclient "github.com/letheanVPN/blockchain/utils/sdk/client/go"
)
func main() {
configuration := openapiclient.NewConfiguration()
apiClient := openapiclient.NewAPIClient(configuration)
resp, r, err := apiClient.BlockAPI.GetBlocks(context.Background()).Execute()
resp, r, err := apiClient.BlockUtilsSdkClientGo.GetBlocks(context.Background()).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `BlockAPI.GetBlocks``: %v\n", err)
fmt.Fprintf(os.Stderr, "Error when calling `BlockUtilsSdkClientGo.GetBlocks``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `GetBlocks`: []BlockDetailsModel
fmt.Fprintf(os.Stdout, "Response from `BlockAPI.GetBlocks`: %v\n", resp)
fmt.Fprintf(os.Stdout, "Response from `BlockUtilsSdkClientGo.GetBlocks`: %v\n", resp)
}
```
@ -218,20 +218,20 @@ import (
"context"
"fmt"
"os"
openapiclient "github.com/letheanVPN/blockchain/lthn"
openapiclient "github.com/letheanVPN/blockchain/utils/sdk/client/go"
)
func main() {
configuration := openapiclient.NewConfiguration()
apiClient := openapiclient.NewAPIClient(configuration)
resp, r, err := apiClient.BlockAPI.GetHeight(context.Background()).Execute()
resp, r, err := apiClient.BlockUtilsSdkClientGo.GetHeight(context.Background()).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `BlockAPI.GetHeight``: %v\n", err)
fmt.Fprintf(os.Stderr, "Error when calling `BlockUtilsSdkClientGo.GetHeight``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `GetHeight`: HeightModel
fmt.Fprintf(os.Stdout, "Response from `BlockAPI.GetHeight`: %v\n", resp)
fmt.Fprintf(os.Stdout, "Response from `BlockUtilsSdkClientGo.GetHeight`: %v\n", resp)
}
```
@ -277,7 +277,7 @@ import (
"context"
"fmt"
"os"
openapiclient "github.com/letheanVPN/blockchain/lthn"
openapiclient "github.com/letheanVPN/blockchain/utils/sdk/client/go"
)
func main() {
@ -285,13 +285,13 @@ func main() {
configuration := openapiclient.NewConfiguration()
apiClient := openapiclient.NewAPIClient(configuration)
resp, r, err := apiClient.BlockAPI.SubmitBlock(context.Background()).SubmitBlockRequestModel(submitBlockRequestModel).Execute()
resp, r, err := apiClient.BlockUtilsSdkClientGo.SubmitBlock(context.Background()).SubmitBlockRequestModel(submitBlockRequestModel).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `BlockAPI.SubmitBlock``: %v\n", err)
fmt.Fprintf(os.Stderr, "Error when calling `BlockUtilsSdkClientGo.SubmitBlock``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `SubmitBlock`: SubmitBlockResponseModel
fmt.Fprintf(os.Stdout, "Response from `BlockAPI.SubmitBlock`: %v\n", resp)
fmt.Fprintf(os.Stdout, "Response from `BlockUtilsSdkClientGo.SubmitBlock`: %v\n", resp)
}
```

View file

@ -1,11 +1,11 @@
# \InfoAPI
# \InfoUtilsSdkClientGo
All URIs are relative to *http://127.0.0.1:36943*
Method | HTTP request | Description
------------- | ------------- | -------------
[**GetInfo**](InfoAPI.md#GetInfo) | **Get** /info | Get detailed information about the blockchain and daemon state
[**Version**](InfoAPI.md#Version) | **Get** /info/version | Get API version
[**GetInfo**](InfoUtilsSdkClientGo.md#GetInfo) | **Get** /info | Get detailed information about the blockchain and daemon state
[**Version**](InfoUtilsSdkClientGo.md#Version) | **Get** /info/version | Get API version
@ -24,7 +24,7 @@ import (
"context"
"fmt"
"os"
openapiclient "github.com/letheanVPN/blockchain/lthn"
openapiclient "github.com/letheanVPN/blockchain/utils/sdk/client/go"
)
func main() {
@ -32,13 +32,13 @@ func main() {
configuration := openapiclient.NewConfiguration()
apiClient := openapiclient.NewAPIClient(configuration)
resp, r, err := apiClient.InfoAPI.GetInfo(context.Background()).Flags(flags).Execute()
resp, r, err := apiClient.InfoUtilsSdkClientGo.GetInfo(context.Background()).Flags(flags).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `InfoAPI.GetInfo``: %v\n", err)
fmt.Fprintf(os.Stderr, "Error when calling `InfoUtilsSdkClientGo.GetInfo``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `GetInfo`: InfoModel
fmt.Fprintf(os.Stdout, "Response from `InfoAPI.GetInfo`: %v\n", resp)
fmt.Fprintf(os.Stdout, "Response from `InfoUtilsSdkClientGo.GetInfo`: %v\n", resp)
}
```
@ -90,20 +90,20 @@ import (
"context"
"fmt"
"os"
openapiclient "github.com/letheanVPN/blockchain/lthn"
openapiclient "github.com/letheanVPN/blockchain/utils/sdk/client/go"
)
func main() {
configuration := openapiclient.NewConfiguration()
apiClient := openapiclient.NewAPIClient(configuration)
resp, r, err := apiClient.InfoAPI.Version(context.Background()).Execute()
resp, r, err := apiClient.InfoUtilsSdkClientGo.Version(context.Background()).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `InfoAPI.Version``: %v\n", err)
fmt.Fprintf(os.Stderr, "Error when calling `InfoUtilsSdkClientGo.Version``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `Version`: VersionModel
fmt.Fprintf(os.Stdout, "Response from `InfoAPI.Version`: %v\n", resp)
fmt.Fprintf(os.Stdout, "Response from `InfoUtilsSdkClientGo.Version`: %v\n", resp)
}
```

View file

@ -1,3 +1,11 @@
module github.com/letheanVPN/blockchain/utils/sdk/client/go
go 1.23
require github.com/stretchr/testify v1.11.1
require (
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
)

10
utils/sdk/client/go/go.sum generated Normal file
View file

@ -0,0 +1,10 @@
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
github.com/stretchr/testify v1.11.1 h1:7s2iGBzp5EwR7/aIZr8ao5+dra3wiQyKjjFuvgVKu7U=
github.com/stretchr/testify v1.11.1/go.mod h1:wZwfW3scLgRK+23gO65QZefKpKQRnfz6sD981Nm4B6U=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=

View file

@ -44,8 +44,11 @@ type BlockDetailsModel struct {
TotalTxsSize *int32 `json:"total_txs_size,omitempty"`
TransactionsDetails []TransactionDetailsModel `json:"transactions_details,omitempty"`
Type *int32 `json:"type,omitempty"`
AdditionalProperties map[string]interface{}
}
type _BlockDetailsModel BlockDetailsModel
// NewBlockDetailsModel instantiates a new BlockDetailsModel object
// This constructor will assign default values to properties that have it defined,
// and makes sure properties required by API are set, but the set of arguments
@ -948,9 +951,59 @@ func (o BlockDetailsModel) ToMap() (map[string]interface{}, error) {
if !IsNil(o.Type) {
toSerialize["type"] = o.Type
}
for key, value := range o.AdditionalProperties {
toSerialize[key] = value
}
return toSerialize, nil
}
func (o *BlockDetailsModel) UnmarshalJSON(data []byte) (err error) {
varBlockDetailsModel := _BlockDetailsModel{}
err = json.Unmarshal(data, &varBlockDetailsModel)
if err != nil {
return err
}
*o = BlockDetailsModel(varBlockDetailsModel)
additionalProperties := make(map[string]interface{})
if err = json.Unmarshal(data, &additionalProperties); err == nil {
delete(additionalProperties, "actual_timestamp")
delete(additionalProperties, "already_generated_coins")
delete(additionalProperties, "base_reward")
delete(additionalProperties, "blob")
delete(additionalProperties, "block_cumulative_size")
delete(additionalProperties, "block_tself_size")
delete(additionalProperties, "cumulative_diff_adjusted")
delete(additionalProperties, "cumulative_diff_precise")
delete(additionalProperties, "difficulty")
delete(additionalProperties, "effective_fee_median")
delete(additionalProperties, "height")
delete(additionalProperties, "id")
delete(additionalProperties, "is_orphan")
delete(additionalProperties, "miner_text_info")
delete(additionalProperties, "object_in_json")
delete(additionalProperties, "penalty")
delete(additionalProperties, "pow_seed")
delete(additionalProperties, "prev_id")
delete(additionalProperties, "summary_reward")
delete(additionalProperties, "this_block_fee_median")
delete(additionalProperties, "timestamp")
delete(additionalProperties, "total_fee")
delete(additionalProperties, "total_txs_size")
delete(additionalProperties, "transactions_details")
delete(additionalProperties, "type")
o.AdditionalProperties = additionalProperties
}
return err
}
type NullableBlockDetailsModel struct {
value *BlockDetailsModel
isSet bool

View file

@ -35,8 +35,11 @@ type BlockProcessingPerformanceModel struct {
PosValidateKiSearch *int32 `json:"pos_validate_ki_search,omitempty"`
PosValidateGetOutKeysForInputs *int32 `json:"pos_validate_get_out_keys_for_inputs,omitempty"`
PosValidateZvp *int32 `json:"pos_validate_zvp,omitempty"`
AdditionalProperties map[string]interface{}
}
type _BlockProcessingPerformanceModel BlockProcessingPerformanceModel
// NewBlockProcessingPerformanceModel instantiates a new BlockProcessingPerformanceModel object
// This constructor will assign default values to properties that have it defined,
// and makes sure properties required by API are set, but the set of arguments
@ -624,9 +627,50 @@ func (o BlockProcessingPerformanceModel) ToMap() (map[string]interface{}, error)
if !IsNil(o.PosValidateZvp) {
toSerialize["pos_validate_zvp"] = o.PosValidateZvp
}
for key, value := range o.AdditionalProperties {
toSerialize[key] = value
}
return toSerialize, nil
}
func (o *BlockProcessingPerformanceModel) UnmarshalJSON(data []byte) (err error) {
varBlockProcessingPerformanceModel := _BlockProcessingPerformanceModel{}
err = json.Unmarshal(data, &varBlockProcessingPerformanceModel)
if err != nil {
return err
}
*o = BlockProcessingPerformanceModel(varBlockProcessingPerformanceModel)
additionalProperties := make(map[string]interface{})
if err = json.Unmarshal(data, &additionalProperties); err == nil {
delete(additionalProperties, "block_processing_time_0")
delete(additionalProperties, "block_processing_time_1")
delete(additionalProperties, "target_calculating_time_2")
delete(additionalProperties, "longhash_calculating_time_3")
delete(additionalProperties, "all_txs_insert_time_5")
delete(additionalProperties, "etc_stuff_6")
delete(additionalProperties, "insert_time_4")
delete(additionalProperties, "raise_block_core_event")
delete(additionalProperties, "validate_miner_transaction_time")
delete(additionalProperties, "collect_rangeproofs_data_from_tx_time")
delete(additionalProperties, "verify_multiple_zc_outs_range_proofs_time")
delete(additionalProperties, "target_calculating_enum_blocks")
delete(additionalProperties, "target_calculating_calc")
delete(additionalProperties, "pos_validate_ki_search")
delete(additionalProperties, "pos_validate_get_out_keys_for_inputs")
delete(additionalProperties, "pos_validate_zvp")
o.AdditionalProperties = additionalProperties
}
return err
}
type NullableBlockProcessingPerformanceModel struct {
value *BlockProcessingPerformanceModel
isSet bool

View file

@ -28,8 +28,11 @@ type BlockTemplateModel struct {
TxsFee *int32 `json:"txs_fee,omitempty"`
PrevHash *string `json:"prev_hash,omitempty"`
Seed *string `json:"seed,omitempty"`
AdditionalProperties map[string]interface{}
}
type _BlockTemplateModel BlockTemplateModel
// NewBlockTemplateModel instantiates a new BlockTemplateModel object
// This constructor will assign default values to properties that have it defined,
// and makes sure properties required by API are set, but the set of arguments
@ -372,9 +375,43 @@ func (o BlockTemplateModel) ToMap() (map[string]interface{}, error) {
if !IsNil(o.Seed) {
toSerialize["seed"] = o.Seed
}
for key, value := range o.AdditionalProperties {
toSerialize[key] = value
}
return toSerialize, nil
}
func (o *BlockTemplateModel) UnmarshalJSON(data []byte) (err error) {
varBlockTemplateModel := _BlockTemplateModel{}
err = json.Unmarshal(data, &varBlockTemplateModel)
if err != nil {
return err
}
*o = BlockTemplateModel(varBlockTemplateModel)
additionalProperties := make(map[string]interface{})
if err = json.Unmarshal(data, &additionalProperties); err == nil {
delete(additionalProperties, "blocktemplate_blob")
delete(additionalProperties, "difficulty")
delete(additionalProperties, "height")
delete(additionalProperties, "miner_tx_tgc")
delete(additionalProperties, "block_reward_without_fee")
delete(additionalProperties, "block_reward")
delete(additionalProperties, "txs_fee")
delete(additionalProperties, "prev_hash")
delete(additionalProperties, "seed")
o.AdditionalProperties = additionalProperties
}
return err
}
type NullableBlockTemplateModel struct {
value *BlockTemplateModel
isSet bool

View file

@ -26,8 +26,11 @@ type BlockTemplateRequestModel struct {
IgnorePowTsCheck *bool `json:"ignore_pow_ts_check,omitempty"`
Pe *PosEntryModel `json:"pe,omitempty"`
ExplicitTxs []string `json:"explicit_txs,omitempty"`
AdditionalProperties map[string]interface{}
}
type _BlockTemplateRequestModel BlockTemplateRequestModel
// NewBlockTemplateRequestModel instantiates a new BlockTemplateRequestModel object
// This constructor will assign default values to properties that have it defined,
// and makes sure properties required by API are set, but the set of arguments
@ -300,9 +303,41 @@ func (o BlockTemplateRequestModel) ToMap() (map[string]interface{}, error) {
if !IsNil(o.ExplicitTxs) {
toSerialize["explicit_txs"] = o.ExplicitTxs
}
for key, value := range o.AdditionalProperties {
toSerialize[key] = value
}
return toSerialize, nil
}
func (o *BlockTemplateRequestModel) UnmarshalJSON(data []byte) (err error) {
varBlockTemplateRequestModel := _BlockTemplateRequestModel{}
err = json.Unmarshal(data, &varBlockTemplateRequestModel)
if err != nil {
return err
}
*o = BlockTemplateRequestModel(varBlockTemplateRequestModel)
additionalProperties := make(map[string]interface{})
if err = json.Unmarshal(data, &additionalProperties); err == nil {
delete(additionalProperties, "miner_address")
delete(additionalProperties, "stakeholder_address")
delete(additionalProperties, "ex_nonce")
delete(additionalProperties, "pos_block")
delete(additionalProperties, "ignore_pow_ts_check")
delete(additionalProperties, "pe")
delete(additionalProperties, "explicit_txs")
o.AdditionalProperties = additionalProperties
}
return err
}
type NullableBlockTemplateRequestModel struct {
value *BlockTemplateRequestModel
isSet bool

View file

@ -22,8 +22,11 @@ type DbStatInfoModel struct {
TxCount *int32 `json:"tx_count,omitempty"`
WriteTxCount *int32 `json:"write_tx_count,omitempty"`
MapSize *int32 `json:"map_size,omitempty"`
AdditionalProperties map[string]interface{}
}
type _DbStatInfoModel DbStatInfoModel
// NewDbStatInfoModel instantiates a new DbStatInfoModel object
// This constructor will assign default values to properties that have it defined,
// and makes sure properties required by API are set, but the set of arguments
@ -156,9 +159,37 @@ func (o DbStatInfoModel) ToMap() (map[string]interface{}, error) {
if !IsNil(o.MapSize) {
toSerialize["map_size"] = o.MapSize
}
for key, value := range o.AdditionalProperties {
toSerialize[key] = value
}
return toSerialize, nil
}
func (o *DbStatInfoModel) UnmarshalJSON(data []byte) (err error) {
varDbStatInfoModel := _DbStatInfoModel{}
err = json.Unmarshal(data, &varDbStatInfoModel)
if err != nil {
return err
}
*o = DbStatInfoModel(varDbStatInfoModel)
additionalProperties := make(map[string]interface{})
if err = json.Unmarshal(data, &additionalProperties); err == nil {
delete(additionalProperties, "tx_count")
delete(additionalProperties, "write_tx_count")
delete(additionalProperties, "map_size")
o.AdditionalProperties = additionalProperties
}
return err
}
type NullableDbStatInfoModel struct {
value *DbStatInfoModel
isSet bool

View file

@ -20,8 +20,11 @@ var _ MappedNullable = &HeightModel{}
// HeightModel struct for HeightModel
type HeightModel struct {
Height *int32 `json:"height,omitempty"`
AdditionalProperties map[string]interface{}
}
type _HeightModel HeightModel
// NewHeightModel instantiates a new HeightModel object
// This constructor will assign default values to properties that have it defined,
// and makes sure properties required by API are set, but the set of arguments
@ -84,9 +87,35 @@ func (o HeightModel) ToMap() (map[string]interface{}, error) {
if !IsNil(o.Height) {
toSerialize["height"] = o.Height
}
for key, value := range o.AdditionalProperties {
toSerialize[key] = value
}
return toSerialize, nil
}
func (o *HeightModel) UnmarshalJSON(data []byte) (err error) {
varHeightModel := _HeightModel{}
err = json.Unmarshal(data, &varHeightModel)
if err != nil {
return err
}
*o = HeightModel(varHeightModel)
additionalProperties := make(map[string]interface{})
if err = json.Unmarshal(data, &additionalProperties); err == nil {
delete(additionalProperties, "height")
o.AdditionalProperties = additionalProperties
}
return err
}
type NullableHeightModel struct {
value *HeightModel
isSet bool

View file

@ -65,8 +65,11 @@ type InfoModel struct {
PerformanceData *PerformanceModel `json:"performance_data,omitempty"`
OffersCount *int32 `json:"offers_count,omitempty"`
ExpirationMedianTimestamp *int32 `json:"expiration_median_timestamp,omitempty"`
AdditionalProperties map[string]interface{}
}
type _InfoModel InfoModel
// NewInfoModel instantiates a new InfoModel object
// This constructor will assign default values to properties that have it defined,
// and makes sure properties required by API are set, but the set of arguments
@ -1704,9 +1707,80 @@ func (o InfoModel) ToMap() (map[string]interface{}, error) {
if !IsNil(o.ExpirationMedianTimestamp) {
toSerialize["expiration_median_timestamp"] = o.ExpirationMedianTimestamp
}
for key, value := range o.AdditionalProperties {
toSerialize[key] = value
}
return toSerialize, nil
}
func (o *InfoModel) UnmarshalJSON(data []byte) (err error) {
varInfoModel := _InfoModel{}
err = json.Unmarshal(data, &varInfoModel)
if err != nil {
return err
}
*o = InfoModel(varInfoModel)
additionalProperties := make(map[string]interface{})
if err = json.Unmarshal(data, &additionalProperties); err == nil {
delete(additionalProperties, "height")
delete(additionalProperties, "tx_count")
delete(additionalProperties, "tx_pool_size")
delete(additionalProperties, "alt_blocks_count")
delete(additionalProperties, "outgoing_connections_count")
delete(additionalProperties, "incoming_connections_count")
delete(additionalProperties, "synchronized_connections_count")
delete(additionalProperties, "white_peerlist_size")
delete(additionalProperties, "grey_peerlist_size")
delete(additionalProperties, "current_blocks_median")
delete(additionalProperties, "alias_count")
delete(additionalProperties, "current_max_allowed_block_size")
delete(additionalProperties, "daemon_network_state")
delete(additionalProperties, "synchronization_start_height")
delete(additionalProperties, "max_net_seen_height")
delete(additionalProperties, "mi")
delete(additionalProperties, "pos_allowed")
delete(additionalProperties, "pos_difficulty")
delete(additionalProperties, "pow_difficulty")
delete(additionalProperties, "default_fee")
delete(additionalProperties, "minimum_fee")
delete(additionalProperties, "is_hardfork_active")
delete(additionalProperties, "net_time_delta_median")
delete(additionalProperties, "current_network_hashrate_50")
delete(additionalProperties, "current_network_hashrate_350")
delete(additionalProperties, "seconds_for_10_blocks")
delete(additionalProperties, "seconds_for_30_blocks")
delete(additionalProperties, "transactions_cnt_per_day")
delete(additionalProperties, "transactions_volume_per_day")
delete(additionalProperties, "last_pos_timestamp")
delete(additionalProperties, "last_pow_timestamp")
delete(additionalProperties, "total_coins")
delete(additionalProperties, "last_block_size")
delete(additionalProperties, "tx_count_in_last_block")
delete(additionalProperties, "pos_sequence_factor")
delete(additionalProperties, "pow_sequence_factor")
delete(additionalProperties, "block_reward")
delete(additionalProperties, "last_block_total_reward")
delete(additionalProperties, "pos_diff_total_coins_rate")
delete(additionalProperties, "last_block_timestamp")
delete(additionalProperties, "last_block_hash")
delete(additionalProperties, "pos_block_ts_shift_vs_actual")
delete(additionalProperties, "outs_stat")
delete(additionalProperties, "performance_data")
delete(additionalProperties, "offers_count")
delete(additionalProperties, "expiration_median_timestamp")
o.AdditionalProperties = additionalProperties
}
return err
}
type NullableInfoModel struct {
value *InfoModel
isSet bool

View file

@ -24,8 +24,11 @@ type MaintainersInfoModel struct {
VerRevision *int32 `json:"ver_revision,omitempty"`
BuildNo *int32 `json:"build_no,omitempty"`
Mode *int32 `json:"mode,omitempty"`
AdditionalProperties map[string]interface{}
}
type _MaintainersInfoModel MaintainersInfoModel
// NewMaintainersInfoModel instantiates a new MaintainersInfoModel object
// This constructor will assign default values to properties that have it defined,
// and makes sure properties required by API are set, but the set of arguments
@ -228,9 +231,39 @@ func (o MaintainersInfoModel) ToMap() (map[string]interface{}, error) {
if !IsNil(o.Mode) {
toSerialize["mode"] = o.Mode
}
for key, value := range o.AdditionalProperties {
toSerialize[key] = value
}
return toSerialize, nil
}
func (o *MaintainersInfoModel) UnmarshalJSON(data []byte) (err error) {
varMaintainersInfoModel := _MaintainersInfoModel{}
err = json.Unmarshal(data, &varMaintainersInfoModel)
if err != nil {
return err
}
*o = MaintainersInfoModel(varMaintainersInfoModel)
additionalProperties := make(map[string]interface{})
if err = json.Unmarshal(data, &additionalProperties); err == nil {
delete(additionalProperties, "ver_major")
delete(additionalProperties, "ver_minor")
delete(additionalProperties, "ver_revision")
delete(additionalProperties, "build_no")
delete(additionalProperties, "mode")
o.AdditionalProperties = additionalProperties
}
return err
}
type NullableMaintainersInfoModel struct {
value *MaintainersInfoModel
isSet bool

View file

@ -23,8 +23,11 @@ type PerformanceModel struct {
TxProcessing *TxProcessingPerformanceModel `json:"tx_processing,omitempty"`
TxPool *TxPoolPerformanceModel `json:"tx_pool,omitempty"`
DbStatInfo *DbStatInfoModel `json:"db_stat_info,omitempty"`
AdditionalProperties map[string]interface{}
}
type _PerformanceModel PerformanceModel
// NewPerformanceModel instantiates a new PerformanceModel object
// This constructor will assign default values to properties that have it defined,
// and makes sure properties required by API are set, but the set of arguments
@ -192,9 +195,38 @@ func (o PerformanceModel) ToMap() (map[string]interface{}, error) {
if !IsNil(o.DbStatInfo) {
toSerialize["db_stat_info"] = o.DbStatInfo
}
for key, value := range o.AdditionalProperties {
toSerialize[key] = value
}
return toSerialize, nil
}
func (o *PerformanceModel) UnmarshalJSON(data []byte) (err error) {
varPerformanceModel := _PerformanceModel{}
err = json.Unmarshal(data, &varPerformanceModel)
if err != nil {
return err
}
*o = PerformanceModel(varPerformanceModel)
additionalProperties := make(map[string]interface{})
if err = json.Unmarshal(data, &additionalProperties); err == nil {
delete(additionalProperties, "block_processing")
delete(additionalProperties, "tx_processing")
delete(additionalProperties, "tx_pool")
delete(additionalProperties, "db_stat_info")
o.AdditionalProperties = additionalProperties
}
return err
}
type NullablePerformanceModel struct {
value *PerformanceModel
isSet bool

View file

@ -27,8 +27,11 @@ type PosEntryModel struct {
TxId *string `json:"tx_id,omitempty"`
TxOutIndex *int32 `json:"tx_out_index,omitempty"`
WalletIndex *int32 `json:"wallet_index,omitempty"`
AdditionalProperties map[string]interface{}
}
type _PosEntryModel PosEntryModel
// NewPosEntryModel instantiates a new PosEntryModel object
// This constructor will assign default values to properties that have it defined,
// and makes sure properties required by API are set, but the set of arguments
@ -336,9 +339,42 @@ func (o PosEntryModel) ToMap() (map[string]interface{}, error) {
if !IsNil(o.WalletIndex) {
toSerialize["wallet_index"] = o.WalletIndex
}
for key, value := range o.AdditionalProperties {
toSerialize[key] = value
}
return toSerialize, nil
}
func (o *PosEntryModel) UnmarshalJSON(data []byte) (err error) {
varPosEntryModel := _PosEntryModel{}
err = json.Unmarshal(data, &varPosEntryModel)
if err != nil {
return err
}
*o = PosEntryModel(varPosEntryModel)
additionalProperties := make(map[string]interface{})
if err = json.Unmarshal(data, &additionalProperties); err == nil {
delete(additionalProperties, "amount")
delete(additionalProperties, "g_index")
delete(additionalProperties, "keyimage")
delete(additionalProperties, "block_timestamp")
delete(additionalProperties, "stake_unlock_time")
delete(additionalProperties, "tx_id")
delete(additionalProperties, "tx_out_index")
delete(additionalProperties, "wallet_index")
o.AdditionalProperties = additionalProperties
}
return err
}
type NullablePosEntryModel struct {
value *PosEntryModel
isSet bool

View file

@ -20,8 +20,11 @@ var _ MappedNullable = &SubmitBlockRequestModel{}
// SubmitBlockRequestModel struct for SubmitBlockRequestModel
type SubmitBlockRequestModel struct {
BlockBlob *string `json:"block_blob,omitempty"`
AdditionalProperties map[string]interface{}
}
type _SubmitBlockRequestModel SubmitBlockRequestModel
// NewSubmitBlockRequestModel instantiates a new SubmitBlockRequestModel object
// This constructor will assign default values to properties that have it defined,
// and makes sure properties required by API are set, but the set of arguments
@ -84,9 +87,35 @@ func (o SubmitBlockRequestModel) ToMap() (map[string]interface{}, error) {
if !IsNil(o.BlockBlob) {
toSerialize["block_blob"] = o.BlockBlob
}
for key, value := range o.AdditionalProperties {
toSerialize[key] = value
}
return toSerialize, nil
}
func (o *SubmitBlockRequestModel) UnmarshalJSON(data []byte) (err error) {
varSubmitBlockRequestModel := _SubmitBlockRequestModel{}
err = json.Unmarshal(data, &varSubmitBlockRequestModel)
if err != nil {
return err
}
*o = SubmitBlockRequestModel(varSubmitBlockRequestModel)
additionalProperties := make(map[string]interface{})
if err = json.Unmarshal(data, &additionalProperties); err == nil {
delete(additionalProperties, "block_blob")
o.AdditionalProperties = additionalProperties
}
return err
}
type NullableSubmitBlockRequestModel struct {
value *SubmitBlockRequestModel
isSet bool

View file

@ -20,8 +20,11 @@ var _ MappedNullable = &SubmitBlockResponseModel{}
// SubmitBlockResponseModel struct for SubmitBlockResponseModel
type SubmitBlockResponseModel struct {
Status *string `json:"status,omitempty"`
AdditionalProperties map[string]interface{}
}
type _SubmitBlockResponseModel SubmitBlockResponseModel
// NewSubmitBlockResponseModel instantiates a new SubmitBlockResponseModel object
// This constructor will assign default values to properties that have it defined,
// and makes sure properties required by API are set, but the set of arguments
@ -84,9 +87,35 @@ func (o SubmitBlockResponseModel) ToMap() (map[string]interface{}, error) {
if !IsNil(o.Status) {
toSerialize["status"] = o.Status
}
for key, value := range o.AdditionalProperties {
toSerialize[key] = value
}
return toSerialize, nil
}
func (o *SubmitBlockResponseModel) UnmarshalJSON(data []byte) (err error) {
varSubmitBlockResponseModel := _SubmitBlockResponseModel{}
err = json.Unmarshal(data, &varSubmitBlockResponseModel)
if err != nil {
return err
}
*o = SubmitBlockResponseModel(varSubmitBlockResponseModel)
additionalProperties := make(map[string]interface{})
if err = json.Unmarshal(data, &additionalProperties); err == nil {
delete(additionalProperties, "status")
o.AdditionalProperties = additionalProperties
}
return err
}
type NullableSubmitBlockResponseModel struct {
value *SubmitBlockResponseModel
isSet bool

View file

@ -22,8 +22,11 @@ type TransactionAttachmentModel struct {
Type *string `json:"type,omitempty"`
ShortView *string `json:"short_view,omitempty"`
DetailsView *string `json:"details_view,omitempty"`
AdditionalProperties map[string]interface{}
}
type _TransactionAttachmentModel TransactionAttachmentModel
// NewTransactionAttachmentModel instantiates a new TransactionAttachmentModel object
// This constructor will assign default values to properties that have it defined,
// and makes sure properties required by API are set, but the set of arguments
@ -156,9 +159,37 @@ func (o TransactionAttachmentModel) ToMap() (map[string]interface{}, error) {
if !IsNil(o.DetailsView) {
toSerialize["details_view"] = o.DetailsView
}
for key, value := range o.AdditionalProperties {
toSerialize[key] = value
}
return toSerialize, nil
}
func (o *TransactionAttachmentModel) UnmarshalJSON(data []byte) (err error) {
varTransactionAttachmentModel := _TransactionAttachmentModel{}
err = json.Unmarshal(data, &varTransactionAttachmentModel)
if err != nil {
return err
}
*o = TransactionAttachmentModel(varTransactionAttachmentModel)
additionalProperties := make(map[string]interface{})
if err = json.Unmarshal(data, &additionalProperties); err == nil {
delete(additionalProperties, "type")
delete(additionalProperties, "short_view")
delete(additionalProperties, "details_view")
o.AdditionalProperties = additionalProperties
}
return err
}
type NullableTransactionAttachmentModel struct {
value *TransactionAttachmentModel
isSet bool

View file

@ -32,8 +32,11 @@ type TransactionDetailsModel struct {
Outs []TransactionOutputModel `json:"outs,omitempty"`
PubKey *string `json:"pub_key,omitempty"`
Timestamp *int32 `json:"timestamp,omitempty"`
AdditionalProperties map[string]interface{}
}
type _TransactionDetailsModel TransactionDetailsModel
// NewTransactionDetailsModel instantiates a new TransactionDetailsModel object
// This constructor will assign default values to properties that have it defined,
// and makes sure properties required by API are set, but the set of arguments
@ -516,9 +519,47 @@ func (o TransactionDetailsModel) ToMap() (map[string]interface{}, error) {
if !IsNil(o.Timestamp) {
toSerialize["timestamp"] = o.Timestamp
}
for key, value := range o.AdditionalProperties {
toSerialize[key] = value
}
return toSerialize, nil
}
func (o *TransactionDetailsModel) UnmarshalJSON(data []byte) (err error) {
varTransactionDetailsModel := _TransactionDetailsModel{}
err = json.Unmarshal(data, &varTransactionDetailsModel)
if err != nil {
return err
}
*o = TransactionDetailsModel(varTransactionDetailsModel)
additionalProperties := make(map[string]interface{})
if err = json.Unmarshal(data, &additionalProperties); err == nil {
delete(additionalProperties, "amount")
delete(additionalProperties, "attachments")
delete(additionalProperties, "blob")
delete(additionalProperties, "blob_size")
delete(additionalProperties, "extra")
delete(additionalProperties, "fee")
delete(additionalProperties, "id")
delete(additionalProperties, "ins")
delete(additionalProperties, "keeper_block")
delete(additionalProperties, "object_in_json")
delete(additionalProperties, "outs")
delete(additionalProperties, "pub_key")
delete(additionalProperties, "timestamp")
o.AdditionalProperties = additionalProperties
}
return err
}
type NullableTransactionDetailsModel struct {
value *TransactionDetailsModel
isSet bool

View file

@ -22,8 +22,11 @@ type TransactionExtraModel struct {
Type *string `json:"type,omitempty"`
ShortView *string `json:"short_view,omitempty"`
DetailsView *string `json:"details_view,omitempty"`
AdditionalProperties map[string]interface{}
}
type _TransactionExtraModel TransactionExtraModel
// NewTransactionExtraModel instantiates a new TransactionExtraModel object
// This constructor will assign default values to properties that have it defined,
// and makes sure properties required by API are set, but the set of arguments
@ -156,9 +159,37 @@ func (o TransactionExtraModel) ToMap() (map[string]interface{}, error) {
if !IsNil(o.DetailsView) {
toSerialize["details_view"] = o.DetailsView
}
for key, value := range o.AdditionalProperties {
toSerialize[key] = value
}
return toSerialize, nil
}
func (o *TransactionExtraModel) UnmarshalJSON(data []byte) (err error) {
varTransactionExtraModel := _TransactionExtraModel{}
err = json.Unmarshal(data, &varTransactionExtraModel)
if err != nil {
return err
}
*o = TransactionExtraModel(varTransactionExtraModel)
additionalProperties := make(map[string]interface{})
if err = json.Unmarshal(data, &additionalProperties); err == nil {
delete(additionalProperties, "type")
delete(additionalProperties, "short_view")
delete(additionalProperties, "details_view")
o.AdditionalProperties = additionalProperties
}
return err
}
type NullableTransactionExtraModel struct {
value *TransactionExtraModel
isSet bool

View file

@ -24,8 +24,11 @@ type TransactionInputModel struct {
HtlcOrigin *string `json:"htlc_origin,omitempty"`
KimageOrMsId *string `json:"kimage_or_ms_id,omitempty"`
MultisigCount *int32 `json:"multisig_count,omitempty"`
AdditionalProperties map[string]interface{}
}
type _TransactionInputModel TransactionInputModel
// NewTransactionInputModel instantiates a new TransactionInputModel object
// This constructor will assign default values to properties that have it defined,
// and makes sure properties required by API are set, but the set of arguments
@ -228,9 +231,39 @@ func (o TransactionInputModel) ToMap() (map[string]interface{}, error) {
if !IsNil(o.MultisigCount) {
toSerialize["multisig_count"] = o.MultisigCount
}
for key, value := range o.AdditionalProperties {
toSerialize[key] = value
}
return toSerialize, nil
}
func (o *TransactionInputModel) UnmarshalJSON(data []byte) (err error) {
varTransactionInputModel := _TransactionInputModel{}
err = json.Unmarshal(data, &varTransactionInputModel)
if err != nil {
return err
}
*o = TransactionInputModel(varTransactionInputModel)
additionalProperties := make(map[string]interface{})
if err = json.Unmarshal(data, &additionalProperties); err == nil {
delete(additionalProperties, "amount")
delete(additionalProperties, "global_indexes")
delete(additionalProperties, "htlc_origin")
delete(additionalProperties, "kimage_or_ms_id")
delete(additionalProperties, "multisig_count")
o.AdditionalProperties = additionalProperties
}
return err
}
type NullableTransactionInputModel struct {
value *TransactionInputModel
isSet bool

View file

@ -24,8 +24,11 @@ type TransactionOutputModel struct {
IsSpent *bool `json:"is_spent,omitempty"`
MinimumSigs *int32 `json:"minimum_sigs,omitempty"`
PubKeys []string `json:"pub_keys,omitempty"`
AdditionalProperties map[string]interface{}
}
type _TransactionOutputModel TransactionOutputModel
// NewTransactionOutputModel instantiates a new TransactionOutputModel object
// This constructor will assign default values to properties that have it defined,
// and makes sure properties required by API are set, but the set of arguments
@ -228,9 +231,39 @@ func (o TransactionOutputModel) ToMap() (map[string]interface{}, error) {
if !IsNil(o.PubKeys) {
toSerialize["pub_keys"] = o.PubKeys
}
for key, value := range o.AdditionalProperties {
toSerialize[key] = value
}
return toSerialize, nil
}
func (o *TransactionOutputModel) UnmarshalJSON(data []byte) (err error) {
varTransactionOutputModel := _TransactionOutputModel{}
err = json.Unmarshal(data, &varTransactionOutputModel)
if err != nil {
return err
}
*o = TransactionOutputModel(varTransactionOutputModel)
additionalProperties := make(map[string]interface{})
if err = json.Unmarshal(data, &additionalProperties); err == nil {
delete(additionalProperties, "amount")
delete(additionalProperties, "global_index")
delete(additionalProperties, "is_spent")
delete(additionalProperties, "minimum_sigs")
delete(additionalProperties, "pub_keys")
o.AdditionalProperties = additionalProperties
}
return err
}
type NullableTransactionOutputModel struct {
value *TransactionOutputModel
isSet bool

View file

@ -43,8 +43,11 @@ type TxGenerationContextModel struct {
TxKeyPub *string `json:"tx_key_pub,omitempty"`
TxKeySec *string `json:"tx_key_sec,omitempty"`
TxPubKeyP *string `json:"tx_pub_key_p,omitempty"`
AdditionalProperties map[string]interface{}
}
type _TxGenerationContextModel TxGenerationContextModel
// NewTxGenerationContextModel instantiates a new TxGenerationContextModel object
// This constructor will assign default values to properties that have it defined,
// and makes sure properties required by API are set, but the set of arguments
@ -912,9 +915,58 @@ func (o TxGenerationContextModel) ToMap() (map[string]interface{}, error) {
if !IsNil(o.TxPubKeyP) {
toSerialize["tx_pub_key_p"] = o.TxPubKeyP
}
for key, value := range o.AdditionalProperties {
toSerialize[key] = value
}
return toSerialize, nil
}
func (o *TxGenerationContextModel) UnmarshalJSON(data []byte) (err error) {
varTxGenerationContextModel := _TxGenerationContextModel{}
err = json.Unmarshal(data, &varTxGenerationContextModel)
if err != nil {
return err
}
*o = TxGenerationContextModel(varTxGenerationContextModel)
additionalProperties := make(map[string]interface{})
if err = json.Unmarshal(data, &additionalProperties); err == nil {
delete(additionalProperties, "asset_ids")
delete(additionalProperties, "blinded_asset_ids")
delete(additionalProperties, "amount_commitments")
delete(additionalProperties, "asset_id_blinding_masks")
delete(additionalProperties, "amounts")
delete(additionalProperties, "amount_blinding_masks")
delete(additionalProperties, "pseudo_outs_blinded_asset_ids")
delete(additionalProperties, "pseudo_outs_plus_real_out_blinding_masks")
delete(additionalProperties, "real_zc_ins_asset_ids")
delete(additionalProperties, "zc_input_amounts")
delete(additionalProperties, "pseudo_out_amount_commitments_sum")
delete(additionalProperties, "pseudo_out_amount_blinding_masks_sum")
delete(additionalProperties, "real_in_asset_id_blinding_mask_x_amount_sum")
delete(additionalProperties, "amount_commitments_sum")
delete(additionalProperties, "amount_blinding_masks_sum")
delete(additionalProperties, "asset_id_blinding_mask_x_amount_sum")
delete(additionalProperties, "ao_asset_id")
delete(additionalProperties, "ao_asset_id_pt")
delete(additionalProperties, "ao_amount_commitment")
delete(additionalProperties, "ao_amount_blinding_mask")
delete(additionalProperties, "ao_commitment_in_outputs")
delete(additionalProperties, "tx_key_pub")
delete(additionalProperties, "tx_key_sec")
delete(additionalProperties, "tx_pub_key_p")
o.AdditionalProperties = additionalProperties
}
return err
}
type NullableTxGenerationContextModel struct {
value *TxGenerationContextModel
isSet bool

View file

@ -30,8 +30,11 @@ type TxPoolPerformanceModel struct {
UpdateDbTime *int32 `json:"update_db_time,omitempty"`
DbCommitTime *int32 `json:"db_commit_time,omitempty"`
CheckPostHf4Balance *int32 `json:"check_post_hf4_balance,omitempty"`
AdditionalProperties map[string]interface{}
}
type _TxPoolPerformanceModel TxPoolPerformanceModel
// NewTxPoolPerformanceModel instantiates a new TxPoolPerformanceModel object
// This constructor will assign default values to properties that have it defined,
// and makes sure properties required by API are set, but the set of arguments
@ -444,9 +447,45 @@ func (o TxPoolPerformanceModel) ToMap() (map[string]interface{}, error) {
if !IsNil(o.CheckPostHf4Balance) {
toSerialize["check_post_hf4_balance"] = o.CheckPostHf4Balance
}
for key, value := range o.AdditionalProperties {
toSerialize[key] = value
}
return toSerialize, nil
}
func (o *TxPoolPerformanceModel) UnmarshalJSON(data []byte) (err error) {
varTxPoolPerformanceModel := _TxPoolPerformanceModel{}
err = json.Unmarshal(data, &varTxPoolPerformanceModel)
if err != nil {
return err
}
*o = TxPoolPerformanceModel(varTxPoolPerformanceModel)
additionalProperties := make(map[string]interface{})
if err = json.Unmarshal(data, &additionalProperties); err == nil {
delete(additionalProperties, "tx_processing_time")
delete(additionalProperties, "check_inputs_types_supported_time")
delete(additionalProperties, "expiration_validate_time")
delete(additionalProperties, "validate_amount_time")
delete(additionalProperties, "validate_alias_time")
delete(additionalProperties, "check_keyimages_ws_ms_time")
delete(additionalProperties, "check_inputs_time")
delete(additionalProperties, "begin_tx_time")
delete(additionalProperties, "update_db_time")
delete(additionalProperties, "db_commit_time")
delete(additionalProperties, "check_post_hf4_balance")
o.AdditionalProperties = additionalProperties
}
return err
}
type NullableTxPoolPerformanceModel struct {
value *TxPoolPerformanceModel
isSet bool

View file

@ -44,8 +44,11 @@ type TxProcessingPerformanceModel struct {
TxCheckInputsLoopScanOutputkeysLoopFindTx *int32 `json:"tx_check_inputs_loop_scan_outputkeys_loop_find_tx,omitempty"`
TxCheckInputsLoopScanOutputkeysLoopHandleOutput *int32 `json:"tx_check_inputs_loop_scan_outputkeys_loop_handle_output,omitempty"`
TxMixinCount *int32 `json:"tx_mixin_count,omitempty"`
AdditionalProperties map[string]interface{}
}
type _TxProcessingPerformanceModel TxProcessingPerformanceModel
// NewTxProcessingPerformanceModel instantiates a new TxProcessingPerformanceModel object
// This constructor will assign default values to properties that have it defined,
// and makes sure properties required by API are set, but the set of arguments
@ -948,9 +951,59 @@ func (o TxProcessingPerformanceModel) ToMap() (map[string]interface{}, error) {
if !IsNil(o.TxMixinCount) {
toSerialize["tx_mixin_count"] = o.TxMixinCount
}
for key, value := range o.AdditionalProperties {
toSerialize[key] = value
}
return toSerialize, nil
}
func (o *TxProcessingPerformanceModel) UnmarshalJSON(data []byte) (err error) {
varTxProcessingPerformanceModel := _TxProcessingPerformanceModel{}
err = json.Unmarshal(data, &varTxProcessingPerformanceModel)
if err != nil {
return err
}
*o = TxProcessingPerformanceModel(varTxProcessingPerformanceModel)
additionalProperties := make(map[string]interface{})
if err = json.Unmarshal(data, &additionalProperties); err == nil {
delete(additionalProperties, "tx_check_inputs")
delete(additionalProperties, "tx_add_one_tx")
delete(additionalProperties, "tx_process_extra")
delete(additionalProperties, "tx_process_attachment")
delete(additionalProperties, "tx_process_inputs")
delete(additionalProperties, "tx_push_global_index")
delete(additionalProperties, "tx_check_exist")
delete(additionalProperties, "tx_print_log")
delete(additionalProperties, "tx_prapare_append")
delete(additionalProperties, "tx_append")
delete(additionalProperties, "tx_append_rl_wait")
delete(additionalProperties, "tx_append_is_expired")
delete(additionalProperties, "tx_store_db")
delete(additionalProperties, "tx_check_inputs_prefix_hash")
delete(additionalProperties, "tx_check_inputs_attachment_check")
delete(additionalProperties, "tx_check_inputs_loop")
delete(additionalProperties, "tx_check_inputs_loop_kimage_check")
delete(additionalProperties, "tx_check_inputs_loop_ch_in_val_sig")
delete(additionalProperties, "tx_check_inputs_loop_scan_outputkeys_get_item_size")
delete(additionalProperties, "tx_check_inputs_loop_scan_outputkeys_relative_to_absolute")
delete(additionalProperties, "tx_check_inputs_loop_scan_outputkeys_loop")
delete(additionalProperties, "tx_check_inputs_loop_scan_outputkeys_loop_get_subitem")
delete(additionalProperties, "tx_check_inputs_loop_scan_outputkeys_loop_find_tx")
delete(additionalProperties, "tx_check_inputs_loop_scan_outputkeys_loop_handle_output")
delete(additionalProperties, "tx_mixin_count")
o.AdditionalProperties = additionalProperties
}
return err
}
type NullableTxProcessingPerformanceModel struct {
value *TxProcessingPerformanceModel
isSet bool

View file

@ -24,8 +24,11 @@ type VersionModel struct {
Major *string `json:"major,omitempty"`
Minor *string `json:"minor,omitempty"`
Revision *string `json:"revision,omitempty"`
AdditionalProperties map[string]interface{}
}
type _VersionModel VersionModel
// NewVersionModel instantiates a new VersionModel object
// This constructor will assign default values to properties that have it defined,
// and makes sure properties required by API are set, but the set of arguments
@ -228,9 +231,39 @@ func (o VersionModel) ToMap() (map[string]interface{}, error) {
if !IsNil(o.Revision) {
toSerialize["revision"] = o.Revision
}
for key, value := range o.AdditionalProperties {
toSerialize[key] = value
}
return toSerialize, nil
}
func (o *VersionModel) UnmarshalJSON(data []byte) (err error) {
varVersionModel := _VersionModel{}
err = json.Unmarshal(data, &varVersionModel)
if err != nil {
return err
}
*o = VersionModel(varVersionModel)
additionalProperties := make(map[string]interface{})
if err = json.Unmarshal(data, &additionalProperties); err == nil {
delete(additionalProperties, "version")
delete(additionalProperties, "version_long")
delete(additionalProperties, "major")
delete(additionalProperties, "minor")
delete(additionalProperties, "revision")
o.AdditionalProperties = additionalProperties
}
return err
}
type NullableVersionModel struct {
value *VersionModel
isSet bool

View file

@ -1,7 +1,7 @@
/*
Lethean Blockchain API
Testing BlockAPIService
Testing BlockUtilsSdkClientGoService
*/
@ -14,19 +14,19 @@ import (
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
"testing"
openapiclient "github.com/letheanVPN/blockchain/lthn"
openapiclient "github.com/letheanVPN/blockchain/utils/sdk/client/go"
)
func Test_lthn_BlockAPIService(t *testing.T) {
func Test_lthn_BlockUtilsSdkClientGoService(t *testing.T) {
configuration := openapiclient.NewConfiguration()
apiClient := openapiclient.NewAPIClient(configuration)
t.Run("Test BlockAPIService CreateBlockTemplate", func(t *testing.T) {
t.Run("Test BlockUtilsSdkClientGoService CreateBlockTemplate", func(t *testing.T) {
t.Skip("skip test") // remove to run test
resp, httpRes, err := apiClient.BlockAPI.CreateBlockTemplate(context.Background()).Execute()
resp, httpRes, err := apiClient.BlockUtilsSdkClientGo.CreateBlockTemplate(context.Background()).Execute()
require.Nil(t, err)
require.NotNil(t, resp)
@ -34,13 +34,13 @@ func Test_lthn_BlockAPIService(t *testing.T) {
})
t.Run("Test BlockAPIService GetBlock", func(t *testing.T) {
t.Run("Test BlockUtilsSdkClientGoService GetBlock", func(t *testing.T) {
t.Skip("skip test") // remove to run test
var identifier string
resp, httpRes, err := apiClient.BlockAPI.GetBlock(context.Background(), identifier).Execute()
resp, httpRes, err := apiClient.BlockUtilsSdkClientGo.GetBlock(context.Background(), identifier).Execute()
require.Nil(t, err)
require.NotNil(t, resp)
@ -48,11 +48,11 @@ func Test_lthn_BlockAPIService(t *testing.T) {
})
t.Run("Test BlockAPIService GetBlocks", func(t *testing.T) {
t.Run("Test BlockUtilsSdkClientGoService GetBlocks", func(t *testing.T) {
t.Skip("skip test") // remove to run test
resp, httpRes, err := apiClient.BlockAPI.GetBlocks(context.Background()).Execute()
resp, httpRes, err := apiClient.BlockUtilsSdkClientGo.GetBlocks(context.Background()).Execute()
require.Nil(t, err)
require.NotNil(t, resp)
@ -60,11 +60,11 @@ func Test_lthn_BlockAPIService(t *testing.T) {
})
t.Run("Test BlockAPIService GetHeight", func(t *testing.T) {
t.Run("Test BlockUtilsSdkClientGoService GetHeight", func(t *testing.T) {
t.Skip("skip test") // remove to run test
resp, httpRes, err := apiClient.BlockAPI.GetHeight(context.Background()).Execute()
resp, httpRes, err := apiClient.BlockUtilsSdkClientGo.GetHeight(context.Background()).Execute()
require.Nil(t, err)
require.NotNil(t, resp)
@ -72,11 +72,11 @@ func Test_lthn_BlockAPIService(t *testing.T) {
})
t.Run("Test BlockAPIService SubmitBlock", func(t *testing.T) {
t.Run("Test BlockUtilsSdkClientGoService SubmitBlock", func(t *testing.T) {
t.Skip("skip test") // remove to run test
resp, httpRes, err := apiClient.BlockAPI.SubmitBlock(context.Background()).Execute()
resp, httpRes, err := apiClient.BlockUtilsSdkClientGo.SubmitBlock(context.Background()).Execute()
require.Nil(t, err)
require.NotNil(t, resp)

View file

@ -1,7 +1,7 @@
/*
Lethean Blockchain API
Testing InfoAPIService
Testing InfoUtilsSdkClientGoService
*/
@ -14,19 +14,19 @@ import (
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
"testing"
openapiclient "github.com/letheanVPN/blockchain/lthn"
openapiclient "github.com/letheanVPN/blockchain/utils/sdk/client/go"
)
func Test_lthn_InfoAPIService(t *testing.T) {
func Test_lthn_InfoUtilsSdkClientGoService(t *testing.T) {
configuration := openapiclient.NewConfiguration()
apiClient := openapiclient.NewAPIClient(configuration)
t.Run("Test InfoAPIService GetInfo", func(t *testing.T) {
t.Run("Test InfoUtilsSdkClientGoService GetInfo", func(t *testing.T) {
t.Skip("skip test") // remove to run test
resp, httpRes, err := apiClient.InfoAPI.GetInfo(context.Background()).Execute()
resp, httpRes, err := apiClient.InfoUtilsSdkClientGo.GetInfo(context.Background()).Execute()
require.Nil(t, err)
require.NotNil(t, resp)
@ -34,11 +34,11 @@ func Test_lthn_InfoAPIService(t *testing.T) {
})
t.Run("Test InfoAPIService Version", func(t *testing.T) {
t.Run("Test InfoUtilsSdkClientGoService Version", func(t *testing.T) {
t.Skip("skip test") // remove to run test
resp, httpRes, err := apiClient.InfoAPI.Version(context.Background()).Execute()
resp, httpRes, err := apiClient.InfoUtilsSdkClientGo.Version(context.Background()).Execute()
require.Nil(t, err)
require.NotNil(t, resp)

30
utils/sdk/client/java/.github/workflows/maven.yml generated vendored Normal file
View file

@ -0,0 +1,30 @@
# This workflow will build a Java project with Maven, and cache/restore any dependencies to improve the workflow execution time
# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-maven
#
# This file is auto-generated by OpenAPI Generator (https://openapi-generator.tech)
name: Java CI with Maven
on:
push:
branches: [ main, master ]
pull_request:
branches: [ main, master ]
jobs:
build:
name: Build Lethean Blockchain API
runs-on: ubuntu-latest
strategy:
matrix:
java: [ 17, 21 ]
steps:
- uses: actions/checkout@v4
- name: Set up JDK
uses: actions/setup-java@v4
with:
java-version: ${{ matrix.java }}
distribution: 'temurin'
cache: maven
- name: Build with Maven
run: mvn -B package --no-transfer-progress --file pom.xml

21
utils/sdk/client/java/.gitignore generated vendored Normal file
View file

@ -0,0 +1,21 @@
*.class
# Mobile Tools for Java (J2ME)
.mtj.tmp/
# Package Files #
*.jar
*.war
*.ear
# exclude jar for gradle wrapper
!gradle/wrapper/*.jar
# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
hs_err_pid*
# build files
**/target
target
.gradle
build

View file

@ -0,0 +1,3 @@
git_push.sh
.travis.yml
README.md

View file

@ -0,0 +1,77 @@
.github/workflows/maven.yml
.gitignore
api/openapi.yaml
build.gradle
build.sbt
docs/BlockApi.md
docs/BlockDetailsModel.md
docs/BlockProcessingPerformanceModel.md
docs/BlockTemplateModel.md
docs/BlockTemplateRequestModel.md
docs/DbStatInfoModel.md
docs/HeightModel.md
docs/InfoApi.md
docs/InfoModel.md
docs/MaintainersInfoModel.md
docs/PerformanceModel.md
docs/PosEntryModel.md
docs/SubmitBlockRequestModel.md
docs/SubmitBlockResponseModel.md
docs/TransactionAttachmentModel.md
docs/TransactionDetailsModel.md
docs/TransactionExtraModel.md
docs/TransactionInputModel.md
docs/TransactionOutputModel.md
docs/TxGenerationContextModel.md
docs/TxPoolPerformanceModel.md
docs/TxProcessingPerformanceModel.md
docs/VersionModel.md
gradle.properties
gradle/wrapper/gradle-wrapper.jar
gradle/wrapper/gradle-wrapper.properties
gradlew
gradlew.bat
pom.xml
settings.gradle
src/main/AndroidManifest.xml
src/main/java/invalidPackageName/ApiCallback.java
src/main/java/invalidPackageName/ApiClient.java
src/main/java/invalidPackageName/ApiException.java
src/main/java/invalidPackageName/ApiResponse.java
src/main/java/invalidPackageName/Configuration.java
src/main/java/invalidPackageName/GzipRequestInterceptor.java
src/main/java/invalidPackageName/JSON.java
src/main/java/invalidPackageName/Pair.java
src/main/java/invalidPackageName/ProgressRequestBody.java
src/main/java/invalidPackageName/ProgressResponseBody.java
src/main/java/invalidPackageName/ServerConfiguration.java
src/main/java/invalidPackageName/ServerVariable.java
src/main/java/invalidPackageName/StringUtil.java
src/main/java/invalidPackageName/auth/ApiKeyAuth.java
src/main/java/invalidPackageName/auth/Authentication.java
src/main/java/invalidPackageName/auth/HttpBasicAuth.java
src/main/java/invalidPackageName/auth/HttpBearerAuth.java
src/main/java/lthn/BlockApi.java
src/main/java/lthn/InfoApi.java
src/main/java/org/openapitools/client/model/AbstractOpenApiSchema.java
src/main/java/org/openapitools/client/model/BlockDetailsModel.java
src/main/java/org/openapitools/client/model/BlockProcessingPerformanceModel.java
src/main/java/org/openapitools/client/model/BlockTemplateModel.java
src/main/java/org/openapitools/client/model/BlockTemplateRequestModel.java
src/main/java/org/openapitools/client/model/DbStatInfoModel.java
src/main/java/org/openapitools/client/model/HeightModel.java
src/main/java/org/openapitools/client/model/InfoModel.java
src/main/java/org/openapitools/client/model/MaintainersInfoModel.java
src/main/java/org/openapitools/client/model/PerformanceModel.java
src/main/java/org/openapitools/client/model/PosEntryModel.java
src/main/java/org/openapitools/client/model/SubmitBlockRequestModel.java
src/main/java/org/openapitools/client/model/SubmitBlockResponseModel.java
src/main/java/org/openapitools/client/model/TransactionAttachmentModel.java
src/main/java/org/openapitools/client/model/TransactionDetailsModel.java
src/main/java/org/openapitools/client/model/TransactionExtraModel.java
src/main/java/org/openapitools/client/model/TransactionInputModel.java
src/main/java/org/openapitools/client/model/TransactionOutputModel.java
src/main/java/org/openapitools/client/model/TxGenerationContextModel.java
src/main/java/org/openapitools/client/model/TxPoolPerformanceModel.java
src/main/java/org/openapitools/client/model/TxProcessingPerformanceModel.java
src/main/java/org/openapitools/client/model/VersionModel.java

View file

@ -0,0 +1 @@
7.16.0

1346
utils/sdk/client/java/api/openapi.yaml generated Normal file

File diff suppressed because it is too large Load diff

166
utils/sdk/client/java/build.gradle generated Normal file
View file

@ -0,0 +1,166 @@
apply plugin: 'idea'
apply plugin: 'eclipse'
apply plugin: 'java'
apply plugin: 'com.diffplug.spotless'
group = 'letheanVPN'
version = '6.0.1'
buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.3.+'
classpath 'com.github.dcendents:android-maven-gradle-plugin:2.1'
classpath 'com.diffplug.spotless:spotless-plugin-gradle:6.11.0'
}
}
repositories {
mavenCentral()
}
sourceSets {
main.java.srcDirs = ['src/main/java']
}
if(hasProperty('target') && target == 'android') {
apply plugin: 'com.android.library'
apply plugin: 'com.github.dcendents.android-maven'
android {
compileSdkVersion 25
buildToolsVersion '25.0.2'
defaultConfig {
minSdkVersion 14
targetSdkVersion 25
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
// Rename the aar correctly
libraryVariants.all { variant ->
variant.outputs.each { output ->
def outputFile = output.outputFile
if (outputFile != null && outputFile.name.endsWith('.aar')) {
def fileName = "${project.name}-${variant.baseName}-${version}.aar"
output.outputFile = new File(outputFile.parent, fileName)
}
}
}
dependencies {
provided "jakarta.annotation:jakarta.annotation-api:$jakarta_annotation_version"
}
}
afterEvaluate {
android.libraryVariants.all { variant ->
def task = project.tasks.create "jar${variant.name.capitalize()}", Jar
task.description = "Create jar artifact for ${variant.name}"
task.dependsOn variant.javaCompile
task.from variant.javaCompile.destinationDirectory
task.destinationDirectory = project.file("${project.buildDir}/outputs/jar")
task.archiveFileName = "${project.name}-${variant.baseName}-${version}.jar"
artifacts.add('archives', task)
}
}
task sourcesJar(type: Jar) {
from android.sourceSets.main.java.srcDirs
classifier = 'sources'
}
artifacts {
archives sourcesJar
}
} else {
apply plugin: 'java'
apply plugin: 'maven-publish'
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
publishing {
publications {
maven(MavenPublication) {
artifactId = 'lthn'
from components.java
}
}
}
task execute(type:JavaExec) {
main = System.getProperty('mainClass')
classpath = sourceSets.main.runtimeClasspath
}
}
ext {
jakarta_annotation_version = "1.3.5"
}
dependencies {
implementation "com.google.code.findbugs:jsr305:3.0.2"
implementation 'com.squareup.okhttp3:okhttp:4.12.0'
implementation 'com.squareup.okhttp3:logging-interceptor:4.12.0'
implementation 'com.google.code.gson:gson:2.9.1'
implementation 'io.gsonfire:gson-fire:1.9.0'
implementation 'jakarta.ws.rs:jakarta.ws.rs-api:2.1.6'
implementation 'org.openapitools:jackson-databind-nullable:0.2.7'
implementation group: 'org.apache.commons', name: 'commons-lang3', version: '3.18.0'
implementation "jakarta.annotation:jakarta.annotation-api:$jakarta_annotation_version"
testImplementation 'org.junit.jupiter:junit-jupiter-api:5.10.3'
testImplementation 'org.mockito:mockito-core:3.12.4'
testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.10.3'
}
javadoc {
options.tags = [ "http.response.details:a:Http Response Details" ]
}
// Use spotless plugin to automatically format code, remove unused import, etc
// To apply changes directly to the file, run `gradlew spotlessApply`
// Ref: https://github.com/diffplug/spotless/tree/main/plugin-gradle
spotless {
// comment out below to run spotless as part of the `check` task
enforceCheck false
format 'misc', {
// define the files (e.g. '*.gradle', '*.md') to apply `misc` to
target '.gitignore'
// define the steps to apply to those files
trimTrailingWhitespace()
indentWithSpaces() // Takes an integer argument if you don't like 4
endWithNewline()
}
java {
// don't need to set target, it is inferred from java
// apply a specific flavor of google-java-format
googleJavaFormat('1.8').aosp().reflowLongStrings()
removeUnusedImports()
importOrder()
}
}
test {
// Enable JUnit 5 (Gradle 4.6+).
useJUnitPlatform()
// Always run tests, even when nothing changed.
dependsOn 'cleanTest'
// Show test results.
testLogging {
events "passed", "skipped", "failed"
}
}

27
utils/sdk/client/java/build.sbt generated Normal file
View file

@ -0,0 +1,27 @@
lazy val root = (project in file(".")).
settings(
organization := "letheanVPN",
name := "lthn",
version := "6.0.1",
scalaVersion := "2.11.12",
scalacOptions ++= Seq("-feature"),
compile / javacOptions ++= Seq("-Xlint:deprecation"),
Compile / packageDoc / publishArtifact := false,
resolvers += Resolver.mavenLocal,
libraryDependencies ++= Seq(
"io.swagger" % "swagger-annotations" % "1.6.5",
"com.squareup.okhttp3" % "okhttp" % "4.12.0",
"com.squareup.okhttp3" % "logging-interceptor" % "4.12.0",
"com.google.code.gson" % "gson" % "2.9.1",
"org.apache.commons" % "commons-lang3" % "3.18.0",
"jakarta.ws.rs" % "jakarta.ws.rs-api" % "2.1.6",
"org.openapitools" % "jackson-databind-nullable" % "0.2.7",
"io.gsonfire" % "gson-fire" % "1.9.0" % "compile",
"jakarta.annotation" % "jakarta.annotation-api" % "1.3.5" % "compile",
"com.google.code.findbugs" % "jsr305" % "3.0.2" % "compile",
"jakarta.annotation" % "jakarta.annotation-api" % "1.3.5" % "compile",
"org.junit.jupiter" % "junit-jupiter-api" % "5.10.3" % "test",
"com.novocode" % "junit-interface" % "0.10" % "test",
"org.mockito" % "mockito-core" % "3.12.4" % "test"
)
)

313
utils/sdk/client/java/docs/BlockApi.md generated Normal file
View file

@ -0,0 +1,313 @@
# BlockApi
All URIs are relative to *http://127.0.0.1:36943*
| Method | HTTP request | Description |
|------------- | ------------- | -------------|
| [**createBlockTemplate**](BlockApi.md#createBlockTemplate) | **POST** /block/template | Create a block template for mining |
| [**getBlock**](BlockApi.md#getBlock) | **GET** /block/{identifier} | Get a block by its hash or height (ID) |
| [**getBlocks**](BlockApi.md#getBlocks) | **GET** /block | Get one or more blocks, with optional pagination. |
| [**getHeight**](BlockApi.md#getHeight) | **GET** /block/height | Get the current blockchain height |
| [**submitBlock**](BlockApi.md#submitBlock) | **POST** /block/submit | Submit a new block to the network |
<a id="createBlockTemplate"></a>
# **createBlockTemplate**
> BlockTemplateModel createBlockTemplate(blockTemplateRequestModel)
Create a block template for mining
### Example
```java
// Import classes:
import invalidPackageName.ApiClient;
import invalidPackageName.ApiException;
import invalidPackageName.Configuration;
import invalidPackageName.models.*;
import lthn.BlockApi;
public class Example {
public static void main(String[] args) {
ApiClient defaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("http://127.0.0.1:36943");
BlockApi apiInstance = new BlockApi(defaultClient);
BlockTemplateRequestModel blockTemplateRequestModel = new BlockTemplateRequestModel(); // BlockTemplateRequestModel |
try {
BlockTemplateModel result = apiInstance.createBlockTemplate(blockTemplateRequestModel);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling BlockApi#createBlockTemplate");
System.err.println("Status code: " + e.getCode());
System.err.println("Reason: " + e.getResponseBody());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}
```
### Parameters
| Name | Type | Description | Notes |
|------------- | ------------- | ------------- | -------------|
| **blockTemplateRequestModel** | [**BlockTemplateRequestModel**](BlockTemplateRequestModel.md)| | |
### Return type
[**BlockTemplateModel**](BlockTemplateModel.md)
### Authorization
No authorization required
### HTTP request headers
- **Content-Type**: application/json
- **Accept**: application/json
### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
| **500** | text/plain | - |
| **400** | text/plain | - |
| **200** | OK | - |
<a id="getBlock"></a>
# **getBlock**
> BlockDetailsModel getBlock(identifier)
Get a block by its hash or height (ID)
### Example
```java
// Import classes:
import invalidPackageName.ApiClient;
import invalidPackageName.ApiException;
import invalidPackageName.Configuration;
import invalidPackageName.models.*;
import lthn.BlockApi;
public class Example {
public static void main(String[] args) {
ApiClient defaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("http://127.0.0.1:36943");
BlockApi apiInstance = new BlockApi(defaultClient);
String identifier = "identifier_example"; // String | The hash (hex string) or height (integer) of the block to retrieve.
try {
BlockDetailsModel result = apiInstance.getBlock(identifier);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling BlockApi#getBlock");
System.err.println("Status code: " + e.getCode());
System.err.println("Reason: " + e.getResponseBody());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}
```
### Parameters
| Name | Type | Description | Notes |
|------------- | ------------- | ------------- | -------------|
| **identifier** | **String**| The hash (hex string) or height (integer) of the block to retrieve. | |
### Return type
[**BlockDetailsModel**](BlockDetailsModel.md)
### Authorization
No authorization required
### HTTP request headers
- **Content-Type**: Not defined
- **Accept**: application/json
### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
| **404** | text/plain | - |
| **400** | text/plain | - |
| **200** | OK | - |
<a id="getBlocks"></a>
# **getBlocks**
> List&lt;BlockDetailsModel&gt; getBlocks()
Get one or more blocks, with optional pagination.
### Example
```java
// Import classes:
import invalidPackageName.ApiClient;
import invalidPackageName.ApiException;
import invalidPackageName.Configuration;
import invalidPackageName.models.*;
import lthn.BlockApi;
public class Example {
public static void main(String[] args) {
ApiClient defaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("http://127.0.0.1:36943");
BlockApi apiInstance = new BlockApi(defaultClient);
try {
List<BlockDetailsModel> result = apiInstance.getBlocks();
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling BlockApi#getBlocks");
System.err.println("Status code: " + e.getCode());
System.err.println("Reason: " + e.getResponseBody());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}
```
### Parameters
This endpoint does not need any parameter.
### Return type
[**List&lt;BlockDetailsModel&gt;**](BlockDetailsModel.md)
### Authorization
No authorization required
### HTTP request headers
- **Content-Type**: Not defined
- **Accept**: application/json
### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
| **404** | text/plain | - |
| **400** | text/plain | - |
| **200** | A list of block objects. | - |
<a id="getHeight"></a>
# **getHeight**
> HeightModel getHeight()
Get the current blockchain height
### Example
```java
// Import classes:
import invalidPackageName.ApiClient;
import invalidPackageName.ApiException;
import invalidPackageName.Configuration;
import invalidPackageName.models.*;
import lthn.BlockApi;
public class Example {
public static void main(String[] args) {
ApiClient defaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("http://127.0.0.1:36943");
BlockApi apiInstance = new BlockApi(defaultClient);
try {
HeightModel result = apiInstance.getHeight();
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling BlockApi#getHeight");
System.err.println("Status code: " + e.getCode());
System.err.println("Reason: " + e.getResponseBody());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}
```
### Parameters
This endpoint does not need any parameter.
### Return type
[**HeightModel**](HeightModel.md)
### Authorization
No authorization required
### HTTP request headers
- **Content-Type**: Not defined
- **Accept**: application/json
### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
| **200** | OK | - |
<a id="submitBlock"></a>
# **submitBlock**
> SubmitBlockResponseModel submitBlock(submitBlockRequestModel)
Submit a new block to the network
### Example
```java
// Import classes:
import invalidPackageName.ApiClient;
import invalidPackageName.ApiException;
import invalidPackageName.Configuration;
import invalidPackageName.models.*;
import lthn.BlockApi;
public class Example {
public static void main(String[] args) {
ApiClient defaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("http://127.0.0.1:36943");
BlockApi apiInstance = new BlockApi(defaultClient);
SubmitBlockRequestModel submitBlockRequestModel = new SubmitBlockRequestModel(); // SubmitBlockRequestModel |
try {
SubmitBlockResponseModel result = apiInstance.submitBlock(submitBlockRequestModel);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling BlockApi#submitBlock");
System.err.println("Status code: " + e.getCode());
System.err.println("Reason: " + e.getResponseBody());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}
```
### Parameters
| Name | Type | Description | Notes |
|------------- | ------------- | ------------- | -------------|
| **submitBlockRequestModel** | [**SubmitBlockRequestModel**](SubmitBlockRequestModel.md)| | |
### Return type
[**SubmitBlockResponseModel**](SubmitBlockResponseModel.md)
### Authorization
No authorization required
### HTTP request headers
- **Content-Type**: application/json
- **Accept**: application/json
### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
| **406** | text/plain | - |
| **400** | text/plain | - |
| **200** | OK | - |

View file

@ -0,0 +1,37 @@
# BlockDetailsModel
## Properties
| Name | Type | Description | Notes |
|------------ | ------------- | ------------- | -------------|
|**actualTimestamp** | **Integer** | | [optional] |
|**alreadyGeneratedCoins** | **String** | | [optional] |
|**baseReward** | **Integer** | | [optional] |
|**blob** | **String** | | [optional] |
|**blockCumulativeSize** | **Integer** | | [optional] |
|**blockTselfSize** | **Integer** | | [optional] |
|**cumulativeDiffAdjusted** | **String** | | [optional] |
|**cumulativeDiffPrecise** | **String** | | [optional] |
|**difficulty** | **String** | | [optional] |
|**effectiveFeeMedian** | **Integer** | | [optional] |
|**height** | **Integer** | | [optional] |
|**id** | **String** | | [optional] |
|**isOrphan** | **Boolean** | | [optional] |
|**minerTextInfo** | **String** | | [optional] |
|**objectInJson** | **String** | | [optional] |
|**penalty** | **Integer** | | [optional] |
|**powSeed** | **String** | | [optional] |
|**prevId** | **String** | | [optional] |
|**summaryReward** | **Integer** | | [optional] |
|**thisBlockFeeMedian** | **Integer** | | [optional] |
|**timestamp** | **Integer** | | [optional] |
|**totalFee** | **Integer** | | [optional] |
|**totalTxsSize** | **Integer** | | [optional] |
|**transactionsDetails** | [**List&lt;TransactionDetailsModel&gt;**](TransactionDetailsModel.md) | | [optional] |
|**type** | **Integer** | | [optional] |

View file

@ -0,0 +1,28 @@
# BlockProcessingPerformanceModel
## Properties
| Name | Type | Description | Notes |
|------------ | ------------- | ------------- | -------------|
|**blockProcessingTime0** | **Integer** | | [optional] |
|**blockProcessingTime1** | **Integer** | | [optional] |
|**targetCalculatingTime2** | **Integer** | | [optional] |
|**longhashCalculatingTime3** | **Integer** | | [optional] |
|**allTxsInsertTime5** | **Integer** | | [optional] |
|**etcStuff6** | **Integer** | | [optional] |
|**insertTime4** | **Integer** | | [optional] |
|**raiseBlockCoreEvent** | **Integer** | | [optional] |
|**validateMinerTransactionTime** | **Integer** | | [optional] |
|**collectRangeproofsDataFromTxTime** | **Integer** | | [optional] |
|**verifyMultipleZcOutsRangeProofsTime** | **Integer** | | [optional] |
|**targetCalculatingEnumBlocks** | **Integer** | | [optional] |
|**targetCalculatingCalc** | **Integer** | | [optional] |
|**posValidateKiSearch** | **Integer** | | [optional] |
|**posValidateGetOutKeysForInputs** | **Integer** | | [optional] |
|**posValidateZvp** | **Integer** | | [optional] |

View file

@ -0,0 +1,21 @@
# BlockTemplateModel
## Properties
| Name | Type | Description | Notes |
|------------ | ------------- | ------------- | -------------|
|**blocktemplateBlob** | **String** | | [optional] |
|**difficulty** | **String** | | [optional] |
|**height** | **Integer** | | [optional] |
|**minerTxTgc** | [**TxGenerationContextModel**](TxGenerationContextModel.md) | | [optional] |
|**blockRewardWithoutFee** | **Integer** | | [optional] |
|**blockReward** | **Integer** | | [optional] |
|**txsFee** | **Integer** | | [optional] |
|**prevHash** | **String** | | [optional] |
|**seed** | **String** | | [optional] |

View file

@ -0,0 +1,19 @@
# BlockTemplateRequestModel
## Properties
| Name | Type | Description | Notes |
|------------ | ------------- | ------------- | -------------|
|**minerAddress** | **String** | | [optional] |
|**stakeholderAddress** | **String** | | [optional] |
|**exNonce** | **String** | | [optional] |
|**posBlock** | **Boolean** | | [optional] |
|**ignorePowTsCheck** | **Boolean** | | [optional] |
|**pe** | [**PosEntryModel**](PosEntryModel.md) | | [optional] |
|**explicitTxs** | **List&lt;String&gt;** | | [optional] |

View file

@ -0,0 +1,15 @@
# DbStatInfoModel
## Properties
| Name | Type | Description | Notes |
|------------ | ------------- | ------------- | -------------|
|**txCount** | **Integer** | | [optional] |
|**writeTxCount** | **Integer** | | [optional] |
|**mapSize** | **Integer** | | [optional] |

View file

@ -0,0 +1,13 @@
# HeightModel
## Properties
| Name | Type | Description | Notes |
|------------ | ------------- | ------------- | -------------|
|**height** | **Integer** | | [optional] |

128
utils/sdk/client/java/docs/InfoApi.md generated Normal file
View file

@ -0,0 +1,128 @@
# InfoApi
All URIs are relative to *http://127.0.0.1:36943*
| Method | HTTP request | Description |
|------------- | ------------- | -------------|
| [**getInfo**](InfoApi.md#getInfo) | **GET** /info | Get detailed information about the blockchain and daemon state |
| [**version**](InfoApi.md#version) | **GET** /info/version | Get API version |
<a id="getInfo"></a>
# **getInfo**
> InfoModel getInfo(flags)
Get detailed information about the blockchain and daemon state
### Example
```java
// Import classes:
import invalidPackageName.ApiClient;
import invalidPackageName.ApiException;
import invalidPackageName.Configuration;
import invalidPackageName.models.*;
import lthn.InfoApi;
public class Example {
public static void main(String[] args) {
ApiClient defaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("http://127.0.0.1:36943");
InfoApi apiInstance = new InfoApi(defaultClient);
String flags = "flags_example"; // String | Possible values: net_time_delta_median, current_network_hashrate_50, current_network_hashrate_350, seconds_for_10_blocks, seconds_for_30_blocks, transactions_daily_stat, last_pos_timestamp, last_pow_timestamp, total_coins, last_block_size, tx_count_in_last_block, pos_sequence_factor, pow_sequence_factor, pos_difficulty, performance, outs_stat, expirations_median.
try {
InfoModel result = apiInstance.getInfo(flags);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling InfoApi#getInfo");
System.err.println("Status code: " + e.getCode());
System.err.println("Reason: " + e.getResponseBody());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}
```
### Parameters
| Name | Type | Description | Notes |
|------------- | ------------- | ------------- | -------------|
| **flags** | **String**| Possible values: net_time_delta_median, current_network_hashrate_50, current_network_hashrate_350, seconds_for_10_blocks, seconds_for_30_blocks, transactions_daily_stat, last_pos_timestamp, last_pow_timestamp, total_coins, last_block_size, tx_count_in_last_block, pos_sequence_factor, pow_sequence_factor, pos_difficulty, performance, outs_stat, expirations_median. | [optional] |
### Return type
[**InfoModel**](InfoModel.md)
### Authorization
No authorization required
### HTTP request headers
- **Content-Type**: Not defined
- **Accept**: application/json
### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
| **200** | OK | - |
<a id="version"></a>
# **version**
> VersionModel version()
Get API version
Returns the current version of the API.
### Example
```java
// Import classes:
import invalidPackageName.ApiClient;
import invalidPackageName.ApiException;
import invalidPackageName.Configuration;
import invalidPackageName.models.*;
import lthn.InfoApi;
public class Example {
public static void main(String[] args) {
ApiClient defaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("http://127.0.0.1:36943");
InfoApi apiInstance = new InfoApi(defaultClient);
try {
VersionModel result = apiInstance.version();
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling InfoApi#version");
System.err.println("Status code: " + e.getCode());
System.err.println("Reason: " + e.getResponseBody());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}
```
### Parameters
This endpoint does not need any parameter.
### Return type
[**VersionModel**](VersionModel.md)
### Authorization
No authorization required
### HTTP request headers
- **Content-Type**: Not defined
- **Accept**: application/json
### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
| **200** | OK | - |

58
utils/sdk/client/java/docs/InfoModel.md generated Normal file
View file

@ -0,0 +1,58 @@
# InfoModel
## Properties
| Name | Type | Description | Notes |
|------------ | ------------- | ------------- | -------------|
|**height** | **Integer** | | [optional] |
|**txCount** | **Integer** | | [optional] |
|**txPoolSize** | **Integer** | | [optional] |
|**altBlocksCount** | **Integer** | | [optional] |
|**outgoingConnectionsCount** | **Integer** | | [optional] |
|**incomingConnectionsCount** | **Integer** | | [optional] |
|**synchronizedConnectionsCount** | **Integer** | | [optional] |
|**whitePeerlistSize** | **Integer** | | [optional] |
|**greyPeerlistSize** | **Integer** | | [optional] |
|**currentBlocksMedian** | **Integer** | | [optional] |
|**aliasCount** | **Integer** | | [optional] |
|**currentMaxAllowedBlockSize** | **Integer** | | [optional] |
|**daemonNetworkState** | **String** | | [optional] |
|**synchronizationStartHeight** | **Integer** | | [optional] |
|**maxNetSeenHeight** | **Integer** | | [optional] |
|**mi** | [**MaintainersInfoModel**](MaintainersInfoModel.md) | | [optional] |
|**posAllowed** | **Boolean** | | [optional] |
|**posDifficulty** | **String** | | [optional] |
|**powDifficulty** | **Integer** | | [optional] |
|**defaultFee** | **Integer** | | [optional] |
|**minimumFee** | **Integer** | | [optional] |
|**isHardforkActive** | **List&lt;Boolean&gt;** | | [optional] |
|**netTimeDeltaMedian** | **Long** | | [optional] |
|**currentNetworkHashrate50** | **Integer** | | [optional] |
|**currentNetworkHashrate350** | **Integer** | | [optional] |
|**secondsFor10Blocks** | **Integer** | | [optional] |
|**secondsFor30Blocks** | **Integer** | | [optional] |
|**transactionsCntPerDay** | **List&lt;Integer&gt;** | | [optional] |
|**transactionsVolumePerDay** | **List&lt;Integer&gt;** | | [optional] |
|**lastPosTimestamp** | **Integer** | | [optional] |
|**lastPowTimestamp** | **Integer** | | [optional] |
|**totalCoins** | **String** | | [optional] |
|**lastBlockSize** | **Integer** | | [optional] |
|**txCountInLastBlock** | **Integer** | | [optional] |
|**posSequenceFactor** | **Double** | | [optional] |
|**powSequenceFactor** | **Double** | | [optional] |
|**blockReward** | **Integer** | | [optional] |
|**lastBlockTotalReward** | **Integer** | | [optional] |
|**posDiffTotalCoinsRate** | **Integer** | | [optional] |
|**lastBlockTimestamp** | **Integer** | | [optional] |
|**lastBlockHash** | **String** | | [optional] |
|**posBlockTsShiftVsActual** | **Long** | | [optional] |
|**outsStat** | **Map&lt;String, Integer&gt;** | | [optional] |
|**performanceData** | [**PerformanceModel**](PerformanceModel.md) | | [optional] |
|**offersCount** | **Integer** | | [optional] |
|**expirationMedianTimestamp** | **Integer** | | [optional] |

View file

@ -0,0 +1,17 @@
# MaintainersInfoModel
## Properties
| Name | Type | Description | Notes |
|------------ | ------------- | ------------- | -------------|
|**verMajor** | **Integer** | | [optional] |
|**verMinor** | **Integer** | | [optional] |
|**verRevision** | **Integer** | | [optional] |
|**buildNo** | **Integer** | | [optional] |
|**mode** | **Integer** | | [optional] |

View file

@ -0,0 +1,16 @@
# PerformanceModel
## Properties
| Name | Type | Description | Notes |
|------------ | ------------- | ------------- | -------------|
|**blockProcessing** | [**BlockProcessingPerformanceModel**](BlockProcessingPerformanceModel.md) | | [optional] |
|**txProcessing** | [**TxProcessingPerformanceModel**](TxProcessingPerformanceModel.md) | | [optional] |
|**txPool** | [**TxPoolPerformanceModel**](TxPoolPerformanceModel.md) | | [optional] |
|**dbStatInfo** | [**DbStatInfoModel**](DbStatInfoModel.md) | | [optional] |

View file

@ -0,0 +1,20 @@
# PosEntryModel
## Properties
| Name | Type | Description | Notes |
|------------ | ------------- | ------------- | -------------|
|**amount** | **Integer** | | [optional] |
|**gIndex** | **Integer** | | [optional] |
|**keyimage** | **String** | | [optional] |
|**blockTimestamp** | **Integer** | | [optional] |
|**stakeUnlockTime** | **Integer** | | [optional] |
|**txId** | **String** | | [optional] |
|**txOutIndex** | **Integer** | | [optional] |
|**walletIndex** | **Integer** | | [optional] |

View file

@ -0,0 +1,13 @@
# SubmitBlockRequestModel
## Properties
| Name | Type | Description | Notes |
|------------ | ------------- | ------------- | -------------|
|**blockBlob** | **String** | | [optional] |

View file

@ -0,0 +1,13 @@
# SubmitBlockResponseModel
## Properties
| Name | Type | Description | Notes |
|------------ | ------------- | ------------- | -------------|
|**status** | **String** | | [optional] |

View file

@ -0,0 +1,15 @@
# TransactionAttachmentModel
## Properties
| Name | Type | Description | Notes |
|------------ | ------------- | ------------- | -------------|
|**type** | **String** | | [optional] |
|**shortView** | **String** | | [optional] |
|**detailsView** | **String** | | [optional] |

View file

@ -0,0 +1,25 @@
# TransactionDetailsModel
## Properties
| Name | Type | Description | Notes |
|------------ | ------------- | ------------- | -------------|
|**amount** | **Integer** | | [optional] |
|**attachments** | [**List&lt;TransactionAttachmentModel&gt;**](TransactionAttachmentModel.md) | | [optional] |
|**blob** | **String** | | [optional] |
|**blobSize** | **Integer** | | [optional] |
|**extra** | [**List&lt;TransactionExtraModel&gt;**](TransactionExtraModel.md) | | [optional] |
|**fee** | **Integer** | | [optional] |
|**id** | **String** | | [optional] |
|**ins** | [**List&lt;TransactionInputModel&gt;**](TransactionInputModel.md) | | [optional] |
|**keeperBlock** | **Long** | | [optional] |
|**objectInJson** | **String** | | [optional] |
|**outs** | [**List&lt;TransactionOutputModel&gt;**](TransactionOutputModel.md) | | [optional] |
|**pubKey** | **String** | | [optional] |
|**timestamp** | **Integer** | | [optional] |

View file

@ -0,0 +1,15 @@
# TransactionExtraModel
## Properties
| Name | Type | Description | Notes |
|------------ | ------------- | ------------- | -------------|
|**type** | **String** | | [optional] |
|**shortView** | **String** | | [optional] |
|**detailsView** | **String** | | [optional] |

View file

@ -0,0 +1,17 @@
# TransactionInputModel
## Properties
| Name | Type | Description | Notes |
|------------ | ------------- | ------------- | -------------|
|**amount** | **Integer** | | [optional] |
|**globalIndexes** | **List&lt;Integer&gt;** | | [optional] |
|**htlcOrigin** | **String** | | [optional] |
|**kimageOrMsId** | **String** | | [optional] |
|**multisigCount** | **Integer** | | [optional] |

View file

@ -0,0 +1,17 @@
# TransactionOutputModel
## Properties
| Name | Type | Description | Notes |
|------------ | ------------- | ------------- | -------------|
|**amount** | **Integer** | | [optional] |
|**globalIndex** | **Integer** | | [optional] |
|**isSpent** | **Boolean** | | [optional] |
|**minimumSigs** | **Integer** | | [optional] |
|**pubKeys** | **List&lt;String&gt;** | | [optional] |

View file

@ -0,0 +1,36 @@
# TxGenerationContextModel
## Properties
| Name | Type | Description | Notes |
|------------ | ------------- | ------------- | -------------|
|**assetIds** | **List&lt;String&gt;** | | [optional] |
|**blindedAssetIds** | **List&lt;String&gt;** | | [optional] |
|**amountCommitments** | **List&lt;String&gt;** | | [optional] |
|**assetIdBlindingMasks** | **List&lt;String&gt;** | | [optional] |
|**amounts** | **List&lt;String&gt;** | | [optional] |
|**amountBlindingMasks** | **List&lt;String&gt;** | | [optional] |
|**pseudoOutsBlindedAssetIds** | **List&lt;String&gt;** | | [optional] |
|**pseudoOutsPlusRealOutBlindingMasks** | **List&lt;String&gt;** | | [optional] |
|**realZcInsAssetIds** | **List&lt;String&gt;** | | [optional] |
|**zcInputAmounts** | **List&lt;Integer&gt;** | | [optional] |
|**pseudoOutAmountCommitmentsSum** | **String** | | [optional] |
|**pseudoOutAmountBlindingMasksSum** | **String** | | [optional] |
|**realInAssetIdBlindingMaskXAmountSum** | **String** | | [optional] |
|**amountCommitmentsSum** | **String** | | [optional] |
|**amountBlindingMasksSum** | **String** | | [optional] |
|**assetIdBlindingMaskXAmountSum** | **String** | | [optional] |
|**aoAssetId** | **String** | | [optional] |
|**aoAssetIdPt** | **String** | | [optional] |
|**aoAmountCommitment** | **String** | | [optional] |
|**aoAmountBlindingMask** | **String** | | [optional] |
|**aoCommitmentInOutputs** | **Boolean** | | [optional] |
|**txKeyPub** | **String** | | [optional] |
|**txKeySec** | **String** | | [optional] |
|**txPubKeyP** | **String** | | [optional] |

View file

@ -0,0 +1,23 @@
# TxPoolPerformanceModel
## Properties
| Name | Type | Description | Notes |
|------------ | ------------- | ------------- | -------------|
|**txProcessingTime** | **Integer** | | [optional] |
|**checkInputsTypesSupportedTime** | **Integer** | | [optional] |
|**expirationValidateTime** | **Integer** | | [optional] |
|**validateAmountTime** | **Integer** | | [optional] |
|**validateAliasTime** | **Integer** | | [optional] |
|**checkKeyimagesWsMsTime** | **Integer** | | [optional] |
|**checkInputsTime** | **Integer** | | [optional] |
|**beginTxTime** | **Integer** | | [optional] |
|**updateDbTime** | **Integer** | | [optional] |
|**dbCommitTime** | **Integer** | | [optional] |
|**checkPostHf4Balance** | **Integer** | | [optional] |

View file

@ -0,0 +1,37 @@
# TxProcessingPerformanceModel
## Properties
| Name | Type | Description | Notes |
|------------ | ------------- | ------------- | -------------|
|**txCheckInputs** | **Integer** | | [optional] |
|**txAddOneTx** | **Integer** | | [optional] |
|**txProcessExtra** | **Integer** | | [optional] |
|**txProcessAttachment** | **Integer** | | [optional] |
|**txProcessInputs** | **Integer** | | [optional] |
|**txPushGlobalIndex** | **Integer** | | [optional] |
|**txCheckExist** | **Integer** | | [optional] |
|**txPrintLog** | **Integer** | | [optional] |
|**txPrapareAppend** | **Integer** | | [optional] |
|**txAppend** | **Integer** | | [optional] |
|**txAppendRlWait** | **Integer** | | [optional] |
|**txAppendIsExpired** | **Integer** | | [optional] |
|**txStoreDb** | **Integer** | | [optional] |
|**txCheckInputsPrefixHash** | **Integer** | | [optional] |
|**txCheckInputsAttachmentCheck** | **Integer** | | [optional] |
|**txCheckInputsLoop** | **Integer** | | [optional] |
|**txCheckInputsLoopKimageCheck** | **Integer** | | [optional] |
|**txCheckInputsLoopChInValSig** | **Integer** | | [optional] |
|**txCheckInputsLoopScanOutputkeysGetItemSize** | **Integer** | | [optional] |
|**txCheckInputsLoopScanOutputkeysRelativeToAbsolute** | **Integer** | | [optional] |
|**txCheckInputsLoopScanOutputkeysLoop** | **Integer** | | [optional] |
|**txCheckInputsLoopScanOutputkeysLoopGetSubitem** | **Integer** | | [optional] |
|**txCheckInputsLoopScanOutputkeysLoopFindTx** | **Integer** | | [optional] |
|**txCheckInputsLoopScanOutputkeysLoopHandleOutput** | **Integer** | | [optional] |
|**txMixinCount** | **Integer** | | [optional] |

View file

@ -0,0 +1,17 @@
# VersionModel
## Properties
| Name | Type | Description | Notes |
|------------ | ------------- | ------------- | -------------|
|**version** | **String** | | [optional] |
|**versionLong** | **String** | | [optional] |
|**major** | **String** | | [optional] |
|**minor** | **String** | | [optional] |
|**revision** | **String** | | [optional] |

6
utils/sdk/client/java/gradle.properties generated Normal file
View file

@ -0,0 +1,6 @@
# This file is automatically generated by OpenAPI Generator (https://github.com/openAPITools/openapi-generator).
# To include other gradle properties as part of the code generation process, please use the `gradleProperties` option.
#
# Gradle properties reference: https://docs.gradle.org/current/userguide/build_environment.html#sec:gradle_configuration_properties
# For example, uncomment below to build for Android
#target = android

BIN
utils/sdk/client/java/gradle/wrapper/gradle-wrapper.jar generated vendored Normal file

Binary file not shown.

View file

@ -0,0 +1,7 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists

249
utils/sdk/client/java/gradlew generated vendored Normal file
View file

@ -0,0 +1,249 @@
#!/bin/sh
#
# Copyright © 2015-2021 the original authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
##############################################################################
#
# Gradle start up script for POSIX generated by Gradle.
#
# Important for running:
#
# (1) You need a POSIX-compliant shell to run this script. If your /bin/sh is
# noncompliant, but you have some other compliant shell such as ksh or
# bash, then to run this script, type that shell name before the whole
# command line, like:
#
# ksh Gradle
#
# Busybox and similar reduced shells will NOT work, because this script
# requires all of these POSIX shell features:
# * functions;
# * expansions «$var», «${var}», «${var:-default}», «${var+SET}»,
# «${var#prefix}», «${var%suffix}», and «$( cmd )»;
# * compound commands having a testable exit status, especially «case»;
# * various built-in commands including «command», «set», and «ulimit».
#
# Important for patching:
#
# (2) This script targets any POSIX shell, so it avoids extensions provided
# by Bash, Ksh, etc; in particular arrays are avoided.
#
# The "traditional" practice of packing multiple parameters into a
# space-separated string is a well documented source of bugs and security
# problems, so this is (mostly) avoided, by progressively accumulating
# options in "$@", and eventually passing that to Java.
#
# Where the inherited environment variables (DEFAULT_JVM_OPTS, JAVA_OPTS,
# and GRADLE_OPTS) rely on word-splitting, this is performed explicitly;
# see the in-line comments for details.
#
# There are tweaks for specific operating systems such as AIX, CygWin,
# Darwin, MinGW, and NonStop.
#
# (3) This script is generated from the Groovy template
# https://github.com/gradle/gradle/blob/HEAD/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
# within the Gradle project.
#
# You can find Gradle at https://github.com/gradle/gradle/.
#
##############################################################################
# Attempt to set APP_HOME
# Resolve links: $0 may be a link
app_path=$0
# Need this for daisy-chained symlinks.
while
APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path
[ -h "$app_path" ]
do
ls=$( ls -ld "$app_path" )
link=${ls#*' -> '}
case $link in #(
/*) app_path=$link ;; #(
*) app_path=$APP_HOME$link ;;
esac
done
# This is normally unused
# shellcheck disable=SC2034
APP_BASE_NAME=${0##*/}
# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036)
APP_HOME=$( cd "${APP_HOME:-./}" > /dev/null && pwd -P ) || exit
# Use the maximum available, or set MAX_FD != -1 to use that value.
MAX_FD=maximum
warn () {
echo "$*"
} >&2
die () {
echo
echo "$*"
echo
exit 1
} >&2
# OS specific support (must be 'true' or 'false').
cygwin=false
msys=false
darwin=false
nonstop=false
case "$( uname )" in #(
CYGWIN* ) cygwin=true ;; #(
Darwin* ) darwin=true ;; #(
MSYS* | MINGW* ) msys=true ;; #(
NONSTOP* ) nonstop=true ;;
esac
CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
# Determine the Java command to use to start the JVM.
if [ -n "$JAVA_HOME" ] ; then
if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
# IBM's JDK on AIX uses strange locations for the executables
JAVACMD=$JAVA_HOME/jre/sh/java
else
JAVACMD=$JAVA_HOME/bin/java
fi
if [ ! -x "$JAVACMD" ] ; then
die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
Please set the JAVA_HOME variable in your environment to match the
location of your Java installation."
fi
else
JAVACMD=java
if ! command -v java >/dev/null 2>&1
then
die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
Please set the JAVA_HOME variable in your environment to match the
location of your Java installation."
fi
fi
# Increase the maximum file descriptors if we can.
if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then
case $MAX_FD in #(
max*)
# In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked.
# shellcheck disable=SC2039,SC3045
MAX_FD=$( ulimit -H -n ) ||
warn "Could not query maximum file descriptor limit"
esac
case $MAX_FD in #(
'' | soft) :;; #(
*)
# In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked.
# shellcheck disable=SC2039,SC3045
ulimit -n "$MAX_FD" ||
warn "Could not set maximum file descriptor limit to $MAX_FD"
esac
fi
# Collect all arguments for the java command, stacking in reverse order:
# * args from the command line
# * the main class name
# * -classpath
# * -D...appname settings
# * --module-path (only if needed)
# * DEFAULT_JVM_OPTS, JAVA_OPTS, and GRADLE_OPTS environment variables.
# For Cygwin or MSYS, switch paths to Windows format before running java
if "$cygwin" || "$msys" ; then
APP_HOME=$( cygpath --path --mixed "$APP_HOME" )
CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" )
JAVACMD=$( cygpath --unix "$JAVACMD" )
# Now convert the arguments - kludge to limit ourselves to /bin/sh
for arg do
if
case $arg in #(
-*) false ;; # don't mess with options #(
/?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath
[ -e "$t" ] ;; #(
*) false ;;
esac
then
arg=$( cygpath --path --ignore --mixed "$arg" )
fi
# Roll the args list around exactly as many times as the number of
# args, so each arg winds up back in the position where it started, but
# possibly modified.
#
# NB: a `for` loop captures its iteration list before it begins, so
# changing the positional parameters here affects neither the number of
# iterations, nor the values presented in `arg`.
shift # remove old arg
set -- "$@" "$arg" # push replacement arg
done
fi
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
# Collect all arguments for the java command:
# * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments,
# and any embedded shellness will be escaped.
# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be
# treated as '${Hostname}' itself on the command line.
set -- \
"-Dorg.gradle.appname=$APP_BASE_NAME" \
-classpath "$CLASSPATH" \
org.gradle.wrapper.GradleWrapperMain \
"$@"
# Stop when "xargs" is not available.
if ! command -v xargs >/dev/null 2>&1
then
die "xargs is not available"
fi
# Use "xargs" to parse quoted args.
#
# With -n1 it outputs one arg per line, with the quotes and backslashes removed.
#
# In Bash we could simply go:
#
# readarray ARGS < <( xargs -n1 <<<"$var" ) &&
# set -- "${ARGS[@]}" "$@"
#
# but POSIX shell has neither arrays nor command substitution, so instead we
# post-process each arg (as a line of input to sed) to backslash-escape any
# character that might be a shell metacharacter, then use eval to reverse
# that process (while maintaining the separation between arguments), and wrap
# the whole thing up as a single "set" statement.
#
# This will of course break if any of these variables contains a newline or
# an unmatched quote.
#
eval "set -- $(
printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" |
xargs -n1 |
sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' |
tr '\n' ' '
)" '"$@"'
exec "$JAVACMD" "$@"

92
utils/sdk/client/java/gradlew.bat generated vendored Normal file
View file

@ -0,0 +1,92 @@
@rem
@rem Copyright 2015 the original author or authors.
@rem
@rem Licensed under the Apache License, Version 2.0 (the "License");
@rem you may not use this file except in compliance with the License.
@rem You may obtain a copy of the License at
@rem
@rem https://www.apache.org/licenses/LICENSE-2.0
@rem
@rem Unless required by applicable law or agreed to in writing, software
@rem distributed under the License is distributed on an "AS IS" BASIS,
@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@rem See the License for the specific language governing permissions and
@rem limitations under the License.
@rem
@if "%DEBUG%"=="" @echo off
@rem ##########################################################################
@rem
@rem Gradle startup script for Windows
@rem
@rem ##########################################################################
@rem Set local scope for the variables with windows NT shell
if "%OS%"=="Windows_NT" setlocal
set DIRNAME=%~dp0
if "%DIRNAME%"=="" set DIRNAME=.
@rem This is normally unused
set APP_BASE_NAME=%~n0
set APP_HOME=%DIRNAME%
@rem Resolve any "." and ".." in APP_HOME to make it shorter.
for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi
@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m"
@rem Find java.exe
if defined JAVA_HOME goto findJavaFromJavaHome
set JAVA_EXE=java.exe
%JAVA_EXE% -version >NUL 2>&1
if %ERRORLEVEL% equ 0 goto execute
echo. 1>&2
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 1>&2
echo. 1>&2
echo Please set the JAVA_HOME variable in your environment to match the 1>&2
echo location of your Java installation. 1>&2
goto fail
:findJavaFromJavaHome
set JAVA_HOME=%JAVA_HOME:"=%
set JAVA_EXE=%JAVA_HOME%/bin/java.exe
if exist "%JAVA_EXE%" goto execute
echo. 1>&2
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 1>&2
echo. 1>&2
echo Please set the JAVA_HOME variable in your environment to match the 1>&2
echo location of your Java installation. 1>&2
goto fail
:execute
@rem Setup the command line
set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
@rem Execute Gradle
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %*
:end
@rem End local scope for the variables with windows NT shell
if %ERRORLEVEL% equ 0 goto mainEnd
:fail
rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
rem the _cmd.exe /c_ return code!
set EXIT_CODE=%ERRORLEVEL%
if %EXIT_CODE% equ 0 set EXIT_CODE=1
if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE%
exit /b %EXIT_CODE%
:mainEnd
if "%OS%"=="Windows_NT" endlocal
:omega

340
utils/sdk/client/java/pom.xml generated Normal file
View file

@ -0,0 +1,340 @@
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>letheanVPN</groupId>
<artifactId>lthn</artifactId>
<packaging>jar</packaging>
<name>lthn</name>
<version>6.0.1</version>
<url>https://github.com/openapitools/openapi-generator</url>
<description>OpenAPI Java</description>
<scm>
<connection>scm:git:git@github.com:openapitools/openapi-generator.git</connection>
<developerConnection>scm:git:git@github.com:openapitools/openapi-generator.git</developerConnection>
<url>https://github.com/openapitools/openapi-generator</url>
</scm>
<licenses>
<license>
<name>EUPL-1.2</name>
<url>https://joinup.ec.europa.eu/software/page/eupl/licence-eupl</url>
<distribution>repo</distribution>
</license>
</licenses>
<developers>
<developer>
<name>Lethean Community</name>
<email>support@lt.hn</email>
<organization>letheanVPN</organization>
<organizationUrl>https://lt.hn</organizationUrl>
</developer>
</developers>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.8.1</version>
<configuration>
<fork>true</fork>
<meminitial>128m</meminitial>
<maxmem>512m</maxmem>
<compilerArgs>
<arg>-Xlint:all</arg>
<arg>-J-Xss4m</arg><!-- Compiling the generated JSON.java file may require larger stack size. -->
</compilerArgs>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-enforcer-plugin</artifactId>
<version>3.4.1</version>
<executions>
<execution>
<id>enforce-maven</id>
<goals>
<goal>enforce</goal>
</goals>
<configuration>
<rules>
<requireMavenVersion>
<version>2.2.0</version>
</requireMavenVersion>
</rules>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.22.2</version>
<configuration>
<systemPropertyVariables>
<property>
<name>loggerPath</name>
<value>conf/log4j.properties</value>
</property>
</systemPropertyVariables>
<argLine>-Xms512m -Xmx1500m</argLine>
<parallel>methods</parallel>
<threadCount>10</threadCount>
</configuration>
<dependencies>
<!--Custom provider and engine for Junit 5 to surefire-->
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-engine</artifactId>
<version>${junit-version}</version>
</dependency>
</dependencies>
</plugin>
<plugin>
<artifactId>maven-dependency-plugin</artifactId>
<version>3.6.1</version>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>copy-dependencies</goal>
</goals>
<configuration>
<outputDirectory>${project.build.directory}/lib</outputDirectory>
</configuration>
</execution>
</executions>
</plugin>
<!-- attach test jar -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<version>3.3.0</version>
<executions>
<execution>
<goals>
<goal>test-jar</goal>
</goals>
</execution>
</executions>
<configuration>
</configuration>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>build-helper-maven-plugin</artifactId>
<version>3.5.0</version>
<executions>
<execution>
<id>add_sources</id>
<phase>generate-sources</phase>
<goals>
<goal>add-source</goal>
</goals>
<configuration>
<sources>
<source>src/main/java</source>
</sources>
</configuration>
</execution>
<execution>
<id>add_test_sources</id>
<phase>generate-test-sources</phase>
<goals>
<goal>add-test-source</goal>
</goals>
<configuration>
<sources>
<source>src/test/java</source>
</sources>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<version>3.6.3</version>
<executions>
<execution>
<id>attach-javadocs</id>
<goals>
<goal>jar</goal>
</goals>
</execution>
</executions>
<configuration>
<doclint>none</doclint>
<tags>
<tag>
<name>http.response.details</name>
<placement>a</placement>
<head>Http Response Details:</head>
</tag>
</tags>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-source-plugin</artifactId>
<version>3.3.0</version>
<executions>
<execution>
<id>attach-sources</id>
<goals>
<goal>jar-no-fork</goal>
</goals>
</execution>
</executions>
</plugin>
<!-- Use spotless plugin to automatically format code, remove unused import, etc
To apply changes directly to the file, run `mvn spotless:apply`
Ref: https://github.com/diffplug/spotless/tree/main/plugin-maven
-->
<plugin>
<groupId>com.diffplug.spotless</groupId>
<artifactId>spotless-maven-plugin</artifactId>
<version>${spotless.version}</version>
<configuration>
<formats>
<!-- you can define as many formats as you want, each is independent -->
<format>
<!-- define the files to apply to -->
<includes>
<include>.gitignore</include>
</includes>
<!-- define the steps to apply to those files -->
<trimTrailingWhitespace/>
<endWithNewline/>
<indent>
<spaces>true</spaces> <!-- or <tabs>true</tabs> -->
<spacesPerTab>4</spacesPerTab> <!-- optional, default is 4 -->
</indent>
</format>
</formats>
<!-- define a language-specific format -->
<java>
<!-- no need to specify files, inferred automatically, but you can if you want -->
<!-- apply a specific flavor of google-java-format and reflow long strings -->
<googleJavaFormat>
<version>1.8</version>
<style>AOSP</style>
<reflowLongStrings>true</reflowLongStrings>
</googleJavaFormat>
<removeUnusedImports/>
<importOrder/>
</java>
</configuration>
</plugin>
</plugins>
</build>
<profiles>
<profile>
<id>sign-artifacts</id>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-gpg-plugin</artifactId>
<version>3.2.1</version>
<executions>
<execution>
<id>sign-artifacts</id>
<phase>verify</phase>
<goals>
<goal>sign</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
</profiles>
<dependencies>
<!-- @Nullable annotation -->
<dependency>
<groupId>com.google.code.findbugs</groupId>
<artifactId>jsr305</artifactId>
<version>3.0.2</version>
</dependency>
<dependency>
<groupId>com.squareup.okhttp3</groupId>
<artifactId>okhttp</artifactId>
<version>${okhttp-version}</version>
</dependency>
<dependency>
<groupId>com.squareup.okhttp3</groupId>
<artifactId>logging-interceptor</artifactId>
<version>${okhttp-version}</version>
</dependency>
<dependency>
<groupId>com.google.code.gson</groupId>
<artifactId>gson</artifactId>
<version>${gson-version}</version>
</dependency>
<dependency>
<groupId>io.gsonfire</groupId>
<artifactId>gson-fire</artifactId>
<version>${gson-fire-version}</version>
</dependency>
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId>
<version>${commons-lang3-version}</version>
</dependency>
<dependency>
<groupId>jakarta.annotation</groupId>
<artifactId>jakarta.annotation-api</artifactId>
<version>${jakarta-annotation-version}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.openapitools</groupId>
<artifactId>jackson-databind-nullable</artifactId>
<version>${jackson-databind-nullable-version}</version>
</dependency>
<dependency>
<groupId>jakarta.ws.rs</groupId>
<artifactId>jakarta.ws.rs-api</artifactId>
<version>${jakarta.ws.rs-api-version}</version>
</dependency>
<!-- test dependencies -->
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-engine</artifactId>
<version>${junit-version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.junit.platform</groupId>
<artifactId>junit-platform-runner</artifactId>
<version>${junit-platform-runner.version}</version>
<scope>test</scope>
</dependency>
</dependencies>
<properties>
<java.version>1.8</java.version>
<maven.compiler.source>${java.version}</maven.compiler.source>
<maven.compiler.target>${java.version}</maven.compiler.target>
<gson-fire-version>1.9.0</gson-fire-version>
<okhttp-version>4.12.0</okhttp-version>
<gson-version>2.10.1</gson-version>
<commons-lang3-version>3.18.0</commons-lang3-version>
<jackson-databind-nullable-version>0.2.7</jackson-databind-nullable-version>
<jakarta-annotation-version>1.3.5</jakarta-annotation-version>
<beanvalidation-version>2.0.2</beanvalidation-version>
<junit-version>5.10.3</junit-version>
<junit-platform-runner.version>1.10.0</junit-platform-runner.version>
<jakarta.ws.rs-api-version>2.1.6</jakarta.ws.rs-api-version>
<jsr311-api-version>1.1.1</jsr311-api-version>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<spotless.version>2.43.0</spotless.version>
</properties>
</project>

1
utils/sdk/client/java/settings.gradle generated Normal file
View file

@ -0,0 +1 @@
rootProject.name = "lthn"

View file

@ -0,0 +1,3 @@
<manifest package="invalidPackageName" xmlns:android="http://schemas.android.com/apk/res/android">
<application />
</manifest>

View file

@ -0,0 +1,62 @@
/*
* Lethean Blockchain API
* OpenAPI for Lethean Blockchain
*
* The version of the OpenAPI document: 6.0.1
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
package invalidPackageName;
import java.io.IOException;
import java.util.Map;
import java.util.List;
/**
* Callback for asynchronous API call.
*
* @param <T> The return type
*/
public interface ApiCallback<T> {
/**
* This is called when the API call fails.
*
* @param e The exception causing the failure
* @param statusCode Status code of the response if available, otherwise it would be 0
* @param responseHeaders Headers of the response if available, otherwise it would be null
*/
void onFailure(ApiException e, int statusCode, Map<String, List<String>> responseHeaders);
/**
* This is called when the API call succeeded.
*
* @param result The result deserialized from response
* @param statusCode Status code of the response
* @param responseHeaders Headers of the response
*/
void onSuccess(T result, int statusCode, Map<String, List<String>> responseHeaders);
/**
* This is called when the API upload processing.
*
* @param bytesWritten bytes Written
* @param contentLength content length of request body
* @param done write end
*/
void onUploadProgress(long bytesWritten, long contentLength, boolean done);
/**
* This is called when the API download processing.
*
* @param bytesRead bytes Read
* @param contentLength content length of the response
* @param done Read end
*/
void onDownloadProgress(long bytesRead, long contentLength, boolean done);
}

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,168 @@
/*
* Lethean Blockchain API
* OpenAPI for Lethean Blockchain
*
* The version of the OpenAPI document: 6.0.1
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
package invalidPackageName;
import java.util.Map;
import java.util.List;
import java.util.Locale;
/**
* <p>ApiException class.</p>
*/
@SuppressWarnings("serial")
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-10-19T15:35:02.750468+01:00[Europe/London]", comments = "Generator version: 7.16.0")
public class ApiException extends Exception {
private static final long serialVersionUID = 1L;
private int code = 0;
private Map<String, List<String>> responseHeaders = null;
private String responseBody = null;
/**
* <p>Constructor for ApiException.</p>
*/
public ApiException() {}
/**
* <p>Constructor for ApiException.</p>
*
* @param throwable a {@link java.lang.Throwable} object
*/
public ApiException(Throwable throwable) {
super(throwable);
}
/**
* <p>Constructor for ApiException.</p>
*
* @param message the error message
*/
public ApiException(String message) {
super(message);
}
/**
* <p>Constructor for ApiException.</p>
*
* @param message the error message
* @param throwable a {@link java.lang.Throwable} object
* @param code HTTP status code
* @param responseHeaders a {@link java.util.Map} of HTTP response headers
* @param responseBody the response body
*/
public ApiException(String message, Throwable throwable, int code, Map<String, List<String>> responseHeaders, String responseBody) {
super(message, throwable);
this.code = code;
this.responseHeaders = responseHeaders;
this.responseBody = responseBody;
}
/**
* <p>Constructor for ApiException.</p>
*
* @param message the error message
* @param code HTTP status code
* @param responseHeaders a {@link java.util.Map} of HTTP response headers
* @param responseBody the response body
*/
public ApiException(String message, int code, Map<String, List<String>> responseHeaders, String responseBody) {
this(message, (Throwable) null, code, responseHeaders, responseBody);
}
/**
* <p>Constructor for ApiException.</p>
*
* @param message the error message
* @param throwable a {@link java.lang.Throwable} object
* @param code HTTP status code
* @param responseHeaders a {@link java.util.Map} of HTTP response headers
*/
public ApiException(String message, Throwable throwable, int code, Map<String, List<String>> responseHeaders) {
this(message, throwable, code, responseHeaders, null);
}
/**
* <p>Constructor for ApiException.</p>
*
* @param code HTTP status code
* @param responseHeaders a {@link java.util.Map} of HTTP response headers
* @param responseBody the response body
*/
public ApiException(int code, Map<String, List<String>> responseHeaders, String responseBody) {
this("Response Code: " + code + " Response Body: " + responseBody, (Throwable) null, code, responseHeaders, responseBody);
}
/**
* <p>Constructor for ApiException.</p>
*
* @param code HTTP status code
* @param message a {@link java.lang.String} object
*/
public ApiException(int code, String message) {
super(message);
this.code = code;
}
/**
* <p>Constructor for ApiException.</p>
*
* @param code HTTP status code
* @param message the error message
* @param responseHeaders a {@link java.util.Map} of HTTP response headers
* @param responseBody the response body
*/
public ApiException(int code, String message, Map<String, List<String>> responseHeaders, String responseBody) {
this(code, message);
this.responseHeaders = responseHeaders;
this.responseBody = responseBody;
}
/**
* Get the HTTP status code.
*
* @return HTTP status code
*/
public int getCode() {
return code;
}
/**
* Get the HTTP response headers.
*
* @return A map of list of string
*/
public Map<String, List<String>> getResponseHeaders() {
return responseHeaders;
}
/**
* Get the HTTP response body.
*
* @return Response body in the form of string
*/
public String getResponseBody() {
return responseBody;
}
/**
* Get the exception message including HTTP response data.
*
* @return The exception message
*/
public String getMessage() {
return String.format(Locale.ROOT, "Message: %s%nHTTP response code: %s%nHTTP response body: %s%nHTTP response headers: %s",
super.getMessage(), this.getCode(), this.getResponseBody(), this.getResponseHeaders());
}
}

View file

@ -0,0 +1,76 @@
/*
* Lethean Blockchain API
* OpenAPI for Lethean Blockchain
*
* The version of the OpenAPI document: 6.0.1
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
package invalidPackageName;
import java.util.List;
import java.util.Map;
/**
* API response returned by API call.
*/
public class ApiResponse<T> {
final private int statusCode;
final private Map<String, List<String>> headers;
final private T data;
/**
* <p>Constructor for ApiResponse.</p>
*
* @param statusCode The status code of HTTP response
* @param headers The headers of HTTP response
*/
public ApiResponse(int statusCode, Map<String, List<String>> headers) {
this(statusCode, headers, null);
}
/**
* <p>Constructor for ApiResponse.</p>
*
* @param statusCode The status code of HTTP response
* @param headers The headers of HTTP response
* @param data The object deserialized from response bod
*/
public ApiResponse(int statusCode, Map<String, List<String>> headers, T data) {
this.statusCode = statusCode;
this.headers = headers;
this.data = data;
}
/**
* <p>Get the <code>status code</code>.</p>
*
* @return the status code
*/
public int getStatusCode() {
return statusCode;
}
/**
* <p>Get the <code>headers</code>.</p>
*
* @return a {@link java.util.Map} of headers
*/
public Map<String, List<String>> getHeaders() {
return headers;
}
/**
* <p>Get the <code>data</code>.</p>
*
* @return the data
*/
public T getData() {
return data;
}
}

View file

@ -0,0 +1,63 @@
/*
* Lethean Blockchain API
* OpenAPI for Lethean Blockchain
*
* The version of the OpenAPI document: 6.0.1
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
package invalidPackageName;
import java.util.Objects;
import java.util.concurrent.atomic.AtomicReference;
import java.util.function.Supplier;
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-10-19T15:35:02.750468+01:00[Europe/London]", comments = "Generator version: 7.16.0")
public class Configuration {
public static final String VERSION = "6.0.1";
private static final AtomicReference<ApiClient> defaultApiClient = new AtomicReference<>();
private static volatile Supplier<ApiClient> apiClientFactory = ApiClient::new;
/**
* Get the default API client, which would be used when creating API instances without providing an API client.
*
* @return Default API client
*/
public static ApiClient getDefaultApiClient() {
ApiClient client = defaultApiClient.get();
if (client == null) {
client = defaultApiClient.updateAndGet(val -> {
if (val != null) { // changed by another thread
return val;
}
return apiClientFactory.get();
});
}
return client;
}
/**
* Set the default API client, which would be used when creating API instances without providing an API client.
*
* @param apiClient API client
*/
public static void setDefaultApiClient(ApiClient apiClient) {
defaultApiClient.set(apiClient);
}
/**
* set the callback used to create new ApiClient objects
*/
public static void setApiClientFactory(Supplier<ApiClient> factory) {
apiClientFactory = Objects.requireNonNull(factory);
}
private Configuration() {
}
}

View file

@ -0,0 +1,85 @@
/*
* Lethean Blockchain API
* OpenAPI for Lethean Blockchain
*
* The version of the OpenAPI document: 6.0.1
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
package invalidPackageName;
import okhttp3.*;
import okio.Buffer;
import okio.BufferedSink;
import okio.GzipSink;
import okio.Okio;
import java.io.IOException;
/**
* Encodes request bodies using gzip.
*
* Taken from https://github.com/square/okhttp/issues/350
*/
class GzipRequestInterceptor implements Interceptor {
@Override
public Response intercept(Chain chain) throws IOException {
Request originalRequest = chain.request();
if (originalRequest.body() == null || originalRequest.header("Content-Encoding") != null) {
return chain.proceed(originalRequest);
}
Request compressedRequest = originalRequest.newBuilder()
.header("Content-Encoding", "gzip")
.method(originalRequest.method(), forceContentLength(gzip(originalRequest.body())))
.build();
return chain.proceed(compressedRequest);
}
private RequestBody forceContentLength(final RequestBody requestBody) throws IOException {
final Buffer buffer = new Buffer();
requestBody.writeTo(buffer);
return new RequestBody() {
@Override
public MediaType contentType() {
return requestBody.contentType();
}
@Override
public long contentLength() {
return buffer.size();
}
@Override
public void writeTo(BufferedSink sink) throws IOException {
sink.write(buffer.snapshot());
}
};
}
private RequestBody gzip(final RequestBody body) {
return new RequestBody() {
@Override
public MediaType contentType() {
return body.contentType();
}
@Override
public long contentLength() {
return -1; // We don't know the compressed length in advance!
}
@Override
public void writeTo(BufferedSink sink) throws IOException {
BufferedSink gzipSink = Okio.buffer(new GzipSink(sink));
body.writeTo(gzipSink);
gzipSink.close();
}
};
}
}

View file

@ -0,0 +1,446 @@
/*
* Lethean Blockchain API
* OpenAPI for Lethean Blockchain
*
* The version of the OpenAPI document: 6.0.1
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
package invalidPackageName;
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.google.gson.JsonParseException;
import com.google.gson.TypeAdapter;
import com.google.gson.internal.bind.util.ISO8601Utils;
import com.google.gson.stream.JsonReader;
import com.google.gson.stream.JsonWriter;
import com.google.gson.JsonElement;
import io.gsonfire.GsonFireBuilder;
import io.gsonfire.TypeSelector;
import okio.ByteString;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.StringReader;
import java.lang.reflect.Type;
import java.nio.charset.StandardCharsets;
import java.text.DateFormat;
import java.text.ParseException;
import java.text.ParsePosition;
import java.time.LocalDate;
import java.time.OffsetDateTime;
import java.time.format.DateTimeFormatter;
import java.util.Date;
import java.util.Locale;
import java.util.Map;
import java.util.HashMap;
/*
* A JSON utility class
*
* NOTE: in the future, this class may be converted to static, which may break
* backward-compatibility
*/
public class JSON {
private static Gson gson;
private static boolean isLenientOnJson = false;
private static DateTypeAdapter dateTypeAdapter = new DateTypeAdapter();
private static SqlDateTypeAdapter sqlDateTypeAdapter = new SqlDateTypeAdapter();
private static OffsetDateTimeTypeAdapter offsetDateTimeTypeAdapter = new OffsetDateTimeTypeAdapter();
private static LocalDateTypeAdapter localDateTypeAdapter = new LocalDateTypeAdapter();
private static ByteArrayAdapter byteArrayAdapter = new ByteArrayAdapter();
@SuppressWarnings("unchecked")
public static GsonBuilder createGson() {
GsonFireBuilder fireBuilder = new GsonFireBuilder()
;
GsonBuilder builder = fireBuilder.createGsonBuilder();
return builder;
}
private static String getDiscriminatorValue(JsonElement readElement, String discriminatorField) {
JsonElement element = readElement.getAsJsonObject().get(discriminatorField);
if (null == element) {
throw new IllegalArgumentException("missing discriminator field: <" + discriminatorField + ">");
}
return element.getAsString();
}
/**
* Returns the Java class that implements the OpenAPI schema for the specified discriminator value.
*
* @param classByDiscriminatorValue The map of discriminator values to Java classes.
* @param discriminatorValue The value of the OpenAPI discriminator in the input data.
* @return The Java class that implements the OpenAPI schema
*/
private static Class getClassByDiscriminator(Map classByDiscriminatorValue, String discriminatorValue) {
Class clazz = (Class) classByDiscriminatorValue.get(discriminatorValue);
if (null == clazz) {
throw new IllegalArgumentException("cannot determine model class of name: <" + discriminatorValue + ">");
}
return clazz;
}
static {
GsonBuilder gsonBuilder = createGson();
gsonBuilder.registerTypeAdapter(Date.class, dateTypeAdapter);
gsonBuilder.registerTypeAdapter(java.sql.Date.class, sqlDateTypeAdapter);
gsonBuilder.registerTypeAdapter(OffsetDateTime.class, offsetDateTimeTypeAdapter);
gsonBuilder.registerTypeAdapter(LocalDate.class, localDateTypeAdapter);
gsonBuilder.registerTypeAdapter(byte[].class, byteArrayAdapter);
gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.BlockDetailsModel.CustomTypeAdapterFactory());
gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.BlockProcessingPerformanceModel.CustomTypeAdapterFactory());
gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.BlockTemplateModel.CustomTypeAdapterFactory());
gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.BlockTemplateRequestModel.CustomTypeAdapterFactory());
gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.DbStatInfoModel.CustomTypeAdapterFactory());
gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.HeightModel.CustomTypeAdapterFactory());
gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.InfoModel.CustomTypeAdapterFactory());
gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.MaintainersInfoModel.CustomTypeAdapterFactory());
gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.PerformanceModel.CustomTypeAdapterFactory());
gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.PosEntryModel.CustomTypeAdapterFactory());
gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.SubmitBlockRequestModel.CustomTypeAdapterFactory());
gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.SubmitBlockResponseModel.CustomTypeAdapterFactory());
gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.TransactionAttachmentModel.CustomTypeAdapterFactory());
gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.TransactionDetailsModel.CustomTypeAdapterFactory());
gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.TransactionExtraModel.CustomTypeAdapterFactory());
gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.TransactionInputModel.CustomTypeAdapterFactory());
gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.TransactionOutputModel.CustomTypeAdapterFactory());
gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.TxGenerationContextModel.CustomTypeAdapterFactory());
gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.TxPoolPerformanceModel.CustomTypeAdapterFactory());
gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.TxProcessingPerformanceModel.CustomTypeAdapterFactory());
gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.VersionModel.CustomTypeAdapterFactory());
gson = gsonBuilder.create();
}
/**
* Get Gson.
*
* @return Gson
*/
public static Gson getGson() {
return gson;
}
/**
* Set Gson.
*
* @param gson Gson
*/
public static void setGson(Gson gson) {
JSON.gson = gson;
}
public static void setLenientOnJson(boolean lenientOnJson) {
isLenientOnJson = lenientOnJson;
}
/**
* Serialize the given Java object into JSON string.
*
* @param obj Object
* @return String representation of the JSON
*/
public static String serialize(Object obj) {
return gson.toJson(obj);
}
/**
* Deserialize the given JSON string to Java object.
*
* @param <T> Type
* @param body The JSON string
* @param returnType The type to deserialize into
* @return The deserialized Java object
*/
@SuppressWarnings("unchecked")
public static <T> T deserialize(String body, Type returnType) {
try {
if (isLenientOnJson) {
JsonReader jsonReader = new JsonReader(new StringReader(body));
// see https://google-gson.googlecode.com/svn/trunk/gson/docs/javadocs/com/google/gson/stream/JsonReader.html#setLenient(boolean)
jsonReader.setLenient(true);
return gson.fromJson(jsonReader, returnType);
} else {
return gson.fromJson(body, returnType);
}
} catch (JsonParseException e) {
// Fallback processing when failed to parse JSON form response body:
// return the response body string directly for the String return type;
if (returnType.equals(String.class)) {
return (T) body;
} else {
throw (e);
}
}
}
/**
* Deserialize the given JSON InputStream to a Java object.
*
* @param <T> Type
* @param inputStream The JSON InputStream
* @param returnType The type to deserialize into
* @return The deserialized Java object
*/
@SuppressWarnings("unchecked")
public static <T> T deserialize(InputStream inputStream, Type returnType) throws IOException {
try (InputStreamReader reader = new InputStreamReader(inputStream, StandardCharsets.UTF_8)) {
if (isLenientOnJson) {
// see https://google-gson.googlecode.com/svn/trunk/gson/docs/javadocs/com/google/gson/stream/JsonReader.html#setLenient(boolean)
JsonReader jsonReader = new JsonReader(reader);
jsonReader.setLenient(true);
return gson.fromJson(jsonReader, returnType);
} else {
return gson.fromJson(reader, returnType);
}
}
}
/**
* Gson TypeAdapter for Byte Array type
*/
public static class ByteArrayAdapter extends TypeAdapter<byte[]> {
@Override
public void write(JsonWriter out, byte[] value) throws IOException {
if (value == null) {
out.nullValue();
} else {
out.value(ByteString.of(value).base64());
}
}
@Override
public byte[] read(JsonReader in) throws IOException {
switch (in.peek()) {
case NULL:
in.nextNull();
return null;
default:
String bytesAsBase64 = in.nextString();
ByteString byteString = ByteString.decodeBase64(bytesAsBase64);
return byteString.toByteArray();
}
}
}
/**
* Gson TypeAdapter for JSR310 OffsetDateTime type
*/
public static class OffsetDateTimeTypeAdapter extends TypeAdapter<OffsetDateTime> {
private DateTimeFormatter formatter;
public OffsetDateTimeTypeAdapter() {
this(DateTimeFormatter.ISO_OFFSET_DATE_TIME);
}
public OffsetDateTimeTypeAdapter(DateTimeFormatter formatter) {
this.formatter = formatter;
}
public void setFormat(DateTimeFormatter dateFormat) {
this.formatter = dateFormat;
}
@Override
public void write(JsonWriter out, OffsetDateTime date) throws IOException {
if (date == null) {
out.nullValue();
} else {
out.value(formatter.format(date));
}
}
@Override
public OffsetDateTime read(JsonReader in) throws IOException {
switch (in.peek()) {
case NULL:
in.nextNull();
return null;
default:
String date = in.nextString();
if (date.endsWith("+0000")) {
date = date.substring(0, date.length()-5) + "Z";
}
return OffsetDateTime.parse(date, formatter);
}
}
}
/**
* Gson TypeAdapter for JSR310 LocalDate type
*/
public static class LocalDateTypeAdapter extends TypeAdapter<LocalDate> {
private DateTimeFormatter formatter;
public LocalDateTypeAdapter() {
this(DateTimeFormatter.ISO_LOCAL_DATE);
}
public LocalDateTypeAdapter(DateTimeFormatter formatter) {
this.formatter = formatter;
}
public void setFormat(DateTimeFormatter dateFormat) {
this.formatter = dateFormat;
}
@Override
public void write(JsonWriter out, LocalDate date) throws IOException {
if (date == null) {
out.nullValue();
} else {
out.value(formatter.format(date));
}
}
@Override
public LocalDate read(JsonReader in) throws IOException {
switch (in.peek()) {
case NULL:
in.nextNull();
return null;
default:
String date = in.nextString();
return LocalDate.parse(date, formatter);
}
}
}
public static void setOffsetDateTimeFormat(DateTimeFormatter dateFormat) {
offsetDateTimeTypeAdapter.setFormat(dateFormat);
}
public static void setLocalDateFormat(DateTimeFormatter dateFormat) {
localDateTypeAdapter.setFormat(dateFormat);
}
/**
* Gson TypeAdapter for java.sql.Date type
* If the dateFormat is null, a simple "yyyy-MM-dd" format will be used
* (more efficient than SimpleDateFormat).
*/
public static class SqlDateTypeAdapter extends TypeAdapter<java.sql.Date> {
private DateFormat dateFormat;
public SqlDateTypeAdapter() {}
public SqlDateTypeAdapter(DateFormat dateFormat) {
this.dateFormat = dateFormat;
}
public void setFormat(DateFormat dateFormat) {
this.dateFormat = dateFormat;
}
@Override
public void write(JsonWriter out, java.sql.Date date) throws IOException {
if (date == null) {
out.nullValue();
} else {
String value;
if (dateFormat != null) {
value = dateFormat.format(date);
} else {
value = date.toString();
}
out.value(value);
}
}
@Override
public java.sql.Date read(JsonReader in) throws IOException {
switch (in.peek()) {
case NULL:
in.nextNull();
return null;
default:
String date = in.nextString();
try {
if (dateFormat != null) {
return new java.sql.Date(dateFormat.parse(date).getTime());
}
return new java.sql.Date(ISO8601Utils.parse(date, new ParsePosition(0)).getTime());
} catch (ParseException e) {
throw new JsonParseException(e);
}
}
}
}
/**
* Gson TypeAdapter for java.util.Date type
* If the dateFormat is null, ISO8601Utils will be used.
*/
public static class DateTypeAdapter extends TypeAdapter<Date> {
private DateFormat dateFormat;
public DateTypeAdapter() {}
public DateTypeAdapter(DateFormat dateFormat) {
this.dateFormat = dateFormat;
}
public void setFormat(DateFormat dateFormat) {
this.dateFormat = dateFormat;
}
@Override
public void write(JsonWriter out, Date date) throws IOException {
if (date == null) {
out.nullValue();
} else {
String value;
if (dateFormat != null) {
value = dateFormat.format(date);
} else {
value = ISO8601Utils.format(date, true);
}
out.value(value);
}
}
@Override
public Date read(JsonReader in) throws IOException {
try {
switch (in.peek()) {
case NULL:
in.nextNull();
return null;
default:
String date = in.nextString();
try {
if (dateFormat != null) {
return dateFormat.parse(date);
}
return ISO8601Utils.parse(date, new ParsePosition(0));
} catch (ParseException e) {
throw new JsonParseException(e);
}
}
} catch (IllegalArgumentException e) {
throw new JsonParseException(e);
}
}
}
public static void setDateFormat(DateFormat dateFormat) {
dateTypeAdapter.setFormat(dateFormat);
}
public static void setSqlDateFormat(DateFormat dateFormat) {
sqlDateTypeAdapter.setFormat(dateFormat);
}
}

View file

@ -0,0 +1,37 @@
/*
* Lethean Blockchain API
* OpenAPI for Lethean Blockchain
*
* The version of the OpenAPI document: 6.0.1
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
package invalidPackageName;
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-10-19T15:35:02.750468+01:00[Europe/London]", comments = "Generator version: 7.16.0")
public class Pair {
private final String name;
private final String value;
public Pair(String name, String value) {
this.name = isValidString(name) ? name : "";
this.value = isValidString(value) ? value : "";
}
public String getName() {
return this.name;
}
public String getValue() {
return this.value;
}
private static boolean isValidString(String arg) {
return arg != null;
}
}

View file

@ -0,0 +1,73 @@
/*
* Lethean Blockchain API
* OpenAPI for Lethean Blockchain
*
* The version of the OpenAPI document: 6.0.1
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
package invalidPackageName;
import okhttp3.MediaType;
import okhttp3.RequestBody;
import java.io.IOException;
import okio.Buffer;
import okio.BufferedSink;
import okio.ForwardingSink;
import okio.Okio;
import okio.Sink;
public class ProgressRequestBody extends RequestBody {
private final RequestBody requestBody;
private final ApiCallback callback;
public ProgressRequestBody(RequestBody requestBody, ApiCallback callback) {
this.requestBody = requestBody;
this.callback = callback;
}
@Override
public MediaType contentType() {
return requestBody.contentType();
}
@Override
public long contentLength() throws IOException {
return requestBody.contentLength();
}
@Override
public void writeTo(BufferedSink sink) throws IOException {
BufferedSink bufferedSink = Okio.buffer(sink(sink));
requestBody.writeTo(bufferedSink);
bufferedSink.flush();
}
private Sink sink(Sink sink) {
return new ForwardingSink(sink) {
long bytesWritten = 0L;
long contentLength = 0L;
@Override
public void write(Buffer source, long byteCount) throws IOException {
super.write(source, byteCount);
if (contentLength == 0) {
contentLength = contentLength();
}
bytesWritten += byteCount;
callback.onUploadProgress(bytesWritten, contentLength, bytesWritten == contentLength);
}
};
}
}

View file

@ -0,0 +1,70 @@
/*
* Lethean Blockchain API
* OpenAPI for Lethean Blockchain
*
* The version of the OpenAPI document: 6.0.1
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
package invalidPackageName;
import okhttp3.MediaType;
import okhttp3.ResponseBody;
import java.io.IOException;
import okio.Buffer;
import okio.BufferedSource;
import okio.ForwardingSource;
import okio.Okio;
import okio.Source;
public class ProgressResponseBody extends ResponseBody {
private final ResponseBody responseBody;
private final ApiCallback callback;
private BufferedSource bufferedSource;
public ProgressResponseBody(ResponseBody responseBody, ApiCallback callback) {
this.responseBody = responseBody;
this.callback = callback;
}
@Override
public MediaType contentType() {
return responseBody.contentType();
}
@Override
public long contentLength() {
return responseBody.contentLength();
}
@Override
public BufferedSource source() {
if (bufferedSource == null) {
bufferedSource = Okio.buffer(source(responseBody.source()));
}
return bufferedSource;
}
private Source source(Source source) {
return new ForwardingSource(source) {
long totalBytesRead = 0L;
@Override
public long read(Buffer sink, long byteCount) throws IOException {
long bytesRead = super.read(sink, byteCount);
// read() returns the number of bytes read, or -1 if this source is exhausted.
totalBytesRead += bytesRead != -1 ? bytesRead : 0;
callback.onDownloadProgress(totalBytesRead, responseBody.contentLength(), bytesRead == -1);
return bytesRead;
}
};
}
}

View file

@ -0,0 +1,72 @@
/*
* Lethean Blockchain API
* OpenAPI for Lethean Blockchain
*
* The version of the OpenAPI document: 6.0.1
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
package invalidPackageName;
import java.util.Map;
/**
* Representing a Server configuration.
*/
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-10-19T15:35:02.750468+01:00[Europe/London]", comments = "Generator version: 7.16.0")
public class ServerConfiguration {
public String URL;
public String description;
public Map<String, ServerVariable> variables;
/**
* @param URL A URL to the target host.
* @param description A description of the host designated by the URL.
* @param variables A map between a variable name and its value. The value is used for substitution in the server's URL template.
*/
public ServerConfiguration(String URL, String description, Map<String, ServerVariable> variables) {
this.URL = URL;
this.description = description;
this.variables = variables;
}
/**
* Format URL template using given variables.
*
* @param variables A map between a variable name and its value.
* @return Formatted URL.
*/
public String URL(Map<String, String> variables) {
String url = this.URL;
// go through variables and replace placeholders
for (Map.Entry<String, ServerVariable> variable: this.variables.entrySet()) {
String name = variable.getKey();
ServerVariable serverVariable = variable.getValue();
String value = serverVariable.defaultValue;
if (variables != null && variables.containsKey(name)) {
value = variables.get(name);
if (serverVariable.enumValues.size() > 0 && !serverVariable.enumValues.contains(value)) {
throw new IllegalArgumentException("The variable " + name + " in the server URL has invalid value " + value + ".");
}
}
url = url.replace("{" + name + "}", value);
}
return url;
}
/**
* Format URL template using default server variables.
*
* @return Formatted URL.
*/
public String URL() {
return URL(null);
}
}

View file

@ -0,0 +1,37 @@
/*
* Lethean Blockchain API
* OpenAPI for Lethean Blockchain
*
* The version of the OpenAPI document: 6.0.1
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
package invalidPackageName;
import java.util.HashSet;
/**
* Representing a Server Variable for server URL template substitution.
*/
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-10-19T15:35:02.750468+01:00[Europe/London]", comments = "Generator version: 7.16.0")
public class ServerVariable {
public String description;
public String defaultValue;
public HashSet<String> enumValues = null;
/**
* @param description A description for the server variable.
* @param defaultValue The default value to use for substitution.
* @param enumValues An enumeration of string values to be used if the substitution options are from a limited set.
*/
public ServerVariable(String description, String defaultValue, HashSet<String> enumValues) {
this.description = description;
this.defaultValue = defaultValue;
this.enumValues = enumValues;
}
}

View file

@ -0,0 +1,83 @@
/*
* Lethean Blockchain API
* OpenAPI for Lethean Blockchain
*
* The version of the OpenAPI document: 6.0.1
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
package invalidPackageName;
import java.util.Collection;
import java.util.Iterator;
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-10-19T15:35:02.750468+01:00[Europe/London]", comments = "Generator version: 7.16.0")
public class StringUtil {
/**
* Check if the given array contains the given value (with case-insensitive comparison).
*
* @param array The array
* @param value The value to search
* @return true if the array contains the value
*/
public static boolean containsIgnoreCase(String[] array, String value) {
for (String str : array) {
if (value == null && str == null) {
return true;
}
if (value != null && value.equalsIgnoreCase(str)) {
return true;
}
}
return false;
}
/**
* Join an array of strings with the given separator.
* <p>
* Note: This might be replaced by utility method from commons-lang or guava someday
* if one of those libraries is added as dependency.
* </p>
*
* @param array The array of strings
* @param separator The separator
* @return the resulting string
*/
public static String join(String[] array, String separator) {
int len = array.length;
if (len == 0) {
return "";
}
StringBuilder out = new StringBuilder();
out.append(array[0]);
for (int i = 1; i < len; i++) {
out.append(separator).append(array[i]);
}
return out.toString();
}
/**
* Join a list of strings with the given separator.
*
* @param list The list of strings
* @param separator The separator
* @return the resulting string
*/
public static String join(Collection<String> list, String separator) {
Iterator<String> iterator = list.iterator();
StringBuilder out = new StringBuilder();
if (iterator.hasNext()) {
out.append(iterator.next());
}
while (iterator.hasNext()) {
out.append(separator).append(iterator.next());
}
return out.toString();
}
}

View file

@ -0,0 +1,80 @@
/*
* Lethean Blockchain API
* OpenAPI for Lethean Blockchain
*
* The version of the OpenAPI document: 6.0.1
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
package invalidPackageName.auth;
import invalidPackageName.ApiException;
import invalidPackageName.Pair;
import java.net.URI;
import java.util.Map;
import java.util.List;
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-10-19T15:35:02.750468+01:00[Europe/London]", comments = "Generator version: 7.16.0")
public class ApiKeyAuth implements Authentication {
private final String location;
private final String paramName;
private String apiKey;
private String apiKeyPrefix;
public ApiKeyAuth(String location, String paramName) {
this.location = location;
this.paramName = paramName;
}
public String getLocation() {
return location;
}
public String getParamName() {
return paramName;
}
public String getApiKey() {
return apiKey;
}
public void setApiKey(String apiKey) {
this.apiKey = apiKey;
}
public String getApiKeyPrefix() {
return apiKeyPrefix;
}
public void setApiKeyPrefix(String apiKeyPrefix) {
this.apiKeyPrefix = apiKeyPrefix;
}
@Override
public void applyToParams(List<Pair> queryParams, Map<String, String> headerParams, Map<String, String> cookieParams,
String payload, String method, URI uri) throws ApiException {
if (apiKey == null) {
return;
}
String value;
if (apiKeyPrefix != null) {
value = apiKeyPrefix + " " + apiKey;
} else {
value = apiKey;
}
if ("query".equals(location)) {
queryParams.add(new Pair(paramName, value));
} else if ("header".equals(location)) {
headerParams.put(paramName, value);
} else if ("cookie".equals(location)) {
cookieParams.put(paramName, value);
}
}
}

View file

@ -0,0 +1,37 @@
/*
* Lethean Blockchain API
* OpenAPI for Lethean Blockchain
*
* The version of the OpenAPI document: 6.0.1
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
package invalidPackageName.auth;
import invalidPackageName.Pair;
import invalidPackageName.ApiException;
import java.net.URI;
import java.util.Map;
import java.util.List;
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-10-19T15:35:02.750468+01:00[Europe/London]", comments = "Generator version: 7.16.0")
public interface Authentication {
/**
* Apply authentication settings to header and query params.
*
* @param queryParams List of query parameters
* @param headerParams Map of header parameters
* @param cookieParams Map of cookie parameters
* @param payload HTTP request body
* @param method HTTP method
* @param uri URI
* @throws ApiException if failed to update the parameters
*/
void applyToParams(List<Pair> queryParams, Map<String, String> headerParams, Map<String, String> cookieParams, String payload, String method, URI uri) throws ApiException;
}

View file

@ -0,0 +1,55 @@
/*
* Lethean Blockchain API
* OpenAPI for Lethean Blockchain
*
* The version of the OpenAPI document: 6.0.1
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
package invalidPackageName.auth;
import invalidPackageName.Pair;
import invalidPackageName.ApiException;
import okhttp3.Credentials;
import java.net.URI;
import java.util.Map;
import java.util.List;
public class HttpBasicAuth implements Authentication {
private String username;
private String password;
public String getUsername() {
return username;
}
public void setUsername(String username) {
this.username = username;
}
public String getPassword() {
return password;
}
public void setPassword(String password) {
this.password = password;
}
@Override
public void applyToParams(List<Pair> queryParams, Map<String, String> headerParams, Map<String, String> cookieParams,
String payload, String method, URI uri) throws ApiException {
if (username == null && password == null) {
return;
}
headerParams.put("Authorization", Credentials.basic(
username == null ? "" : username,
password == null ? "" : password));
}
}

View file

@ -0,0 +1,75 @@
/*
* Lethean Blockchain API
* OpenAPI for Lethean Blockchain
*
* The version of the OpenAPI document: 6.0.1
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
package invalidPackageName.auth;
import invalidPackageName.ApiException;
import invalidPackageName.Pair;
import java.net.URI;
import java.util.List;
import java.util.Map;
import java.util.Optional;
import java.util.function.Supplier;
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-10-19T15:35:02.750468+01:00[Europe/London]", comments = "Generator version: 7.16.0")
public class HttpBearerAuth implements Authentication {
private final String scheme;
private Supplier<String> tokenSupplier;
public HttpBearerAuth(String scheme) {
this.scheme = scheme;
}
/**
* Gets the token, which together with the scheme, will be sent as the value of the Authorization header.
*
* @return The bearer token
*/
public String getBearerToken() {
return tokenSupplier.get();
}
/**
* Sets the token, which together with the scheme, will be sent as the value of the Authorization header.
*
* @param bearerToken The bearer token to send in the Authorization header
*/
public void setBearerToken(String bearerToken) {
this.tokenSupplier = () -> bearerToken;
}
/**
* Sets the supplier of tokens, which together with the scheme, will be sent as the value of the Authorization header.
*
* @param tokenSupplier The supplier of bearer tokens to send in the Authorization header
*/
public void setBearerToken(Supplier<String> tokenSupplier) {
this.tokenSupplier = tokenSupplier;
}
@Override
public void applyToParams(List<Pair> queryParams, Map<String, String> headerParams, Map<String, String> cookieParams,
String payload, String method, URI uri) throws ApiException {
String bearerToken = Optional.ofNullable(tokenSupplier).map(Supplier::get).orElse(null);
if (bearerToken == null) {
return;
}
headerParams.put("Authorization", (scheme != null ? upperCaseBearer(scheme) + " " : "") + bearerToken);
}
private static String upperCaseBearer(String scheme) {
return ("bearer".equalsIgnoreCase(scheme)) ? "Bearer" : scheme;
}
}

View file

@ -0,0 +1,727 @@
/*
* Lethean Blockchain API
* OpenAPI for Lethean Blockchain
*
* The version of the OpenAPI document: 6.0.1
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
package lthn;
import invalidPackageName.ApiCallback;
import invalidPackageName.ApiClient;
import invalidPackageName.ApiException;
import invalidPackageName.ApiResponse;
import invalidPackageName.Configuration;
import invalidPackageName.Pair;
import invalidPackageName.ProgressRequestBody;
import invalidPackageName.ProgressResponseBody;
import com.google.gson.reflect.TypeToken;
import java.io.IOException;
import org.openapitools.client.model.BlockDetailsModel;
import org.openapitools.client.model.BlockTemplateModel;
import org.openapitools.client.model.BlockTemplateRequestModel;
import org.openapitools.client.model.HeightModel;
import org.openapitools.client.model.SubmitBlockRequestModel;
import org.openapitools.client.model.SubmitBlockResponseModel;
import java.lang.reflect.Type;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
public class BlockApi {
private ApiClient localVarApiClient;
private int localHostIndex;
private String localCustomBaseUrl;
public BlockApi() {
this(Configuration.getDefaultApiClient());
}
public BlockApi(ApiClient apiClient) {
this.localVarApiClient = apiClient;
}
public ApiClient getApiClient() {
return localVarApiClient;
}
public void setApiClient(ApiClient apiClient) {
this.localVarApiClient = apiClient;
}
public int getHostIndex() {
return localHostIndex;
}
public void setHostIndex(int hostIndex) {
this.localHostIndex = hostIndex;
}
public String getCustomBaseUrl() {
return localCustomBaseUrl;
}
public void setCustomBaseUrl(String customBaseUrl) {
this.localCustomBaseUrl = customBaseUrl;
}
/**
* Build call for createBlockTemplate
* @param blockTemplateRequestModel (required)
* @param _callback Callback for upload/download progress
* @return Call to execute
* @throws ApiException If fail to serialize the request body object
* @http.response.details
<table border="1">
<caption>Response Details</caption>
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 500 </td><td> text/plain </td><td> - </td></tr>
<tr><td> 400 </td><td> text/plain </td><td> - </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public okhttp3.Call createBlockTemplateCall(@javax.annotation.Nonnull BlockTemplateRequestModel blockTemplateRequestModel, final ApiCallback _callback) throws ApiException {
String basePath = null;
// Operation Servers
String[] localBasePaths = new String[] { };
// Determine Base Path to Use
if (localCustomBaseUrl != null){
basePath = localCustomBaseUrl;
} else if ( localBasePaths.length > 0 ) {
basePath = localBasePaths[localHostIndex];
} else {
basePath = null;
}
Object localVarPostBody = blockTemplateRequestModel;
// create path and map variables
String localVarPath = "/block/template";
List<Pair> localVarQueryParams = new ArrayList<Pair>();
List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
Map<String, String> localVarCookieParams = new HashMap<String, String>();
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
final String[] localVarAccepts = {
"application/json"
};
final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
if (localVarAccept != null) {
localVarHeaderParams.put("Accept", localVarAccept);
}
final String[] localVarContentTypes = {
"application/json"
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
if (localVarContentType != null) {
localVarHeaderParams.put("Content-Type", localVarContentType);
}
String[] localVarAuthNames = new String[] { };
return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
}
@SuppressWarnings("rawtypes")
private okhttp3.Call createBlockTemplateValidateBeforeCall(@javax.annotation.Nonnull BlockTemplateRequestModel blockTemplateRequestModel, final ApiCallback _callback) throws ApiException {
// verify the required parameter 'blockTemplateRequestModel' is set
if (blockTemplateRequestModel == null) {
throw new ApiException("Missing the required parameter 'blockTemplateRequestModel' when calling createBlockTemplate(Async)");
}
return createBlockTemplateCall(blockTemplateRequestModel, _callback);
}
/**
* Create a block template for mining
*
* @param blockTemplateRequestModel (required)
* @return BlockTemplateModel
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table border="1">
<caption>Response Details</caption>
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 500 </td><td> text/plain </td><td> - </td></tr>
<tr><td> 400 </td><td> text/plain </td><td> - </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public BlockTemplateModel createBlockTemplate(@javax.annotation.Nonnull BlockTemplateRequestModel blockTemplateRequestModel) throws ApiException {
ApiResponse<BlockTemplateModel> localVarResp = createBlockTemplateWithHttpInfo(blockTemplateRequestModel);
return localVarResp.getData();
}
/**
* Create a block template for mining
*
* @param blockTemplateRequestModel (required)
* @return ApiResponse&lt;BlockTemplateModel&gt;
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table border="1">
<caption>Response Details</caption>
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 500 </td><td> text/plain </td><td> - </td></tr>
<tr><td> 400 </td><td> text/plain </td><td> - </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public ApiResponse<BlockTemplateModel> createBlockTemplateWithHttpInfo(@javax.annotation.Nonnull BlockTemplateRequestModel blockTemplateRequestModel) throws ApiException {
okhttp3.Call localVarCall = createBlockTemplateValidateBeforeCall(blockTemplateRequestModel, null);
Type localVarReturnType = new TypeToken<BlockTemplateModel>(){}.getType();
return localVarApiClient.execute(localVarCall, localVarReturnType);
}
/**
* Create a block template for mining (asynchronously)
*
* @param blockTemplateRequestModel (required)
* @param _callback The callback to be executed when the API call finishes
* @return The request call
* @throws ApiException If fail to process the API call, e.g. serializing the request body object
* @http.response.details
<table border="1">
<caption>Response Details</caption>
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 500 </td><td> text/plain </td><td> - </td></tr>
<tr><td> 400 </td><td> text/plain </td><td> - </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public okhttp3.Call createBlockTemplateAsync(@javax.annotation.Nonnull BlockTemplateRequestModel blockTemplateRequestModel, final ApiCallback<BlockTemplateModel> _callback) throws ApiException {
okhttp3.Call localVarCall = createBlockTemplateValidateBeforeCall(blockTemplateRequestModel, _callback);
Type localVarReturnType = new TypeToken<BlockTemplateModel>(){}.getType();
localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
return localVarCall;
}
/**
* Build call for getBlock
* @param identifier The hash (hex string) or height (integer) of the block to retrieve. (required)
* @param _callback Callback for upload/download progress
* @return Call to execute
* @throws ApiException If fail to serialize the request body object
* @http.response.details
<table border="1">
<caption>Response Details</caption>
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 404 </td><td> text/plain </td><td> - </td></tr>
<tr><td> 400 </td><td> text/plain </td><td> - </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public okhttp3.Call getBlockCall(@javax.annotation.Nonnull String identifier, final ApiCallback _callback) throws ApiException {
String basePath = null;
// Operation Servers
String[] localBasePaths = new String[] { };
// Determine Base Path to Use
if (localCustomBaseUrl != null){
basePath = localCustomBaseUrl;
} else if ( localBasePaths.length > 0 ) {
basePath = localBasePaths[localHostIndex];
} else {
basePath = null;
}
Object localVarPostBody = null;
// create path and map variables
String localVarPath = "/block/{identifier}"
.replace("{" + "identifier" + "}", localVarApiClient.escapeString(identifier.toString()));
List<Pair> localVarQueryParams = new ArrayList<Pair>();
List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
Map<String, String> localVarCookieParams = new HashMap<String, String>();
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
final String[] localVarAccepts = {
"application/json"
};
final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
if (localVarAccept != null) {
localVarHeaderParams.put("Accept", localVarAccept);
}
final String[] localVarContentTypes = {
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
if (localVarContentType != null) {
localVarHeaderParams.put("Content-Type", localVarContentType);
}
String[] localVarAuthNames = new String[] { };
return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
}
@SuppressWarnings("rawtypes")
private okhttp3.Call getBlockValidateBeforeCall(@javax.annotation.Nonnull String identifier, final ApiCallback _callback) throws ApiException {
// verify the required parameter 'identifier' is set
if (identifier == null) {
throw new ApiException("Missing the required parameter 'identifier' when calling getBlock(Async)");
}
return getBlockCall(identifier, _callback);
}
/**
* Get a block by its hash or height (ID)
*
* @param identifier The hash (hex string) or height (integer) of the block to retrieve. (required)
* @return BlockDetailsModel
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table border="1">
<caption>Response Details</caption>
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 404 </td><td> text/plain </td><td> - </td></tr>
<tr><td> 400 </td><td> text/plain </td><td> - </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public BlockDetailsModel getBlock(@javax.annotation.Nonnull String identifier) throws ApiException {
ApiResponse<BlockDetailsModel> localVarResp = getBlockWithHttpInfo(identifier);
return localVarResp.getData();
}
/**
* Get a block by its hash or height (ID)
*
* @param identifier The hash (hex string) or height (integer) of the block to retrieve. (required)
* @return ApiResponse&lt;BlockDetailsModel&gt;
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table border="1">
<caption>Response Details</caption>
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 404 </td><td> text/plain </td><td> - </td></tr>
<tr><td> 400 </td><td> text/plain </td><td> - </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public ApiResponse<BlockDetailsModel> getBlockWithHttpInfo(@javax.annotation.Nonnull String identifier) throws ApiException {
okhttp3.Call localVarCall = getBlockValidateBeforeCall(identifier, null);
Type localVarReturnType = new TypeToken<BlockDetailsModel>(){}.getType();
return localVarApiClient.execute(localVarCall, localVarReturnType);
}
/**
* Get a block by its hash or height (ID) (asynchronously)
*
* @param identifier The hash (hex string) or height (integer) of the block to retrieve. (required)
* @param _callback The callback to be executed when the API call finishes
* @return The request call
* @throws ApiException If fail to process the API call, e.g. serializing the request body object
* @http.response.details
<table border="1">
<caption>Response Details</caption>
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 404 </td><td> text/plain </td><td> - </td></tr>
<tr><td> 400 </td><td> text/plain </td><td> - </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public okhttp3.Call getBlockAsync(@javax.annotation.Nonnull String identifier, final ApiCallback<BlockDetailsModel> _callback) throws ApiException {
okhttp3.Call localVarCall = getBlockValidateBeforeCall(identifier, _callback);
Type localVarReturnType = new TypeToken<BlockDetailsModel>(){}.getType();
localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
return localVarCall;
}
/**
* Build call for getBlocks
* @param _callback Callback for upload/download progress
* @return Call to execute
* @throws ApiException If fail to serialize the request body object
* @http.response.details
<table border="1">
<caption>Response Details</caption>
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 404 </td><td> text/plain </td><td> - </td></tr>
<tr><td> 400 </td><td> text/plain </td><td> - </td></tr>
<tr><td> 200 </td><td> A list of block objects. </td><td> - </td></tr>
</table>
*/
public okhttp3.Call getBlocksCall(final ApiCallback _callback) throws ApiException {
String basePath = null;
// Operation Servers
String[] localBasePaths = new String[] { };
// Determine Base Path to Use
if (localCustomBaseUrl != null){
basePath = localCustomBaseUrl;
} else if ( localBasePaths.length > 0 ) {
basePath = localBasePaths[localHostIndex];
} else {
basePath = null;
}
Object localVarPostBody = null;
// create path and map variables
String localVarPath = "/block";
List<Pair> localVarQueryParams = new ArrayList<Pair>();
List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
Map<String, String> localVarCookieParams = new HashMap<String, String>();
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
final String[] localVarAccepts = {
"application/json"
};
final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
if (localVarAccept != null) {
localVarHeaderParams.put("Accept", localVarAccept);
}
final String[] localVarContentTypes = {
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
if (localVarContentType != null) {
localVarHeaderParams.put("Content-Type", localVarContentType);
}
String[] localVarAuthNames = new String[] { };
return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
}
@SuppressWarnings("rawtypes")
private okhttp3.Call getBlocksValidateBeforeCall(final ApiCallback _callback) throws ApiException {
return getBlocksCall(_callback);
}
/**
* Get one or more blocks, with optional pagination.
*
* @return List&lt;BlockDetailsModel&gt;
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table border="1">
<caption>Response Details</caption>
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 404 </td><td> text/plain </td><td> - </td></tr>
<tr><td> 400 </td><td> text/plain </td><td> - </td></tr>
<tr><td> 200 </td><td> A list of block objects. </td><td> - </td></tr>
</table>
*/
public List<BlockDetailsModel> getBlocks() throws ApiException {
ApiResponse<List<BlockDetailsModel>> localVarResp = getBlocksWithHttpInfo();
return localVarResp.getData();
}
/**
* Get one or more blocks, with optional pagination.
*
* @return ApiResponse&lt;List&lt;BlockDetailsModel&gt;&gt;
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table border="1">
<caption>Response Details</caption>
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 404 </td><td> text/plain </td><td> - </td></tr>
<tr><td> 400 </td><td> text/plain </td><td> - </td></tr>
<tr><td> 200 </td><td> A list of block objects. </td><td> - </td></tr>
</table>
*/
public ApiResponse<List<BlockDetailsModel>> getBlocksWithHttpInfo() throws ApiException {
okhttp3.Call localVarCall = getBlocksValidateBeforeCall(null);
Type localVarReturnType = new TypeToken<List<BlockDetailsModel>>(){}.getType();
return localVarApiClient.execute(localVarCall, localVarReturnType);
}
/**
* Get one or more blocks, with optional pagination. (asynchronously)
*
* @param _callback The callback to be executed when the API call finishes
* @return The request call
* @throws ApiException If fail to process the API call, e.g. serializing the request body object
* @http.response.details
<table border="1">
<caption>Response Details</caption>
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 404 </td><td> text/plain </td><td> - </td></tr>
<tr><td> 400 </td><td> text/plain </td><td> - </td></tr>
<tr><td> 200 </td><td> A list of block objects. </td><td> - </td></tr>
</table>
*/
public okhttp3.Call getBlocksAsync(final ApiCallback<List<BlockDetailsModel>> _callback) throws ApiException {
okhttp3.Call localVarCall = getBlocksValidateBeforeCall(_callback);
Type localVarReturnType = new TypeToken<List<BlockDetailsModel>>(){}.getType();
localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
return localVarCall;
}
/**
* Build call for getHeight
* @param _callback Callback for upload/download progress
* @return Call to execute
* @throws ApiException If fail to serialize the request body object
* @http.response.details
<table border="1">
<caption>Response Details</caption>
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public okhttp3.Call getHeightCall(final ApiCallback _callback) throws ApiException {
String basePath = null;
// Operation Servers
String[] localBasePaths = new String[] { };
// Determine Base Path to Use
if (localCustomBaseUrl != null){
basePath = localCustomBaseUrl;
} else if ( localBasePaths.length > 0 ) {
basePath = localBasePaths[localHostIndex];
} else {
basePath = null;
}
Object localVarPostBody = null;
// create path and map variables
String localVarPath = "/block/height";
List<Pair> localVarQueryParams = new ArrayList<Pair>();
List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
Map<String, String> localVarCookieParams = new HashMap<String, String>();
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
final String[] localVarAccepts = {
"application/json"
};
final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
if (localVarAccept != null) {
localVarHeaderParams.put("Accept", localVarAccept);
}
final String[] localVarContentTypes = {
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
if (localVarContentType != null) {
localVarHeaderParams.put("Content-Type", localVarContentType);
}
String[] localVarAuthNames = new String[] { };
return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
}
@SuppressWarnings("rawtypes")
private okhttp3.Call getHeightValidateBeforeCall(final ApiCallback _callback) throws ApiException {
return getHeightCall(_callback);
}
/**
* Get the current blockchain height
*
* @return HeightModel
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table border="1">
<caption>Response Details</caption>
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public HeightModel getHeight() throws ApiException {
ApiResponse<HeightModel> localVarResp = getHeightWithHttpInfo();
return localVarResp.getData();
}
/**
* Get the current blockchain height
*
* @return ApiResponse&lt;HeightModel&gt;
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table border="1">
<caption>Response Details</caption>
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public ApiResponse<HeightModel> getHeightWithHttpInfo() throws ApiException {
okhttp3.Call localVarCall = getHeightValidateBeforeCall(null);
Type localVarReturnType = new TypeToken<HeightModel>(){}.getType();
return localVarApiClient.execute(localVarCall, localVarReturnType);
}
/**
* Get the current blockchain height (asynchronously)
*
* @param _callback The callback to be executed when the API call finishes
* @return The request call
* @throws ApiException If fail to process the API call, e.g. serializing the request body object
* @http.response.details
<table border="1">
<caption>Response Details</caption>
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public okhttp3.Call getHeightAsync(final ApiCallback<HeightModel> _callback) throws ApiException {
okhttp3.Call localVarCall = getHeightValidateBeforeCall(_callback);
Type localVarReturnType = new TypeToken<HeightModel>(){}.getType();
localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
return localVarCall;
}
/**
* Build call for submitBlock
* @param submitBlockRequestModel (required)
* @param _callback Callback for upload/download progress
* @return Call to execute
* @throws ApiException If fail to serialize the request body object
* @http.response.details
<table border="1">
<caption>Response Details</caption>
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 406 </td><td> text/plain </td><td> - </td></tr>
<tr><td> 400 </td><td> text/plain </td><td> - </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public okhttp3.Call submitBlockCall(@javax.annotation.Nonnull SubmitBlockRequestModel submitBlockRequestModel, final ApiCallback _callback) throws ApiException {
String basePath = null;
// Operation Servers
String[] localBasePaths = new String[] { };
// Determine Base Path to Use
if (localCustomBaseUrl != null){
basePath = localCustomBaseUrl;
} else if ( localBasePaths.length > 0 ) {
basePath = localBasePaths[localHostIndex];
} else {
basePath = null;
}
Object localVarPostBody = submitBlockRequestModel;
// create path and map variables
String localVarPath = "/block/submit";
List<Pair> localVarQueryParams = new ArrayList<Pair>();
List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
Map<String, String> localVarCookieParams = new HashMap<String, String>();
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
final String[] localVarAccepts = {
"application/json"
};
final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
if (localVarAccept != null) {
localVarHeaderParams.put("Accept", localVarAccept);
}
final String[] localVarContentTypes = {
"application/json"
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
if (localVarContentType != null) {
localVarHeaderParams.put("Content-Type", localVarContentType);
}
String[] localVarAuthNames = new String[] { };
return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
}
@SuppressWarnings("rawtypes")
private okhttp3.Call submitBlockValidateBeforeCall(@javax.annotation.Nonnull SubmitBlockRequestModel submitBlockRequestModel, final ApiCallback _callback) throws ApiException {
// verify the required parameter 'submitBlockRequestModel' is set
if (submitBlockRequestModel == null) {
throw new ApiException("Missing the required parameter 'submitBlockRequestModel' when calling submitBlock(Async)");
}
return submitBlockCall(submitBlockRequestModel, _callback);
}
/**
* Submit a new block to the network
*
* @param submitBlockRequestModel (required)
* @return SubmitBlockResponseModel
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table border="1">
<caption>Response Details</caption>
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 406 </td><td> text/plain </td><td> - </td></tr>
<tr><td> 400 </td><td> text/plain </td><td> - </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public SubmitBlockResponseModel submitBlock(@javax.annotation.Nonnull SubmitBlockRequestModel submitBlockRequestModel) throws ApiException {
ApiResponse<SubmitBlockResponseModel> localVarResp = submitBlockWithHttpInfo(submitBlockRequestModel);
return localVarResp.getData();
}
/**
* Submit a new block to the network
*
* @param submitBlockRequestModel (required)
* @return ApiResponse&lt;SubmitBlockResponseModel&gt;
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table border="1">
<caption>Response Details</caption>
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 406 </td><td> text/plain </td><td> - </td></tr>
<tr><td> 400 </td><td> text/plain </td><td> - </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public ApiResponse<SubmitBlockResponseModel> submitBlockWithHttpInfo(@javax.annotation.Nonnull SubmitBlockRequestModel submitBlockRequestModel) throws ApiException {
okhttp3.Call localVarCall = submitBlockValidateBeforeCall(submitBlockRequestModel, null);
Type localVarReturnType = new TypeToken<SubmitBlockResponseModel>(){}.getType();
return localVarApiClient.execute(localVarCall, localVarReturnType);
}
/**
* Submit a new block to the network (asynchronously)
*
* @param submitBlockRequestModel (required)
* @param _callback The callback to be executed when the API call finishes
* @return The request call
* @throws ApiException If fail to process the API call, e.g. serializing the request body object
* @http.response.details
<table border="1">
<caption>Response Details</caption>
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 406 </td><td> text/plain </td><td> - </td></tr>
<tr><td> 400 </td><td> text/plain </td><td> - </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public okhttp3.Call submitBlockAsync(@javax.annotation.Nonnull SubmitBlockRequestModel submitBlockRequestModel, final ApiCallback<SubmitBlockResponseModel> _callback) throws ApiException {
okhttp3.Call localVarCall = submitBlockValidateBeforeCall(submitBlockRequestModel, _callback);
Type localVarReturnType = new TypeToken<SubmitBlockResponseModel>(){}.getType();
localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
return localVarCall;
}
}

View file

@ -0,0 +1,318 @@
/*
* Lethean Blockchain API
* OpenAPI for Lethean Blockchain
*
* The version of the OpenAPI document: 6.0.1
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
package lthn;
import invalidPackageName.ApiCallback;
import invalidPackageName.ApiClient;
import invalidPackageName.ApiException;
import invalidPackageName.ApiResponse;
import invalidPackageName.Configuration;
import invalidPackageName.Pair;
import invalidPackageName.ProgressRequestBody;
import invalidPackageName.ProgressResponseBody;
import com.google.gson.reflect.TypeToken;
import java.io.IOException;
import org.openapitools.client.model.InfoModel;
import org.openapitools.client.model.VersionModel;
import java.lang.reflect.Type;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
public class InfoApi {
private ApiClient localVarApiClient;
private int localHostIndex;
private String localCustomBaseUrl;
public InfoApi() {
this(Configuration.getDefaultApiClient());
}
public InfoApi(ApiClient apiClient) {
this.localVarApiClient = apiClient;
}
public ApiClient getApiClient() {
return localVarApiClient;
}
public void setApiClient(ApiClient apiClient) {
this.localVarApiClient = apiClient;
}
public int getHostIndex() {
return localHostIndex;
}
public void setHostIndex(int hostIndex) {
this.localHostIndex = hostIndex;
}
public String getCustomBaseUrl() {
return localCustomBaseUrl;
}
public void setCustomBaseUrl(String customBaseUrl) {
this.localCustomBaseUrl = customBaseUrl;
}
/**
* Build call for getInfo
* @param flags Possible values: net_time_delta_median, current_network_hashrate_50, current_network_hashrate_350, seconds_for_10_blocks, seconds_for_30_blocks, transactions_daily_stat, last_pos_timestamp, last_pow_timestamp, total_coins, last_block_size, tx_count_in_last_block, pos_sequence_factor, pow_sequence_factor, pos_difficulty, performance, outs_stat, expirations_median. (optional)
* @param _callback Callback for upload/download progress
* @return Call to execute
* @throws ApiException If fail to serialize the request body object
* @http.response.details
<table border="1">
<caption>Response Details</caption>
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public okhttp3.Call getInfoCall(@javax.annotation.Nullable String flags, final ApiCallback _callback) throws ApiException {
String basePath = null;
// Operation Servers
String[] localBasePaths = new String[] { };
// Determine Base Path to Use
if (localCustomBaseUrl != null){
basePath = localCustomBaseUrl;
} else if ( localBasePaths.length > 0 ) {
basePath = localBasePaths[localHostIndex];
} else {
basePath = null;
}
Object localVarPostBody = null;
// create path and map variables
String localVarPath = "/info";
List<Pair> localVarQueryParams = new ArrayList<Pair>();
List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
Map<String, String> localVarCookieParams = new HashMap<String, String>();
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
if (flags != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("flags", flags));
}
final String[] localVarAccepts = {
"application/json"
};
final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
if (localVarAccept != null) {
localVarHeaderParams.put("Accept", localVarAccept);
}
final String[] localVarContentTypes = {
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
if (localVarContentType != null) {
localVarHeaderParams.put("Content-Type", localVarContentType);
}
String[] localVarAuthNames = new String[] { };
return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
}
@SuppressWarnings("rawtypes")
private okhttp3.Call getInfoValidateBeforeCall(@javax.annotation.Nullable String flags, final ApiCallback _callback) throws ApiException {
return getInfoCall(flags, _callback);
}
/**
* Get detailed information about the blockchain and daemon state
*
* @param flags Possible values: net_time_delta_median, current_network_hashrate_50, current_network_hashrate_350, seconds_for_10_blocks, seconds_for_30_blocks, transactions_daily_stat, last_pos_timestamp, last_pow_timestamp, total_coins, last_block_size, tx_count_in_last_block, pos_sequence_factor, pow_sequence_factor, pos_difficulty, performance, outs_stat, expirations_median. (optional)
* @return InfoModel
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table border="1">
<caption>Response Details</caption>
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public InfoModel getInfo(@javax.annotation.Nullable String flags) throws ApiException {
ApiResponse<InfoModel> localVarResp = getInfoWithHttpInfo(flags);
return localVarResp.getData();
}
/**
* Get detailed information about the blockchain and daemon state
*
* @param flags Possible values: net_time_delta_median, current_network_hashrate_50, current_network_hashrate_350, seconds_for_10_blocks, seconds_for_30_blocks, transactions_daily_stat, last_pos_timestamp, last_pow_timestamp, total_coins, last_block_size, tx_count_in_last_block, pos_sequence_factor, pow_sequence_factor, pos_difficulty, performance, outs_stat, expirations_median. (optional)
* @return ApiResponse&lt;InfoModel&gt;
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table border="1">
<caption>Response Details</caption>
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public ApiResponse<InfoModel> getInfoWithHttpInfo(@javax.annotation.Nullable String flags) throws ApiException {
okhttp3.Call localVarCall = getInfoValidateBeforeCall(flags, null);
Type localVarReturnType = new TypeToken<InfoModel>(){}.getType();
return localVarApiClient.execute(localVarCall, localVarReturnType);
}
/**
* Get detailed information about the blockchain and daemon state (asynchronously)
*
* @param flags Possible values: net_time_delta_median, current_network_hashrate_50, current_network_hashrate_350, seconds_for_10_blocks, seconds_for_30_blocks, transactions_daily_stat, last_pos_timestamp, last_pow_timestamp, total_coins, last_block_size, tx_count_in_last_block, pos_sequence_factor, pow_sequence_factor, pos_difficulty, performance, outs_stat, expirations_median. (optional)
* @param _callback The callback to be executed when the API call finishes
* @return The request call
* @throws ApiException If fail to process the API call, e.g. serializing the request body object
* @http.response.details
<table border="1">
<caption>Response Details</caption>
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public okhttp3.Call getInfoAsync(@javax.annotation.Nullable String flags, final ApiCallback<InfoModel> _callback) throws ApiException {
okhttp3.Call localVarCall = getInfoValidateBeforeCall(flags, _callback);
Type localVarReturnType = new TypeToken<InfoModel>(){}.getType();
localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
return localVarCall;
}
/**
* Build call for version
* @param _callback Callback for upload/download progress
* @return Call to execute
* @throws ApiException If fail to serialize the request body object
* @http.response.details
<table border="1">
<caption>Response Details</caption>
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public okhttp3.Call versionCall(final ApiCallback _callback) throws ApiException {
String basePath = null;
// Operation Servers
String[] localBasePaths = new String[] { };
// Determine Base Path to Use
if (localCustomBaseUrl != null){
basePath = localCustomBaseUrl;
} else if ( localBasePaths.length > 0 ) {
basePath = localBasePaths[localHostIndex];
} else {
basePath = null;
}
Object localVarPostBody = null;
// create path and map variables
String localVarPath = "/info/version";
List<Pair> localVarQueryParams = new ArrayList<Pair>();
List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
Map<String, String> localVarCookieParams = new HashMap<String, String>();
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
final String[] localVarAccepts = {
"application/json"
};
final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
if (localVarAccept != null) {
localVarHeaderParams.put("Accept", localVarAccept);
}
final String[] localVarContentTypes = {
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
if (localVarContentType != null) {
localVarHeaderParams.put("Content-Type", localVarContentType);
}
String[] localVarAuthNames = new String[] { };
return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
}
@SuppressWarnings("rawtypes")
private okhttp3.Call versionValidateBeforeCall(final ApiCallback _callback) throws ApiException {
return versionCall(_callback);
}
/**
* Get API version
* Returns the current version of the API.
* @return VersionModel
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table border="1">
<caption>Response Details</caption>
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public VersionModel version() throws ApiException {
ApiResponse<VersionModel> localVarResp = versionWithHttpInfo();
return localVarResp.getData();
}
/**
* Get API version
* Returns the current version of the API.
* @return ApiResponse&lt;VersionModel&gt;
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table border="1">
<caption>Response Details</caption>
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public ApiResponse<VersionModel> versionWithHttpInfo() throws ApiException {
okhttp3.Call localVarCall = versionValidateBeforeCall(null);
Type localVarReturnType = new TypeToken<VersionModel>(){}.getType();
return localVarApiClient.execute(localVarCall, localVarReturnType);
}
/**
* Get API version (asynchronously)
* Returns the current version of the API.
* @param _callback The callback to be executed when the API call finishes
* @return The request call
* @throws ApiException If fail to process the API call, e.g. serializing the request body object
* @http.response.details
<table border="1">
<caption>Response Details</caption>
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public okhttp3.Call versionAsync(final ApiCallback<VersionModel> _callback) throws ApiException {
okhttp3.Call localVarCall = versionValidateBeforeCall(_callback);
Type localVarReturnType = new TypeToken<VersionModel>(){}.getType();
localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
return localVarCall;
}
}

View file

@ -0,0 +1,62 @@
/*
* Lethean Blockchain API
* OpenAPI for Lethean Blockchain
*
* The version of the OpenAPI document: 6.0.1
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
package org.lthn;
import java.io.IOException;
import java.util.Map;
import java.util.List;
/**
* Callback for asynchronous API call.
*
* @param <T> The return type
*/
public interface ApiCallback<T> {
/**
* This is called when the API call fails.
*
* @param e The exception causing the failure
* @param statusCode Status code of the response if available, otherwise it would be 0
* @param responseHeaders Headers of the response if available, otherwise it would be null
*/
void onFailure(ApiException e, int statusCode, Map<String, List<String>> responseHeaders);
/**
* This is called when the API call succeeded.
*
* @param result The result deserialized from response
* @param statusCode Status code of the response
* @param responseHeaders Headers of the response
*/
void onSuccess(T result, int statusCode, Map<String, List<String>> responseHeaders);
/**
* This is called when the API upload processing.
*
* @param bytesWritten bytes Written
* @param contentLength content length of request body
* @param done write end
*/
void onUploadProgress(long bytesWritten, long contentLength, boolean done);
/**
* This is called when the API download processing.
*
* @param bytesRead bytes Read
* @param contentLength content length of the response
* @param done Read end
*/
void onDownloadProgress(long bytesRead, long contentLength, boolean done);
}

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,168 @@
/*
* Lethean Blockchain API
* OpenAPI for Lethean Blockchain
*
* The version of the OpenAPI document: 6.0.1
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
package org.lthn;
import java.util.Map;
import java.util.List;
import java.util.Locale;
/**
* <p>ApiException class.</p>
*/
@SuppressWarnings("serial")
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-10-19T15:31:48.909623+01:00[Europe/London]", comments = "Generator version: 7.16.0")
public class ApiException extends Exception {
private static final long serialVersionUID = 1L;
private int code = 0;
private Map<String, List<String>> responseHeaders = null;
private String responseBody = null;
/**
* <p>Constructor for ApiException.</p>
*/
public ApiException() {}
/**
* <p>Constructor for ApiException.</p>
*
* @param throwable a {@link java.lang.Throwable} object
*/
public ApiException(Throwable throwable) {
super(throwable);
}
/**
* <p>Constructor for ApiException.</p>
*
* @param message the error message
*/
public ApiException(String message) {
super(message);
}
/**
* <p>Constructor for ApiException.</p>
*
* @param message the error message
* @param throwable a {@link java.lang.Throwable} object
* @param code HTTP status code
* @param responseHeaders a {@link java.util.Map} of HTTP response headers
* @param responseBody the response body
*/
public ApiException(String message, Throwable throwable, int code, Map<String, List<String>> responseHeaders, String responseBody) {
super(message, throwable);
this.code = code;
this.responseHeaders = responseHeaders;
this.responseBody = responseBody;
}
/**
* <p>Constructor for ApiException.</p>
*
* @param message the error message
* @param code HTTP status code
* @param responseHeaders a {@link java.util.Map} of HTTP response headers
* @param responseBody the response body
*/
public ApiException(String message, int code, Map<String, List<String>> responseHeaders, String responseBody) {
this(message, (Throwable) null, code, responseHeaders, responseBody);
}
/**
* <p>Constructor for ApiException.</p>
*
* @param message the error message
* @param throwable a {@link java.lang.Throwable} object
* @param code HTTP status code
* @param responseHeaders a {@link java.util.Map} of HTTP response headers
*/
public ApiException(String message, Throwable throwable, int code, Map<String, List<String>> responseHeaders) {
this(message, throwable, code, responseHeaders, null);
}
/**
* <p>Constructor for ApiException.</p>
*
* @param code HTTP status code
* @param responseHeaders a {@link java.util.Map} of HTTP response headers
* @param responseBody the response body
*/
public ApiException(int code, Map<String, List<String>> responseHeaders, String responseBody) {
this("Response Code: " + code + " Response Body: " + responseBody, (Throwable) null, code, responseHeaders, responseBody);
}
/**
* <p>Constructor for ApiException.</p>
*
* @param code HTTP status code
* @param message a {@link java.lang.String} object
*/
public ApiException(int code, String message) {
super(message);
this.code = code;
}
/**
* <p>Constructor for ApiException.</p>
*
* @param code HTTP status code
* @param message the error message
* @param responseHeaders a {@link java.util.Map} of HTTP response headers
* @param responseBody the response body
*/
public ApiException(int code, String message, Map<String, List<String>> responseHeaders, String responseBody) {
this(code, message);
this.responseHeaders = responseHeaders;
this.responseBody = responseBody;
}
/**
* Get the HTTP status code.
*
* @return HTTP status code
*/
public int getCode() {
return code;
}
/**
* Get the HTTP response headers.
*
* @return A map of list of string
*/
public Map<String, List<String>> getResponseHeaders() {
return responseHeaders;
}
/**
* Get the HTTP response body.
*
* @return Response body in the form of string
*/
public String getResponseBody() {
return responseBody;
}
/**
* Get the exception message including HTTP response data.
*
* @return The exception message
*/
public String getMessage() {
return String.format(Locale.ROOT, "Message: %s%nHTTP response code: %s%nHTTP response body: %s%nHTTP response headers: %s",
super.getMessage(), this.getCode(), this.getResponseBody(), this.getResponseHeaders());
}
}

View file

@ -0,0 +1,76 @@
/*
* Lethean Blockchain API
* OpenAPI for Lethean Blockchain
*
* The version of the OpenAPI document: 6.0.1
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
package org.lthn;
import java.util.List;
import java.util.Map;
/**
* API response returned by API call.
*/
public class ApiResponse<T> {
final private int statusCode;
final private Map<String, List<String>> headers;
final private T data;
/**
* <p>Constructor for ApiResponse.</p>
*
* @param statusCode The status code of HTTP response
* @param headers The headers of HTTP response
*/
public ApiResponse(int statusCode, Map<String, List<String>> headers) {
this(statusCode, headers, null);
}
/**
* <p>Constructor for ApiResponse.</p>
*
* @param statusCode The status code of HTTP response
* @param headers The headers of HTTP response
* @param data The object deserialized from response bod
*/
public ApiResponse(int statusCode, Map<String, List<String>> headers, T data) {
this.statusCode = statusCode;
this.headers = headers;
this.data = data;
}
/**
* <p>Get the <code>status code</code>.</p>
*
* @return the status code
*/
public int getStatusCode() {
return statusCode;
}
/**
* <p>Get the <code>headers</code>.</p>
*
* @return a {@link java.util.Map} of headers
*/
public Map<String, List<String>> getHeaders() {
return headers;
}
/**
* <p>Get the <code>data</code>.</p>
*
* @return the data
*/
public T getData() {
return data;
}
}

View file

@ -0,0 +1,63 @@
/*
* Lethean Blockchain API
* OpenAPI for Lethean Blockchain
*
* The version of the OpenAPI document: 6.0.1
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
package org.lthn;
import java.util.Objects;
import java.util.concurrent.atomic.AtomicReference;
import java.util.function.Supplier;
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-10-19T15:31:48.909623+01:00[Europe/London]", comments = "Generator version: 7.16.0")
public class Configuration {
public static final String VERSION = "6.0.1";
private static final AtomicReference<ApiClient> defaultApiClient = new AtomicReference<>();
private static volatile Supplier<ApiClient> apiClientFactory = ApiClient::new;
/**
* Get the default API client, which would be used when creating API instances without providing an API client.
*
* @return Default API client
*/
public static ApiClient getDefaultApiClient() {
ApiClient client = defaultApiClient.get();
if (client == null) {
client = defaultApiClient.updateAndGet(val -> {
if (val != null) { // changed by another thread
return val;
}
return apiClientFactory.get();
});
}
return client;
}
/**
* Set the default API client, which would be used when creating API instances without providing an API client.
*
* @param apiClient API client
*/
public static void setDefaultApiClient(ApiClient apiClient) {
defaultApiClient.set(apiClient);
}
/**
* set the callback used to create new ApiClient objects
*/
public static void setApiClientFactory(Supplier<ApiClient> factory) {
apiClientFactory = Objects.requireNonNull(factory);
}
private Configuration() {
}
}

View file

@ -0,0 +1,85 @@
/*
* Lethean Blockchain API
* OpenAPI for Lethean Blockchain
*
* The version of the OpenAPI document: 6.0.1
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
package org.lthn;
import okhttp3.*;
import okio.Buffer;
import okio.BufferedSink;
import okio.GzipSink;
import okio.Okio;
import java.io.IOException;
/**
* Encodes request bodies using gzip.
*
* Taken from https://github.com/square/okhttp/issues/350
*/
class GzipRequestInterceptor implements Interceptor {
@Override
public Response intercept(Chain chain) throws IOException {
Request originalRequest = chain.request();
if (originalRequest.body() == null || originalRequest.header("Content-Encoding") != null) {
return chain.proceed(originalRequest);
}
Request compressedRequest = originalRequest.newBuilder()
.header("Content-Encoding", "gzip")
.method(originalRequest.method(), forceContentLength(gzip(originalRequest.body())))
.build();
return chain.proceed(compressedRequest);
}
private RequestBody forceContentLength(final RequestBody requestBody) throws IOException {
final Buffer buffer = new Buffer();
requestBody.writeTo(buffer);
return new RequestBody() {
@Override
public MediaType contentType() {
return requestBody.contentType();
}
@Override
public long contentLength() {
return buffer.size();
}
@Override
public void writeTo(BufferedSink sink) throws IOException {
sink.write(buffer.snapshot());
}
};
}
private RequestBody gzip(final RequestBody body) {
return new RequestBody() {
@Override
public MediaType contentType() {
return body.contentType();
}
@Override
public long contentLength() {
return -1; // We don't know the compressed length in advance!
}
@Override
public void writeTo(BufferedSink sink) throws IOException {
BufferedSink gzipSink = Okio.buffer(new GzipSink(sink));
body.writeTo(gzipSink);
gzipSink.close();
}
};
}
}

View file

@ -0,0 +1,446 @@
/*
* Lethean Blockchain API
* OpenAPI for Lethean Blockchain
*
* The version of the OpenAPI document: 6.0.1
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
package org.lthn;
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.google.gson.JsonParseException;
import com.google.gson.TypeAdapter;
import com.google.gson.internal.bind.util.ISO8601Utils;
import com.google.gson.stream.JsonReader;
import com.google.gson.stream.JsonWriter;
import com.google.gson.JsonElement;
import io.gsonfire.GsonFireBuilder;
import io.gsonfire.TypeSelector;
import okio.ByteString;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.StringReader;
import java.lang.reflect.Type;
import java.nio.charset.StandardCharsets;
import java.text.DateFormat;
import java.text.ParseException;
import java.text.ParsePosition;
import java.time.LocalDate;
import java.time.OffsetDateTime;
import java.time.format.DateTimeFormatter;
import java.util.Date;
import java.util.Locale;
import java.util.Map;
import java.util.HashMap;
/*
* A JSON utility class
*
* NOTE: in the future, this class may be converted to static, which may break
* backward-compatibility
*/
public class JSON {
private static Gson gson;
private static boolean isLenientOnJson = false;
private static DateTypeAdapter dateTypeAdapter = new DateTypeAdapter();
private static SqlDateTypeAdapter sqlDateTypeAdapter = new SqlDateTypeAdapter();
private static OffsetDateTimeTypeAdapter offsetDateTimeTypeAdapter = new OffsetDateTimeTypeAdapter();
private static LocalDateTypeAdapter localDateTypeAdapter = new LocalDateTypeAdapter();
private static ByteArrayAdapter byteArrayAdapter = new ByteArrayAdapter();
@SuppressWarnings("unchecked")
public static GsonBuilder createGson() {
GsonFireBuilder fireBuilder = new GsonFireBuilder()
;
GsonBuilder builder = fireBuilder.createGsonBuilder();
return builder;
}
private static String getDiscriminatorValue(JsonElement readElement, String discriminatorField) {
JsonElement element = readElement.getAsJsonObject().get(discriminatorField);
if (null == element) {
throw new IllegalArgumentException("missing discriminator field: <" + discriminatorField + ">");
}
return element.getAsString();
}
/**
* Returns the Java class that implements the OpenAPI schema for the specified discriminator value.
*
* @param classByDiscriminatorValue The map of discriminator values to Java classes.
* @param discriminatorValue The value of the OpenAPI discriminator in the input data.
* @return The Java class that implements the OpenAPI schema
*/
private static Class getClassByDiscriminator(Map classByDiscriminatorValue, String discriminatorValue) {
Class clazz = (Class) classByDiscriminatorValue.get(discriminatorValue);
if (null == clazz) {
throw new IllegalArgumentException("cannot determine model class of name: <" + discriminatorValue + ">");
}
return clazz;
}
static {
GsonBuilder gsonBuilder = createGson();
gsonBuilder.registerTypeAdapter(Date.class, dateTypeAdapter);
gsonBuilder.registerTypeAdapter(java.sql.Date.class, sqlDateTypeAdapter);
gsonBuilder.registerTypeAdapter(OffsetDateTime.class, offsetDateTimeTypeAdapter);
gsonBuilder.registerTypeAdapter(LocalDate.class, localDateTypeAdapter);
gsonBuilder.registerTypeAdapter(byte[].class, byteArrayAdapter);
gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.BlockDetailsModel.CustomTypeAdapterFactory());
gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.BlockProcessingPerformanceModel.CustomTypeAdapterFactory());
gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.BlockTemplateModel.CustomTypeAdapterFactory());
gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.BlockTemplateRequestModel.CustomTypeAdapterFactory());
gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.DbStatInfoModel.CustomTypeAdapterFactory());
gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.HeightModel.CustomTypeAdapterFactory());
gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.InfoModel.CustomTypeAdapterFactory());
gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.MaintainersInfoModel.CustomTypeAdapterFactory());
gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.PerformanceModel.CustomTypeAdapterFactory());
gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.PosEntryModel.CustomTypeAdapterFactory());
gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.SubmitBlockRequestModel.CustomTypeAdapterFactory());
gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.SubmitBlockResponseModel.CustomTypeAdapterFactory());
gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.TransactionAttachmentModel.CustomTypeAdapterFactory());
gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.TransactionDetailsModel.CustomTypeAdapterFactory());
gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.TransactionExtraModel.CustomTypeAdapterFactory());
gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.TransactionInputModel.CustomTypeAdapterFactory());
gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.TransactionOutputModel.CustomTypeAdapterFactory());
gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.TxGenerationContextModel.CustomTypeAdapterFactory());
gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.TxPoolPerformanceModel.CustomTypeAdapterFactory());
gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.TxProcessingPerformanceModel.CustomTypeAdapterFactory());
gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.VersionModel.CustomTypeAdapterFactory());
gson = gsonBuilder.create();
}
/**
* Get Gson.
*
* @return Gson
*/
public static Gson getGson() {
return gson;
}
/**
* Set Gson.
*
* @param gson Gson
*/
public static void setGson(Gson gson) {
JSON.gson = gson;
}
public static void setLenientOnJson(boolean lenientOnJson) {
isLenientOnJson = lenientOnJson;
}
/**
* Serialize the given Java object into JSON string.
*
* @param obj Object
* @return String representation of the JSON
*/
public static String serialize(Object obj) {
return gson.toJson(obj);
}
/**
* Deserialize the given JSON string to Java object.
*
* @param <T> Type
* @param body The JSON string
* @param returnType The type to deserialize into
* @return The deserialized Java object
*/
@SuppressWarnings("unchecked")
public static <T> T deserialize(String body, Type returnType) {
try {
if (isLenientOnJson) {
JsonReader jsonReader = new JsonReader(new StringReader(body));
// see https://google-gson.googlecode.com/svn/trunk/gson/docs/javadocs/com/google/gson/stream/JsonReader.html#setLenient(boolean)
jsonReader.setLenient(true);
return gson.fromJson(jsonReader, returnType);
} else {
return gson.fromJson(body, returnType);
}
} catch (JsonParseException e) {
// Fallback processing when failed to parse JSON form response body:
// return the response body string directly for the String return type;
if (returnType.equals(String.class)) {
return (T) body;
} else {
throw (e);
}
}
}
/**
* Deserialize the given JSON InputStream to a Java object.
*
* @param <T> Type
* @param inputStream The JSON InputStream
* @param returnType The type to deserialize into
* @return The deserialized Java object
*/
@SuppressWarnings("unchecked")
public static <T> T deserialize(InputStream inputStream, Type returnType) throws IOException {
try (InputStreamReader reader = new InputStreamReader(inputStream, StandardCharsets.UTF_8)) {
if (isLenientOnJson) {
// see https://google-gson.googlecode.com/svn/trunk/gson/docs/javadocs/com/google/gson/stream/JsonReader.html#setLenient(boolean)
JsonReader jsonReader = new JsonReader(reader);
jsonReader.setLenient(true);
return gson.fromJson(jsonReader, returnType);
} else {
return gson.fromJson(reader, returnType);
}
}
}
/**
* Gson TypeAdapter for Byte Array type
*/
public static class ByteArrayAdapter extends TypeAdapter<byte[]> {
@Override
public void write(JsonWriter out, byte[] value) throws IOException {
if (value == null) {
out.nullValue();
} else {
out.value(ByteString.of(value).base64());
}
}
@Override
public byte[] read(JsonReader in) throws IOException {
switch (in.peek()) {
case NULL:
in.nextNull();
return null;
default:
String bytesAsBase64 = in.nextString();
ByteString byteString = ByteString.decodeBase64(bytesAsBase64);
return byteString.toByteArray();
}
}
}
/**
* Gson TypeAdapter for JSR310 OffsetDateTime type
*/
public static class OffsetDateTimeTypeAdapter extends TypeAdapter<OffsetDateTime> {
private DateTimeFormatter formatter;
public OffsetDateTimeTypeAdapter() {
this(DateTimeFormatter.ISO_OFFSET_DATE_TIME);
}
public OffsetDateTimeTypeAdapter(DateTimeFormatter formatter) {
this.formatter = formatter;
}
public void setFormat(DateTimeFormatter dateFormat) {
this.formatter = dateFormat;
}
@Override
public void write(JsonWriter out, OffsetDateTime date) throws IOException {
if (date == null) {
out.nullValue();
} else {
out.value(formatter.format(date));
}
}
@Override
public OffsetDateTime read(JsonReader in) throws IOException {
switch (in.peek()) {
case NULL:
in.nextNull();
return null;
default:
String date = in.nextString();
if (date.endsWith("+0000")) {
date = date.substring(0, date.length()-5) + "Z";
}
return OffsetDateTime.parse(date, formatter);
}
}
}
/**
* Gson TypeAdapter for JSR310 LocalDate type
*/
public static class LocalDateTypeAdapter extends TypeAdapter<LocalDate> {
private DateTimeFormatter formatter;
public LocalDateTypeAdapter() {
this(DateTimeFormatter.ISO_LOCAL_DATE);
}
public LocalDateTypeAdapter(DateTimeFormatter formatter) {
this.formatter = formatter;
}
public void setFormat(DateTimeFormatter dateFormat) {
this.formatter = dateFormat;
}
@Override
public void write(JsonWriter out, LocalDate date) throws IOException {
if (date == null) {
out.nullValue();
} else {
out.value(formatter.format(date));
}
}
@Override
public LocalDate read(JsonReader in) throws IOException {
switch (in.peek()) {
case NULL:
in.nextNull();
return null;
default:
String date = in.nextString();
return LocalDate.parse(date, formatter);
}
}
}
public static void setOffsetDateTimeFormat(DateTimeFormatter dateFormat) {
offsetDateTimeTypeAdapter.setFormat(dateFormat);
}
public static void setLocalDateFormat(DateTimeFormatter dateFormat) {
localDateTypeAdapter.setFormat(dateFormat);
}
/**
* Gson TypeAdapter for java.sql.Date type
* If the dateFormat is null, a simple "yyyy-MM-dd" format will be used
* (more efficient than SimpleDateFormat).
*/
public static class SqlDateTypeAdapter extends TypeAdapter<java.sql.Date> {
private DateFormat dateFormat;
public SqlDateTypeAdapter() {}
public SqlDateTypeAdapter(DateFormat dateFormat) {
this.dateFormat = dateFormat;
}
public void setFormat(DateFormat dateFormat) {
this.dateFormat = dateFormat;
}
@Override
public void write(JsonWriter out, java.sql.Date date) throws IOException {
if (date == null) {
out.nullValue();
} else {
String value;
if (dateFormat != null) {
value = dateFormat.format(date);
} else {
value = date.toString();
}
out.value(value);
}
}
@Override
public java.sql.Date read(JsonReader in) throws IOException {
switch (in.peek()) {
case NULL:
in.nextNull();
return null;
default:
String date = in.nextString();
try {
if (dateFormat != null) {
return new java.sql.Date(dateFormat.parse(date).getTime());
}
return new java.sql.Date(ISO8601Utils.parse(date, new ParsePosition(0)).getTime());
} catch (ParseException e) {
throw new JsonParseException(e);
}
}
}
}
/**
* Gson TypeAdapter for java.util.Date type
* If the dateFormat is null, ISO8601Utils will be used.
*/
public static class DateTypeAdapter extends TypeAdapter<Date> {
private DateFormat dateFormat;
public DateTypeAdapter() {}
public DateTypeAdapter(DateFormat dateFormat) {
this.dateFormat = dateFormat;
}
public void setFormat(DateFormat dateFormat) {
this.dateFormat = dateFormat;
}
@Override
public void write(JsonWriter out, Date date) throws IOException {
if (date == null) {
out.nullValue();
} else {
String value;
if (dateFormat != null) {
value = dateFormat.format(date);
} else {
value = ISO8601Utils.format(date, true);
}
out.value(value);
}
}
@Override
public Date read(JsonReader in) throws IOException {
try {
switch (in.peek()) {
case NULL:
in.nextNull();
return null;
default:
String date = in.nextString();
try {
if (dateFormat != null) {
return dateFormat.parse(date);
}
return ISO8601Utils.parse(date, new ParsePosition(0));
} catch (ParseException e) {
throw new JsonParseException(e);
}
}
} catch (IllegalArgumentException e) {
throw new JsonParseException(e);
}
}
}
public static void setDateFormat(DateFormat dateFormat) {
dateTypeAdapter.setFormat(dateFormat);
}
public static void setSqlDateFormat(DateFormat dateFormat) {
sqlDateTypeAdapter.setFormat(dateFormat);
}
}

View file

@ -0,0 +1,37 @@
/*
* Lethean Blockchain API
* OpenAPI for Lethean Blockchain
*
* The version of the OpenAPI document: 6.0.1
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
package org.lthn;
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-10-19T15:31:48.909623+01:00[Europe/London]", comments = "Generator version: 7.16.0")
public class Pair {
private final String name;
private final String value;
public Pair(String name, String value) {
this.name = isValidString(name) ? name : "";
this.value = isValidString(value) ? value : "";
}
public String getName() {
return this.name;
}
public String getValue() {
return this.value;
}
private static boolean isValidString(String arg) {
return arg != null;
}
}

View file

@ -0,0 +1,73 @@
/*
* Lethean Blockchain API
* OpenAPI for Lethean Blockchain
*
* The version of the OpenAPI document: 6.0.1
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
package org.lthn;
import okhttp3.MediaType;
import okhttp3.RequestBody;
import java.io.IOException;
import okio.Buffer;
import okio.BufferedSink;
import okio.ForwardingSink;
import okio.Okio;
import okio.Sink;
public class ProgressRequestBody extends RequestBody {
private final RequestBody requestBody;
private final ApiCallback callback;
public ProgressRequestBody(RequestBody requestBody, ApiCallback callback) {
this.requestBody = requestBody;
this.callback = callback;
}
@Override
public MediaType contentType() {
return requestBody.contentType();
}
@Override
public long contentLength() throws IOException {
return requestBody.contentLength();
}
@Override
public void writeTo(BufferedSink sink) throws IOException {
BufferedSink bufferedSink = Okio.buffer(sink(sink));
requestBody.writeTo(bufferedSink);
bufferedSink.flush();
}
private Sink sink(Sink sink) {
return new ForwardingSink(sink) {
long bytesWritten = 0L;
long contentLength = 0L;
@Override
public void write(Buffer source, long byteCount) throws IOException {
super.write(source, byteCount);
if (contentLength == 0) {
contentLength = contentLength();
}
bytesWritten += byteCount;
callback.onUploadProgress(bytesWritten, contentLength, bytesWritten == contentLength);
}
};
}
}

View file

@ -0,0 +1,70 @@
/*
* Lethean Blockchain API
* OpenAPI for Lethean Blockchain
*
* The version of the OpenAPI document: 6.0.1
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
package org.lthn;
import okhttp3.MediaType;
import okhttp3.ResponseBody;
import java.io.IOException;
import okio.Buffer;
import okio.BufferedSource;
import okio.ForwardingSource;
import okio.Okio;
import okio.Source;
public class ProgressResponseBody extends ResponseBody {
private final ResponseBody responseBody;
private final ApiCallback callback;
private BufferedSource bufferedSource;
public ProgressResponseBody(ResponseBody responseBody, ApiCallback callback) {
this.responseBody = responseBody;
this.callback = callback;
}
@Override
public MediaType contentType() {
return responseBody.contentType();
}
@Override
public long contentLength() {
return responseBody.contentLength();
}
@Override
public BufferedSource source() {
if (bufferedSource == null) {
bufferedSource = Okio.buffer(source(responseBody.source()));
}
return bufferedSource;
}
private Source source(Source source) {
return new ForwardingSource(source) {
long totalBytesRead = 0L;
@Override
public long read(Buffer sink, long byteCount) throws IOException {
long bytesRead = super.read(sink, byteCount);
// read() returns the number of bytes read, or -1 if this source is exhausted.
totalBytesRead += bytesRead != -1 ? bytesRead : 0;
callback.onDownloadProgress(totalBytesRead, responseBody.contentLength(), bytesRead == -1);
return bytesRead;
}
};
}
}

View file

@ -0,0 +1,72 @@
/*
* Lethean Blockchain API
* OpenAPI for Lethean Blockchain
*
* The version of the OpenAPI document: 6.0.1
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
package org.lthn;
import java.util.Map;
/**
* Representing a Server configuration.
*/
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-10-19T15:31:48.909623+01:00[Europe/London]", comments = "Generator version: 7.16.0")
public class ServerConfiguration {
public String URL;
public String description;
public Map<String, ServerVariable> variables;
/**
* @param URL A URL to the target host.
* @param description A description of the host designated by the URL.
* @param variables A map between a variable name and its value. The value is used for substitution in the server's URL template.
*/
public ServerConfiguration(String URL, String description, Map<String, ServerVariable> variables) {
this.URL = URL;
this.description = description;
this.variables = variables;
}
/**
* Format URL template using given variables.
*
* @param variables A map between a variable name and its value.
* @return Formatted URL.
*/
public String URL(Map<String, String> variables) {
String url = this.URL;
// go through variables and replace placeholders
for (Map.Entry<String, ServerVariable> variable: this.variables.entrySet()) {
String name = variable.getKey();
ServerVariable serverVariable = variable.getValue();
String value = serverVariable.defaultValue;
if (variables != null && variables.containsKey(name)) {
value = variables.get(name);
if (serverVariable.enumValues.size() > 0 && !serverVariable.enumValues.contains(value)) {
throw new IllegalArgumentException("The variable " + name + " in the server URL has invalid value " + value + ".");
}
}
url = url.replace("{" + name + "}", value);
}
return url;
}
/**
* Format URL template using default server variables.
*
* @return Formatted URL.
*/
public String URL() {
return URL(null);
}
}

Some files were not shown because too many files have changed in this diff Show more