diff --git a/openapi/experimental/go-client-generated/.swagger-codegen/VERSION b/openapi/experimental/go-client-generated/.swagger-codegen/VERSION index c6e7ea918..caa50679b 100644 --- a/openapi/experimental/go-client-generated/.swagger-codegen/VERSION +++ b/openapi/experimental/go-client-generated/.swagger-codegen/VERSION @@ -1 +1 @@ -3.0.75 \ No newline at end of file +3.0.78 \ No newline at end of file diff --git a/openapi/experimental/go-client-generated/README.md b/openapi/experimental/go-client-generated/README.md index 8978e2305..bcb9facad 100644 --- a/openapi/experimental/go-client-generated/README.md +++ b/openapi/experimental/go-client-generated/README.md @@ -24,6 +24,10 @@ Class | Method | HTTP request | Description *AccountsApi* | [**GetAccountFungibleTransfers**](docs/AccountsApi.md#getaccountfungibletransfers) | **Get** /experimental/v1/accounts/{address}/ft/transfers | Get account fungible token transfers *AccountsApi* | [**GetAccountNonFungibleTransfers**](docs/AccountsApi.md#getaccountnonfungibletransfers) | **Get** /experimental/v1/accounts/{address}/nft/transfers | Get account non-fungible token transfers *AccountsApi* | [**GetAccountTransactions**](docs/AccountsApi.md#getaccounttransactions) | **Get** /experimental/v1/accounts/{address}/transactions | Get account transactions +*AccountsApi* | [**GetScheduledTransactionsByAccount**](docs/AccountsApi.md#getscheduledtransactionsbyaccount) | **Get** /experimental/v1/accounts/{address}/scheduled | List scheduled transactions for an account +*ScheduledTransactionsApi* | [**GetScheduledTransactionByID**](docs/ScheduledTransactionsApi.md#getscheduledtransactionbyid) | **Get** /experimental/v1/scheduled/transaction/{id} | Get scheduled transaction by ID +*ScheduledTransactionsApi* | [**GetScheduledTransactions**](docs/ScheduledTransactionsApi.md#getscheduledtransactions) | **Get** /experimental/v1/scheduled | List scheduled transactions +*ScheduledTransactionsApi* | [**GetScheduledTransactionsByAccount**](docs/ScheduledTransactionsApi.md#getscheduledtransactionsbyaccount) | **Get** /experimental/v1/accounts/{address}/scheduled | List scheduled transactions for an account ## Documentation For Models @@ -32,6 +36,7 @@ Class | Method | HTTP request | Description - [AccountTransaction](docs/AccountTransaction.md) - [AccountTransactionExpandable](docs/AccountTransactionExpandable.md) - [AccountTransactionsResponse](docs/AccountTransactionsResponse.md) + - [Contract](docs/Contract.md) - [Event](docs/Event.md) - [FungibleTokenTransfer](docs/FungibleTokenTransfer.md) - [Links](docs/Links.md) @@ -39,6 +44,11 @@ Class | Method | HTTP request | Description - [NonFungibleTokenTransfer](docs/NonFungibleTokenTransfer.md) - [ProposalKey](docs/ProposalKey.md) - [Role](docs/Role.md) + - [ScheduledTransaction](docs/ScheduledTransaction.md) + - [ScheduledTransactionExpandable](docs/ScheduledTransactionExpandable.md) + - [ScheduledTransactionPriority](docs/ScheduledTransactionPriority.md) + - [ScheduledTransactionStatus](docs/ScheduledTransactionStatus.md) + - [ScheduledTransactionsResponse](docs/ScheduledTransactionsResponse.md) - [Transaction](docs/Transaction.md) - [TransactionExecution](docs/TransactionExecution.md) - [TransactionExpandable](docs/TransactionExpandable.md) diff --git a/openapi/experimental/go-client-generated/api/swagger.yaml b/openapi/experimental/go-client-generated/api/swagger.yaml index 87c3096b6..a61c68bec 100644 --- a/openapi/experimental/go-client-generated/api/swagger.yaml +++ b/openapi/experimental/go-client-generated/api/swagger.yaml @@ -13,6 +13,8 @@ servers: tags: - name: Accounts description: Endpoints for querying account-related data. +- name: ScheduledTransactions + description: Endpoints for querying scheduled transaction data. paths: /experimental/v1/accounts/{address}/transactions: get: @@ -105,12 +107,6 @@ paths: application/json: schema: $ref: "#/components/schemas/Error" - "412": - description: Precondition failed (account transaction index not initialized). - content: - application/json: - schema: - $ref: "#/components/schemas/Error" "429": description: Too many requests. content: @@ -233,12 +229,6 @@ paths: application/json: schema: $ref: "#/components/schemas/Error" - "412": - description: Precondition failed (account transfer index not initialized). - content: - application/json: - schema: - $ref: "#/components/schemas/Error" "429": description: Too many requests. content: @@ -361,196 +351,560 @@ paths: application/json: schema: $ref: "#/components/schemas/Error" - "412": - description: Precondition failed (account transfer index not initialized). - content: - application/json: - schema: - $ref: "#/components/schemas/Error" "429": description: Too many requests. content: application/json: schema: $ref: "#/components/schemas/Error" -components: - schemas: - AccountTransactionsResponse: - required: - - transactions - type: object - properties: - transactions: + /experimental/v1/scheduled: + get: + tags: + - ScheduledTransactions + summary: List scheduled transactions + description: | + Returns a paginated list of scheduled transactions, ordered descending by scheduled transaction identifier (newest first). + Results can be filtered by status, priority, time range, and transaction handler properties. + operationId: getScheduledTransactions + parameters: + - name: cursor + in: query + description: Opaque pagination cursor from a previous response's `next_cursor` + field. + required: false + style: form + explode: true + schema: + $ref: "#/components/schemas/Cursor" + - name: limit + in: query + description: The maximum number of results to return. + required: false + style: form + explode: true + schema: + maximum: 200 + minimum: 1 + type: integer + default: 50 + - name: statuses + in: query + description: A comma-separated list of scheduled transaction statuses to filter + by. + required: false + style: form + explode: false + schema: + minItems: 1 + uniqueItems: true type: array items: - $ref: "#/components/schemas/AccountTransaction" - next_cursor: - $ref: "#/components/schemas/Cursor" - example: - next_cursor: next_cursor - transactions: - - transaction_id: transaction_id - result: null - _links: null - roles: - - authorizer - - authorizer - block_height: block_height - transaction_index: transaction_index - _expandable: - result: http://example.com/aeiou - transaction: http://example.com/aeiou - transaction: - _links: null - reference_block_id: null - payer: payer - script: script - result: - collection_id: null - error_message: error_message - execution: Pending - status_code: 0 - _links: - _self: _self - block_id: null - computation_used: computation_used - events: - - transaction_id: null - payload: "" - transaction_index: transaction_index - type: type - event_index: event_index - - transaction_id: null - payload: "" - transaction_index: transaction_index - type: type - event_index: event_index - status: Pending - envelope_signatures: - - null - - null - gas_limit: gas_limit - payload_signatures: - - address: null - signature: "" - key_index: key_index - - address: null - signature: "" - key_index: key_index - arguments: - - "" - - "" - id: null - authorizers: - - null - - null - _expandable: - result: http://example.com/aeiou - proposal_key: - sequence_number: sequence_number - address: null - key_index: key_index - timestamp: 2000-01-23T04:56:07.000+00:00 - - transaction_id: transaction_id - result: null - _links: null - roles: - - authorizer - - authorizer - block_height: block_height - transaction_index: transaction_index - _expandable: - result: http://example.com/aeiou - transaction: http://example.com/aeiou - transaction: - _links: null - reference_block_id: null - payer: payer - script: script - result: - collection_id: null - error_message: error_message - execution: Pending - status_code: 0 - _links: - _self: _self - block_id: null - computation_used: computation_used - events: - - transaction_id: null - payload: "" - transaction_index: transaction_index - type: type - event_index: event_index - - transaction_id: null - payload: "" - transaction_index: transaction_index - type: type - event_index: event_index - status: Pending - envelope_signatures: - - null - - null - gas_limit: gas_limit - payload_signatures: - - address: null - signature: "" - key_index: key_index - - address: null - signature: "" - key_index: key_index - arguments: - - "" - - "" - id: null - authorizers: - - null - - null - _expandable: - result: http://example.com/aeiou - proposal_key: - sequence_number: sequence_number - address: null - key_index: key_index - timestamp: 2000-01-23T04:56:07.000+00:00 - AccountTransaction: - required: - - _expandable - - block_height - - roles - - timestamp - - transaction_id - - transaction_index - type: object - properties: - block_height: + $ref: "#/components/schemas/ScheduledTransactionStatus" + - name: priority + in: query + description: Filter by scheduled transaction priority. + required: false + style: form + explode: true + schema: + $ref: "#/components/schemas/ScheduledTransactionPriority" + - name: start_time + in: query + description: "Filter to include only scheduled transactions with a scheduled\ + \ time at or after this value (inclusive, RFC 3339)." + required: false + style: form + explode: true + schema: type: string - description: Block height where the transaction was included. - format: uint64 - timestamp: + format: date-time + - name: end_time + in: query + description: "Filter to include only scheduled transactions with a scheduled\ + \ time at or before this value (inclusive, RFC 3339)." + required: false + style: form + explode: true + schema: type: string - description: Timestamp of the block where the transaction was included. format: date-time - transaction_id: - $ref: "#/components/schemas/Identifier" - transaction_index: + - name: handler_owner + in: query + description: Filter by the address of the account that owns the transaction + handler. + required: false + style: form + explode: true + schema: + $ref: "#/components/schemas/Address" + - name: handler_type_identifier + in: query + description: Filter by the Cadence type identifier of the transaction handler + (e.g. `A.1654653399040a61.MyScheduler.Handler`). + required: false + style: form + explode: true + schema: type: string - description: Index of the transaction within the block. - format: uint32 - roles: + - name: handler_uuid + in: query + description: Filter by the UUID of the transaction handler resource. + required: false + style: form + explode: true + schema: + type: string + format: uint64 + - name: expand + in: query + description: A comma-separated list indicating which properties of the content + to expand. + required: false + style: form + explode: false + schema: + minItems: 1 + uniqueItems: true type: array items: type: string - enum: - - authorizer - - payer - - proposer - - interacted - transaction: - $ref: "#/components/schemas/Transaction" - result: - $ref: "#/components/schemas/TransactionResult" - _expandable: + - name: select + in: query + description: A comma-separated list indicating which properties of the content + to return. + required: false + style: form + explode: false + schema: + minItems: 1 + uniqueItems: true + type: array + items: + type: string + responses: + "200": + description: A page of scheduled transactions. + content: + application/json: + schema: + $ref: "#/components/schemas/ScheduledTransactionsResponse" + "400": + description: "Bad request (invalid filter parameters, cursor, or limit)." + content: + application/json: + schema: + $ref: "#/components/schemas/Error" + "429": + description: Too many requests. + content: + application/json: + schema: + $ref: "#/components/schemas/Error" + /experimental/v1/scheduled/transaction/{id}: + get: + tags: + - ScheduledTransactions + summary: Get scheduled transaction by ID + description: Returns the scheduled transaction with the given ID. + operationId: getScheduledTransactionByID + parameters: + - name: id + in: path + description: The scheduled transaction identifier (hex-encoded). + required: true + style: simple + explode: false + schema: + $ref: "#/components/schemas/Identifier" + - name: expand + in: query + description: A comma-separated list indicating which properties of the content + to expand. + required: false + style: form + explode: false + schema: + minItems: 1 + uniqueItems: true + type: array + items: + type: string + - name: select + in: query + description: A comma-separated list indicating which properties of the content + to return. + required: false + style: form + explode: false + schema: + minItems: 1 + uniqueItems: true + type: array + items: + type: string + responses: + "200": + description: The scheduled transaction. + content: + application/json: + schema: + $ref: "#/components/schemas/ScheduledTransaction" + "400": + description: Bad request (invalid transaction ID). + content: + application/json: + schema: + $ref: "#/components/schemas/Error" + "404": + description: No scheduled transaction found for the given ID. + content: + application/json: + schema: + $ref: "#/components/schemas/Error" + "429": + description: Too many requests. + content: + application/json: + schema: + $ref: "#/components/schemas/Error" + /experimental/v1/accounts/{address}/scheduled: + get: + tags: + - ScheduledTransactions + - Accounts + summary: List scheduled transactions for an account + description: | + Returns a paginated list of scheduled transactions associated with the given account address, + ordered descending by scheduled time (newest first). + Results can be filtered by status, priority, time range, and transaction handler properties. + operationId: getScheduledTransactionsByAccount + parameters: + - name: address + in: path + description: The account address (hex-encoded without 0x prefix). + required: true + style: simple + explode: false + schema: + $ref: "#/components/schemas/Address" + - name: cursor + in: query + description: Opaque pagination cursor from a previous response's `next_cursor` + field. + required: false + style: form + explode: true + schema: + $ref: "#/components/schemas/Cursor" + - name: limit + in: query + description: The maximum number of results to return. + required: false + style: form + explode: true + schema: + maximum: 200 + minimum: 1 + type: integer + default: 50 + - name: statuses + in: query + description: A comma-separated list of scheduled transaction statuses to filter + by. + required: false + style: form + explode: false + schema: + minItems: 1 + uniqueItems: true + type: array + items: + $ref: "#/components/schemas/ScheduledTransactionStatus" + - name: priority + in: query + description: Filter by scheduled transaction priority. + required: false + style: form + explode: true + schema: + $ref: "#/components/schemas/ScheduledTransactionPriority" + - name: start_time + in: query + description: "Filter to include only scheduled transactions with a scheduled\ + \ time at or after this value (inclusive, RFC 3339)." + required: false + style: form + explode: true + schema: + type: string + format: date-time + - name: end_time + in: query + description: "Filter to include only scheduled transactions with a scheduled\ + \ time at or before this value (inclusive, RFC 3339)." + required: false + style: form + explode: true + schema: + type: string + format: date-time + - name: handler_owner + in: query + description: Filter by the address of the account that owns the transaction + handler. + required: false + style: form + explode: true + schema: + $ref: "#/components/schemas/Address" + - name: handler_type_identifier + in: query + description: Filter by the Cadence type identifier of the transaction handler + (e.g. `A.1654653399040a61.MyScheduler.Handler`). + required: false + style: form + explode: true + schema: + type: string + - name: handler_uuid + in: query + description: Filter by the UUID of the transaction handler resource. + required: false + style: form + explode: true + schema: + type: string + format: uint64 + - name: expand + in: query + description: A comma-separated list indicating which properties of the content + to expand. + required: false + style: form + explode: false + schema: + minItems: 1 + uniqueItems: true + type: array + items: + type: string + - name: select + in: query + description: A comma-separated list indicating which properties of the content + to return. + required: false + style: form + explode: false + schema: + minItems: 1 + uniqueItems: true + type: array + items: + type: string + responses: + "200": + description: A page of scheduled transactions. + content: + application/json: + schema: + $ref: "#/components/schemas/ScheduledTransactionsResponse" + "400": + description: "Bad request (invalid address, filter parameters, cursor, or\ + \ limit)." + content: + application/json: + schema: + $ref: "#/components/schemas/Error" + "404": + description: No account found for the given address. + content: + application/json: + schema: + $ref: "#/components/schemas/Error" + "429": + description: Too many requests. + content: + application/json: + schema: + $ref: "#/components/schemas/Error" +components: + schemas: + AccountTransactionsResponse: + required: + - transactions + type: object + properties: + transactions: + type: array + items: + $ref: "#/components/schemas/AccountTransaction" + next_cursor: + $ref: "#/components/schemas/Cursor" + example: + next_cursor: next_cursor + transactions: + - transaction_id: transaction_id + result: null + _links: null + roles: + - authorizer + - authorizer + block_height: block_height + transaction_index: transaction_index + _expandable: + result: http://example.com/aeiou + transaction: http://example.com/aeiou + transaction: + _links: null + reference_block_id: null + payer: payer + script: script + result: + collection_id: null + error_message: error_message + execution: Pending + status_code: 0 + _links: + _self: _self + block_id: null + computation_used: computation_used + events: + - transaction_id: null + payload: "" + transaction_index: transaction_index + type: type + event_index: event_index + - transaction_id: null + payload: "" + transaction_index: transaction_index + type: type + event_index: event_index + status: Pending + envelope_signatures: + - null + - null + gas_limit: gas_limit + payload_signatures: + - address: null + signature: "" + key_index: key_index + - address: null + signature: "" + key_index: key_index + arguments: + - "" + - "" + id: null + authorizers: + - null + - null + _expandable: + result: http://example.com/aeiou + proposal_key: + sequence_number: sequence_number + address: null + key_index: key_index + timestamp: 2000-01-23T04:56:07.000+00:00 + - transaction_id: transaction_id + result: null + _links: null + roles: + - authorizer + - authorizer + block_height: block_height + transaction_index: transaction_index + _expandable: + result: http://example.com/aeiou + transaction: http://example.com/aeiou + transaction: + _links: null + reference_block_id: null + payer: payer + script: script + result: + collection_id: null + error_message: error_message + execution: Pending + status_code: 0 + _links: + _self: _self + block_id: null + computation_used: computation_used + events: + - transaction_id: null + payload: "" + transaction_index: transaction_index + type: type + event_index: event_index + - transaction_id: null + payload: "" + transaction_index: transaction_index + type: type + event_index: event_index + status: Pending + envelope_signatures: + - null + - null + gas_limit: gas_limit + payload_signatures: + - address: null + signature: "" + key_index: key_index + - address: null + signature: "" + key_index: key_index + arguments: + - "" + - "" + id: null + authorizers: + - null + - null + _expandable: + result: http://example.com/aeiou + proposal_key: + sequence_number: sequence_number + address: null + key_index: key_index + timestamp: 2000-01-23T04:56:07.000+00:00 + AccountTransaction: + required: + - _expandable + - block_height + - roles + - timestamp + - transaction_id + - transaction_index + type: object + properties: + block_height: + type: string + description: Block height where the transaction was included. + format: uint64 + timestamp: + type: string + description: Timestamp of the block where the transaction was included. + format: date-time + transaction_id: + $ref: "#/components/schemas/Identifier" + transaction_index: + type: string + description: Index of the transaction within the block. + format: uint32 + roles: + type: array + items: + type: string + enum: + - authorizer + - payer + - proposer + - interacted + transaction: + $ref: "#/components/schemas/Transaction" + result: + $ref: "#/components/schemas/TransactionResult" + _expandable: $ref: "#/components/schemas/AccountTransaction__expandable" _links: $ref: "#/components/schemas/Links" @@ -906,14 +1260,201 @@ components: transfers: type: array items: - $ref: "#/components/schemas/FungibleTokenTransfer" + $ref: "#/components/schemas/FungibleTokenTransfer" + next_cursor: + $ref: "#/components/schemas/Cursor" + example: + next_cursor: next_cursor + transfers: + - transaction_id: transaction_id + amount: amount + _links: + _self: _self + event_indices: + - event_indices + - event_indices + block_height: block_height + transaction_index: transaction_index + recipient_address: null + token_type: token_type + result: + collection_id: null + error_message: error_message + execution: Pending + status_code: 0 + _links: + _self: _self + block_id: null + computation_used: computation_used + events: + - transaction_id: null + payload: "" + transaction_index: transaction_index + type: type + event_index: event_index + - transaction_id: null + payload: "" + transaction_index: transaction_index + type: type + event_index: event_index + status: Pending + source_address: source_address + _expandable: + result: http://example.com/aeiou + transaction: http://example.com/aeiou + transaction: + _links: null + reference_block_id: null + payer: payer + script: script + result: + collection_id: null + error_message: error_message + execution: Pending + status_code: 0 + _links: + _self: _self + block_id: null + computation_used: computation_used + events: + - transaction_id: null + payload: "" + transaction_index: transaction_index + type: type + event_index: event_index + - transaction_id: null + payload: "" + transaction_index: transaction_index + type: type + event_index: event_index + status: Pending + envelope_signatures: + - null + - null + gas_limit: gas_limit + payload_signatures: + - address: null + signature: "" + key_index: key_index + - address: null + signature: "" + key_index: key_index + arguments: + - "" + - "" + id: null + authorizers: + - null + - null + _expandable: + result: http://example.com/aeiou + proposal_key: + sequence_number: sequence_number + address: null + key_index: key_index + timestamp: 2000-01-23T04:56:07.000+00:00 + - transaction_id: transaction_id + amount: amount + _links: + _self: _self + event_indices: + - event_indices + - event_indices + block_height: block_height + transaction_index: transaction_index + recipient_address: null + token_type: token_type + result: + collection_id: null + error_message: error_message + execution: Pending + status_code: 0 + _links: + _self: _self + block_id: null + computation_used: computation_used + events: + - transaction_id: null + payload: "" + transaction_index: transaction_index + type: type + event_index: event_index + - transaction_id: null + payload: "" + transaction_index: transaction_index + type: type + event_index: event_index + status: Pending + source_address: source_address + _expandable: + result: http://example.com/aeiou + transaction: http://example.com/aeiou + transaction: + _links: null + reference_block_id: null + payer: payer + script: script + result: + collection_id: null + error_message: error_message + execution: Pending + status_code: 0 + _links: + _self: _self + block_id: null + computation_used: computation_used + events: + - transaction_id: null + payload: "" + transaction_index: transaction_index + type: type + event_index: event_index + - transaction_id: null + payload: "" + transaction_index: transaction_index + type: type + event_index: event_index + status: Pending + envelope_signatures: + - null + - null + gas_limit: gas_limit + payload_signatures: + - address: null + signature: "" + key_index: key_index + - address: null + signature: "" + key_index: key_index + arguments: + - "" + - "" + id: null + authorizers: + - null + - null + _expandable: + result: http://example.com/aeiou + proposal_key: + sequence_number: sequence_number + address: null + key_index: key_index + timestamp: 2000-01-23T04:56:07.000+00:00 + AccountNonFungibleTransfersResponse: + required: + - transfers + type: object + properties: + transfers: + type: array + items: + $ref: "#/components/schemas/NonFungibleTokenTransfer" next_cursor: $ref: "#/components/schemas/Cursor" example: next_cursor: next_cursor transfers: - transaction_id: transaction_id - amount: amount _links: _self: _self event_indices: @@ -944,6 +1485,7 @@ components: type: type event_index: event_index status: Pending + nft_id: nft_id source_address: source_address _expandable: result: http://example.com/aeiou @@ -998,20 +1540,8 @@ components: sequence_number: sequence_number address: null key_index: key_index - events: - - transaction_id: null - payload: "" - transaction_index: transaction_index - type: type - event_index: event_index - - transaction_id: null - payload: "" - transaction_index: transaction_index - type: type - event_index: event_index timestamp: 2000-01-23T04:56:07.000+00:00 - transaction_id: transaction_id - amount: amount _links: _self: _self event_indices: @@ -1042,6 +1572,7 @@ components: type: type event_index: event_index status: Pending + nft_id: nft_id source_address: source_address _expandable: result: http://example.com/aeiou @@ -1096,6 +1627,222 @@ components: sequence_number: sequence_number address: null key_index: key_index + timestamp: 2000-01-23T04:56:07.000+00:00 + FungibleTokenTransfer: + required: + - _expandable + - amount + - block_height + - event_indices + - recipient_address + - source_address + - timestamp + - token_type + - transaction_id + - transaction_index + type: object + properties: + transaction_id: + $ref: "#/components/schemas/Identifier" + block_height: + type: string + description: Block height where the transfer was included. + format: uint64 + timestamp: + type: string + description: Timestamp of the block where the transfer was included. + format: date-time + transaction_index: + type: string + description: Index of the transaction within the block. + format: uint32 + event_indices: + type: array + description: Indices of the events within the transaction that represent + this transfer. + items: + type: string + format: uint32 + token_type: + type: string + description: Fully qualified token type identifier (e.g. `A.1654653399040a61.FlowToken`). + amount: + type: string + description: "Amount of tokens transferred, as a decimal string." + source_address: + $ref: "#/components/schemas/Address" + recipient_address: + $ref: "#/components/schemas/Address" + transaction: + $ref: "#/components/schemas/Transaction" + result: + $ref: "#/components/schemas/TransactionResult" + _expandable: + $ref: "#/components/schemas/AccountTransaction__expandable" + _links: + $ref: "#/components/schemas/Links" + example: + transaction_id: transaction_id + amount: amount + _links: + _self: _self + event_indices: + - event_indices + - event_indices + block_height: block_height + transaction_index: transaction_index + recipient_address: null + token_type: token_type + result: + collection_id: null + error_message: error_message + execution: Pending + status_code: 0 + _links: + _self: _self + block_id: null + computation_used: computation_used + events: + - transaction_id: null + payload: "" + transaction_index: transaction_index + type: type + event_index: event_index + - transaction_id: null + payload: "" + transaction_index: transaction_index + type: type + event_index: event_index + status: Pending + source_address: source_address + _expandable: + result: http://example.com/aeiou + transaction: http://example.com/aeiou + transaction: + _links: null + reference_block_id: null + payer: payer + script: script + result: + collection_id: null + error_message: error_message + execution: Pending + status_code: 0 + _links: + _self: _self + block_id: null + computation_used: computation_used + events: + - transaction_id: null + payload: "" + transaction_index: transaction_index + type: type + event_index: event_index + - transaction_id: null + payload: "" + transaction_index: transaction_index + type: type + event_index: event_index + status: Pending + envelope_signatures: + - null + - null + gas_limit: gas_limit + payload_signatures: + - address: null + signature: "" + key_index: key_index + - address: null + signature: "" + key_index: key_index + arguments: + - "" + - "" + id: null + authorizers: + - null + - null + _expandable: + result: http://example.com/aeiou + proposal_key: + sequence_number: sequence_number + address: null + key_index: key_index + timestamp: 2000-01-23T04:56:07.000+00:00 + NonFungibleTokenTransfer: + required: + - _expandable + - block_height + - event_indices + - nft_id + - recipient_address + - source_address + - timestamp + - token_type + - transaction_id + - transaction_index + type: object + properties: + transaction_id: + $ref: "#/components/schemas/Identifier" + block_height: + type: string + description: Block height where the transfer was included. + format: uint64 + timestamp: + type: string + description: Timestamp of the block where the transfer was included. + format: date-time + transaction_index: + type: string + description: Index of the transaction within the block. + format: uint32 + event_indices: + type: array + description: Indices of the events within the transaction that represent + this transfer. + items: + type: string + format: uint32 + token_type: + type: string + description: Fully qualified NFT collection type (e.g. `A.1654653399040a61.MyNFT`). + nft_id: + type: string + description: Unique identifier of the NFT within its collection. + format: uint64 + source_address: + $ref: "#/components/schemas/Address" + recipient_address: + $ref: "#/components/schemas/Address" + transaction: + $ref: "#/components/schemas/Transaction" + result: + $ref: "#/components/schemas/TransactionResult" + _expandable: + $ref: "#/components/schemas/AccountTransaction__expandable" + _links: + $ref: "#/components/schemas/Links" + example: + transaction_id: transaction_id + _links: + _self: _self + event_indices: + - event_indices + - event_indices + block_height: block_height + transaction_index: transaction_index + recipient_address: null + token_type: token_type + result: + collection_id: null + error_message: error_message + execution: Pending + status_code: 0 + _links: + _self: _self + block_id: null + computation_used: computation_used events: - transaction_id: null payload: "" @@ -1107,31 +1854,17 @@ components: transaction_index: transaction_index type: type event_index: event_index - timestamp: 2000-01-23T04:56:07.000+00:00 - AccountNonFungibleTransfersResponse: - required: - - transfers - type: object - properties: - transfers: - type: array - items: - $ref: "#/components/schemas/NonFungibleTokenTransfer" - next_cursor: - $ref: "#/components/schemas/Cursor" - example: - next_cursor: next_cursor - transfers: - - transaction_id: transaction_id - _links: - _self: _self - event_indices: - - event_indices - - event_indices - block_height: block_height - transaction_index: transaction_index - recipient_address: null - token_type: token_type + status: Pending + nft_id: nft_id + source_address: source_address + _expandable: + result: http://example.com/aeiou + transaction: http://example.com/aeiou + transaction: + _links: null + reference_block_id: null + payer: payer + script: script result: collection_id: null error_message: error_message @@ -1153,83 +1886,56 @@ components: type: type event_index: event_index status: Pending - nft_id: nft_id - source_address: source_address + envelope_signatures: + - null + - null + gas_limit: gas_limit + payload_signatures: + - address: null + signature: "" + key_index: key_index + - address: null + signature: "" + key_index: key_index + arguments: + - "" + - "" + id: null + authorizers: + - null + - null _expandable: result: http://example.com/aeiou - transaction: http://example.com/aeiou - transaction: - _links: null - reference_block_id: null - payer: payer - script: script - result: - collection_id: null - error_message: error_message - execution: Pending - status_code: 0 - _links: - _self: _self - block_id: null - computation_used: computation_used - events: - - transaction_id: null - payload: "" - transaction_index: transaction_index - type: type - event_index: event_index - - transaction_id: null - payload: "" - transaction_index: transaction_index - type: type - event_index: event_index - status: Pending - envelope_signatures: - - null - - null - gas_limit: gas_limit - payload_signatures: - - address: null - signature: "" - key_index: key_index - - address: null - signature: "" - key_index: key_index - arguments: - - "" - - "" - id: null - authorizers: - - null - - null - _expandable: - result: http://example.com/aeiou - proposal_key: - sequence_number: sequence_number - address: null - key_index: key_index - events: - - transaction_id: null - payload: "" - transaction_index: transaction_index - type: type - event_index: event_index - - transaction_id: null - payload: "" - transaction_index: transaction_index - type: type - event_index: event_index - timestamp: 2000-01-23T04:56:07.000+00:00 - - transaction_id: transaction_id + proposal_key: + sequence_number: sequence_number + address: null + key_index: key_index + timestamp: 2000-01-23T04:56:07.000+00:00 + TransferRole: + type: string + enum: + - sender + - recipient + ScheduledTransactionsResponse: + required: + - scheduled_transactions + type: object + properties: + scheduled_transactions: + type: array + items: + $ref: "#/components/schemas/ScheduledTransaction" + next_cursor: + $ref: "#/components/schemas/Cursor" + example: + scheduled_transactions: + - fees: fees + fees_deducted: fees_deducted + transaction_handler_public_path: transaction_handler_public_path _links: _self: _self - event_indices: - - event_indices - - event_indices - block_height: block_height - transaction_index: transaction_index - recipient_address: null - token_type: token_type + priority: low + created_transaction_id: created_transaction_id result: collection_id: null error_message: error_message @@ -1251,11 +1957,21 @@ components: type: type event_index: event_index status: Pending - nft_id: nft_id - source_address: source_address + transaction_handler_type_identifier: transaction_handler_type_identifier + execution_effort: execution_effort + transaction_handler_owner: transaction_handler_owner + transaction_handler_uuid: transaction_handler_uuid + cancelled_transaction_id: null + id: id + executed_transaction_id: null + handler_contract: + identifier: identifier + body: body _expandable: result: http://example.com/aeiou + handler_contract: http://example.com/aeiou transaction: http://example.com/aeiou + fees_returned: fees_returned transaction: _links: null reference_block_id: null @@ -1304,119 +2020,17 @@ components: result: http://example.com/aeiou proposal_key: sequence_number: sequence_number - address: null - key_index: key_index - events: - - transaction_id: null - payload: "" - transaction_index: transaction_index - type: type - event_index: event_index - - transaction_id: null - payload: "" - transaction_index: transaction_index - type: type - event_index: event_index - timestamp: 2000-01-23T04:56:07.000+00:00 - FungibleTokenTransfer: - required: - - _expandable - - amount - - block_height - - event_indices - - recipient_address - - source_address - - timestamp - - token_type - - transaction_id - - transaction_index - type: object - properties: - transaction_id: - $ref: "#/components/schemas/Identifier" - block_height: - type: string - description: Block height where the transfer was included. - format: uint64 - timestamp: - type: string - description: Timestamp of the block where the transfer was included. - format: date-time - transaction_index: - type: string - description: Index of the transaction within the block. - format: uint32 - event_indices: - type: array - description: Indices of the events within the transaction that represent - this transfer. - items: - type: string - format: uint32 - token_type: - type: string - description: Fully qualified token type identifier (e.g. `A.1654653399040a61.FlowToken`). - amount: - type: string - description: "Amount of tokens transferred, as a decimal string." - source_address: - $ref: "#/components/schemas/Address" - recipient_address: - $ref: "#/components/schemas/Address" - transaction: - $ref: "#/components/schemas/Transaction" - result: - $ref: "#/components/schemas/TransactionResult" - events: - type: array - items: - $ref: "#/components/schemas/Event" - _expandable: - $ref: "#/components/schemas/AccountTransaction__expandable" - _links: - $ref: "#/components/schemas/Links" - example: - transaction_id: transaction_id - amount: amount - _links: - _self: _self - event_indices: - - event_indices - - event_indices - block_height: block_height - transaction_index: transaction_index - recipient_address: null - token_type: token_type - result: - collection_id: null - error_message: error_message - execution: Pending - status_code: 0 + address: null + key_index: key_index + status: scheduled + timestamp: timestamp + - fees: fees + fees_deducted: fees_deducted + transaction_handler_public_path: transaction_handler_public_path _links: _self: _self - block_id: null - computation_used: computation_used - events: - - transaction_id: null - payload: "" - transaction_index: transaction_index - type: type - event_index: event_index - - transaction_id: null - payload: "" - transaction_index: transaction_index - type: type - event_index: event_index - status: Pending - source_address: source_address - _expandable: - result: http://example.com/aeiou - transaction: http://example.com/aeiou - transaction: - _links: null - reference_block_id: null - payer: payer - script: script + priority: low + created_transaction_id: created_transaction_id result: collection_id: null error_message: error_message @@ -1438,111 +2052,149 @@ components: type: type event_index: event_index status: Pending - envelope_signatures: - - null - - null - gas_limit: gas_limit - payload_signatures: - - address: null - signature: "" - key_index: key_index - - address: null - signature: "" - key_index: key_index - arguments: - - "" - - "" - id: null - authorizers: - - null - - null + transaction_handler_type_identifier: transaction_handler_type_identifier + execution_effort: execution_effort + transaction_handler_owner: transaction_handler_owner + transaction_handler_uuid: transaction_handler_uuid + cancelled_transaction_id: null + id: id + executed_transaction_id: null + handler_contract: + identifier: identifier + body: body _expandable: result: http://example.com/aeiou - proposal_key: - sequence_number: sequence_number - address: null - key_index: key_index - events: - - transaction_id: null - payload: "" - transaction_index: transaction_index - type: type - event_index: event_index - - transaction_id: null - payload: "" - transaction_index: transaction_index - type: type - event_index: event_index - timestamp: 2000-01-23T04:56:07.000+00:00 - NonFungibleTokenTransfer: + handler_contract: http://example.com/aeiou + transaction: http://example.com/aeiou + fees_returned: fees_returned + transaction: + _links: null + reference_block_id: null + payer: payer + script: script + result: + collection_id: null + error_message: error_message + execution: Pending + status_code: 0 + _links: + _self: _self + block_id: null + computation_used: computation_used + events: + - transaction_id: null + payload: "" + transaction_index: transaction_index + type: type + event_index: event_index + - transaction_id: null + payload: "" + transaction_index: transaction_index + type: type + event_index: event_index + status: Pending + envelope_signatures: + - null + - null + gas_limit: gas_limit + payload_signatures: + - address: null + signature: "" + key_index: key_index + - address: null + signature: "" + key_index: key_index + arguments: + - "" + - "" + id: null + authorizers: + - null + - null + _expandable: + result: http://example.com/aeiou + proposal_key: + sequence_number: sequence_number + address: null + key_index: key_index + status: scheduled + timestamp: timestamp + next_cursor: next_cursor + ScheduledTransaction: required: - _expandable - - block_height - - event_indices - - nft_id - - recipient_address - - source_address + - created_transaction_id + - execution_effort + - fees + - id + - priority + - status - timestamp - - token_type - - transaction_id - - transaction_index + - transaction_handler_owner + - transaction_handler_type_identifier + - transaction_handler_uuid type: object properties: - transaction_id: - $ref: "#/components/schemas/Identifier" - block_height: + id: type: string - description: Block height where the transfer was included. + description: Scheduler-assigned uint64 identifier. format: uint64 + status: + $ref: "#/components/schemas/ScheduledTransactionStatus" + priority: + $ref: "#/components/schemas/ScheduledTransactionPriority" timestamp: type: string - description: Timestamp of the block where the transfer was included. - format: date-time - transaction_index: + description: Scheduled execution timestamp as a UFix64 decimal string. + execution_effort: type: string - description: Index of the transaction within the block. - format: uint32 - event_indices: - type: array - description: Indices of the events within the transaction that represent - this transfer. - items: - type: string - format: uint32 - token_type: + description: Execution effort estimate as a UFix64 decimal string. + fees: type: string - description: Fully qualified NFT collection type (e.g. `A.1654653399040a61.MyNFT`). - nft_id: + description: Scheduled fee as a UFix64 decimal string. + transaction_handler_owner: + $ref: "#/components/schemas/Address" + transaction_handler_type_identifier: type: string - description: Unique identifier of the NFT within its collection. + description: Fully qualified Cadence type identifier of the transaction + handler (e.g. `A.1654653399040a61.MyScheduler.Handler`). + transaction_handler_uuid: + type: string + description: Resource UUID of the transaction handler. format: uint64 - source_address: - $ref: "#/components/schemas/Address" - recipient_address: - $ref: "#/components/schemas/Address" + transaction_handler_public_path: + type: string + description: "Public path of the transaction handler, if set." + fees_returned: + type: string + description: "Fees returned on cancellation, as a UFix64 decimal string." + fees_deducted: + type: string + description: "Fees deducted on cancellation, as a UFix64 decimal string." + created_transaction_id: + $ref: "#/components/schemas/Identifier" + executed_transaction_id: + $ref: "#/components/schemas/Identifier" + cancelled_transaction_id: + $ref: "#/components/schemas/Identifier" transaction: $ref: "#/components/schemas/Transaction" result: $ref: "#/components/schemas/TransactionResult" - events: - type: array - items: - $ref: "#/components/schemas/Event" + handler_contract: + $ref: "#/components/schemas/Contract" _expandable: - $ref: "#/components/schemas/AccountTransaction__expandable" + $ref: "#/components/schemas/ScheduledTransaction__expandable" _links: $ref: "#/components/schemas/Links" example: - transaction_id: transaction_id + fees: fees + fees_deducted: fees_deducted + transaction_handler_public_path: transaction_handler_public_path _links: _self: _self - event_indices: - - event_indices - - event_indices - block_height: block_height - transaction_index: transaction_index - recipient_address: null - token_type: token_type + priority: low + created_transaction_id: created_transaction_id result: collection_id: null error_message: error_message @@ -1564,11 +2216,21 @@ components: type: type event_index: event_index status: Pending - nft_id: nft_id - source_address: source_address + transaction_handler_type_identifier: transaction_handler_type_identifier + execution_effort: execution_effort + transaction_handler_owner: transaction_handler_owner + transaction_handler_uuid: transaction_handler_uuid + cancelled_transaction_id: null + id: id + executed_transaction_id: null + handler_contract: + identifier: identifier + body: body _expandable: result: http://example.com/aeiou + handler_contract: http://example.com/aeiou transaction: http://example.com/aeiou + fees_returned: fees_returned transaction: _links: null reference_block_id: null @@ -1619,23 +2281,38 @@ components: sequence_number: sequence_number address: null key_index: key_index - events: - - transaction_id: null - payload: "" - transaction_index: transaction_index - type: type - event_index: event_index - - transaction_id: null - payload: "" - transaction_index: transaction_index - type: type - event_index: event_index - timestamp: 2000-01-23T04:56:07.000+00:00 - TransferRole: + status: scheduled + timestamp: timestamp + Contract: + required: + - body + - identifier + type: object + properties: + identifier: + type: string + description: Unique identifier for the contract (e.g. `A.1654653399040a61.MyContract`). + body: + type: string + description: Full source code of the contract. + example: + identifier: identifier + body: body + ScheduledTransactionStatus: type: string + description: The current lifecycle status of a scheduled transaction. enum: - - sender - - recipient + - scheduled + - executed + - cancelled + - failed + ScheduledTransactionPriority: + type: string + description: The execution priority of a scheduled transaction. + enum: + - low + - medium + - high Error: required: - code @@ -1671,6 +2348,29 @@ components: format: uri example: result: http://example.com/aeiou + ScheduledTransaction__expandable: + type: object + properties: + transaction: + type: string + description: Link to fetch the full transaction body. + format: uri + result: + type: string + description: Link to fetch the transaction result. + format: uri + handler_contract: + type: string + description: Link to fetch the Cadence contract that implements the transaction + handler. + format: uri + description: "Contains URI links for fields not included in the response. When\ + \ a field is expanded via the `expand` query parameter, it appears inline\ + \ and is removed from `_expandable`." + example: + result: http://example.com/aeiou + handler_contract: http://example.com/aeiou + transaction: http://example.com/aeiou parameters: cursorParam: name: cursor @@ -1768,3 +2468,78 @@ components: explode: true schema: $ref: "#/components/schemas/TransferRole" + scheduledStatusesParam: + name: statuses + in: query + description: A comma-separated list of scheduled transaction statuses to filter + by. + required: false + style: form + explode: false + schema: + minItems: 1 + uniqueItems: true + type: array + items: + $ref: "#/components/schemas/ScheduledTransactionStatus" + priorityParam: + name: priority + in: query + description: Filter by scheduled transaction priority. + required: false + style: form + explode: true + schema: + $ref: "#/components/schemas/ScheduledTransactionPriority" + startTimeParam: + name: start_time + in: query + description: "Filter to include only scheduled transactions with a scheduled\ + \ time at or after this value (inclusive, RFC 3339)." + required: false + style: form + explode: true + schema: + type: string + format: date-time + endTimeParam: + name: end_time + in: query + description: "Filter to include only scheduled transactions with a scheduled\ + \ time at or before this value (inclusive, RFC 3339)." + required: false + style: form + explode: true + schema: + type: string + format: date-time + handlerOwnerParam: + name: handler_owner + in: query + description: Filter by the address of the account that owns the transaction + handler. + required: false + style: form + explode: true + schema: + $ref: "#/components/schemas/Address" + handlerTypeIdentifierParam: + name: handler_type_identifier + in: query + description: Filter by the Cadence type identifier of the transaction handler + (e.g. `A.1654653399040a61.MyScheduler.Handler`). + required: false + style: form + explode: true + schema: + type: string + handlerUuidParam: + name: handler_uuid + in: query + description: Filter by the UUID of the transaction handler resource. + required: false + style: form + explode: true + schema: + type: string + format: uint64 diff --git a/openapi/experimental/go-client-generated/api_accounts.go b/openapi/experimental/go-client-generated/api_accounts.go index 4c3ea672b..a9f651cea 100644 --- a/openapi/experimental/go-client-generated/api_accounts.go +++ b/openapi/experimental/go-client-generated/api_accounts.go @@ -170,16 +170,6 @@ func (a *AccountsApiService) GetAccountFungibleTransfers(ctx context.Context, ad newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } - if localVarHttpResponse.StatusCode == 412 { - var v ModelError - err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHttpResponse, newErr - } - newErr.model = v - return localVarReturnValue, localVarHttpResponse, newErr - } if localVarHttpResponse.StatusCode == 429 { var v ModelError err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); @@ -340,16 +330,6 @@ func (a *AccountsApiService) GetAccountNonFungibleTransfers(ctx context.Context, newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } - if localVarHttpResponse.StatusCode == 412 { - var v ModelError - err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHttpResponse, newErr - } - newErr.model = v - return localVarReturnValue, localVarHttpResponse, newErr - } if localVarHttpResponse.StatusCode == 429 { var v ModelError err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); @@ -495,7 +475,172 @@ func (a *AccountsApiService) GetAccountTransactions(ctx context.Context, address newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } - if localVarHttpResponse.StatusCode == 412 { + if localVarHttpResponse.StatusCode == 429 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} +/* +AccountsApiService List scheduled transactions for an account +Returns a paginated list of scheduled transactions associated with the given account address, ordered descending by scheduled time (newest first). Results can be filtered by status, priority, time range, and transaction handler properties. + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param address The account address (hex-encoded without 0x prefix). + * @param optional nil or *AccountsApiGetScheduledTransactionsByAccountOpts - Optional Parameters: + * @param "Cursor" (optional.Interface of string) - Opaque pagination cursor from a previous response's `next_cursor` field. + * @param "Limit" (optional.Int32) - The maximum number of results to return. + * @param "Statuses" (optional.Interface of []ScheduledTransactionStatus) - A comma-separated list of scheduled transaction statuses to filter by. + * @param "Priority" (optional.Interface of ScheduledTransactionPriority) - Filter by scheduled transaction priority. + * @param "StartTime" (optional.Time) - Filter to include only scheduled transactions with a scheduled time at or after this value (inclusive, RFC 3339). + * @param "EndTime" (optional.Time) - Filter to include only scheduled transactions with a scheduled time at or before this value (inclusive, RFC 3339). + * @param "HandlerOwner" (optional.Interface of string) - Filter by the address of the account that owns the transaction handler. + * @param "HandlerTypeIdentifier" (optional.String) - Filter by the Cadence type identifier of the transaction handler (e.g. `A.1654653399040a61.MyScheduler.Handler`). + * @param "HandlerUuid" (optional.String) - Filter by the UUID of the transaction handler resource. + * @param "Expand" (optional.Interface of []string) - A comma-separated list indicating which properties of the content to expand. + * @param "Select_" (optional.Interface of []string) - A comma-separated list indicating which properties of the content to return. +@return ScheduledTransactionsResponse +*/ + +type AccountsApiGetScheduledTransactionsByAccountOpts struct { + Cursor optional.Interface + Limit optional.Int32 + Statuses optional.Interface + Priority optional.Interface + StartTime optional.Time + EndTime optional.Time + HandlerOwner optional.Interface + HandlerTypeIdentifier optional.String + HandlerUuid optional.String + Expand optional.Interface + Select_ optional.Interface +} + +func (a *AccountsApiService) GetScheduledTransactionsByAccount(ctx context.Context, address string, localVarOptionals *AccountsApiGetScheduledTransactionsByAccountOpts) (ScheduledTransactionsResponse, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue ScheduledTransactionsResponse + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/experimental/v1/accounts/{address}/scheduled" + localVarPath = strings.Replace(localVarPath, "{"+"address"+"}", fmt.Sprintf("%v", address), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if localVarOptionals != nil && localVarOptionals.Cursor.IsSet() { + localVarQueryParams.Add("cursor", parameterToString(localVarOptionals.Cursor.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Limit.IsSet() { + localVarQueryParams.Add("limit", parameterToString(localVarOptionals.Limit.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Statuses.IsSet() { + localVarQueryParams.Add("statuses", parameterToString(localVarOptionals.Statuses.Value(), "csv")) + } + if localVarOptionals != nil && localVarOptionals.Priority.IsSet() { + localVarQueryParams.Add("priority", parameterToString(localVarOptionals.Priority.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.StartTime.IsSet() { + localVarQueryParams.Add("start_time", parameterToString(localVarOptionals.StartTime.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.EndTime.IsSet() { + localVarQueryParams.Add("end_time", parameterToString(localVarOptionals.EndTime.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.HandlerOwner.IsSet() { + localVarQueryParams.Add("handler_owner", parameterToString(localVarOptionals.HandlerOwner.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.HandlerTypeIdentifier.IsSet() { + localVarQueryParams.Add("handler_type_identifier", parameterToString(localVarOptionals.HandlerTypeIdentifier.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.HandlerUuid.IsSet() { + localVarQueryParams.Add("handler_uuid", parameterToString(localVarOptionals.HandlerUuid.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Expand.IsSet() { + localVarQueryParams.Add("expand", parameterToString(localVarOptionals.Expand.Value(), "csv")) + } + if localVarOptionals != nil && localVarOptionals.Select_.IsSet() { + localVarQueryParams.Add("select", parameterToString(localVarOptionals.Select_.Value(), "csv")) + } + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + if localVarHttpResponse.StatusCode == 200 { + var v ScheduledTransactionsResponse + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 400 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 404 { var v ModelError err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); if err != nil { diff --git a/openapi/experimental/go-client-generated/api_scheduled_transactions.go b/openapi/experimental/go-client-generated/api_scheduled_transactions.go new file mode 100644 index 000000000..1e016ffb2 --- /dev/null +++ b/openapi/experimental/go-client-generated/api_scheduled_transactions.go @@ -0,0 +1,495 @@ + +/* + * Flow Experimental API + * + * Experimental API endpoints for the Flow Access Node. These endpoints are subject to change without notice. Endpoints may be moved to a permanent API once they are stable. + * + * API version: 0.1.0 + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package swagger + +import ( + "context" + "io/ioutil" + "net/http" + "net/url" + "strings" + "fmt" + "github.com/antihax/optional" +) + +// Linger please +var ( + _ context.Context +) + +type ScheduledTransactionsApiService service +/* +ScheduledTransactionsApiService Get scheduled transaction by ID +Returns the scheduled transaction with the given ID. + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param id The scheduled transaction identifier (hex-encoded). + * @param optional nil or *ScheduledTransactionsApiGetScheduledTransactionByIDOpts - Optional Parameters: + * @param "Expand" (optional.Interface of []string) - A comma-separated list indicating which properties of the content to expand. + * @param "Select_" (optional.Interface of []string) - A comma-separated list indicating which properties of the content to return. +@return ScheduledTransaction +*/ + +type ScheduledTransactionsApiGetScheduledTransactionByIDOpts struct { + Expand optional.Interface + Select_ optional.Interface +} + +func (a *ScheduledTransactionsApiService) GetScheduledTransactionByID(ctx context.Context, id string, localVarOptionals *ScheduledTransactionsApiGetScheduledTransactionByIDOpts) (ScheduledTransaction, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue ScheduledTransaction + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/experimental/v1/scheduled/transaction/{id}" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", fmt.Sprintf("%v", id), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if localVarOptionals != nil && localVarOptionals.Expand.IsSet() { + localVarQueryParams.Add("expand", parameterToString(localVarOptionals.Expand.Value(), "csv")) + } + if localVarOptionals != nil && localVarOptionals.Select_.IsSet() { + localVarQueryParams.Add("select", parameterToString(localVarOptionals.Select_.Value(), "csv")) + } + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + if localVarHttpResponse.StatusCode == 200 { + var v ScheduledTransaction + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 400 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 404 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 429 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} +/* +ScheduledTransactionsApiService List scheduled transactions +Returns a paginated list of scheduled transactions, ordered descending by scheduled transaction identifier (newest first). Results can be filtered by status, priority, time range, and transaction handler properties. + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param optional nil or *ScheduledTransactionsApiGetScheduledTransactionsOpts - Optional Parameters: + * @param "Cursor" (optional.Interface of string) - Opaque pagination cursor from a previous response's `next_cursor` field. + * @param "Limit" (optional.Int32) - The maximum number of results to return. + * @param "Statuses" (optional.Interface of []ScheduledTransactionStatus) - A comma-separated list of scheduled transaction statuses to filter by. + * @param "Priority" (optional.Interface of ScheduledTransactionPriority) - Filter by scheduled transaction priority. + * @param "StartTime" (optional.Time) - Filter to include only scheduled transactions with a scheduled time at or after this value (inclusive, RFC 3339). + * @param "EndTime" (optional.Time) - Filter to include only scheduled transactions with a scheduled time at or before this value (inclusive, RFC 3339). + * @param "HandlerOwner" (optional.Interface of string) - Filter by the address of the account that owns the transaction handler. + * @param "HandlerTypeIdentifier" (optional.String) - Filter by the Cadence type identifier of the transaction handler (e.g. `A.1654653399040a61.MyScheduler.Handler`). + * @param "HandlerUuid" (optional.String) - Filter by the UUID of the transaction handler resource. + * @param "Expand" (optional.Interface of []string) - A comma-separated list indicating which properties of the content to expand. + * @param "Select_" (optional.Interface of []string) - A comma-separated list indicating which properties of the content to return. +@return ScheduledTransactionsResponse +*/ + +type ScheduledTransactionsApiGetScheduledTransactionsOpts struct { + Cursor optional.Interface + Limit optional.Int32 + Statuses optional.Interface + Priority optional.Interface + StartTime optional.Time + EndTime optional.Time + HandlerOwner optional.Interface + HandlerTypeIdentifier optional.String + HandlerUuid optional.String + Expand optional.Interface + Select_ optional.Interface +} + +func (a *ScheduledTransactionsApiService) GetScheduledTransactions(ctx context.Context, localVarOptionals *ScheduledTransactionsApiGetScheduledTransactionsOpts) (ScheduledTransactionsResponse, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue ScheduledTransactionsResponse + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/experimental/v1/scheduled" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if localVarOptionals != nil && localVarOptionals.Cursor.IsSet() { + localVarQueryParams.Add("cursor", parameterToString(localVarOptionals.Cursor.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Limit.IsSet() { + localVarQueryParams.Add("limit", parameterToString(localVarOptionals.Limit.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Statuses.IsSet() { + localVarQueryParams.Add("statuses", parameterToString(localVarOptionals.Statuses.Value(), "csv")) + } + if localVarOptionals != nil && localVarOptionals.Priority.IsSet() { + localVarQueryParams.Add("priority", parameterToString(localVarOptionals.Priority.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.StartTime.IsSet() { + localVarQueryParams.Add("start_time", parameterToString(localVarOptionals.StartTime.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.EndTime.IsSet() { + localVarQueryParams.Add("end_time", parameterToString(localVarOptionals.EndTime.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.HandlerOwner.IsSet() { + localVarQueryParams.Add("handler_owner", parameterToString(localVarOptionals.HandlerOwner.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.HandlerTypeIdentifier.IsSet() { + localVarQueryParams.Add("handler_type_identifier", parameterToString(localVarOptionals.HandlerTypeIdentifier.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.HandlerUuid.IsSet() { + localVarQueryParams.Add("handler_uuid", parameterToString(localVarOptionals.HandlerUuid.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Expand.IsSet() { + localVarQueryParams.Add("expand", parameterToString(localVarOptionals.Expand.Value(), "csv")) + } + if localVarOptionals != nil && localVarOptionals.Select_.IsSet() { + localVarQueryParams.Add("select", parameterToString(localVarOptionals.Select_.Value(), "csv")) + } + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + if localVarHttpResponse.StatusCode == 200 { + var v ScheduledTransactionsResponse + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 400 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 429 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} +/* +ScheduledTransactionsApiService List scheduled transactions for an account +Returns a paginated list of scheduled transactions associated with the given account address, ordered descending by scheduled time (newest first). Results can be filtered by status, priority, time range, and transaction handler properties. + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param address The account address (hex-encoded without 0x prefix). + * @param optional nil or *ScheduledTransactionsApiGetScheduledTransactionsByAccountOpts - Optional Parameters: + * @param "Cursor" (optional.Interface of string) - Opaque pagination cursor from a previous response's `next_cursor` field. + * @param "Limit" (optional.Int32) - The maximum number of results to return. + * @param "Statuses" (optional.Interface of []ScheduledTransactionStatus) - A comma-separated list of scheduled transaction statuses to filter by. + * @param "Priority" (optional.Interface of ScheduledTransactionPriority) - Filter by scheduled transaction priority. + * @param "StartTime" (optional.Time) - Filter to include only scheduled transactions with a scheduled time at or after this value (inclusive, RFC 3339). + * @param "EndTime" (optional.Time) - Filter to include only scheduled transactions with a scheduled time at or before this value (inclusive, RFC 3339). + * @param "HandlerOwner" (optional.Interface of string) - Filter by the address of the account that owns the transaction handler. + * @param "HandlerTypeIdentifier" (optional.String) - Filter by the Cadence type identifier of the transaction handler (e.g. `A.1654653399040a61.MyScheduler.Handler`). + * @param "HandlerUuid" (optional.String) - Filter by the UUID of the transaction handler resource. + * @param "Expand" (optional.Interface of []string) - A comma-separated list indicating which properties of the content to expand. + * @param "Select_" (optional.Interface of []string) - A comma-separated list indicating which properties of the content to return. +@return ScheduledTransactionsResponse +*/ + +type ScheduledTransactionsApiGetScheduledTransactionsByAccountOpts struct { + Cursor optional.Interface + Limit optional.Int32 + Statuses optional.Interface + Priority optional.Interface + StartTime optional.Time + EndTime optional.Time + HandlerOwner optional.Interface + HandlerTypeIdentifier optional.String + HandlerUuid optional.String + Expand optional.Interface + Select_ optional.Interface +} + +func (a *ScheduledTransactionsApiService) GetScheduledTransactionsByAccount(ctx context.Context, address string, localVarOptionals *ScheduledTransactionsApiGetScheduledTransactionsByAccountOpts) (ScheduledTransactionsResponse, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue ScheduledTransactionsResponse + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/experimental/v1/accounts/{address}/scheduled" + localVarPath = strings.Replace(localVarPath, "{"+"address"+"}", fmt.Sprintf("%v", address), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if localVarOptionals != nil && localVarOptionals.Cursor.IsSet() { + localVarQueryParams.Add("cursor", parameterToString(localVarOptionals.Cursor.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Limit.IsSet() { + localVarQueryParams.Add("limit", parameterToString(localVarOptionals.Limit.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Statuses.IsSet() { + localVarQueryParams.Add("statuses", parameterToString(localVarOptionals.Statuses.Value(), "csv")) + } + if localVarOptionals != nil && localVarOptionals.Priority.IsSet() { + localVarQueryParams.Add("priority", parameterToString(localVarOptionals.Priority.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.StartTime.IsSet() { + localVarQueryParams.Add("start_time", parameterToString(localVarOptionals.StartTime.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.EndTime.IsSet() { + localVarQueryParams.Add("end_time", parameterToString(localVarOptionals.EndTime.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.HandlerOwner.IsSet() { + localVarQueryParams.Add("handler_owner", parameterToString(localVarOptionals.HandlerOwner.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.HandlerTypeIdentifier.IsSet() { + localVarQueryParams.Add("handler_type_identifier", parameterToString(localVarOptionals.HandlerTypeIdentifier.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.HandlerUuid.IsSet() { + localVarQueryParams.Add("handler_uuid", parameterToString(localVarOptionals.HandlerUuid.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Expand.IsSet() { + localVarQueryParams.Add("expand", parameterToString(localVarOptionals.Expand.Value(), "csv")) + } + if localVarOptionals != nil && localVarOptionals.Select_.IsSet() { + localVarQueryParams.Add("select", parameterToString(localVarOptionals.Select_.Value(), "csv")) + } + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + if localVarHttpResponse.StatusCode == 200 { + var v ScheduledTransactionsResponse + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 400 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 404 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 429 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} diff --git a/openapi/experimental/go-client-generated/client.go b/openapi/experimental/go-client-generated/client.go index a934bf8c6..3438a1190 100644 --- a/openapi/experimental/go-client-generated/client.go +++ b/openapi/experimental/go-client-generated/client.go @@ -45,6 +45,8 @@ type APIClient struct { // API Services AccountsApi *AccountsApiService + + ScheduledTransactionsApi *ScheduledTransactionsApiService } type service struct { @@ -64,6 +66,7 @@ func NewAPIClient(cfg *Configuration) *APIClient { // API Services c.AccountsApi = (*AccountsApiService)(&c.common) + c.ScheduledTransactionsApi = (*ScheduledTransactionsApiService)(&c.common) return c } diff --git a/openapi/experimental/go-client-generated/docs/AccountsApi.md b/openapi/experimental/go-client-generated/docs/AccountsApi.md index 67cb870b0..34b6a9e3b 100644 --- a/openapi/experimental/go-client-generated/docs/AccountsApi.md +++ b/openapi/experimental/go-client-generated/docs/AccountsApi.md @@ -7,6 +7,7 @@ Method | HTTP request | Description [**GetAccountFungibleTransfers**](AccountsApi.md#GetAccountFungibleTransfers) | **Get** /experimental/v1/accounts/{address}/ft/transfers | Get account fungible token transfers [**GetAccountNonFungibleTransfers**](AccountsApi.md#GetAccountNonFungibleTransfers) | **Get** /experimental/v1/accounts/{address}/nft/transfers | Get account non-fungible token transfers [**GetAccountTransactions**](AccountsApi.md#GetAccountTransactions) | **Get** /experimental/v1/accounts/{address}/transactions | Get account transactions +[**GetScheduledTransactionsByAccount**](AccountsApi.md#GetScheduledTransactionsByAccount) | **Get** /experimental/v1/accounts/{address}/scheduled | List scheduled transactions for an account # **GetAccountFungibleTransfers** > AccountFungibleTransfersResponse GetAccountFungibleTransfers(ctx, address, optional) @@ -134,3 +135,49 @@ No authorization required [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +# **GetScheduledTransactionsByAccount** +> ScheduledTransactionsResponse GetScheduledTransactionsByAccount(ctx, address, optional) +List scheduled transactions for an account + +Returns a paginated list of scheduled transactions associated with the given account address, ordered descending by scheduled time (newest first). Results can be filtered by status, priority, time range, and transaction handler properties. + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **address** | [**string**](.md)| The account address (hex-encoded without 0x prefix). | + **optional** | ***AccountsApiGetScheduledTransactionsByAccountOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a AccountsApiGetScheduledTransactionsByAccountOpts struct +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **cursor** | [**optional.Interface of string**](.md)| Opaque pagination cursor from a previous response's `next_cursor` field. | + **limit** | **optional.Int32**| The maximum number of results to return. | [default to 50] + **statuses** | [**optional.Interface of []ScheduledTransactionStatus**](ScheduledTransactionStatus.md)| A comma-separated list of scheduled transaction statuses to filter by. | + **priority** | [**optional.Interface of ScheduledTransactionPriority**](.md)| Filter by scheduled transaction priority. | + **startTime** | **optional.Time**| Filter to include only scheduled transactions with a scheduled time at or after this value (inclusive, RFC 3339). | + **endTime** | **optional.Time**| Filter to include only scheduled transactions with a scheduled time at or before this value (inclusive, RFC 3339). | + **handlerOwner** | [**optional.Interface of string**](.md)| Filter by the address of the account that owns the transaction handler. | + **handlerTypeIdentifier** | **optional.String**| Filter by the Cadence type identifier of the transaction handler (e.g. `A.1654653399040a61.MyScheduler.Handler`). | + **handlerUuid** | **optional.String**| Filter by the UUID of the transaction handler resource. | + **expand** | [**optional.Interface of []string**](string.md)| A comma-separated list indicating which properties of the content to expand. | + **select_** | [**optional.Interface of []string**](string.md)| A comma-separated list indicating which properties of the content to return. | + +### Return type + +[**ScheduledTransactionsResponse**](ScheduledTransactionsResponse.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/openapi/experimental/go-client-generated/docs/Contract.md b/openapi/experimental/go-client-generated/docs/Contract.md new file mode 100644 index 000000000..d33638375 --- /dev/null +++ b/openapi/experimental/go-client-generated/docs/Contract.md @@ -0,0 +1,10 @@ +# Contract + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Identifier** | **string** | Unique identifier for the contract (e.g. `A.1654653399040a61.MyContract`). | [default to null] +**Body** | **string** | Full source code of the contract. | [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/openapi/experimental/go-client-generated/docs/FungibleTokenTransfer.md b/openapi/experimental/go-client-generated/docs/FungibleTokenTransfer.md index 754c73734..64faaff45 100644 --- a/openapi/experimental/go-client-generated/docs/FungibleTokenTransfer.md +++ b/openapi/experimental/go-client-generated/docs/FungibleTokenTransfer.md @@ -14,7 +14,6 @@ Name | Type | Description | Notes **RecipientAddress** | **string** | | [default to null] **Transaction** | [***Transaction**](Transaction.md) | | [optional] [default to null] **Result** | [***TransactionResult**](TransactionResult.md) | | [optional] [default to null] -**Events** | [**[]Event**](Event.md) | | [optional] [default to null] **Expandable** | [***AccountTransactionExpandable**](AccountTransaction__expandable.md) | | [default to null] **Links** | [***Links**](Links.md) | | [optional] [default to null] diff --git a/openapi/experimental/go-client-generated/docs/NonFungibleTokenTransfer.md b/openapi/experimental/go-client-generated/docs/NonFungibleTokenTransfer.md index 24cdef1d4..84c3216aa 100644 --- a/openapi/experimental/go-client-generated/docs/NonFungibleTokenTransfer.md +++ b/openapi/experimental/go-client-generated/docs/NonFungibleTokenTransfer.md @@ -14,7 +14,6 @@ Name | Type | Description | Notes **RecipientAddress** | **string** | | [default to null] **Transaction** | [***Transaction**](Transaction.md) | | [optional] [default to null] **Result** | [***TransactionResult**](TransactionResult.md) | | [optional] [default to null] -**Events** | [**[]Event**](Event.md) | | [optional] [default to null] **Expandable** | [***AccountTransactionExpandable**](AccountTransaction__expandable.md) | | [default to null] **Links** | [***Links**](Links.md) | | [optional] [default to null] diff --git a/openapi/experimental/go-client-generated/docs/ScheduledTransaction.md b/openapi/experimental/go-client-generated/docs/ScheduledTransaction.md new file mode 100644 index 000000000..7570b8388 --- /dev/null +++ b/openapi/experimental/go-client-generated/docs/ScheduledTransaction.md @@ -0,0 +1,28 @@ +# ScheduledTransaction + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Id** | **string** | Scheduler-assigned uint64 identifier. | [default to null] +**Status** | [***ScheduledTransactionStatus**](ScheduledTransactionStatus.md) | | [default to null] +**Priority** | [***ScheduledTransactionPriority**](ScheduledTransactionPriority.md) | | [default to null] +**Timestamp** | **string** | Scheduled execution timestamp as a UFix64 decimal string. | [default to null] +**ExecutionEffort** | **string** | Execution effort estimate as a UFix64 decimal string. | [default to null] +**Fees** | **string** | Scheduled fee as a UFix64 decimal string. | [default to null] +**TransactionHandlerOwner** | **string** | | [default to null] +**TransactionHandlerTypeIdentifier** | **string** | Fully qualified Cadence type identifier of the transaction handler (e.g. `A.1654653399040a61.MyScheduler.Handler`). | [default to null] +**TransactionHandlerUuid** | **string** | Resource UUID of the transaction handler. | [default to null] +**TransactionHandlerPublicPath** | **string** | Public path of the transaction handler, if set. | [optional] [default to null] +**FeesReturned** | **string** | Fees returned on cancellation, as a UFix64 decimal string. | [optional] [default to null] +**FeesDeducted** | **string** | Fees deducted on cancellation, as a UFix64 decimal string. | [optional] [default to null] +**CreatedTransactionId** | **string** | | [default to null] +**ExecutedTransactionId** | **string** | | [optional] [default to null] +**CancelledTransactionId** | **string** | | [optional] [default to null] +**Transaction** | [***Transaction**](Transaction.md) | | [optional] [default to null] +**Result** | [***TransactionResult**](TransactionResult.md) | | [optional] [default to null] +**HandlerContract** | [***Contract**](Contract.md) | | [optional] [default to null] +**Expandable** | [***ScheduledTransactionExpandable**](ScheduledTransaction__expandable.md) | | [default to null] +**Links** | [***Links**](Links.md) | | [optional] [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/openapi/experimental/go-client-generated/docs/ScheduledTransactionExpandable.md b/openapi/experimental/go-client-generated/docs/ScheduledTransactionExpandable.md new file mode 100644 index 000000000..24211fefe --- /dev/null +++ b/openapi/experimental/go-client-generated/docs/ScheduledTransactionExpandable.md @@ -0,0 +1,11 @@ +# ScheduledTransactionExpandable + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Transaction** | **string** | Link to fetch the full transaction body. | [optional] [default to null] +**Result** | **string** | Link to fetch the transaction result. | [optional] [default to null] +**HandlerContract** | **string** | Link to fetch the Cadence contract that implements the transaction handler. | [optional] [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/openapi/experimental/go-client-generated/docs/ScheduledTransactionPriority.md b/openapi/experimental/go-client-generated/docs/ScheduledTransactionPriority.md new file mode 100644 index 000000000..cfd9695ea --- /dev/null +++ b/openapi/experimental/go-client-generated/docs/ScheduledTransactionPriority.md @@ -0,0 +1,8 @@ +# ScheduledTransactionPriority + +## 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) + diff --git a/openapi/experimental/go-client-generated/docs/ScheduledTransactionStatus.md b/openapi/experimental/go-client-generated/docs/ScheduledTransactionStatus.md new file mode 100644 index 000000000..b4aa41dd1 --- /dev/null +++ b/openapi/experimental/go-client-generated/docs/ScheduledTransactionStatus.md @@ -0,0 +1,8 @@ +# ScheduledTransactionStatus + +## 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) + diff --git a/openapi/experimental/go-client-generated/docs/ScheduledTransactionsApi.md b/openapi/experimental/go-client-generated/docs/ScheduledTransactionsApi.md new file mode 100644 index 000000000..6a1af7078 --- /dev/null +++ b/openapi/experimental/go-client-generated/docs/ScheduledTransactionsApi.md @@ -0,0 +1,137 @@ +# {{classname}} + +All URIs are relative to *https://rest-testnet.onflow.org* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**GetScheduledTransactionByID**](ScheduledTransactionsApi.md#GetScheduledTransactionByID) | **Get** /experimental/v1/scheduled/transaction/{id} | Get scheduled transaction by ID +[**GetScheduledTransactions**](ScheduledTransactionsApi.md#GetScheduledTransactions) | **Get** /experimental/v1/scheduled | List scheduled transactions +[**GetScheduledTransactionsByAccount**](ScheduledTransactionsApi.md#GetScheduledTransactionsByAccount) | **Get** /experimental/v1/accounts/{address}/scheduled | List scheduled transactions for an account + +# **GetScheduledTransactionByID** +> ScheduledTransaction GetScheduledTransactionByID(ctx, id, optional) +Get scheduled transaction by ID + +Returns the scheduled transaction with the given ID. + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **id** | [**string**](.md)| The scheduled transaction identifier (hex-encoded). | + **optional** | ***ScheduledTransactionsApiGetScheduledTransactionByIDOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a ScheduledTransactionsApiGetScheduledTransactionByIDOpts struct +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **expand** | [**optional.Interface of []string**](string.md)| A comma-separated list indicating which properties of the content to expand. | + **select_** | [**optional.Interface of []string**](string.md)| A comma-separated list indicating which properties of the content to return. | + +### Return type + +[**ScheduledTransaction**](ScheduledTransaction.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **GetScheduledTransactions** +> ScheduledTransactionsResponse GetScheduledTransactions(ctx, optional) +List scheduled transactions + +Returns a paginated list of scheduled transactions, ordered descending by scheduled transaction identifier (newest first). Results can be filtered by status, priority, time range, and transaction handler properties. + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **optional** | ***ScheduledTransactionsApiGetScheduledTransactionsOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a ScheduledTransactionsApiGetScheduledTransactionsOpts struct +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **cursor** | [**optional.Interface of string**](.md)| Opaque pagination cursor from a previous response's `next_cursor` field. | + **limit** | **optional.Int32**| The maximum number of results to return. | [default to 50] + **statuses** | [**optional.Interface of []ScheduledTransactionStatus**](ScheduledTransactionStatus.md)| A comma-separated list of scheduled transaction statuses to filter by. | + **priority** | [**optional.Interface of ScheduledTransactionPriority**](.md)| Filter by scheduled transaction priority. | + **startTime** | **optional.Time**| Filter to include only scheduled transactions with a scheduled time at or after this value (inclusive, RFC 3339). | + **endTime** | **optional.Time**| Filter to include only scheduled transactions with a scheduled time at or before this value (inclusive, RFC 3339). | + **handlerOwner** | [**optional.Interface of string**](.md)| Filter by the address of the account that owns the transaction handler. | + **handlerTypeIdentifier** | **optional.String**| Filter by the Cadence type identifier of the transaction handler (e.g. `A.1654653399040a61.MyScheduler.Handler`). | + **handlerUuid** | **optional.String**| Filter by the UUID of the transaction handler resource. | + **expand** | [**optional.Interface of []string**](string.md)| A comma-separated list indicating which properties of the content to expand. | + **select_** | [**optional.Interface of []string**](string.md)| A comma-separated list indicating which properties of the content to return. | + +### Return type + +[**ScheduledTransactionsResponse**](ScheduledTransactionsResponse.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **GetScheduledTransactionsByAccount** +> ScheduledTransactionsResponse GetScheduledTransactionsByAccount(ctx, address, optional) +List scheduled transactions for an account + +Returns a paginated list of scheduled transactions associated with the given account address, ordered descending by scheduled time (newest first). Results can be filtered by status, priority, time range, and transaction handler properties. + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **address** | [**string**](.md)| The account address (hex-encoded without 0x prefix). | + **optional** | ***ScheduledTransactionsApiGetScheduledTransactionsByAccountOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a ScheduledTransactionsApiGetScheduledTransactionsByAccountOpts struct +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **cursor** | [**optional.Interface of string**](.md)| Opaque pagination cursor from a previous response's `next_cursor` field. | + **limit** | **optional.Int32**| The maximum number of results to return. | [default to 50] + **statuses** | [**optional.Interface of []ScheduledTransactionStatus**](ScheduledTransactionStatus.md)| A comma-separated list of scheduled transaction statuses to filter by. | + **priority** | [**optional.Interface of ScheduledTransactionPriority**](.md)| Filter by scheduled transaction priority. | + **startTime** | **optional.Time**| Filter to include only scheduled transactions with a scheduled time at or after this value (inclusive, RFC 3339). | + **endTime** | **optional.Time**| Filter to include only scheduled transactions with a scheduled time at or before this value (inclusive, RFC 3339). | + **handlerOwner** | [**optional.Interface of string**](.md)| Filter by the address of the account that owns the transaction handler. | + **handlerTypeIdentifier** | **optional.String**| Filter by the Cadence type identifier of the transaction handler (e.g. `A.1654653399040a61.MyScheduler.Handler`). | + **handlerUuid** | **optional.String**| Filter by the UUID of the transaction handler resource. | + **expand** | [**optional.Interface of []string**](string.md)| A comma-separated list indicating which properties of the content to expand. | + **select_** | [**optional.Interface of []string**](string.md)| A comma-separated list indicating which properties of the content to return. | + +### Return type + +[**ScheduledTransactionsResponse**](ScheduledTransactionsResponse.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/openapi/experimental/go-client-generated/docs/ScheduledTransactionsResponse.md b/openapi/experimental/go-client-generated/docs/ScheduledTransactionsResponse.md new file mode 100644 index 000000000..488560d21 --- /dev/null +++ b/openapi/experimental/go-client-generated/docs/ScheduledTransactionsResponse.md @@ -0,0 +1,10 @@ +# ScheduledTransactionsResponse + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**ScheduledTransactions** | [**[]ScheduledTransaction**](ScheduledTransaction.md) | | [default to null] +**NextCursor** | **string** | | [optional] [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/openapi/experimental/go-client-generated/model_contract.go b/openapi/experimental/go-client-generated/model_contract.go new file mode 100644 index 000000000..9e181507a --- /dev/null +++ b/openapi/experimental/go-client-generated/model_contract.go @@ -0,0 +1,16 @@ +/* + * Flow Experimental API + * + * Experimental API endpoints for the Flow Access Node. These endpoints are subject to change without notice. Endpoints may be moved to a permanent API once they are stable. + * + * API version: 0.1.0 + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package swagger + +type Contract struct { + // Unique identifier for the contract (e.g. `A.1654653399040a61.MyContract`). + Identifier string `json:"identifier"` + // Full source code of the contract. + Body string `json:"body"` +} diff --git a/openapi/experimental/go-client-generated/model_fungible_token_transfer.go b/openapi/experimental/go-client-generated/model_fungible_token_transfer.go index 843b6eab7..68118aec1 100644 --- a/openapi/experimental/go-client-generated/model_fungible_token_transfer.go +++ b/openapi/experimental/go-client-generated/model_fungible_token_transfer.go @@ -29,7 +29,6 @@ type FungibleTokenTransfer struct { RecipientAddress string `json:"recipient_address"` Transaction *Transaction `json:"transaction,omitempty"` Result *TransactionResult `json:"result,omitempty"` - Events []Event `json:"events,omitempty"` Expandable *AccountTransactionExpandable `json:"_expandable"` Links *Links `json:"_links,omitempty"` } diff --git a/openapi/experimental/go-client-generated/model_non_fungible_token_transfer.go b/openapi/experimental/go-client-generated/model_non_fungible_token_transfer.go index ce53a7bbf..1c70934ca 100644 --- a/openapi/experimental/go-client-generated/model_non_fungible_token_transfer.go +++ b/openapi/experimental/go-client-generated/model_non_fungible_token_transfer.go @@ -29,7 +29,6 @@ type NonFungibleTokenTransfer struct { RecipientAddress string `json:"recipient_address"` Transaction *Transaction `json:"transaction,omitempty"` Result *TransactionResult `json:"result,omitempty"` - Events []Event `json:"events,omitempty"` Expandable *AccountTransactionExpandable `json:"_expandable"` Links *Links `json:"_links,omitempty"` } diff --git a/openapi/experimental/go-client-generated/model_scheduled_transaction.go b/openapi/experimental/go-client-generated/model_scheduled_transaction.go new file mode 100644 index 000000000..e2266ddd5 --- /dev/null +++ b/openapi/experimental/go-client-generated/model_scheduled_transaction.go @@ -0,0 +1,41 @@ +/* + * Flow Experimental API + * + * Experimental API endpoints for the Flow Access Node. These endpoints are subject to change without notice. Endpoints may be moved to a permanent API once they are stable. + * + * API version: 0.1.0 + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package swagger + +type ScheduledTransaction struct { + // Scheduler-assigned uint64 identifier. + Id string `json:"id"` + Status *ScheduledTransactionStatus `json:"status"` + Priority *ScheduledTransactionPriority `json:"priority"` + // Scheduled execution timestamp as a UFix64 decimal string. + Timestamp string `json:"timestamp"` + // Execution effort estimate as a UFix64 decimal string. + ExecutionEffort string `json:"execution_effort"` + // Scheduled fee as a UFix64 decimal string. + Fees string `json:"fees"` + TransactionHandlerOwner string `json:"transaction_handler_owner"` + // Fully qualified Cadence type identifier of the transaction handler (e.g. `A.1654653399040a61.MyScheduler.Handler`). + TransactionHandlerTypeIdentifier string `json:"transaction_handler_type_identifier"` + // Resource UUID of the transaction handler. + TransactionHandlerUuid string `json:"transaction_handler_uuid"` + // Public path of the transaction handler, if set. + TransactionHandlerPublicPath string `json:"transaction_handler_public_path,omitempty"` + // Fees returned on cancellation, as a UFix64 decimal string. + FeesReturned string `json:"fees_returned,omitempty"` + // Fees deducted on cancellation, as a UFix64 decimal string. + FeesDeducted string `json:"fees_deducted,omitempty"` + CreatedTransactionId string `json:"created_transaction_id"` + ExecutedTransactionId string `json:"executed_transaction_id,omitempty"` + CancelledTransactionId string `json:"cancelled_transaction_id,omitempty"` + Transaction *Transaction `json:"transaction,omitempty"` + Result *TransactionResult `json:"result,omitempty"` + HandlerContract *Contract `json:"handler_contract,omitempty"` + Expandable *ScheduledTransactionExpandable `json:"_expandable"` + Links *Links `json:"_links,omitempty"` +} diff --git a/openapi/experimental/go-client-generated/model_scheduled_transaction__expandable.go b/openapi/experimental/go-client-generated/model_scheduled_transaction__expandable.go new file mode 100644 index 000000000..065ebdcc0 --- /dev/null +++ b/openapi/experimental/go-client-generated/model_scheduled_transaction__expandable.go @@ -0,0 +1,19 @@ +/* + * Flow Experimental API + * + * Experimental API endpoints for the Flow Access Node. These endpoints are subject to change without notice. Endpoints may be moved to a permanent API once they are stable. + * + * API version: 0.1.0 + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package swagger + +// Contains URI links for fields not included in the response. When a field is expanded via the `expand` query parameter, it appears inline and is removed from `_expandable`. +type ScheduledTransactionExpandable struct { + // Link to fetch the full transaction body. + Transaction string `json:"transaction,omitempty"` + // Link to fetch the transaction result. + Result string `json:"result,omitempty"` + // Link to fetch the Cadence contract that implements the transaction handler. + HandlerContract string `json:"handler_contract,omitempty"` +} diff --git a/openapi/experimental/go-client-generated/model_scheduled_transaction_priority.go b/openapi/experimental/go-client-generated/model_scheduled_transaction_priority.go new file mode 100644 index 000000000..2719643d2 --- /dev/null +++ b/openapi/experimental/go-client-generated/model_scheduled_transaction_priority.go @@ -0,0 +1,18 @@ +/* + * Flow Experimental API + * + * Experimental API endpoints for the Flow Access Node. These endpoints are subject to change without notice. Endpoints may be moved to a permanent API once they are stable. + * + * API version: 0.1.0 + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package swagger +// ScheduledTransactionPriority : The execution priority of a scheduled transaction. +type ScheduledTransactionPriority string + +// List of ScheduledTransactionPriority +const ( + LOW_ScheduledTransactionPriority ScheduledTransactionPriority = "low" + MEDIUM_ScheduledTransactionPriority ScheduledTransactionPriority = "medium" + HIGH_ScheduledTransactionPriority ScheduledTransactionPriority = "high" +) diff --git a/openapi/experimental/go-client-generated/model_scheduled_transaction_status.go b/openapi/experimental/go-client-generated/model_scheduled_transaction_status.go new file mode 100644 index 000000000..3526ba525 --- /dev/null +++ b/openapi/experimental/go-client-generated/model_scheduled_transaction_status.go @@ -0,0 +1,19 @@ +/* + * Flow Experimental API + * + * Experimental API endpoints for the Flow Access Node. These endpoints are subject to change without notice. Endpoints may be moved to a permanent API once they are stable. + * + * API version: 0.1.0 + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package swagger +// ScheduledTransactionStatus : The current lifecycle status of a scheduled transaction. +type ScheduledTransactionStatus string + +// List of ScheduledTransactionStatus +const ( + SCHEDULED_ScheduledTransactionStatus ScheduledTransactionStatus = "scheduled" + EXECUTED_ScheduledTransactionStatus ScheduledTransactionStatus = "executed" + CANCELLED_ScheduledTransactionStatus ScheduledTransactionStatus = "cancelled" + FAILED_ScheduledTransactionStatus ScheduledTransactionStatus = "failed" +) diff --git a/openapi/experimental/go-client-generated/model_scheduled_transactions_response.go b/openapi/experimental/go-client-generated/model_scheduled_transactions_response.go new file mode 100644 index 000000000..32422ac66 --- /dev/null +++ b/openapi/experimental/go-client-generated/model_scheduled_transactions_response.go @@ -0,0 +1,14 @@ +/* + * Flow Experimental API + * + * Experimental API endpoints for the Flow Access Node. These endpoints are subject to change without notice. Endpoints may be moved to a permanent API once they are stable. + * + * API version: 0.1.0 + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package swagger + +type ScheduledTransactionsResponse struct { + ScheduledTransactions []ScheduledTransaction `json:"scheduled_transactions"` + NextCursor string `json:"next_cursor,omitempty"` +} diff --git a/openapi/experimental/openapi.yaml b/openapi/experimental/openapi.yaml index a8d33426b..e0464ff64 100644 --- a/openapi/experimental/openapi.yaml +++ b/openapi/experimental/openapi.yaml @@ -17,6 +17,8 @@ security: [] tags: - name: Accounts description: Endpoints for querying account-related data. + - name: ScheduledTransactions + description: Endpoints for querying scheduled transaction data. paths: /experimental/v1/accounts/{address}/transactions: @@ -59,12 +61,6 @@ paths: application/json: schema: $ref: "#/components/schemas/Error" - "412": - description: Precondition failed (account transaction index not initialized). - content: - application/json: - schema: - $ref: "#/components/schemas/Error" "429": description: Too many requests. content: @@ -115,12 +111,6 @@ paths: application/json: schema: $ref: "#/components/schemas/Error" - "412": - description: Precondition failed (account transfer index not initialized). - content: - application/json: - schema: - $ref: "#/components/schemas/Error" "429": description: Too many requests. content: @@ -171,8 +161,140 @@ paths: application/json: schema: $ref: "#/components/schemas/Error" - "412": - description: Precondition failed (account transfer index not initialized). + "429": + description: Too many requests. + content: + application/json: + schema: + $ref: "#/components/schemas/Error" + + /experimental/v1/scheduled: + get: + summary: List scheduled transactions + description: | + Returns a paginated list of scheduled transactions, ordered descending by scheduled transaction identifier (newest first). + Results can be filtered by status, priority, time range, and transaction handler properties. + operationId: getScheduledTransactions + tags: + - ScheduledTransactions + parameters: + - $ref: '#/components/parameters/cursorParam' + - $ref: '#/components/parameters/limitParam' + - $ref: '#/components/parameters/scheduledStatusesParam' + - $ref: '#/components/parameters/priorityParam' + - $ref: '#/components/parameters/startTimeParam' + - $ref: '#/components/parameters/endTimeParam' + - $ref: '#/components/parameters/handlerOwnerParam' + - $ref: '#/components/parameters/handlerTypeIdentifierParam' + - $ref: '#/components/parameters/handlerUuidParam' + - $ref: '#/components/parameters/expandParam' + - $ref: '#/components/parameters/selectParam' + responses: + "200": + description: A page of scheduled transactions. + content: + application/json: + schema: + $ref: "#/components/schemas/ScheduledTransactionsResponse" + "400": + description: Bad request (invalid filter parameters, cursor, or limit). + content: + application/json: + schema: + $ref: "#/components/schemas/Error" + "429": + description: Too many requests. + content: + application/json: + schema: + $ref: "#/components/schemas/Error" + + /experimental/v1/scheduled/transaction/{id}: + get: + summary: Get scheduled transaction by ID + description: Returns the scheduled transaction with the given ID. + operationId: getScheduledTransactionByID + tags: + - ScheduledTransactions + parameters: + - name: id + in: path + required: true + description: The scheduled transaction identifier (hex-encoded). + schema: + $ref: '#/components/schemas/Identifier' + - $ref: '#/components/parameters/expandParam' + - $ref: '#/components/parameters/selectParam' + responses: + "200": + description: The scheduled transaction. + content: + application/json: + schema: + $ref: "#/components/schemas/ScheduledTransaction" + "400": + description: Bad request (invalid transaction ID). + content: + application/json: + schema: + $ref: "#/components/schemas/Error" + "404": + description: No scheduled transaction found for the given ID. + content: + application/json: + schema: + $ref: "#/components/schemas/Error" + "429": + description: Too many requests. + content: + application/json: + schema: + $ref: "#/components/schemas/Error" + + /experimental/v1/accounts/{address}/scheduled: + get: + summary: List scheduled transactions for an account + description: | + Returns a paginated list of scheduled transactions associated with the given account address, + ordered descending by scheduled time (newest first). + Results can be filtered by status, priority, time range, and transaction handler properties. + operationId: getScheduledTransactionsByAccount + tags: + - ScheduledTransactions + - Accounts + parameters: + - name: address + in: path + required: true + description: The account address (hex-encoded without 0x prefix). + schema: + $ref: '#/components/schemas/Address' + - $ref: '#/components/parameters/cursorParam' + - $ref: '#/components/parameters/limitParam' + - $ref: '#/components/parameters/scheduledStatusesParam' + - $ref: '#/components/parameters/priorityParam' + - $ref: '#/components/parameters/startTimeParam' + - $ref: '#/components/parameters/endTimeParam' + - $ref: '#/components/parameters/handlerOwnerParam' + - $ref: '#/components/parameters/handlerTypeIdentifierParam' + - $ref: '#/components/parameters/handlerUuidParam' + - $ref: '#/components/parameters/expandParam' + - $ref: '#/components/parameters/selectParam' + responses: + "200": + description: A page of scheduled transactions. + content: + application/json: + schema: + $ref: "#/components/schemas/ScheduledTransactionsResponse" + "400": + description: Bad request (invalid address, filter parameters, cursor, or limit). + content: + application/json: + schema: + $ref: "#/components/schemas/Error" + "404": + description: No account found for the given address. content: application/json: schema: @@ -268,6 +390,64 @@ components: schema: $ref: '#/components/schemas/TransferRole' required: false + scheduledStatusesParam: + description: A comma-separated list of scheduled transaction statuses to filter by. + name: statuses + in: query + schema: + type: array + items: + $ref: '#/components/schemas/ScheduledTransactionStatus' + minItems: 1 + uniqueItems: true + explode: false + style: form + required: false + priorityParam: + description: Filter by scheduled transaction priority. + name: priority + in: query + schema: + $ref: '#/components/schemas/ScheduledTransactionPriority' + required: false + startTimeParam: + description: Filter to include only scheduled transactions with a scheduled time at or after this value (inclusive, RFC 3339). + name: start_time + in: query + schema: + type: string + format: date-time + required: false + endTimeParam: + description: Filter to include only scheduled transactions with a scheduled time at or before this value (inclusive, RFC 3339). + name: end_time + in: query + schema: + type: string + format: date-time + required: false + handlerOwnerParam: + description: Filter by the address of the account that owns the transaction handler. + name: handler_owner + in: query + schema: + $ref: '#/components/schemas/Address' + required: false + handlerTypeIdentifierParam: + description: Filter by the Cadence type identifier of the transaction handler (e.g. `A.1654653399040a61.MyScheduler.Handler`). + name: handler_type_identifier + in: query + schema: + type: string + required: false + handlerUuidParam: + description: Filter by the UUID of the transaction handler resource. + name: handler_uuid + in: query + schema: + type: string + format: uint64 + required: false schemas: AccountTransactionsResponse: @@ -596,10 +776,6 @@ components: $ref: '#/components/schemas/Transaction' result: $ref: '#/components/schemas/TransactionResult' - events: - type: array - items: - $ref: '#/components/schemas/Event' _expandable: type: object description: Contains URI links for fields not included in the response. When a field is expanded via the `expand` query parameter, it appears inline and is removed from `_expandable`. @@ -663,10 +839,6 @@ components: $ref: '#/components/schemas/Transaction' result: $ref: '#/components/schemas/TransactionResult' - events: - type: array - items: - $ref: '#/components/schemas/Event' _expandable: type: object description: Contains URI links for fields not included in the response. When a field is expanded via the `expand` query parameter, it appears inline and is removed from `_expandable`. @@ -687,6 +859,129 @@ components: - sender - recipient + ScheduledTransactionsResponse: + type: object + required: + - scheduled_transactions + properties: + scheduled_transactions: + type: array + items: + $ref: "#/components/schemas/ScheduledTransaction" + next_cursor: + $ref: '#/components/schemas/Cursor' + ScheduledTransaction: + type: object + required: + - id + - status + - priority + - timestamp + - execution_effort + - fees + - transaction_handler_owner + - transaction_handler_type_identifier + - transaction_handler_uuid + - created_transaction_id + - _expandable + properties: + id: + description: Scheduler-assigned uint64 identifier. + type: string + format: uint64 + status: + $ref: '#/components/schemas/ScheduledTransactionStatus' + priority: + $ref: '#/components/schemas/ScheduledTransactionPriority' + timestamp: + description: Scheduled execution timestamp as a UFix64 decimal string. + type: string + execution_effort: + description: Execution effort estimate as a UFix64 decimal string. + type: string + fees: + description: Scheduled fee as a UFix64 decimal string. + type: string + transaction_handler_owner: + description: Address of the account that owns the transaction handler. + $ref: '#/components/schemas/Address' + transaction_handler_type_identifier: + description: Fully qualified Cadence type identifier of the transaction handler (e.g. `A.1654653399040a61.MyScheduler.Handler`). + type: string + transaction_handler_uuid: + description: Resource UUID of the transaction handler. + type: string + format: uint64 + transaction_handler_public_path: + description: Public path of the transaction handler, if set. + type: string + fees_returned: + description: Fees returned on cancellation, as a UFix64 decimal string. + type: string + fees_deducted: + description: Fees deducted on cancellation, as a UFix64 decimal string. + type: string + created_transaction_id: + description: Flow transaction ID of the transaction in which the scheduled transaction was created. + $ref: '#/components/schemas/Identifier' + executed_transaction_id: + description: Flow transaction ID of the execution transaction. + $ref: '#/components/schemas/Identifier' + cancelled_transaction_id: + description: Flow transaction ID of the cancellation transaction. + $ref: '#/components/schemas/Identifier' + transaction: + $ref: '#/components/schemas/Transaction' + result: + $ref: '#/components/schemas/TransactionResult' + handler_contract: + $ref: '#/components/schemas/Contract' + _expandable: + type: object + description: Contains URI links for fields not included in the response. When a field is expanded via the `expand` query parameter, it appears inline and is removed from `_expandable`. + properties: + transaction: + type: string + format: uri + description: Link to fetch the full transaction body. + result: + type: string + format: uri + description: Link to fetch the transaction result. + handler_contract: + type: string + format: uri + description: Link to fetch the Cadence contract that implements the transaction handler. + _links: + $ref: '#/components/schemas/Links' + Contract: + type: object + required: + - identifier + - body + properties: + identifier: + description: Unique identifier for the contract (e.g. `A.1654653399040a61.MyContract`). + type: string + body: + description: Full source code of the contract. + type: string + ScheduledTransactionStatus: + type: string + description: The current lifecycle status of a scheduled transaction. + enum: + - scheduled + - executed + - cancelled + - failed + ScheduledTransactionPriority: + type: string + description: The execution priority of a scheduled transaction. + enum: + - low + - medium + - high + Error: type: object required: