Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion openapi/Makefile
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@

generate:
swagger-codegen generate -l go -i ./access.yaml -o ./go-client-generated
swagger-codegen generate -l go -i ./access.yaml -o ./go-client-generated

generate-docker:
docker run --rm -v ${PWD}:/local swaggerapi/swagger-codegen-cli-v3 generate \
-i /local/access.yaml \
-l go \
-o /local/go-client-generated
22 changes: 15 additions & 7 deletions openapi/access.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -123,15 +123,17 @@ paths:
/transactions/{id}:
get:
summary: Get a Transaction by ID.
description: Get a transaction data by the provided transaction ID.
description: Get a transaction data by the provided transaction ID. If the transaction is a scheduled transaction, it can alternatively be retrieved by the scheduled transaction ID field returned by the system contract.
tags:
- Transactions
parameters:
- description: The ID of the transaction to get.
- description: The ID of the transaction, or id field of the scheduled transaction returned by the system contract.
name: id
in: path
schema:
$ref: '#/components/schemas/Identifier'
oneOf:
- $ref: '#/components/schemas/Identifier'
- $ref: '#/components/schemas/ScheduledTransactionId'
required: true
- $ref: '#/components/parameters/blockIdParam'
- $ref: '#/components/parameters/collectionIdParam'
Expand All @@ -152,16 +154,18 @@ paths:
$ref: '#/components/responses/500InternalServerError'
/transaction_results/{transaction_id}:
get:
summary: Get a Transaction Result by ID.
description: Get transaction result by the transaction result ID.
summary: Get a Transaction Result by transaction ID or scheduled transaction ID.
description: Get transaction result by the transaction's ID. If the transaction is a scheduled transaction, it can alternatively be retrieved by the scheduled transaction ID field returned by the system contract.
tags:
- Transactions
parameters:
- description: The transaction ID of the transaction result.
- description: The transaction ID of the transaction result, or id field of the scheduled transaction returned by the system contract.
name: transaction_id
in: path
schema:
$ref: '#/components/schemas/Identifier'
oneOf:
- $ref: '#/components/schemas/Identifier'
- $ref: '#/components/schemas/ScheduledTransactionId'
required: true
- $ref: '#/components/parameters/blockIdParam'
- $ref: '#/components/parameters/collectionIdParam'
Expand Down Expand Up @@ -1230,6 +1234,10 @@ components:
type: string
format: hexadecimal
pattern: '[a-fA-F0-9]{64}'
ScheduledTransactionId:
description: The ID of a scheduled transaction.
type: string
format: uint64
Signature:
description: A variable length signature.
type: string
Expand Down
2 changes: 1 addition & 1 deletion openapi/go-client-generated/.swagger-codegen/VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
3.0.71
3.0.75
4 changes: 3 additions & 1 deletion openapi/go-client-generated/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ Class | Method | HTTP request | Description
*NodeVersionInfoApi* | [**NodeVersionInfoGet**](docs/NodeVersionInfoApi.md#nodeversioninfoget) | **Get** /node_version_info | Get Node Version Information
*ScriptsApi* | [**ScriptsPost**](docs/ScriptsApi.md#scriptspost) | **Post** /scripts | Execute a Cadence Script
*SubscribeEventsApi* | [**SubscribeEventsGet**](docs/SubscribeEventsApi.md#subscribeeventsget) | **Get** /subscribe_events | Subscribe events
*TransactionsApi* | [**TransactionResultsTransactionIdGet**](docs/TransactionsApi.md#transactionresultstransactionidget) | **Get** /transaction_results/{transaction_id} | Get a Transaction Result by ID.
*TransactionsApi* | [**TransactionResultsTransactionIdGet**](docs/TransactionsApi.md#transactionresultstransactionidget) | **Get** /transaction_results/{transaction_id} | Get a Transaction Result by transaction ID or scheduled transaction ID.
*TransactionsApi* | [**TransactionsIdGet**](docs/TransactionsApi.md#transactionsidget) | **Get** /transactions/{id} | Get a Transaction by ID.
*TransactionsApi* | [**TransactionsPost**](docs/TransactionsApi.md#transactionspost) | **Post** /transactions | Submit a Transaction

Expand Down Expand Up @@ -62,6 +62,7 @@ Class | Method | HTTP request | Description
- [ExecutionResult](docs/ExecutionResult.md)
- [ExecutorMetadata](docs/ExecutorMetadata.md)
- [HashingAlgorithm](docs/HashingAlgorithm.md)
- [Id](docs/Id.md)
- [InlineResponse200](docs/InlineResponse200.md)
- [Links](docs/Links.md)
- [Metadata](docs/Metadata.md)
Expand All @@ -75,6 +76,7 @@ Class | Method | HTTP request | Description
- [Transaction](docs/Transaction.md)
- [TransactionExecution](docs/TransactionExecution.md)
- [TransactionExpandable](docs/TransactionExpandable.md)
- [TransactionId](docs/TransactionId.md)
- [TransactionResult](docs/TransactionResult.md)
- [TransactionSignature](docs/TransactionSignature.md)
- [TransactionStatus](docs/TransactionStatus.md)
Expand Down
33 changes: 26 additions & 7 deletions openapi/go-client-generated/api/swagger.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -249,16 +249,19 @@ paths:
tags:
- Transactions
summary: Get a Transaction by ID.
description: Get a transaction data by the provided transaction ID.
description: "Get a transaction data by the provided transaction ID. If the\
\ transaction is a scheduled transaction, it can alternatively be retrieved\
\ by the scheduled transaction ID field returned by the system contract."
parameters:
- name: id
in: path
description: The ID of the transaction to get.
description: "The ID of the transaction, or id field of the scheduled transaction\
\ returned by the system contract."
required: true
style: simple
explode: false
schema:
$ref: "#/components/schemas/Identifier"
$ref: "#/components/schemas/id"
- name: block_id
in: query
description: A block ID optional parameter
Expand Down Expand Up @@ -330,17 +333,21 @@ paths:
get:
tags:
- Transactions
summary: Get a Transaction Result by ID.
description: Get transaction result by the transaction result ID.
summary: Get a Transaction Result by transaction ID or scheduled transaction
ID.
description: "Get transaction result by the transaction's ID. If the transaction\
\ is a scheduled transaction, it can alternatively be retrieved by the scheduled\
\ transaction ID field returned by the system contract."
parameters:
- name: transaction_id
in: path
description: The transaction ID of the transaction result.
description: "The transaction ID of the transaction result, or id field of\
\ the scheduled transaction returned by the system contract."
required: true
style: simple
explode: false
schema:
$ref: "#/components/schemas/Identifier"
$ref: "#/components/schemas/transaction_id"
- name: block_id
in: query
description: A block ID optional parameter
Expand Down Expand Up @@ -2327,6 +2334,10 @@ components:
type: string
description: A 32-byte unique identifier for an entity.
format: hexadecimal
ScheduledTransactionId:
type: string
description: The ID of a scheduled transaction.
format: uint64
Signature:
type: string
description: A variable length signature.
Expand Down Expand Up @@ -2480,6 +2491,14 @@ components:
event_index: event_index
BlockId: BlockId
Height: Height
id:
oneOf:
- $ref: "#/components/schemas/Identifier"
- $ref: "#/components/schemas/ScheduledTransactionId"
transaction_id:
oneOf:
- $ref: "#/components/schemas/Identifier"
- $ref: "#/components/schemas/ScheduledTransactionId"
transactions_body:
required:
- arguments
Expand Down
14 changes: 7 additions & 7 deletions openapi/go-client-generated/api_transactions.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,10 @@ var (

type TransactionsApiService service
/*
TransactionsApiService Get a Transaction Result by ID.
Get transaction result by the transaction result ID.
TransactionsApiService Get a Transaction Result by transaction ID or scheduled transaction ID.
Get transaction result by the transaction's ID. If the transaction is a scheduled transaction, it can alternatively be retrieved by the scheduled transaction ID field returned by the system contract.
* @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
* @param transactionId The transaction ID of the transaction result.
* @param transactionId The transaction ID of the transaction result, or id field of the scheduled transaction returned by the system contract.
* @param optional nil or *TransactionsApiTransactionResultsTransactionIdGetOpts - Optional Parameters:
* @param "BlockId" (optional.Interface of string) - A block ID optional parameter
* @param "CollectionId" (optional.Interface of string) - A collection ID optional parameter.
Expand All @@ -51,7 +51,7 @@ type TransactionsApiTransactionResultsTransactionIdGetOpts struct {
IncludeExecutorMetadata optional.Bool
}

func (a *TransactionsApiService) TransactionResultsTransactionIdGet(ctx context.Context, transactionId string, localVarOptionals *TransactionsApiTransactionResultsTransactionIdGetOpts) (TransactionResult, *http.Response, error) {
func (a *TransactionsApiService) TransactionResultsTransactionIdGet(ctx context.Context, transactionId TransactionId, localVarOptionals *TransactionsApiTransactionResultsTransactionIdGetOpts) (TransactionResult, *http.Response, error) {
var (
localVarHttpMethod = strings.ToUpper("Get")
localVarPostBody interface{}
Expand Down Expand Up @@ -182,9 +182,9 @@ func (a *TransactionsApiService) TransactionResultsTransactionIdGet(ctx context.
}
/*
TransactionsApiService Get a Transaction by ID.
Get a transaction data by the provided transaction ID.
Get a transaction data by the provided transaction ID. If the transaction is a scheduled transaction, it can alternatively be retrieved by the scheduled transaction ID field returned by the system contract.
* @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
* @param id The ID of the transaction to get.
* @param id The ID of the transaction, or id field of the scheduled transaction returned by the system contract.
* @param optional nil or *TransactionsApiTransactionsIdGetOpts - Optional Parameters:
* @param "BlockId" (optional.Interface of string) - A block ID optional parameter
* @param "CollectionId" (optional.Interface of string) - A collection ID optional parameter.
Expand All @@ -200,7 +200,7 @@ type TransactionsApiTransactionsIdGetOpts struct {
Select_ optional.Interface
}

func (a *TransactionsApiService) TransactionsIdGet(ctx context.Context, id string, localVarOptionals *TransactionsApiTransactionsIdGetOpts) (Transaction, *http.Response, error) {
func (a *TransactionsApiService) TransactionsIdGet(ctx context.Context, id Id, localVarOptionals *TransactionsApiTransactionsIdGetOpts) (Transaction, *http.Response, error) {
var (
localVarHttpMethod = strings.ToUpper("Get")
localVarPostBody interface{}
Expand Down
8 changes: 8 additions & 0 deletions openapi/go-client-generated/docs/Id.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Id

## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------

[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

8 changes: 8 additions & 0 deletions openapi/go-client-generated/docs/TransactionId.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# TransactionId

## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------

[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

12 changes: 6 additions & 6 deletions openapi/go-client-generated/docs/TransactionsApi.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,22 +4,22 @@ All URIs are relative to *https://rest-testnet.onflow.org/v1*

Method | HTTP request | Description
------------- | ------------- | -------------
[**TransactionResultsTransactionIdGet**](TransactionsApi.md#TransactionResultsTransactionIdGet) | **Get** /transaction_results/{transaction_id} | Get a Transaction Result by ID.
[**TransactionResultsTransactionIdGet**](TransactionsApi.md#TransactionResultsTransactionIdGet) | **Get** /transaction_results/{transaction_id} | Get a Transaction Result by transaction ID or scheduled transaction ID.
[**TransactionsIdGet**](TransactionsApi.md#TransactionsIdGet) | **Get** /transactions/{id} | Get a Transaction by ID.
[**TransactionsPost**](TransactionsApi.md#TransactionsPost) | **Post** /transactions | Submit a Transaction

# **TransactionResultsTransactionIdGet**
> TransactionResult TransactionResultsTransactionIdGet(ctx, transactionId, optional)
Get a Transaction Result by ID.
Get a Transaction Result by transaction ID or scheduled transaction ID.

Get transaction result by the transaction result ID.
Get transaction result by the transaction's ID. If the transaction is a scheduled transaction, it can alternatively be retrieved by the scheduled transaction ID field returned by the system contract.

### Required Parameters

Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc.
**transactionId** | [**string**](.md)| The transaction ID of the transaction result. |
**transactionId** | [**TransactionId**](.md)| The transaction ID of the transaction result, or id field of the scheduled transaction returned by the system contract. |
**optional** | ***TransactionsApiTransactionResultsTransactionIdGetOpts** | optional parameters | nil if no parameters

### Optional Parameters
Expand Down Expand Up @@ -54,14 +54,14 @@ No authorization required
> Transaction TransactionsIdGet(ctx, id, optional)
Get a Transaction by ID.

Get a transaction data by the provided transaction ID.
Get a transaction data by the provided transaction ID. If the transaction is a scheduled transaction, it can alternatively be retrieved by the scheduled transaction ID field returned by the system contract.

### Required Parameters

Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc.
**id** | [**string**](.md)| The ID of the transaction to get. |
**id** | [**Id**](.md)| The ID of the transaction, or id field of the scheduled transaction returned by the system contract. |
**optional** | ***TransactionsApiTransactionsIdGetOpts** | optional parameters | nil if no parameters

### Optional Parameters
Expand Down
14 changes: 14 additions & 0 deletions openapi/go-client-generated/model_id.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
/*
* Access API
*
* No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
*
* API version: 1.0.0
* Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
*/
package swagger

type Id struct {
Identifier
ScheduledTransactionId
}
14 changes: 14 additions & 0 deletions openapi/go-client-generated/model_transaction_id.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
/*
* Access API
*
* No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
*
* API version: 1.0.0
* Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
*/
package swagger

type TransactionId struct {
Identifier
ScheduledTransactionId
}
27 changes: 27 additions & 0 deletions protobuf/flow/access/access.proto
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,14 @@ service AccessAPI {
rpc GetSystemTransactionResult(GetSystemTransactionResultRequest)
returns (TransactionResultResponse);

// GetScheduledTransaction gets a scheduled transaction body for a given callback ID
rpc GetScheduledTransaction(GetScheduledTransactionRequest)
returns (TransactionResponse);

// GetScheduledTransactionResult gets a scheduled transaction result for a given callback ID
rpc GetScheduledTransactionResult(GetScheduledTransactionResultRequest)
returns (TransactionResultResponse);

// Accounts

// GetAccount is an alias for GetAccountAtLatestBlock.
Expand Down Expand Up @@ -436,6 +444,25 @@ message GetSystemTransactionResultRequest {
bytes id = 4;
}

message GetScheduledTransactionRequest {
// id field of the scheduled transaction returned by the system contract.
uint64 id = 1;

// Execution state query parameters used for unsealed blocks. [optional]
entities.ExecutionStateQuery execution_state_query = 2;
}

message GetScheduledTransactionResultRequest {
// id field of the scheduled transaction returned by the system contract.
uint64 id = 1;

// Desired event payload encoding.
entities.EventEncodingVersion event_encoding_version = 2;

// Execution state query parameters used for unsealed blocks. [optional]
entities.ExecutionStateQuery execution_state_query = 3;
}

message GetTransactionByIndexRequest {
bytes block_id = 1;
uint32 index = 2;
Expand Down
Loading
Loading